unindented the wrapper function.

This commit is contained in:
boombuler 2013-02-25 20:34:25 +01:00
parent ca6fb9952b
commit a392c04469

View File

@ -10,33 +10,34 @@
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function')
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function')
window.plugin = function() {};
// PLUGIN START ////////////////////////////////////////////////////////
// PLUGIN START ////////////////////////////////////////////////////////
// use own namespace for plugin
window.plugin.maxLinks = function() {};
// use own namespace for plugin
window.plugin.maxLinks = function() {};
// const values
window.plugin.maxLinks.MAX_DRAWN_LINKS = 400;
window.plugin.maxLinks.MAX_DRAWN_LINKS_INCREASED_LIMIT = 1000;
window.plugin.maxLinks.STROKE_STYLE = {
// const values
window.plugin.maxLinks.MAX_DRAWN_LINKS = 400;
window.plugin.maxLinks.MAX_DRAWN_LINKS_INCREASED_LIMIT = 1000;
window.plugin.maxLinks.STROKE_STYLE = {
color: '#FF0000',
opacity: 1,
weight:2,
clickable: false,
smoothFactor: 10
};
var delaunayScriptLocation = 'https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/dist/delaunay.js';
};
var delaunayScriptLocation = 'https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/dist/delaunay.js';
window.plugin.maxLinks.layer = null;
window.plugin.maxLinks.layer = null;
var updating = false;
var renderLimitReached = false;
var updating = false;
var renderLimitReached = false;
window.plugin.maxLinks.updateLayer = function() {
window.plugin.maxLinks.updateLayer = function() {
if (updating || window.plugin.maxLinks.layer === null ||
!window.map.hasLayer(window.plugin.maxLinks.layer))
return;
@ -78,9 +79,9 @@ function wrapper() {
});
updating = false;
window.renderUpdateStatus();
}
}
var setup = function() {
var setup = function() {
load(delaunayScriptLocation).thenRun(function() {
window.delaunay.Triangle.prototype.draw = function(layer, divX, divY) {
@ -108,17 +109,18 @@ function wrapper() {
window.map.on('zoomend moveend', window.plugin.maxLinks.updateLayer);
window.layerChooser.addOverlay(window.plugin.maxLinks.layer, 'Maximum Links');
});
}
}
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
}
} // wrapper end
// inject code into site context