From d728775f9e3062597380fa3ac21aeea6c22146de Mon Sep 17 00:00:00 2001 From: johndoe Date: Mon, 25 Feb 2019 09:40:50 +0200 Subject: [PATCH 01/14] deleted: clean up plugins directory --- plugins/{ => deleted}/basemap-nokia-ovi.user.js | 0 plugins/{ => deleted}/canvas-render.user.js | 0 plugins/{ => deleted}/force-https.user.js | 0 plugins/{ => deleted}/show-more-portals.user.js | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename plugins/{ => deleted}/basemap-nokia-ovi.user.js (100%) rename plugins/{ => deleted}/canvas-render.user.js (100%) rename plugins/{ => deleted}/force-https.user.js (100%) rename plugins/{ => deleted}/show-more-portals.user.js (100%) diff --git a/plugins/basemap-nokia-ovi.user.js b/plugins/deleted/basemap-nokia-ovi.user.js similarity index 100% rename from plugins/basemap-nokia-ovi.user.js rename to plugins/deleted/basemap-nokia-ovi.user.js diff --git a/plugins/canvas-render.user.js b/plugins/deleted/canvas-render.user.js similarity index 100% rename from plugins/canvas-render.user.js rename to plugins/deleted/canvas-render.user.js diff --git a/plugins/force-https.user.js b/plugins/deleted/force-https.user.js similarity index 100% rename from plugins/force-https.user.js rename to plugins/deleted/force-https.user.js diff --git a/plugins/show-more-portals.user.js b/plugins/deleted/show-more-portals.user.js similarity index 100% rename from plugins/show-more-portals.user.js rename to plugins/deleted/show-more-portals.user.js From c235d8ea637142309f0c5107ba58e372eaee88f7 Mon Sep 17 00:00:00 2001 From: johndoe Date: Mon, 25 Feb 2019 10:06:02 +0200 Subject: [PATCH 02/14] deleted: default-intel-detail https://github.com/iitc-project/ingress-intel-total-conversion/issues/1296 --- code/map_data_calc_tools.js | 43 ++++++++----------- .../default-intel-detail.user.js | 0 2 files changed, 19 insertions(+), 24 deletions(-) rename plugins/{ => deleted}/default-intel-detail.user.js (100%) diff --git a/code/map_data_calc_tools.js b/code/map_data_calc_tools.js index 8094b53a1..76dbd731c 100755 --- a/code/map_data_calc_tools.js +++ b/code/map_data_calc_tools.js @@ -110,31 +110,26 @@ window.getDataZoomForMapZoom = function(zoom) { zoom = 21; } - - if (!window.CONFIG_ZOOM_DEFAULT_DETAIL_LEVEL) { - - // to improve the cacheing performance, we try and limit the number of zoom levels we retrieve data for - // to avoid impacting server load, we keep ourselves restricted to a zoom level with the sane numbre - // of tilesPerEdge and portal levels visible - - var origTileParams = getMapZoomTileParameters(zoom); - - while (zoom > MIN_ZOOM) { - var newTileParams = getMapZoomTileParameters(zoom-1); - - if ( newTileParams.tilesPerEdge != origTileParams.tilesPerEdge - || newTileParams.hasPortals != origTileParams.hasPortals - || newTileParams.level*newTileParams.hasPortals != origTileParams.level*origTileParams.hasPortals // multiply by 'hasPortals' bool - so comparison does not matter when no portals available - ) { - // switching to zoom-1 would result in a different detail level - so we abort changing things - break; - } else { - // changing to zoom = zoom-1 results in identical tile parameters - so we can safely step back - // with no increase in either server load or number of requests - zoom = zoom-1; - } + // to improve the cacheing performance, we try and limit the number of zoom levels we retrieve data for + // to avoid impacting server load, we keep ourselves restricted to a zoom level with the sane number + // of tilesPerEdge and portal levels visible + + var origTileParams = getMapZoomTileParameters(zoom); + + while (zoom > MIN_ZOOM) { + var newTileParams = getMapZoomTileParameters(zoom-1); + + if ( newTileParams.tilesPerEdge != origTileParams.tilesPerEdge + || newTileParams.hasPortals != origTileParams.hasPortals + || newTileParams.level*newTileParams.hasPortals != origTileParams.level*origTileParams.hasPortals // multiply by 'hasPortals' bool - so comparison does not matter when no portals available + ) { + // switching to zoom-1 would result in a different detail level - so we abort changing things + break; + } else { + // changing to zoom = zoom-1 results in identical tile parameters - so we can safely step back + // with no increase in either server load or number of requests + zoom = zoom-1; } - } return zoom; diff --git a/plugins/default-intel-detail.user.js b/plugins/deleted/default-intel-detail.user.js similarity index 100% rename from plugins/default-intel-detail.user.js rename to plugins/deleted/default-intel-detail.user.js From 7a9f2ff8d7d3897e03729fe2b3fad4fded7bca20 Mon Sep 17 00:00:00 2001 From: johndoe Date: Mon, 25 Feb 2019 10:16:28 +0200 Subject: [PATCH 03/14] deleted: show-less-portals-zoomed-out https://github.com/iitc-project/ingress-intel-total-conversion/issues/1295 https://github.com/iitc-project/ingress-intel-total-conversion/pull/1174 --- plugins/{ => deleted}/show-less-portals-zoomed-out.user.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename plugins/{ => deleted}/show-less-portals-zoomed-out.user.js (100%) diff --git a/plugins/show-less-portals-zoomed-out.user.js b/plugins/deleted/show-less-portals-zoomed-out.user.js similarity index 100% rename from plugins/show-less-portals-zoomed-out.user.js rename to plugins/deleted/show-less-portals-zoomed-out.user.js From b9ce918662ee05110e7f7ea36f1e45b4a3f33688 Mon Sep 17 00:00:00 2001 From: johndoe Date: Mon, 25 Feb 2019 10:17:15 +0200 Subject: [PATCH 04/14] deleted: update-check https://github.com/iitc-project/ingress-intel-total-conversion/issues/1297 --- plugins/{ => deleted}/update-check.user.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename plugins/{ => deleted}/update-check.user.js (100%) diff --git a/plugins/update-check.user.js b/plugins/deleted/update-check.user.js similarity index 100% rename from plugins/update-check.user.js rename to plugins/deleted/update-check.user.js From 7a417ea7fb54094985d35ebd557f0d88dfced7ae Mon Sep 17 00:00:00 2001 From: johndoe Date: Mon, 25 Feb 2019 10:33:32 +0200 Subject: [PATCH 05/14] deleted: basemap-opencyclemap (tiles from thunderforest.com are not free anymore) https://github.com/IITC-CE/ingress-intel-total-conversion/issues/2#issuecomment-460566051 --- plugins/{ => deleted}/basemap-opencyclemap.user.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename plugins/{ => deleted}/basemap-opencyclemap.user.js (100%) diff --git a/plugins/basemap-opencyclemap.user.js b/plugins/deleted/basemap-opencyclemap.user.js similarity index 100% rename from plugins/basemap-opencyclemap.user.js rename to plugins/deleted/basemap-opencyclemap.user.js From 9f214be627a660d5c8f869032daea0a05eda27d7 Mon Sep 17 00:00:00 2001 From: johndoe Date: Mon, 25 Feb 2019 11:01:20 +0200 Subject: [PATCH 06/14] plugins: 'hightlight' typo --- plugins/portal-highlighter-forgotten.user.js | 2 +- plugins/portal-highlighter-needs-recharge.user.js | 2 +- plugins/portal-highlighter-ornaments.user.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/portal-highlighter-forgotten.user.js b/plugins/portal-highlighter-forgotten.user.js index b74a356e6..eaa7c55f7 100644 --- a/plugins/portal-highlighter-forgotten.user.js +++ b/plugins/portal-highlighter-forgotten.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @id iitc-plugin-highlight-forgotten@jonatkins -// @name IITC plugin: Inactive portals. Hightlight unclaimed portals with no recent activity +// @name IITC plugin: Inactive portals. Highlight unclaimed portals with no recent activity // @category Highlighter // @version 0.1.0.@@DATETIMEVERSION@@ // @description [@@BUILDNAME@@-@@BUILDDATE@@] Use the portal fill color to denote if the portal is unclaimed with no recent activity. Shades of red from one week to one month, then tinted to purple for longer. May also highlight captured portals that are stuck and fail to decay every 24 hours. diff --git a/plugins/portal-highlighter-needs-recharge.user.js b/plugins/portal-highlighter-needs-recharge.user.js index e5454e461..056fe8d10 100644 --- a/plugins/portal-highlighter-needs-recharge.user.js +++ b/plugins/portal-highlighter-needs-recharge.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @id iitc-plugin-highlight-needs-recharge@vita10gy -// @name IITC plugin: hightlight portals that need recharging +// @name IITC plugin: highlight portals that need recharging // @category Highlighter // @version 0.1.2.@@DATETIMEVERSION@@ // @description [@@BUILDNAME@@-@@BUILDDATE@@] Use the portal fill color to denote if the portal needs recharging and how much. Yellow: above 85%. Orange: above 50%. Red: above 15%. Magenta: below 15%. diff --git a/plugins/portal-highlighter-ornaments.user.js b/plugins/portal-highlighter-ornaments.user.js index c01d526d8..dfbde7330 100644 --- a/plugins/portal-highlighter-ornaments.user.js +++ b/plugins/portal-highlighter-ornaments.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @id iitc-plugin-highlight-ornaments@jonatkins -// @name IITC plugin: hightlight portals with ornaments +// @name IITC plugin: highlight portals with ornaments // @category Highlighter // @version 0.0.1.@@DATETIMEVERSION@@ // @description [@@BUILDNAME@@-@@BUILDDATE@@] Use the portal fill color to denote portals with additional 'ornament' markers. e.g. Anomaly portals From 5b5e21b31208648e5934187e0ffc09e0e79d9cba Mon Sep 17 00:00:00 2001 From: johndoe Date: Mon, 25 Feb 2019 11:31:21 +0200 Subject: [PATCH 07/14] plugins: more consistent names --- .../{basemap-gmaps-gray.user.js => basemap-google-gray.user.js} | 0 plugins/{cross_link.user.js => cross-links.user.js} | 0 plugins/{add-kml.user.js => overlay-kml.user.js} | 0 ...ortal-weakness.user.js => portal-highlighter-weakness.user.js} | 0 plugins/{max-links.user.js => tidy-links.user.js} | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename plugins/{basemap-gmaps-gray.user.js => basemap-google-gray.user.js} (100%) rename plugins/{cross_link.user.js => cross-links.user.js} (100%) rename plugins/{add-kml.user.js => overlay-kml.user.js} (100%) rename plugins/{show-portal-weakness.user.js => portal-highlighter-weakness.user.js} (100%) rename plugins/{max-links.user.js => tidy-links.user.js} (100%) diff --git a/plugins/basemap-gmaps-gray.user.js b/plugins/basemap-google-gray.user.js similarity index 100% rename from plugins/basemap-gmaps-gray.user.js rename to plugins/basemap-google-gray.user.js diff --git a/plugins/cross_link.user.js b/plugins/cross-links.user.js similarity index 100% rename from plugins/cross_link.user.js rename to plugins/cross-links.user.js diff --git a/plugins/add-kml.user.js b/plugins/overlay-kml.user.js similarity index 100% rename from plugins/add-kml.user.js rename to plugins/overlay-kml.user.js diff --git a/plugins/show-portal-weakness.user.js b/plugins/portal-highlighter-weakness.user.js similarity index 100% rename from plugins/show-portal-weakness.user.js rename to plugins/portal-highlighter-weakness.user.js diff --git a/plugins/max-links.user.js b/plugins/tidy-links.user.js similarity index 100% rename from plugins/max-links.user.js rename to plugins/tidy-links.user.js From b1f4df4f01ff398b6559ca3c04200c7d94df40c7 Mon Sep 17 00:00:00 2001 From: johndoe Date: Mon, 25 Feb 2019 11:40:25 +0200 Subject: [PATCH 08/14] max-links -> tidy-links (was inconsistent) --- plugins/tidy-links.user.js | 80 +++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/plugins/tidy-links.user.js b/plugins/tidy-links.user.js index f2a944cf5..1c92ef76b 100644 --- a/plugins/tidy-links.user.js +++ b/plugins/tidy-links.user.js @@ -1,9 +1,9 @@ // ==UserScript== -// @id max-links@boombuler -// @name IITC plugin: Max Links +// @id tidy-links@boombuler +// @name IITC plugin: Tidy Links // @category Layer // @version 0.4.3.@@DATETIMEVERSION@@ -// @description [@@BUILDNAME@@-@@BUILDDATE@@] Calculate how to link the portals to create a reasonably tidy set of links/fields. Enable from the layer chooser. (Max Links is a poor name, but remains for historical reasons.) +// @description [@@BUILDNAME@@-@@BUILDDATE@@] Calculate how to link the portals to create a reasonably tidy set of links/fields. Enable from the layer chooser. (former `Max Links`) @@METAINFO@@ // ==/UserScript== @@ -12,14 +12,14 @@ // PLUGIN START //////////////////////////////////////////////////////// // use own namespace for plugin -window.plugin.maxLinks = function() {}; +window.plugin.tidyLinks = function() {}; // const values -window.plugin.maxLinks.MAX_PORTALS_TO_LINK = 200; +window.plugin.tidyLinks.MAX_PORTALS_TO_LINK = 200; // zoom level used for projecting points between latLng and pixel coordinates. may affect precision of triangulation -window.plugin.maxLinks.PROJECT_ZOOM = 16; +window.plugin.tidyLinks.PROJECT_ZOOM = 16; -window.plugin.maxLinks.STROKE_STYLE = { +window.plugin.tidyLinks.STROKE_STYLE = { color: '#FF0000', opacity: 1, weight: 1.5, @@ -27,40 +27,40 @@ window.plugin.maxLinks.STROKE_STYLE = { dashArray: '6,4', smoothFactor: 10, }; -window.plugin.maxLinks.layer = null; -window.plugin.maxLinks.errorMarker = null; +window.plugin.tidyLinks.layer = null; +window.plugin.tidyLinks.errorMarker = null; -window.plugin.maxLinks.addErrorMarker = function() { - if (window.plugin.maxLinks.errorMarker == null) { - window.plugin.maxLinks.errorMarker = L.marker (window.map.getCenter(), { +window.plugin.tidyLinks.addErrorMarker = function() { + if (window.plugin.tidyLinks.errorMarker == null) { + window.plugin.tidyLinks.errorMarker = L.marker (window.map.getCenter(), { icon: L.divIcon({ - className: 'max-links-error', + className: 'tidy-links-error', iconSize: [300,30], html: 'Tidy Links: too many portals!' }), interactive: false }); - window.map.addLayer(window.plugin.maxLinks.errorMarker); + window.map.addLayer(window.plugin.tidyLinks.errorMarker); } } -window.plugin.maxLinks.clearErrorMarker = function() { - if (window.plugin.maxLinks.errorMarker != null) { - window.map.removeLayer(window.plugin.maxLinks.errorMarker); - window.plugin.maxLinks.errorMarker = null; +window.plugin.tidyLinks.clearErrorMarker = function() { + if (window.plugin.tidyLinks.errorMarker != null) { + window.map.removeLayer(window.plugin.tidyLinks.errorMarker); + window.plugin.tidyLinks.errorMarker = null; } } -window.plugin.maxLinks.updateLayer = function() { - if (!window.map.hasLayer(window.plugin.maxLinks.layer)) +window.plugin.tidyLinks.updateLayer = function() { + if (!window.map.hasLayer(window.plugin.tidyLinks.layer)) return; - window.plugin.maxLinks.layer.clearLayers(); + window.plugin.tidyLinks.layer.clearLayers(); var locations = []; @@ -68,14 +68,14 @@ window.plugin.maxLinks.updateLayer = function() { $.each(window.portals, function(guid, portal) { var ll = portal.getLatLng(); if (bounds.contains(ll)) { - var p = map.project (portal.getLatLng(), window.plugin.maxLinks.PROJECT_ZOOM); + var p = map.project (portal.getLatLng(), window.plugin.tidyLinks.PROJECT_ZOOM); locations.push(p); - if (locations.length > window.plugin.maxLinks.MAX_PORTALS_TO_LINK) return false; //$.each break + if (locations.length > window.plugin.tidyLinks.MAX_PORTALS_TO_LINK) return false; //$.each break } }); - if (locations.length > window.plugin.maxLinks.MAX_PORTALS_TO_LINK) { - window.plugin.maxLinks.addErrorMarker(); + if (locations.length > window.plugin.tidyLinks.MAX_PORTALS_TO_LINK) { + window.plugin.tidyLinks.addErrorMarker(); return; } @@ -110,11 +110,11 @@ window.plugin.maxLinks.updateLayer = function() { drawnLinks[a][b] = null; // convert back from x/y coordinates to lat/lng for drawing - var alatlng = map.unproject (a, window.plugin.maxLinks.PROJECT_ZOOM); - var blatlng = map.unproject (b, window.plugin.maxLinks.PROJECT_ZOOM); + var alatlng = map.unproject (a, window.plugin.tidyLinks.PROJECT_ZOOM); + var blatlng = map.unproject (b, window.plugin.tidyLinks.PROJECT_ZOOM); - var poly = L.polyline([alatlng, blatlng], window.plugin.maxLinks.STROKE_STYLE); - poly.addTo(window.plugin.maxLinks.layer); + var poly = L.polyline([alatlng, blatlng], window.plugin.tidyLinks.STROKE_STYLE); + poly.addTo(window.plugin.tidyLinks.layer); drawnLinkCount++; } } @@ -126,39 +126,39 @@ window.plugin.maxLinks.updateLayer = function() { }); } -window.plugin.maxLinks.setup = function() { +window.plugin.tidyLinks.setup = function() { try { console.log('Loading delaunay JS now'); } catch(e) {} @@INCLUDERAW:external/delaunay.js@@ try { console.log('done loading delaunay JS'); } catch(e) {} - window.plugin.maxLinks.layer = L.layerGroup([]); + window.plugin.tidyLinks.layer = L.layerGroup([]); window.addHook('mapDataRefreshEnd', function(e) { - window.plugin.maxLinks.updateLayer(); + window.plugin.tidyLinks.updateLayer(); }); window.addHook('mapDataRefreshStart', function(e) { - window.plugin.maxLinks.clearErrorMarker(); + window.plugin.tidyLinks.clearErrorMarker(); }); window.map.on('layeradd', function(e) { - if (e.layer === window.plugin.maxLinks.layer) - window.plugin.maxLinks.updateLayer(); + if (e.layer === window.plugin.tidyLinks.layer) + window.plugin.tidyLinks.updateLayer(); }); window.map.on('layerremove', function(e) { - if (e.layer === window.plugin.maxLinks.layer) - window.plugin.maxLinks.clearErrorMarker(); + if (e.layer === window.plugin.tidyLinks.layer) + window.plugin.tidyLinks.clearErrorMarker(); }); - window.addLayerGroup('Tidy Links (was Max Links)', window.plugin.maxLinks.layer, false); + window.addLayerGroup('Tidy Links', window.plugin.tidyLinks.layer, false); $('head').append(''); } -var setup = window.plugin.maxLinks.setup; +var setup = window.plugin.tidyLinks.setup; // PLUGIN END ////////////////////////////////////////////////////////// From d542b577f032fce6b0b0f5fd4320b43755787e7d Mon Sep 17 00:00:00 2001 From: johndoe Date: Mon, 25 Feb 2019 11:46:59 +0200 Subject: [PATCH 09/14] bookmarks-by-zaso -> bookmarks --- plugins/{bookmarks-by-zaso.css => bookmarks.css} | 0 plugins/{bookmarks-by-zaso.user.js => bookmarks.user.js} | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename plugins/{bookmarks-by-zaso.css => bookmarks.css} (100%) rename plugins/{bookmarks-by-zaso.user.js => bookmarks.user.js} (99%) diff --git a/plugins/bookmarks-by-zaso.css b/plugins/bookmarks.css similarity index 100% rename from plugins/bookmarks-by-zaso.css rename to plugins/bookmarks.css diff --git a/plugins/bookmarks-by-zaso.user.js b/plugins/bookmarks.user.js similarity index 99% rename from plugins/bookmarks-by-zaso.user.js rename to plugins/bookmarks.user.js index cd02f51e6..55acd4556 100644 --- a/plugins/bookmarks-by-zaso.user.js +++ b/plugins/bookmarks.user.js @@ -1131,7 +1131,7 @@ /***************************************************************************************************************************************************************/ window.plugin.bookmarks.setupCSS = function() { - $('