sintonia/airtime_mvc/public/js/airtime/dashboard/versiontooltip.js
Yuchen Wang 51c563f80b CC-2950: Tell users if they are running an out-of-date version or not
1. changed the behavior so that the tooltip comes up on hover
2. changed stat server link to "http://stat.sourcefabric.org/airtime_latest_version"
3. only updates the db if version returned by stat server is valid
2011-11-14 17:52:50 -05:00

52 lines
No EOL
1.2 KiB
JavaScript

/**
* 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
}
},
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();
}
});