CC-2950: Tell users if they are running an out-of-date version or not

Initial implementation.
- added some code in phone_home_stat to retrieve latest version from stat server
  and store result in db

- created new view helper VersionNotify.php, which queries and calculates version
  difference, then returns the necessary information in html to the view files

- created new javascript file versiontooltip.js, which sets up the qtip stuff so that
  when the version notification icon is clicked, a tooltip is displayed
This commit is contained in:
Yuchen Wang 2011-11-14 00:34:53 -05:00
parent 1c5b2dc813
commit 1a1db1892f
14 changed files with 172 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View file

@ -57,6 +57,31 @@ select {
display:block;
}
/* Version Notification Starts*/
#version_icon {
position:absolute;
right:85px;
top:104px;
height:35px;
width:35px;
z-index:1000;
display:block;
cursor:pointer;
background-repeat:no-repeat;
background-position:center;
}
#ui-tooltip-version a {
color:#ff5d1a;
text-decoration:none;
}
#ui-tooltip-version {
font-size: 14px;
}
/* Version Notification Ends*/
/* Clearfix */
.clearfix:after, li:after { content: "."; display: block; height: 0; clear: both; visibility: hidden;}
.clearfix, li { display: inline-block; }

View file

@ -0,0 +1,53 @@
/**
* Get the tooltip message to be displayed,
* which is stored inside a pair of hidden div tags
*/
function getContent() {
return $("#version_message").html();
}
/**
* Get the current version,
* which is stored inside a pair of hidden div tags
*/
function getCurrentVersion() {
return $("#version_current").html();
}
/**
* Sets up the tooltip for version notification
*/
function setupVersionQtip(){
var qtipElem = $('#version_icon');
if (qtipElem.length > 0){
qtipElem.qtip({
id: 'version',
content: {
text: getContent(),
title: {
text: getCurrentVersion(),
button: true
}
},
show: 'click', /* Show on click */
hide: false, /* Don't hide on mouseout */
position: {
my: "top right",
at: "bottom left"
},
style: {
border: {
width: 0,
radius: 4
},
classes: "ui-tooltip-dark ui-tooltip-rounded"
}
});
}
}
$(document).ready(function() {
if($('#version_message').length > 0) {
setupVersionQtip();
}
});