From 0e4efe49ed1667c42cbe31c064fb0ca11162d05d Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Thu, 31 Oct 2013 06:47:04 +0000 Subject: [PATCH] update check plugin: change to table layout, change category - still not finished... --- plugins/update-check.user.js | 80 +++++++++++++++++++++++++++--------- 1 file changed, 61 insertions(+), 19 deletions(-) diff --git a/plugins/update-check.user.js b/plugins/update-check.user.js index f58cc1f3..e144332d 100644 --- a/plugins/update-check.user.js +++ b/plugins/update-check.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @id iitc-plugin-update-check@jonatkins // @name IITC plugin: Check for updates -// @category Tweaks +// @category Misc // @version 0.1.0.@@DATETIMEVERSION@@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ @@ -107,20 +107,21 @@ window.plugin.updateCheck.compareDetails = function(web_version, script_version) var webVerHTML = result.webVersion && window.plugin.updateCheck.versionHTML(result.webVersion); var localVerHTML = result.localVersion && window.plugin.updateCheck.versionHTML(result.localVersion); - var webLinkInstallHTML = ''; - if (result.downloadUrl && result.webUrl) { - webLinkInstallHTML = 'web ' - + 'install'; - } + +// var webLinkInstallHTML = ''; +// if (result.downloadUrl && result.webUrl) { +// webLinkInstallHTML = 'web ' +// + 'install'; +// } if (!result.localVersion) { - result.html = 'version check failed '+webLinkInstallHTML; + result.html = 'version check failed'; } else if (!result.webVersion) { result.html = 'version check failed'; } else if (result.upToDate) { result.html = 'up to date'; } else if (result.outOfDate) { - result.html = 'out of date '+webLinkInstallHTML; + result.html = 'out of date'; } else if (result.localNewer) { result.html = localVerHTML+' is newer than '+webVerHTML+'(?!)'; } else { @@ -156,31 +157,72 @@ window.plugin.updateCheck.showReport = function(data) { } if (data.plugins && window.bootPlugins) { - result += '
Plugins:
'; + result += '
Plugins:'; + + var formatRow = function(p) { + var status = p.status; + var name = p.name; + var statustext = p.compare && p.compare.html || '-'; + + return ''; + } + + result += ''; + for (var i in plugins.outOfDate) { + result += formatRow (plugins.outOfDate[i]); + } + if (plugins.outOfDate.length==0) { + result += ''; + } + + result += ''; + for (var i in plugins.upToDate) { + result += formatRow (plugins.upToDate[i]); + } + if (plugins.upToDate.length==0) { + result += ''; + } + + result += ''; + for (var i in plugins.other) { + result += formatRow (plugins.other[i]); + } + if (plugins.other.length==0) { + result += ''; + } + + result += ''; } }
'+name+''+statustext+'
Out of date
no plugins
Up To Date
no plugins
Other
no plugins