Fixed indent and added macros

This commit is contained in:
Francois Valdy
2013-08-05 15:20:41 +02:00
parent 6005c80082
commit 7c218b76d1

View File

@ -13,11 +13,7 @@
// @match http://www.ingress.com/intel* // @match http://www.ingress.com/intel*
// ==/UserScript== // ==/UserScript==
@@PLUGIUNSTART@@
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
// PLUGIN START //////////////////////////////////////////////////////// // PLUGIN START ////////////////////////////////////////////////////////
@ -87,7 +83,7 @@ window.plugin.portalDefense.renderAttackRegion = function(portal) {
if (defense.total) { if (defense.total) {
var display = defense.total; var display = defense.total;
if (window.plugin.portalDefense.currentDisplay == window.plugin.portalDefense.DisplayEnum.DETAIL) { if (window.plugin.portalDefense.currentDisplay == window.plugin.portalDefense.DisplayEnum.DETAIL) {
if(defense.mod) { if (defense.mod) {
display += "<br>"+"\u2297"+defense.mod; display += "<br>"+"\u2297"+defense.mod;
} }
if(defense.links) { if(defense.links) {
@ -193,16 +189,4 @@ var setup = function() {
// PLUGIN END ////////////////////////////////////////////////////////// // PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') { @@PLUGINEND@@
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);