Date: Wed, 6 Nov 2013 21:32:42 +0000
Subject: [PATCH 28/72] website: add brief note about new release
---
website/page/home.php | 6 ++++++
website/page/news.php | 6 ++++++
2 files changed, 12 insertions(+)
diff --git a/website/page/home.php b/website/page/home.php
index 1eda08fc..cdebd36f 100644
--- a/website/page/home.php
+++ b/website/page/home.php
@@ -13,6 +13,12 @@ offers many more features. It is available for
Latest news
+6th October 2013
+
+IITC 0.14.5 and IITC Mobile 0.7.7.1 have been released. This contains a fix to work with the latest intel site updates.
+Other than this, it is identical to the 0.14.4/0.7.7 release.
+
+
29th October 2013
IITC 0.14.4 and IITC Mobile 0.7.7 have just been released. A critical update required to work with changes made to the
diff --git a/website/page/news.php b/website/page/news.php
index e2e63673..69542478 100644
--- a/website/page/news.php
+++ b/website/page/news.php
@@ -1,5 +1,11 @@
News
+6th October 2013
+
+IITC 0.14.5 and IITC Mobile 0.7.7.1 have been released. This contains a fix to work with the latest intel site updates.
+Other than this, it is identical to the 0.14.4/0.7.7 release.
+
+
29th October 2013
IITC 0.14.4 and IITC Mobile 0.7.7 have just been released. A critical update required to work with changes made to the
From 1f6d25ab59cbee98b1b15946158f9dab5ba9d772 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Wed, 6 Nov 2013 22:19:48 +0000
Subject: [PATCH 29/72] bump dev builds to version 0.15.0, in preperation for a
new release
---
main.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/main.js b/main.js
index e379b564..1f595a0b 100644
--- a/main.js
+++ b/main.js
@@ -1,7 +1,7 @@
// ==UserScript==
// @id ingress-intel-total-conversion@jonatkins
// @name IITC: Ingress intel map total conversion
-// @version 0.14.5.@@DATETIMEVERSION@@
+// @version 0.15.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
From 079ce89a20e1843f8d9d93bf5f50156c2ce5aafc Mon Sep 17 00:00:00 2001
From: Philipp Schaefer
Date: Thu, 7 Nov 2013 00:39:26 +0100
Subject: [PATCH 30/72] bugfix: broken playertracker layout - use popup instead
of tooltip on desktop too (see #630)
---
plugins/player-tracker.user.js | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/plugins/player-tracker.user.js b/plugins/player-tracker.user.js
index 20be22a4..602907a3 100644
--- a/plugins/player-tracker.user.js
+++ b/plugins/player-tracker.user.js
@@ -299,13 +299,18 @@ window.plugin.playerTracker.drawData = function() {
+ ago(last.time, now) + ' ago
'
+ window.chat.getChatPortalName(last);
// show previous data in tooltip
- var minsAgo = '\t ago\t';
- if(evtsLength >= 2)
- title += '
previous locations:
';
+ if(evtsLength >= 2) {
+ title += '
previous locations:
'
+ + '';
+ }
for(var i = evtsLength - 2; i >= 0 && i >= evtsLength - 10; i--) {
var ev = playerData.events[i];
- title += ago(ev.time, now) + minsAgo + window.chat.getChatPortalName(ev) + '
';
+ title += '' + ago(ev.time, now) + ' | '
+ + 'ago | '
+ + '' + window.chat.getChatPortalName(ev) + ' |
';
}
+ if(evtsLength >= 2)
+ title += '
';
// calculate the closest portal to the player
var eventPortal = []
@@ -330,14 +335,8 @@ window.plugin.playerTracker.drawData = function() {
// marker itself
var icon = playerData.team === 'RESISTANCE' ? new plugin.playerTracker.iconRes() : new plugin.playerTracker.iconEnl();
var m;
- if (typeof android !== 'undefined' && android) {
- m = L.marker(gllfe(last), {icon: icon, referenceToPortal: closestPortal, opacity: absOpacity});
- m.bindPopup(title);
- } else {
- m = L.marker(gllfe(last), {title: title, icon: icon, referenceToPortal: closestPortal, opacity: absOpacity});
- // ensure tooltips are closed, sometimes they linger
- m.on('mouseout', function() { $(this._icon).tooltip('close'); });
- }
+ m = L.marker(gllfe(last), {icon: icon, referenceToPortal: closestPortal, opacity: absOpacity});
+ m.bindPopup(title);
m.addTo(playerData.team === 'RESISTANCE' ? plugin.playerTracker.drawnTracesRes : plugin.playerTracker.drawnTracesEnl);
plugin.playerTracker.oms.addMarker(m);
// jQueryUI doesn’t automatically notice the new markers
From d4194dc8af12fa3a89c63342e3660499ddf45e2b Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Wed, 6 Nov 2013 23:43:12 +0000
Subject: [PATCH 31/72] website: fix date on latest news entry
---
website/page/home.php | 2 +-
website/page/news.php | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/website/page/home.php b/website/page/home.php
index cdebd36f..02ae9641 100644
--- a/website/page/home.php
+++ b/website/page/home.php
@@ -13,7 +13,7 @@ offers many more features. It is available for
Latest news
-6th October 2013
+6th November 2013
IITC 0.14.5 and IITC Mobile 0.7.7.1 have been released. This contains a fix to work with the latest intel site updates.
Other than this, it is identical to the 0.14.4/0.7.7 release.
diff --git a/website/page/news.php b/website/page/news.php
index 69542478..0edb63e3 100644
--- a/website/page/news.php
+++ b/website/page/news.php
@@ -1,6 +1,6 @@
News
-6th October 2013
+6th November 2013
IITC 0.14.5 and IITC Mobile 0.7.7.1 have been released. This contains a fix to work with the latest intel site updates.
Other than this, it is identical to the 0.14.4/0.7.7 release.
From 3ff65225c39153e30878cd7377d0ab141616bc40 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Thu, 7 Nov 2013 00:17:01 +0000
Subject: [PATCH 32/72] update overlapping marker spider code
---
external/oms.min.js | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/external/oms.min.js b/external/oms.min.js
index a53aede5..3b426845 100644
--- a/external/oms.min.js
+++ b/external/oms.min.js
@@ -5,15 +5,15 @@ Copyright (c) 2011 - 2012 George MacKerron
Released under the MIT licence: http://opensource.org/licenses/mit-license
Note: The Leaflet maps API must be included *before* this code
*/
-(function(){var n={}.hasOwnProperty,o=[].slice;null!=this.L&&(this.OverlappingMarkerSpiderfier=function(){function l(c,b){var a,e,g,f,d=this;this.map=c;null==b&&(b={});for(a in b)n.call(b,a)&&(e=b[a],this[a]=e);this.initMarkerArrays();this.listeners={};f=["click","zoomend"];e=0;for(g=f.length;eb)return this;a=this.markerListeners.splice(b,1)[0];c.removeEventListener("click",a);delete c._oms;this.markers.splice(b,1);return this};d.clearMarkers=function(){var c,b,a,e,g;this.unspiderfy();g=this.markers;c=a=0;for(e=g.length;aa||this.listeners[c].splice(a,1);return this};d.clearListeners=function(c){this.listeners[c]=[];return this};d.trigger=function(){var c,b,a,e,g,f;b=arguments[0];c=2<=arguments.length?o.call(arguments,1):[];b=null!=(a=this.listeners[b])?a:[];f=[];e=0;for(g=b.length;ec;a=0<=c?++f:--f)a=this.circleStartAngle+a*e,d.push(new L.Point(b.x+g*Math.cos(a),b.y+g*Math.sin(a)));return d};d.generatePtsSpiral=function(c,b){var a,e,g,f,d;g=this.spiralLengthStart;a=0;d=[];for(e=f=0;0<=c?fc;e=0<=c?++f:--f)a+=this.spiralFootSeparation/g+5.0E-4*e,e=new L.Point(b.x+g*Math.cos(a),b.y+g*Math.sin(a)),g+=i*this.spiralLengthFactor/a,d.push(e);return d};d.spiderListener=function(c){var b,a,e,g,f,d,h,i,j;b=
-null!=c._omsData;(!b||!this.keepSpiderfied)&&this.unspiderfy();if(b)return this.trigger("click",c);g=[];f=[];d=this.nearbyDistance*this.nearbyDistance;e=this.map.latLngToLayerPoint(c.getLatLng());j=this.markers;h=0;for(i=j.length;h=this.circleSpiralSwitchover?this.generatePtsSpiral(k,a).reverse():this.generatePtsCircle(k,a);a=function(){var a,b,i,k=this;i=[];a=0;for(b=d.length;aa||this.listeners[c].splice(a,1);return this};d.clearListeners=function(c){this.listeners[c]=[];return this};d.trigger=function(){var c,b,a,e,g,f;b=arguments[0];c=2<=arguments.length?r.call(arguments,1):[];b=null!=(a=this.listeners[b])?a:[];f=[];e=0;for(g=b.length;ec;a=0<=c?++f:--f)a=this.circleStartAngle+a*e,d.push(new L.Point(b.x+g*Math.cos(a),b.y+g*Math.sin(a)));return d};d.generatePtsSpiral=function(c,b){var a,e,g,f,d;g=this.spiralLengthStart;a=0;d=[];for(e=f=0;0<=c?fc;e=0<=c?++f:--f)a+=this.spiralFootSeparation/g+5E-4*e,e=new L.Point(b.x+g*Math.cos(a),b.y+g*Math.sin(a)),g+=k*this.spiralLengthFactor/a,d.push(e);return d};d.spiderListener=function(c){var b,a,e,g,f,d,h,k,l;(b=null!=
+c._omsData)&&this.keepSpiderfied||this.unspiderfy();if(b)return this.trigger("click",c);g=[];f=[];d=this.nearbyDistance*this.nearbyDistance;e=this.map.latLngToLayerPoint(c.getLatLng());l=this.markers;h=0;for(k=l.length;h=this.circleSpiralSwitchover?this.generatePtsSpiral(m,a).reverse():this.generatePtsCircle(m,a);a=function(){var a,b,k,m=this;k=[];a=0;for(b=d.length;a
Date: Thu, 7 Nov 2013 00:17:18 +0000
Subject: [PATCH 33/72] change player tracker to always use a popup some code
changes related to interfacing with clicks and oms, doing things as
recommended by the oms code
---
plugins/player-tracker.user.js | 44 ++++++++++++++++------------------
1 file changed, 20 insertions(+), 24 deletions(-)
diff --git a/plugins/player-tracker.user.js b/plugins/player-tracker.user.js
index 20be22a4..f93cff87 100644
--- a/plugins/player-tracker.user.js
+++ b/plugins/player-tracker.user.js
@@ -2,7 +2,7 @@
// @id iitc-plugin-player-tracker@breunigs
// @name IITC Plugin: Player tracker
// @category Layer
-// @version 0.9.6.@@DATETIMEVERSION@@
+// @version 0.10.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
@@ -62,12 +62,20 @@ window.plugin.playerTracker.setup = function() {
});
}
});
- plugin.playerTracker.oms = new OverlappingMarkerSpiderfier(map);
+ plugin.playerTracker.oms = new OverlappingMarkerSpiderfier(map, {keepSpiderfied: true, legWeight: 3.5});
plugin.playerTracker.oms.legColors = {'usual': '#FFFF00', 'highlighted': '#FF0000'};
- plugin.playerTracker.oms.legWeight = 3.5;
+
+ var playerPopup = new L.Popup({offset: L.point([0,-20])});
plugin.playerTracker.oms.addListener('click', function(player) {
window.renderPortalDetails(player.options.referenceToPortal);
+ playerPopup.setContent(player.options.desc);
+ playerPopup.setLatLng(player.getLatLng());
+ map.openPopup(playerPopup)
});
+ plugin.playerTracker.oms.addListener('spiderfy', function(markers) {
+ map.closePopup();
+ });
+
addHook('publicChatDataAvailable', window.plugin.playerTracker.handleData);
@@ -226,6 +234,7 @@ window.plugin.playerTracker.processNewData = function(data) {
}
window.plugin.playerTracker.getLatLngFromEvent = function(ev) {
+//TODO? add weight to certain events, or otherwise prefer them, to give better locations?
var lats = 0;
var lngs = 0;
$.each(ev.latlngs, function() {
@@ -275,13 +284,13 @@ window.plugin.playerTracker.drawData = function() {
polyLineByAgeEnl[ageBucket].push(line);
}
- // tooltip for marker
+ // popup for marker
var evtsLength = playerData.events.length;
var last = playerData.events[evtsLength-1];
var ago = plugin.playerTracker.ago;
var cssClass = playerData.team === 'RESISTANCE' ? 'res' : 'enl';
var title = '' + playerData.nick + '';
-
+
if(window.plugin.guessPlayerLevels !== undefined &&
window.plugin.guessPlayerLevels.fetchLevelByPlayer !== undefined) {
var playerLevel = window.plugin.guessPlayerLevels.fetchLevelByPlayer(pguid);
@@ -298,7 +307,7 @@ window.plugin.playerTracker.drawData = function() {
title += '
'
+ ago(last.time, now) + ' ago
'
+ window.chat.getChatPortalName(last);
- // show previous data in tooltip
+ // show previous data in popup
var minsAgo = '\t ago\t';
if(evtsLength >= 2)
title += '
previous locations:
';
@@ -329,19 +338,13 @@ window.plugin.playerTracker.drawData = function() {
// marker itself
var icon = playerData.team === 'RESISTANCE' ? new plugin.playerTracker.iconRes() : new plugin.playerTracker.iconEnl();
- var m;
- if (typeof android !== 'undefined' && android) {
- m = L.marker(gllfe(last), {icon: icon, referenceToPortal: closestPortal, opacity: absOpacity});
- m.bindPopup(title);
- } else {
- m = L.marker(gllfe(last), {title: title, icon: icon, referenceToPortal: closestPortal, opacity: absOpacity});
- // ensure tooltips are closed, sometimes they linger
- m.on('mouseout', function() { $(this._icon).tooltip('close'); });
- }
+// as per OverlappingMarkerSpiderfier docs, click events (popups, etc) must be handled via it rather than the standard
+// marker click events. so store the popup text in the options, then display it in the oms click handler
+ var m = L.marker(gllfe(last), {icon: icon, referenceToPortal: closestPortal, opacity: absOpacity, desc: title});
+// m.bindPopup(title);
+
m.addTo(playerData.team === 'RESISTANCE' ? plugin.playerTracker.drawnTracesRes : plugin.playerTracker.drawnTracesEnl);
plugin.playerTracker.oms.addMarker(m);
- // jQueryUI doesn’t automatically notice the new markers
- window.setupTooltips($(m._icon));
});
// draw the poly lines to the map
@@ -378,13 +381,6 @@ window.plugin.playerTracker.handleData = function(data) {
plugin.playerTracker.discardOldData();
plugin.playerTracker.processNewData(data);
- // remove old popups
- plugin.playerTracker.drawnTracesEnl.eachLayer(function(layer) {
- if(layer._icon) $(layer._icon).tooltip('destroy');
- });
- plugin.playerTracker.drawnTracesRes.eachLayer(function(layer) {
- if(layer._icon) $(layer._icon).tooltip('destroy');
- });
plugin.playerTracker.oms.clearMarkers();
plugin.playerTracker.drawnTracesEnl.clearLayers();
plugin.playerTracker.drawnTracesRes.clearLayers();
From 6ea2e82637b04db1717889385a19de116d133609 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Thu, 7 Nov 2013 01:02:08 +0000
Subject: [PATCH 34/72] new basemap plugin - a few from maps.stamen.com
---
plugins/basemap-stamen.user.js | 56 ++++++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+)
create mode 100644 plugins/basemap-stamen.user.js
diff --git a/plugins/basemap-stamen.user.js b/plugins/basemap-stamen.user.js
new file mode 100644
index 00000000..2478e076
--- /dev/null
+++ b/plugins/basemap-stamen.user.js
@@ -0,0 +1,56 @@
+// ==UserScript==
+// @id iitc-plugin-basemap-stamen@jonatkins
+// @name IITC plugin: Map layers from stamen.com
+// @category Map Tiles
+// @version 0.1.0.@@DATETIMEVERSION@@
+// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
+// @updateURL @@UPDATEURL@@
+// @downloadURL @@DOWNLOADURL@@
+// @description [@@BUILDNAME@@-@@BUILDDATE@@] Adds the 'Toner' and 'Watercolor' map layers from maps.stamen.com
+// @include https://www.ingress.com/intel*
+// @include http://www.ingress.com/intel*
+// @match https://www.ingress.com/intel*
+// @match http://www.ingress.com/intel*
+// @grant none
+// ==/UserScript==
+
+@@PLUGINSTART@@
+
+// PLUGIN START ////////////////////////////////////////////////////////
+
+
+// use own namespace for plugin
+window.plugin.mapTileStamen = function() {};
+
+window.plugin.mapTileStamen.setup = function() {
+
+ load('http://maps.stamen.com/js/tile.stamen.js?v1.2.3').thenRun(window.plugin.mapTileStamen.addLayer);
+}
+
+window.plugin.mapTileStamen.addLayer = function() {
+
+ var types = {
+ 'toner': 'Toner',
+// 'toner-hybrid': 'Toner Hybrid', // transparent layer. could be usefun over satelliate imagery or similar
+// 'toner-labels': 'Toner Labels', // transparent layer. could be usefun over satelliate imagery or similar
+// 'toner-lines': 'Toner Lines', // transparent layer. could be usefun over satelliate imagery or similar
+ 'toner-background': 'Toner Background',
+ 'toner-lite': 'Toner Lite',
+ 'watercolor': 'Watercolor',
+ };
+
+ for (var type in types) {
+ var name = types[type];
+
+ var layer = new L.StamenTileLayer(type);
+
+ layerChooser.addBaseLayer(layer,'Stamen '+name);
+ }
+
+};
+
+var setup = window.plugin.mapTileStamen.setup;
+
+// PLUGIN END //////////////////////////////////////////////////////////
+
+@@PLUGINEND@@
From 24581e5893f5ecd2e20740eabc4b94ffe5b8fe92 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Thu, 7 Nov 2013 01:44:22 +0000
Subject: [PATCH 35/72] bing.com base map layers
---
plugins/basemap-bing.user.js | 174 +++++++++++++++++++++++++++++++++++
1 file changed, 174 insertions(+)
create mode 100644 plugins/basemap-bing.user.js
diff --git a/plugins/basemap-bing.user.js b/plugins/basemap-bing.user.js
new file mode 100644
index 00000000..9a1f4adc
--- /dev/null
+++ b/plugins/basemap-bing.user.js
@@ -0,0 +1,174 @@
+// ==UserScript==
+// ==UserScript==
+// @id iitc-plugin-bing-maps
+// @name IITC plugin: Bing maps
+// @category Map Tiles
+// @version 0.1.0.@@DATETIMEVERSION@@
+// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
+// @updateURL @@UPDATEURL@@
+// @downloadURL @@DOWNLOADURL@@
+// @description [@@BUILDNAME@@-@@BUILDDATE@@] Add the maps.bing.com map layers (
+// @include https://www.ingress.com/intel*
+// @include http://www.ingress.com/intel*
+// @match https://www.ingress.com/intel*
+// @match http://www.ingress.com/intel*
+// @grant none
+// ==/UserScript==
+
+@@PLUGINSTART@@
+
+// PLUGIN START ////////////////////////////////////////////////////////
+
+window.plugin.mapBing = function() {};
+
+window.plugin.mapBing.setupBingLeaflet = function() {
+//---------------------------------------------------------------------
+// https://github.com/shramov/leaflet-plugins/blob/master/layer/tile/Bing.js
+L.BingLayer = L.TileLayer.extend({
+ options: {
+ subdomains: [0, 1, 2, 3],
+ type: 'Aerial',
+ attribution: 'Bing',
+ culture: ''
+ },
+
+ initialize: function(key, options) {
+ L.Util.setOptions(this, options);
+
+ this._key = key;
+ this._url = null;
+ this.meta = {};
+ this.loadMetadata();
+ },
+
+ tile2quad: function(x, y, z) {
+ var quad = '';
+ for (var i = z; i > 0; i--) {
+ var digit = 0;
+ var mask = 1 << (i - 1);
+ if ((x & mask) != 0) digit += 1;
+ if ((y & mask) != 0) digit += 2;
+ quad = quad + digit;
+ }
+ return quad;
+ },
+
+ getTileUrl: function(p, z) {
+ var z = this._getZoomForUrl();
+ var subdomains = this.options.subdomains,
+ s = this.options.subdomains[Math.abs((p.x + p.y) % subdomains.length)];
+ return this._url.replace('{subdomain}', s)
+ .replace('{quadkey}', this.tile2quad(p.x, p.y, z))
+ .replace('{culture}', this.options.culture);
+ },
+
+ loadMetadata: function() {
+ // TODO? modify this to cache the metadata in - say - sessionStorage? localStorage?
+ var _this = this;
+ var cbid = '_bing_metadata_' + L.Util.stamp(this);
+ window[cbid] = function (meta) {
+ _this.meta = meta;
+ window[cbid] = undefined;
+ var e = document.getElementById(cbid);
+ e.parentNode.removeChild(e);
+ if (meta.errorDetails) {
+ alert("Got metadata" + meta.errorDetails);
+ return;
+ }
+ _this.initMetadata();
+ };
+ var url = "//dev.virtualearth.net/REST/v1/Imagery/Metadata/" + this.options.type + "?include=ImageryProviders&jsonp=" + cbid + "&key=" + this._key;
+ var script = document.createElement("script");
+ script.type = "text/javascript";
+ script.src = url;
+ script.id = cbid;
+ document.getElementsByTagName("head")[0].appendChild(script);
+ },
+
+ initMetadata: function() {
+ var r = this.meta.resourceSets[0].resources[0];
+ this.options.subdomains = r.imageUrlSubdomains;
+ this._url = r.imageUrl;
+ this._providers = [];
+ for (var i = 0; i < r.imageryProviders.length; i++) {
+ var p = r.imageryProviders[i];
+ for (var j = 0; j < p.coverageAreas.length; j++) {
+ var c = p.coverageAreas[j];
+ var coverage = {zoomMin: c.zoomMin, zoomMax: c.zoomMax, active: false};
+ var bounds = new L.LatLngBounds(
+ new L.LatLng(c.bbox[0]+0.01, c.bbox[1]+0.01),
+ new L.LatLng(c.bbox[2]-0.01, c.bbox[3]-0.01)
+ );
+ coverage.bounds = bounds;
+ coverage.attrib = p.attribution;
+ this._providers.push(coverage);
+ }
+ }
+ this._update();
+ },
+
+ _update: function() {
+ if (this._url == null || !this._map) return;
+ this._update_attribution();
+ L.TileLayer.prototype._update.apply(this, []);
+ },
+
+ _update_attribution: function() {
+ var bounds = this._map.getBounds();
+ var zoom = this._map.getZoom();
+ for (var i = 0; i < this._providers.length; i++) {
+ var p = this._providers[i];
+ if ((zoom <= p.zoomMax && zoom >= p.zoomMin) &&
+ bounds.intersects(p.bounds)) {
+ if (!p.active)
+ this._map.attributionControl.addAttribution(p.attrib);
+ p.active = true;
+ } else {
+ if (p.active)
+ this._map.attributionControl.removeAttribution(p.attrib);
+ p.active = false;
+ }
+ }
+ },
+
+ onRemove: function(map) {
+ for (var i = 0; i < this._providers.length; i++) {
+ var p = this._providers[i];
+ if (p.active) {
+ this._map.attributionControl.removeAttribution(p.attrib);
+ p.active = false;
+ }
+ }
+ L.TileLayer.prototype.onRemove.apply(this, [map]);
+ }
+});
+//---------------------------------------------------------------------
+}
+
+
+window.plugin.mapBing.setup = function() {
+ window.plugin.mapBing.setupBingLeaflet();
+
+ //set this to your API key
+ var bingApiKey = 'ArR2hTa2C9cRQZT-RmgrDkfvh3PwEVRl0gB34OO4wJI7vQNElg3DDWvbo5lfUs3p';
+
+ var bingTypes = {
+ 'Road': "Road",
+ 'Aerial': "Aerial",
+ 'AerialWithLabels': "Aerial with labels",
+ };
+
+ for (type in bingTypes) {
+ var name = bingTypes[type];
+ var bingMap = new L.BingLayer(bingApiKey, {type: type, maxZoom:20});
+ layerChooser.addBaseLayer(bingMap, 'Bing '+name);
+ }
+
+};
+
+var setup = window.plugin.mapBing.setup;
+
+// PLUGIN END //////////////////////////////////////////////////////////
+
+
+@@PLUGINEND@@
From c602e42b2a5d0b636cca131b604aacca646c0372 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Thu, 7 Nov 2013 01:45:42 +0000
Subject: [PATCH 36/72] basemap: nokia ovi maps
---
plugins/basemap-nokia-ovi.user.js | 48 +++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
create mode 100644 plugins/basemap-nokia-ovi.user.js
diff --git a/plugins/basemap-nokia-ovi.user.js b/plugins/basemap-nokia-ovi.user.js
new file mode 100644
index 00000000..e345d921
--- /dev/null
+++ b/plugins/basemap-nokia-ovi.user.js
@@ -0,0 +1,48 @@
+// ==UserScript==
+// @id iitc-plugin-nokia-ovi-maps
+// @name IITC plugin: Nokia OVI maps
+// @category Map Tiles
+// @version 0.1.0.@@DATETIMEVERSION@@
+// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
+// @updateURL @@UPDATEURL@@
+// @downloadURL @@DOWNLOADURL@@
+// @description [@@BUILDNAME@@-@@BUILDDATE@@] Add various map layers from Nokia OVI Maps
+// @include https://www.ingress.com/intel*
+// @include http://www.ingress.com/intel*
+// @match https://www.ingress.com/intel*
+// @match http://www.ingress.com/intel*
+// @grant none
+// ==/UserScript==
+
+@@PLUGINSTART@@
+
+// PLUGIN START ////////////////////////////////////////////////////////
+
+window.plugin.mapNokiaOvi = function() {};
+
+window.plugin.mapNokiaOvi.setup = function() {
+ //the list of styles you'd like to see
+ var oviStyles = {
+ 'normal.day': "Normal",
+ 'normal.day.grey': "Normal (grey)",
+ 'normal.day.transit': "Normal (transit)",
+ 'satellite.day': "Satellite",
+ 'terrain.day': "Terrain",
+ };
+
+
+ var oviOpt = {attribution: 'Imagery © Nokia OVI', maxZoom: 20};
+
+ $.each(oviStyles, function(key,value) {
+ oviOpt['style'] = key;
+ var oviMap = new L.TileLayer('http://maptile.maps.svc.ovi.com/maptiler/maptile/newest/{style}/{z}/{x}/{y}/256/png8', oviOpt);
+ layerChooser.addBaseLayer(oviMap, 'Nokia OVI '+value);
+ });
+
+};
+
+var setup = window.plugin.mapNokiaOvi.setup;
+
+// PLUGIN END //////////////////////////////////////////////////////////
+
+@@PLUGINEND@@
From 6b5571b18ae42f0abc0ca548615387d5a66668ab Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Thu, 7 Nov 2013 03:51:20 +0000
Subject: [PATCH 37/72] artifact display: initial checkin
display artifacts (jarvis shards, jarvis targets) on the map
TODO: add details to the portal info display
---
code/artifact.js | 185 +++++++++++++++++++++++++++++++++++++++++++++++
code/boot.js | 1 +
style.css | 7 ++
3 files changed, 193 insertions(+)
create mode 100644 code/artifact.js
diff --git a/code/artifact.js b/code/artifact.js
new file mode 100644
index 00000000..ec180db0
--- /dev/null
+++ b/code/artifact.js
@@ -0,0 +1,185 @@
+// ARTIFACT ///////////////////////////////////////////////////////
+
+// added as part of the ingress #13magnus in november 2013, artifacts
+// are additional game elements overlayed on the intel map
+// currently there are only jarvis-related entities
+// - shards: move between portals (along links) each hour. more than one can be at a portal
+// - targets: specific portals - one per team
+// the artifact data includes details for the specific portals, so can be useful
+
+
+window.artifact = function() {}
+
+window.artifact.setup = function() {
+ artifact.REFRESH_SUCCESS = 15*60; // 15 minutes on success
+ artifact.REFRESH_FAILURE = 2*60; // 2 minute retry on failure
+
+ artifact.idle = false;
+ artifact.clearData();
+
+ addResumeFunction(artifact.idleResume);
+
+ artifact.requestData();
+
+ artifact._layer = new L.LayerGroup();
+ addLayerGroup ('Artifacts (Jarvis shards)', artifact._layer);
+}
+
+window.artifact.requestData = function() {
+ if (isIdle()) {
+ artifact.idle = true;
+ } else {
+ window.postAjax('getArtifactInfo', {}, artifact.handleSuccess, artifact.handleError);
+ }
+}
+
+window.artifact.idleResume = function() {
+ if (artifact.idle) {
+ artifact.idle = false;
+ artifact.requestData();
+ }
+}
+
+window.artifact.handleSuccess = function(data) {
+ artifact.processData (data);
+
+ setTimeout (artifact.requestData, artifact.REFRESH_SUCCESS*1000);
+}
+
+window.artifact.handleFailure = function(data) {
+ // no useful data on failure - do nothing
+
+ setTimeout (artifact.requestData, artifact.REFRESH_FAILURE*1000);
+}
+
+
+window.artifact.processData = function(data) {
+
+ if (!data.artifacts) {
+ console.warn('Failed to find artifacts in artifact response');
+ return;
+ }
+
+ artifact.clearData();
+
+ $.each (data.artifacts, function(i,artData) {
+ if (artData.artifactId != 'jarvis') {
+ // jarvis artifacts - fragmentInfos and targetInfos
+ // (future types? completely unknown at this time!)
+ console.warn('Note: unknown artifactId '+artData.artifactId+' - guessing how to handle it');
+ }
+
+ if (artData.fragmentInfos) {
+ artifact.processFragmentInfos (artData.artifactId, artData.fragmentInfos);
+ }
+
+ if (artData.targetInfos) {
+ artifact.processTargetInfos (artData.artifactId, artData.targetInfos);
+ }
+
+ // other data in future? completely unknown!
+ });
+
+
+ // redraw the artifact layer
+ artifact.updateLayer();
+
+}
+
+
+window.artifact.clearData = function() {
+
+ artifact.portalInfo = {};
+}
+
+window.artifact.processFragmentInfos = function (id, fragments) {
+ $.each(fragments, function(i, fragment) {
+ if (!artifact.portalInfo[fragment.portalGuid]) {
+ artifact.portalInfo[fragment.portalGuid] = { _entityData: fragment.portalInfo };
+ }
+
+ if (!artifact.portalInfo[fragment.portalGuid][id]) artifact.portalInfo[fragment.portalGuid][id] = {};
+
+ if (!artifact.portalInfo[fragment.portalGuid][id].fragments) artifact.portalInfo[fragment.portalGuid][id].fragments = [];
+
+ $.each(fragment.fragments, function(i,f) {
+ artifact.portalInfo[fragment.portalGuid][id].fragments.push(f);
+ });
+
+ });
+}
+
+window.artifact.processTargetInfos = function (id, targets) {
+ $.each(targets, function(i, target) {
+ if (!artifact.portalInfo[target.portalGuid]) {
+ artifact.portalInfo[target.portalGuid] = { _entityData: target.portalInfo };
+ }
+
+ if (!artifact.portalInfo[target.portalGuid][id]) artifact.portalInfo[target.portalGuid][id] = {};
+
+ artifact.portalInfo[target.portalGuid][id].target = target.team === 'RESISTANCE' ? TEAM_RES : TEAM_ENL;
+ });
+}
+
+
+// used to render portals that would otherwise be below the visible level
+window.artifact.getArtifactEntities = function() {
+ var entities = [];
+
+ // create fake entities from the artifact data
+ $.each (artifact.portalInfo, function(guid,data) {
+ var timestamp = 0; // we don't have a valid timestamp - so let's use 0
+ var ent = [ guid, timestamp, data._entityData ];
+ entities.push(ent);
+ });
+
+ return entities;
+}
+
+
+window.artifact.updateLayer = function() {
+ artifact._layer.clearLayers();
+
+// TODO: icons
+// //commondatastorage.googleapis.com/ingress.com/img/map_icons/marker_images/jarvis_shard.png
+// //commondatastorage.googleapis.com/ingress.com/img/map_icons/marker_images/jarvis_shard_target_0.png
+// (replace '0' with count of shards at the target portal)
+
+
+ $.each(artifact.portalInfo, function(guid,data) {
+ var latlng = L.latLng ([data._entityData.locationE6.latE6/1E6, data._entityData.locationE6.lngE6/1E6]);
+
+ // jarvis shard icon
+ var iconUrl = undefined;
+ var iconSize = 0;
+
+ if (data.jarvis.fragments) {
+ iconUrl = '//commondatastorage.googleapis.com/ingress.com/img/map_icons/marker_images/jarvis_shard.png';
+ iconSize = 60/2; // 60 pixels - half that size works better
+ }
+ if (data.jarvis.target) {
+ // target portal - show the target marker. use the count of fragments at the target to pick the right icon - it has segments that fill up
+
+ var count = data.jarvis.fragments ? data.jarvis.fragments.length : 0;
+
+ iconUrl = '//commondatastorage.googleapis.com/ingress.com/img/map_icons/marker_images/jarvis_shard_target_'+count+'.png';
+ iconSize = 100/2; // 100 pixels - half that size works better
+ }
+
+ if (iconUrl) {
+ var icon = L.icon({
+ iconUrl: iconUrl,
+ iconSize: [iconSize,iconSize],
+ iconAnchor: [iconSize/2,iconSize/2],
+ className: 'no-pointer-events' // the clickable: false below still blocks events going through to the svg underneath
+ });
+
+ var marker = L.marker (latlng, {icon: icon, clickable: false, keyboard: false});
+
+ artifact._layer.addLayer(marker);
+ } else {
+ console.warn('Oops! no URL for artifact portal icon?!');
+ }
+ });
+
+}
diff --git a/code/boot.js b/code/boot.js
index 220e1531..7d39eceb 100644
--- a/code/boot.js
+++ b/code/boot.js
@@ -525,6 +525,7 @@ function boot() {
window.setupLargeImagePreview();
window.setupSidebarToggle();
window.updateGameScore();
+ window.artifact.setup();
window.setupPlayerStat();
window.setupTooltips();
window.chat.setup();
diff --git a/style.css b/style.css
index 3886aa79..9ec21114 100644
--- a/style.css
+++ b/style.css
@@ -1015,3 +1015,10 @@ td + td {
transform: none;
}
+
+
+/* misc */
+
+.no-pointer-events {
+ pointer-events: none;
+}
From 278a8e7536040bea7a2122c05e0cf3df35b39142 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Thu, 7 Nov 2013 04:25:44 +0000
Subject: [PATCH 38/72] missed from previous artifact commit - render artifact
portals quickly from the available data
---
code/map_data_request.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/code/map_data_request.js b/code/map_data_request.js
index ae53421e..ecf31368 100644
--- a/code/map_data_request.js
+++ b/code/map_data_request.js
@@ -213,6 +213,7 @@ window.MapDataRequest.prototype.refresh = function() {
this.render.updateEntityVisibility();
+ this.render.processGameEntities(artifact.getArtifactEntities());
console.log('requesting data tiles at zoom '+zoom+' (L'+minPortalLevel+'+ portals), map zoom is '+map.getZoom());
From 73fc584571e9b5a82dad05d21111d25ec13fee5f Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Thu, 7 Nov 2013 04:44:41 +0000
Subject: [PATCH 39/72] tweaks to iitc-specific leaflet popup style - restore
close button - pointer events only hit the main box, passing through the
'tip' area - this makes it easy to select differetn players after a marker
spider
---
style.css | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/style.css b/style.css
index 9ec21114..a04b3086 100644
--- a/style.css
+++ b/style.css
@@ -985,11 +985,16 @@ td + td {
/* leaflet popups - restyle to match the theme of IITC */
+#map .leaflet-popup {
+ pointer-events: none;
+}
+
#map .leaflet-popup-content-wrapper {
border-radius: 0px;
-webkit-border-radius: 0px;
border: 1px solid #20A8B1;
background: #0e3d4e;
+ pointer-events: auto;
}
#map .leaflet-popup-content {
@@ -998,9 +1003,15 @@ td + td {
}
#map .leaflet-popup-close-button {
- display: none;
+ padding: 2px 1px 0 0;
+ font-size: 12px;
+ line-height: 8px;
+ width: 10px;
+ height: 10px;
+ pointer-events: auto;
}
+
#map .leaflet-popup-tip {
/* change the tip from an arrow to a simple line */
background: #20A8B1;
@@ -1013,7 +1024,6 @@ td + td {
-ms-transform: none;
-o-transform: none;
transform: none;
-
}
From 9c4b3985ccddc81e731574e76e88c6c4131d09c4 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Thu, 7 Nov 2013 05:01:05 +0000
Subject: [PATCH 40/72] artifact layer defaults to on now
---
code/artifact.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/artifact.js b/code/artifact.js
index ec180db0..88b899b7 100644
--- a/code/artifact.js
+++ b/code/artifact.js
@@ -22,7 +22,7 @@ window.artifact.setup = function() {
artifact.requestData();
artifact._layer = new L.LayerGroup();
- addLayerGroup ('Artifacts (Jarvis shards)', artifact._layer);
+ addLayerGroup ('Artifacts (Jarvis shards)', artifact._layer, true);
}
window.artifact.requestData = function() {
From 52a5b231ed25c2dde29a1771e8762b3c2ffb7c3b Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Fri, 8 Nov 2013 00:36:15 +0000
Subject: [PATCH 41/72] new munge set for 2013-11-07
---
code/utils_misc.js | 52 ++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 50 insertions(+), 2 deletions(-)
diff --git a/code/utils_misc.js b/code/utils_misc.js
index 2a9643bb..d04dda75 100644
--- a/code/utils_misc.js
+++ b/code/utils_misc.js
@@ -214,6 +214,49 @@ window.requestParameterMunges = [
inviteeEmailAddress: 'thpbnoyjx0antwm5',
},
+ // set 8 - 2013-11-07
+ {
+ 'dashboard.getArtifactInfo': 'artifacts', // GET_ARTIFACT_INFO: new (and not obfsucated?!)
+ 'dashboard.getGameScore': 'lls4clhel87apzpa', // GET_GAME_SCORE
+ 'dashboard.getPaginatedPlextsV2': 'r6n2xgcd8wjsm4og', // GET_PAGINATED_PLEXTS
+ 'dashboard.getThinnedEntitiesV4': '1ybigzcf2sifu34b', // GET_THINNED_ENTITIES
+ 'dashboard.getPlayersByGuids': 'uig0xeb6trclqd2l', // LOOKUP_PLAYERS
+ 'dashboard.redeemReward': '7dd7x64cc2lbutoq', // REDEEM_REWARD
+ 'dashboard.sendInviteEmail': 'd8p6dvwilsr460u3', // SEND_INVITE_EMAIL
+ 'dashboard.sendPlext': 'repg2orpg7htkoto', // SEND_PLEXT
+
+ // common parameters
+ method: '97aes4vnlvyhoxik',
+ version: 'an8mglz21qabq3wq', //guessed parameter name - only seen munged
+ version_parameter: 'b92c9d055fcdf715887b173c706e7a2c267e32c5', // passed as the value to the above parameter
+
+ // GET_THINNED_ENTITIES
+ quadKeys: 'mhjknavysslwfhk6', //guessed parameter name - only seen munged
+
+ // GET_PAGINATED_PLEXTS
+ desiredNumItems: 'l61g8u397alq3j1x',
+ minLatE6: 'wwsvpboc5bxd1s9q',
+ minLngE6: '48l4x7ngfsz47z3u',
+ maxLatE6: 'p3m1qg81uqldizu6',
+ maxLngE6: 'h4kv1eef878vfyk3',
+ minTimestampMs: 'uj1vcy9ufws24v2c',
+ maxTimestampMs: '8pt1x5nd9hk5vakv',
+ chatTab: 'zy1yc1rfczashshu', //guessed parameter name - only seen munged
+ ascendingTimestampOrder: 'duyuskmky68nl2ci',
+
+ // SEND_PLEXT
+ message: 'xktwjguq0nohzioa',
+ latE6: 'm4crflfaibmg9mdf',
+ lngE6: 'h6jfungrw5ii830r',
+// chatTab: 'zy1yc1rfczashshu', //guessed parameter name - only seen munged
+
+ // LOOKUP_PLAYERS
+ guids: '3u9h9cpfh2yiy4fk',
+
+ // SEND_INVITE_EMAIL
+ inviteeEmailAddress: 'jpg3y4ax7t0w356j',
+ },
+
];
window.activeRequestMungeSet = undefined;
@@ -224,11 +267,16 @@ window.detectActiveMungeSet = function() {
// FIXME? revert to searching through all the code? is that practical?
var stockFunc;
try {
- stockFunc = nemesis.dashboard.network.XhrController.prototype.sendRequest.toString();
+ stockFunc = nemesis.dashboard.network.XhrController.prototype.doSendRequest_.toString();
} catch(e) {
try {
- stockFunc = nemesis.dashboard.network.DataFetcher.prototype.sendRequest_.toString();
+ stockFunc = nemesis.dashboard.network.XhrController.prototype.sendRequest.toString();
} catch(e) {
+ try {
+ stockFunc = nemesis.dashboard.network.DataFetcher.prototype.sendRequest_.toString();
+ } catch(e) {
+ console.warn('Failed to find a relevant function in the stock site');
+ }
}
}
From e99cceff0258275d2853e402c68224d766a073a6 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Fri, 8 Nov 2013 02:28:58 +0000
Subject: [PATCH 42/72] website: update for 0.14.6, mobile 0.7.7.2
---
website/page/home.php | 5 +++++
website/page/news.php | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/website/page/home.php b/website/page/home.php
index 02ae9641..94dd5b6a 100644
--- a/website/page/home.php
+++ b/website/page/home.php
@@ -13,6 +13,11 @@ offers many more features. It is available for
Latest news
+7th November 2013
+
+IITC 0.14.6 and IITC Mobile 0.7.7.2 released. Another change needed to match a minor update to the standard intel site.
+
+
6th November 2013
IITC 0.14.5 and IITC Mobile 0.7.7.1 have been released. This contains a fix to work with the latest intel site updates.
diff --git a/website/page/news.php b/website/page/news.php
index 0edb63e3..017a1cbe 100644
--- a/website/page/news.php
+++ b/website/page/news.php
@@ -1,5 +1,10 @@
News
+7th November 2013
+
+IITC 0.14.6 and IITC Mobile 0.7.7.2 released. Another change needed to match a minor update to the standard intel site.
+
+
6th November 2013
IITC 0.14.5 and IITC Mobile 0.7.7.1 have been released. This contains a fix to work with the latest intel site updates.
From 15537e4e95a7f0aab5405dc1ba1e06cb905b08dc Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Fri, 8 Nov 2013 02:30:24 +0000
Subject: [PATCH 43/72] website: the stock site javascript monitor script now
sets a flag file that indicates things have changed. use this to display a
warning on the website that IITC might be broken
---
website/index.php | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/website/index.php b/website/index.php
index 2d01c87b..8ce5fbfd 100644
--- a/website/index.php
+++ b/website/index.php
@@ -68,6 +68,20 @@ if ( file_exists ( 'tracking.php' ) )
- a place to ask for help and discuss with other users.