add a list of the active plugins to the about dialog, listing the version, etc from the new plugin interface changes

also use the new versin data supplied by grease/tampermonkey for the main script version display
This commit is contained in:
Jon Atkins 2013-10-29 02:09:41 +00:00
parent b6eebccca9
commit 318cea2e9a

View File

@ -1,9 +1,38 @@
// UTILS + MISC ///////////////////////////////////////////////////////
window.aboutIITC = function(){
var v = '@@BUILDNAME@@-@@BUILDDATE@@';
window.aboutIITC = function() {
var v = (script_info.script && script_info.script.version || script_info.dateTimeVersion) + ' ['+script_info.buildName+']';
if (typeof android !== 'undefined' && android && android.getVersionCode) {
v += '[IITC Mobile '+android.getVersionCode()+']';
}
var plugins = '<ul>';
for (var i in bootPlugins) {
var info = bootPlugins[i].info;
if (info) {
var pname = info.script && info.script.name || info.pluginId;
if (pname.substr(0,13) == 'IITC plugin: ' || pname.substr(0,13) == 'IITC Plugin: ') {
pname = pname.substr(13);
}
var pvers = info.script && info.script.version || info.dateTimeVersion;
var ptext = pname + ' - ' + pvers;
if (info.buildName != script_info.buildName) {
ptext += ' ['+info.buildName+']';
}
plugins += '<li>'+ptext+'</li>';
} else {
// no 'info' property of the plugin setup function - old plugin wrapper code
// could attempt to find the "window.plugin.NAME = function() {};" line it's likely to have..?
plugins += '<li>(unknown plugin: index '+i+')</li>';
}
}
plugins += '</ul>';
var attrib = '@@INCLUDEMD:ATTRIBUTION.md@@';
var contrib = '@@INCLUDEMD:CONTRIBS.md@@'
var a = ''
+ ' <div><b>About IITC</b></div> '
+ ' <div>Ingress Intel Total Conversion</div> '
@ -23,10 +52,12 @@ window.aboutIITC = function(){
+ ' </div>'
+ ' <hr>'
+ ' <div>Version: ' + v + '</div>'
+ ' <div>Plugins: ' + plugins + '</div>'
+ ' <hr>'
+ ' <div>' + attrib + '</div>'
+ ' <hr>'
+ ' <div>' + contrib + '</div>';
dialog({
title: 'IITC ' + v,
html: a,