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:
parent
1c5b2dc813
commit
1a1db1892f
14 changed files with 172 additions and 2 deletions
53
airtime_mvc/public/js/airtime/dashboard/versiontooltip.js
Normal file
53
airtime_mvc/public/js/airtime/dashboard/versiontooltip.js
Normal 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();
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue