From 595f857166ea2f0289d2d096604d1676852a7a11 Mon Sep 17 00:00:00 2001 From: Yuchen Wang Date: Fri, 18 Nov 2011 17:42:41 -0500 Subject: [PATCH] CC-2950: Tell users if they are running an out-of-date version or not - make latest version download link open in a new window - show yellow upgrade icon when 2 verions back - show red icon when more than 2 versions back --- .../public/js/airtime/dashboard/versiontooltip.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/public/js/airtime/dashboard/versiontooltip.js b/airtime_mvc/public/js/airtime/dashboard/versiontooltip.js index 6087bb6a2..1032a83f7 100644 --- a/airtime_mvc/public/js/airtime/dashboard/versiontooltip.js +++ b/airtime_mvc/public/js/airtime/dashboard/versiontooltip.js @@ -8,9 +8,9 @@ function getContent() { var msg = ""; if(isUpToDate()) { msg = "You are running the latest version"; - } else if(diff <= 2) { + } else if(diff == 1) { msg = "New version available: " + link; - } else if(diff == 3) { + } else if(diff == 2) { msg = "This version will soon be obsolete.
Please upgrade to " + link; } else { msg = "This version is no longer supported.
Please upgrade to " + link; @@ -44,7 +44,7 @@ function getLatestVersion() { * Returns the download link to latest release in HTML */ function getLatestLink() { - return "" + getLatestVersion() + ""; + return "" + getLatestVersion() + ""; } /** @@ -58,6 +58,13 @@ function isUpToDate() { return (diff == 0 && current == latest) || diff < 0; } +/** + * Opens the link in a new window + */ +function openLatestLink() { + window.open($("#version-link").html()); +} + /** * Sets up the tooltip for version notification */