CC-3029: Graphic design for the version notification feature

- use classes in VersionNotify.php for displaying icons instead of inline styling
- change underscore to hyphen so that naming convention is consistent with the
  rest in style.css
This commit is contained in:
Yuchen Wang 2011-11-15 16:08:05 -05:00
parent ace68bd363
commit af1b376cdf
3 changed files with 24 additions and 25 deletions

View File

@ -33,25 +33,24 @@ class Airtime_View_Helper_VersionNotify extends Zend_View_Helper_Abstract{
- (intval($curMatch[1]) * 10 + intval($curMatch[2])); - (intval($curMatch[1]) * 10 + intval($curMatch[2]));
// Pick icon // Pick icon
$bg = "/css/images/";
if(($diff == 0 && $current == $latest) || $diff < 0) { if(($diff == 0 && $current == $latest) || $diff < 0) {
// current version is up to date // current version is up to date
$bg .= "icon_uptodate.png"; $class = "uptodate";
} else if($diff <= 2) { } else if($diff <= 2) {
// 2 or less major versions back // 2 or less major versions back
$bg .= "icon_update.png"; $class = "update";
} else if($diff == 3) { } else if($diff == 3) {
// 3 major versions back // 3 major versions back
$bg .= "icon_update2.png"; $class = "update2";
} else { } else {
// more than 3 major versions back // more than 3 major versions back
$bg .= "icon_outdated.png"; $class = "outdated";
} }
$result = "<div id='version_diff' style='display:none'>" . $diff . "</div>" $result = "<div id='version-diff' style='display:none'>" . $diff . "</div>"
. "<div id='version_current' style='display:none'>" . $current . "</div>" . "<div id='version-current' style='display:none'>" . $current . "</div>"
. "<div id='version_latest' style='display:none'>" . $latest . "</div>" . "<div id='version-latest' style='display:none'>" . $latest . "</div>"
. "<div id='version_icon' style='background-image: url(" . $bg . ");'></div>"; . "<div id='version-icon' class='" . $class . "'></div>";
return $result; return $result;
} }
} }

View File

@ -58,9 +58,9 @@ select {
} }
/* Version Notification Starts*/ /* Version Notification Starts*/
#version_icon { #version-icon {
position:absolute; position:absolute;
right:98px; right:96px;
top:104px; top:104px;
height:35px; height:35px;
width:35px; width:35px;
@ -68,19 +68,19 @@ select {
display:block; display:block;
cursor:pointer; cursor:pointer;
background-repeat:no-repeat; background-repeat:no-repeat;
background-position:center; background-position:center;
} }
#version_icon.outdated { #version-icon.outdated {
background-image:url(images/icon_outdated.png); background-image:url(/css/images/icon_outdated.png);
} }
#version_icon.update2 { #version-icon.update2 {
background-image:url(images/icon_update2.png); background-image:url(/css/images/icon_update2.png);
} }
#version_icon.update { #version-icon.update {
background-image:url(images/icon_update.png); background-image:url(/css/images/icon_update.png);
} }
#version_icon.uptodate { #version-icon.uptodate {
background-image:url(images/icon_uptodate.png); background-image:url(/css/images/icon_uptodate.png);
} }
#ui-tooltip-version a { #ui-tooltip-version a {

View File

@ -23,21 +23,21 @@ function getContent() {
* Get major version difference b/w current and latest version, in int * Get major version difference b/w current and latest version, in int
*/ */
function getVersionDiff() { function getVersionDiff() {
return parseInt($("#version_diff").html()); return parseInt($("#version-diff").html());
} }
/** /**
* Get the current version * Get the current version
*/ */
function getCurrentVersion() { function getCurrentVersion() {
return $("#version_current").html(); return $("#version-current").html();
} }
/** /**
* Get the latest version * Get the latest version
*/ */
function getLatestVersion() { function getLatestVersion() {
return $("#version_latest").html(); return $("#version-latest").html();
} }
/** /**
@ -62,7 +62,7 @@ function getLatestLink() {
* Sets up the tooltip for version notification * Sets up the tooltip for version notification
*/ */
function setupVersionQtip(){ function setupVersionQtip(){
var qtipElem = $('#version_icon'); var qtipElem = $('#version-icon');
if (qtipElem.length > 0){ if (qtipElem.length > 0){
qtipElem.qtip({ qtipElem.qtip({
id: 'version', id: 'version',
@ -92,7 +92,7 @@ function setupVersionQtip(){
} }
$(document).ready(function() { $(document).ready(function() {
if($('#version_icon').length > 0) { if($('#version-icon').length > 0) {
setupVersionQtip(); setupVersionQtip();
} }
}); });