From 9a4efad4f5dd2b5e6e9f861b7a282ccf33433751 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Sat, 9 Nov 2013 23:03:42 +0000 Subject: [PATCH] update check plugin: more mobile work --- plugins/update-check.user.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/plugins/update-check.user.js b/plugins/update-check.user.js index 5267b120..c27a271b 100644 --- a/plugins/update-check.user.js +++ b/plugins/update-check.user.js @@ -169,17 +169,24 @@ window.plugin.updateCheck.showReport = function(data) { var latestVerCode = parseInt(data.mobile.versioncode); var latestVerName = data.mobile.versionstr; + var webLink = ''; + if (data.mobile.pageurl) webLink = 'web'; + var downloadLink = ''; + if (data.mobile.downloadurl) downloadLink = 'download'; + if (data.mobile.downloadurl && android.updateIitc) downloadLink = 'install'; + + if (ourVerCode == latestVerCode) { // up to date - result += '
IITC Mobile is up to date - version '+ourVerName+'
'; + result += '
IITC Mobile is up to date - version '+ourVerName+' '+webLink+'
'; } else if (ourVerCode < latestVerCode) { // out of date - result += '
IITC Mobile is out of date. Current version '+ourVerName+', ' - + 'Available version '+latestVerName+'.
'; + result += '
IITC Mobile is out of date. Current version '+ourVerName+', ' + + 'Available version '+latestVerName+'. '+webLink+' '+downloadLink+'
'; } else { // local version newer?! - result += '
IITC Mobile version newer than latest on server?! Current version '+ourVerName+', ' - + 'Available version '+latestVerName+'.
'; + result += '
IITC Mobile version newer than latest on server?! Current version '+ourVerName+', ' + + 'Available version '+latestVerName+'.
'; } } else {