Date: Wed, 27 May 2015 16:19:23 +0100
Subject: [PATCH 10/86] update website for new release
---
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 5c294221..c9872ced 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
+27th May 2015
+
+IITC 0.23.0 has been released. This is a critical update needed to fix IITC after a Niantic site update.
+
+
8th May 2015
IITC 0.22.3 has been released. Changes include
diff --git a/website/page/news.php b/website/page/news.php
index 9a5abe11..b1fd8cad 100644
--- a/website/page/news.php
+++ b/website/page/news.php
@@ -1,5 +1,10 @@
News
+27th May 2015
+
+IITC 0.23.0 has been released. This is a critical update needed to fix IITC after a Niantic site update.
+
+
8th May 2015
IITC 0.22.3 has been released. Changes include
From 495a635007d8a2baa46b33857456c82c09540a37 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Wed, 27 May 2015 16:20:51 +0100
Subject: [PATCH 11/86] bump version after new release
---
main.js | 2 +-
mobile/AndroidManifest.xml | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/main.js b/main.js
index 0c6466d6..ff4652fe 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.23.0.@@DATETIMEVERSION@@
+// @version 0.23.1.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
diff --git a/mobile/AndroidManifest.xml b/mobile/AndroidManifest.xml
index a964c5bd..03d414e7 100644
--- a/mobile/AndroidManifest.xml
+++ b/mobile/AndroidManifest.xml
@@ -2,8 +2,8 @@
+ android:versionCode="99"
+ android:versionName="0.23.1">
Date: Fri, 29 May 2015 05:35:08 +0100
Subject: [PATCH 12/86] artifact details are now returned in the selected
portal details - parse them [not yet used anywhere though...]
---
code/entity_decode.js | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/code/entity_decode.js b/code/entity_decode.js
index 76fdd26f..eb09a764 100644
--- a/code/entity_decode.js
+++ b/code/entity_decode.js
@@ -25,6 +25,16 @@
energy: arr[2],
};
}
+ function parseArtifact(arr) {
+ if (arr == null) { return null; }
+ // empty artifact data is pointless - ignore it
+ if (arr.length == 3 && arr[0] == "" && arr[1] == "" && arr[2].length == 0) { return null; }
+ return {
+ type: arr[0],
+ displayName: arr[1],
+ fragments: arr[2],
+ };
+ }
var summaryArrayLength = undefined;
@@ -71,7 +81,8 @@
return $.extend(basePortalData(a),{
mods: a[summaryArrayLength+0].map(parseMod),
resonators:a[summaryArrayLength+1].map(parseResonator),
- owner: a[summaryArrayLength+2]
+ owner: a[summaryArrayLength+2],
+ artifact: parseArtifact(a[summaryArrayLength+3]),
});
}
From 57469890950440ae1cecdd67e92eab6973a28f36 Mon Sep 17 00:00:00 2001
From: fkloft
Date: Thu, 4 Jun 2015 00:50:22 +0200
Subject: [PATCH 13/86] [missions] use console.error instead of console.log
---
plugins/missions.user.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/missions.user.js b/plugins/missions.user.js
index 36ab2815..1d26caf0 100644
--- a/plugins/missions.user.js
+++ b/plugins/missions.user.js
@@ -259,7 +259,7 @@ window.plugin.missions = {
}
callback(missions);
}, function(error) {
- console.log('Error loading missions in bounds', arguments);
+ console.error('Error loading missions in bounds', arguments);
if (errorcallback) {
errorcallback(error);
}
@@ -293,7 +293,7 @@ window.plugin.missions = {
me.storeCache();
callback(missions);
}, function(error) {
- console.log('Error loading portal missions', arguments);
+ console.error('Error loading portal missions', arguments);
if (errorcallback) {
errorcallback(error);
}
From 96a8a94d48dd9b68fd8e71b0540828de6a8aa031 Mon Sep 17 00:00:00 2001
From: fkloft
Date: Thu, 4 Jun 2015 00:54:35 +0200
Subject: [PATCH 14/86] [missions] allow to load missions from portals other
than the selected one (doesn't need to be loaded)
---
plugins/missions.user.js | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/plugins/missions.user.js b/plugins/missions.user.js
index 1d26caf0..0c44dd44 100644
--- a/plugins/missions.user.js
+++ b/plugins/missions.user.js
@@ -117,22 +117,17 @@ window.plugin.missions = {
},
openPortalMissions: function() {
- var me = this,
- portal = window.portals[window.selectedPortal];
- if (!portal) {
- return;
- }
this.loadPortalMissions(window.selectedPortal, function(missions) {
if (!missions.length) {
return;
}
if (missions.length === 1) {
- me.loadMission(missions[0].guid, me.showMissionDialog.bind(me));
+ this.loadMission(missions[0].guid, this.showMissionDialog.bind(this));
} else {
- me.showMissionListDialog(missions);
+ this.showMissionListDialog(missions);
}
- });
+ }.bind(this));
},
openMission: function(guid) {
@@ -274,7 +269,7 @@ window.plugin.missions = {
return;
}
window.postAjax('getTopMissionsForPortal', {
- guid: window.selectedPortal
+ guid: guid,
}, function(data) {
var missions = data.result.map(decodeMissionSummary);
if (!missions) {
From 4146d46e5b846e554da6e1ed32387d4638f4eabd Mon Sep 17 00:00:00 2001
From: fkloft
Date: Thu, 4 Jun 2015 00:55:48 +0200
Subject: [PATCH 15/86] [missions] Bugfix: plugin would break and show weird
dialogs if the mission markers aren't enabled
---
plugins/missions.user.js | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/plugins/missions.user.js b/plugins/missions.user.js
index 0c44dd44..99dbc2db 100644
--- a/plugins/missions.user.js
+++ b/plugins/missions.user.js
@@ -785,12 +785,15 @@ window.plugin.missions = {
},
highlightMissionLayers: function(markers) {
+ // layer.bringToFront() will break if the layer is not visible
+ var bringToFront = map.hasLayer(plugin.missions.missionLayer);
+
this.missionLayer.eachLayer(function(layer) {
var active = (markers.indexOf(layer) !== -1);
layer.setStyle({
color: active ? this.MISSION_COLOR_ACTIVE : this.MISSION_COLOR,
});
- if(active) layer.bringToFront();
+ if(active && bringToFront) layer.bringToFront();
}, this);
},
From 34d13f65592729a42aac6876ac98f5114663ab52 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Thu, 11 Jun 2015 22:35:57 +0100
Subject: [PATCH 16/86] tweaks for latest niantic update iitc detects the
correct map params anyway, but warns when fallback values are different also,
new data in portal entities - unknown12 (only seen 'null') and index 13
(portal timestamp) the timestamp is also in the portal details, so this will
be handy
---
code/entity_decode.js | 4 +++-
code/map_data_calc_tools.js | 8 ++++----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/code/entity_decode.js b/code/entity_decode.js
index eb09a764..9199d1e6 100644
--- a/code/entity_decode.js
+++ b/code/entity_decode.js
@@ -53,7 +53,9 @@
title: a[8],
ornaments: a[9],
mission: a[10],
- mission50plus: a[11]
+ mission50plus: a[11],
+ unknown12: a[12],
+ timestamp: a[13]
};
};
diff --git a/code/map_data_calc_tools.js b/code/map_data_calc_tools.js
index 34636500..aae87cea 100755
--- a/code/map_data_calc_tools.js
+++ b/code/map_data_calc_tools.js
@@ -12,8 +12,8 @@
window.setupDataTileParams = function() {
// default values - used to fall back to if we can't detect those used in stock intel
- var DEFAULT_ZOOM_TO_TILES_PER_EDGE = [256, 256, 256, 256, 512, 512, 512, 2048, 2048, 2048, 4096, 4096, 6500, 6500, 6500, 18e3, 18e3, 36e3];
- var DEFAULT_ZOOM_TO_LEVEL = [ 8, 8, 8, 8, 7, 7, 7, 6, 6, 5, 4, 4, 3, 2, 2, 1, 1 ];
+ var DEFAULT_ZOOM_TO_TILES_PER_EDGE = [256,256,256,256,512,512,512,2048,2048,4096,4096,6500,6500,6500,18000,18000,36000];
+ var DEFAULT_ZOOM_TO_LEVEL = [8,8,8,8,7,7,7,6,6,5,4,4,3,2,2,1,1];
window.TILE_PARAMS = {};
@@ -25,11 +25,11 @@ window.setupDataTileParams = function() {
// lazy numerical array comparison
if ( JSON.stringify(niantic_params.ZOOM_TO_LEVEL) != JSON.stringify(DEFAULT_ZOOM_TO_LEVEL)) {
- console.warn('Tile parameter ZOOM_TO_LEVEL have changed in stock intel. Detectec correct values, but code should be updated');
+ console.warn('Tile parameter ZOOM_TO_LEVEL have changed in stock intel. Detected correct values, but code should be updated');
debugger;
}
if ( JSON.stringify(niantic_params.TILES_PER_EDGE) != JSON.stringify(DEFAULT_ZOOM_TO_TILES_PER_EDGE)) {
- console.warn('Tile parameter ZOOM_TO_LEVEL have changed in stock intel. Detectec correct values, but code should be updated');
+ console.warn('Tile parameter ZOOM_TO_LEVEL have changed in stock intel. Detected correct values, but code should be updated');
debugger;
}
From bd13278ec0a331af64af54f4fd8ebd1531b30437 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Sat, 13 Jun 2015 10:20:16 +0100
Subject: [PATCH 17/86] add comments concerning artifact changes - will double
check once the flaky niantic update sorts itself out
---
code/artifact.js | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/code/artifact.js b/code/artifact.js
index 5bbecc19..b5335b8f 100644
--- a/code/artifact.js
+++ b/code/artifact.js
@@ -37,6 +37,20 @@ window.artifact.requestData = function() {
} else {
// new API available in stock (2015-05-21) - 'getArtifactPortals'
// stock still uses this one, and the new method doesn't yet return anything, but they might be changing things soon...
+//2015-06-13 - stock intel update using the new API
+//above method takes no params, returns a list of portals. however, no longer
+//1. a distinction between target portals and artifact portals
+//2. some shard details in the portal summary 'unknown12' variable
+// a. no sign of fragment numbers in this summary data - only in portal details
+// b. not sure how resistance/enlightened targets are identified. so far, most portals have
+// "[[["lightman"]], []]" (fragment at portal?)
+// aod two have
+// "[[["lightman"]], [["lightman"]]]"
+// best guess - first array is a list of artifact types (but not numbers) at a portal
+// - second array is a list of the target types for a portal
+// (so "[[[]], [["lightman"]]]" would be for a target without any fragments at it
+
+
window.postAjax('artifacts', {}, artifact.handleSuccess, artifact.handleError);
}
}
From a7387e3f4b3e8820f31139828099de620d9ebfcd Mon Sep 17 00:00:00 2001
From: fkloft
Date: Tue, 23 Jun 2015 19:51:48 +0200
Subject: [PATCH 18/86] Support for ULTRA_LINK_AMPs
---
code/portal_detail_display.js | 8 ++++++--
code/portal_detail_display_tools.js | 1 +
code/portal_info.js | 14 +++++++++++++-
code/utils_misc.js | 5 +++--
4 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/code/portal_detail_display.js b/code/portal_detail_display.js
index 3c51cb80..7d1851bc 100644
--- a/code/portal_detail_display.js
+++ b/code/portal_detail_display.js
@@ -169,11 +169,15 @@ window.getPortalMiscDetails = function(guid,d) {
// collect some random data that’s not worth to put in an own method
var linkInfo = getPortalLinks(guid);
+ var maxOutgoing = getMaxOutgoingLinks(d);
var linkCount = linkInfo.in.length + linkInfo.out.length;
var links = {incoming: linkInfo.in.length, outgoing: linkInfo.out.length};
- function linkExpl(t) { return ''+t+''; }
- var linksText = [linkExpl('links'), linkExpl(links.outgoing+' out / '+links.incoming+' in')];
+ var title = 'at most ' + maxOutgoing + ' outgoing links\n' +
+ links.outgoing + ' links out\n' +
+ links.incoming + ' links in\n' +
+ '(' + (links.outgoing+links.incoming) + ' total)'
+ var linksText = ['links', links.outgoing+' out / '+links.incoming+' in', title];
var player = d.owner
? '' + d.owner + ''
diff --git a/code/portal_detail_display_tools.js b/code/portal_detail_display_tools.js
index abd54a50..849cb35a 100644
--- a/code/portal_detail_display_tools.js
+++ b/code/portal_detail_display_tools.js
@@ -115,6 +115,7 @@ window.getModDetails = function(d) {
else if (key === 'ATTACK_FREQUENCY') val = (val/1000) +'x'; // 2000 = 2x
else if (key === 'FORCE_AMPLIFIER') val = (val/1000) +'x'; // 2000 = 2x
else if (key === 'LINK_RANGE_MULTIPLIER') val = (val/1000) +'x'; // 2000 = 2x
+ else if (key === 'LINK_DEFENSE_BOOST') val = (val/1000) +'x'; // 1500 = 1.5x
else if (key === 'REMOVAL_STICKINESS' && val > 100) val = (val/10000)+'%'; // an educated guess
// else display unmodified. correct for shield mitigation and multihack - unknown for future/other mods
diff --git a/code/portal_info.js b/code/portal_info.js
index 663dab51..29d607c6 100644
--- a/code/portal_info.js
+++ b/code/portal_info.js
@@ -207,7 +207,8 @@ window.getPortalModsByType = function(d, type) {
TURRET: 'HIT_BONUS', // and/or ATTACK_FREQUENCY??
HEATSINK: 'HACK_SPEED',
MULTIHACK: 'BURNOUT_INSULATION',
- LINK_AMPLIFIER: 'LINK_RANGE_MULTIPLIER'
+ LINK_AMPLIFIER: 'LINK_RANGE_MULTIPLIER',
+ ULTRA_LINK_AMP: 'OUTGOING_LINKS_BONUS', // and/or LINK_DEFENSE_BOOST??
};
var stat = typeToStat[type];
@@ -257,6 +258,17 @@ window.getPortalMitigationDetails = function(d,linkCount) {
return mitigation;
}
+window.getMaxOutgoingLinks = function(d) {
+ var linkAmps = getPortalModsByType(d, 'ULTRA_LINK_AMP');
+
+ var links = 8;
+
+ linkAmps.forEach(function(mod, i) {
+ links += parseInt(mod.stats.OUTGOING_LINKS_BONUS);
+ });
+
+ return links;
+};
window.getPortalHackDetails = function(d) {
diff --git a/code/utils_misc.js b/code/utils_misc.js
index f2f09ccb..f1892b82 100644
--- a/code/utils_misc.js
+++ b/code/utils_misc.js
@@ -335,10 +335,11 @@ window.uniqueArray = function(arr) {
window.genFourColumnTable = function(blocks) {
var t = $.map(blocks, function(detail, index) {
if(!detail) return '';
+ var title = detail[2] ? ' title="'+escapeHtmlSpecialChars(detail[2]) + '"' : '';
if(index % 2 === 0)
- return ''+detail[1]+' | '+detail[0]+' | ';
+ return '
---|
'+detail[1]+' | '+detail[0]+' | ';
else
- return ' '+detail[0]+' | '+detail[1]+' |
';
+ return ' '+detail[0]+' | '+detail[1]+' | ';
}).join('');
if(t.length % 2 === 1) t + ' | | ';
return t;
From 3396cc7a2746d510e019e39415be308087a5788f Mon Sep 17 00:00:00 2001
From: fkloft
Date: Tue, 23 Jun 2015 20:03:09 +0200
Subject: [PATCH 19/86] Set title in genFourColumnTable
---
code/portal_detail_display_tools.js | 68 ++++++++++++-----------------
1 file changed, 29 insertions(+), 39 deletions(-)
diff --git a/code/portal_detail_display_tools.js b/code/portal_detail_display_tools.js
index 849cb35a..10daac5a 100644
--- a/code/portal_detail_display_tools.js
+++ b/code/portal_detail_display_tools.js
@@ -12,14 +12,15 @@ window.getRangeText = function(d) {
if(!range.isLinkable) title += '\nPortal is missing resonators,\nno new links can be made';
- return ['range',
+ return ['range',
''
+ + '>'
+ (range.range > 1000
? Math.floor(range.range/1000) + ' km'
: Math.floor(range.range) + ' m')
- + ''];
+ + '',
+ title];
}
// generates description text from details for portal
@@ -151,9 +152,9 @@ window.getModDetails = function(d) {
window.getEnergyText = function(d) {
var currentNrg = getCurrentPortalEnergy(d);
var totalNrg = getTotalPortalEnergy(d);
- var inf = currentNrg + ' / ' + totalNrg;
+ var title = currentNrg + ' / ' + totalNrg;
var fill = prettyEnergy(currentNrg) + ' / ' + prettyEnergy(totalNrg)
- return ['energy', '' + fill + ''];
+ return ['energy', fill, title];
}
@@ -237,22 +238,19 @@ window.getAttackApGainText = function(d,fieldCount,linkCount) {
var breakdown = getAttackApGain(d,fieldCount,linkCount);
var totalGain = breakdown.enemyAp;
- function tt(text) {
- var t = '';
- if (teamStringToId(PLAYER.team) == teamStringToId(d.team)) {
- totalGain = breakdown.friendlyAp;
- t += 'Friendly AP:\t' + breakdown.friendlyAp + '\n';
- t += ' Deploy ' + breakdown.deployCount + ', ';
- t += 'Upgrade ' + breakdown.upgradeCount + '\n';
- t += '\n';
- }
- t += 'Enemy AP:\t' + breakdown.enemyAp + '\n';
- t += ' Destroy AP:\t' + breakdown.destroyAp + '\n';
- t += ' Capture AP:\t' + breakdown.captureAp + '\n';
- return '' + text + '';
+ var t = '';
+ if (teamStringToId(PLAYER.team) == teamStringToId(d.team)) {
+ totalGain = breakdown.friendlyAp;
+ t += 'Friendly AP:\t' + breakdown.friendlyAp + '\n';
+ t += ' Deploy ' + breakdown.deployCount + ', ';
+ t += 'Upgrade ' + breakdown.upgradeCount + '\n';
+ t += '\n';
}
+ t += 'Enemy AP:\t' + breakdown.enemyAp + '\n';
+ t += ' Destroy AP:\t' + breakdown.destroyAp + '\n';
+ t += ' Capture AP:\t' + breakdown.captureAp + '\n';
- return [tt('AP Gain'), tt(digits(totalGain))];
+ return ['AP Gain', digits(totalGain), t];
}
@@ -261,16 +259,12 @@ window.getHackDetailsText = function(d) {
var shortHackInfo = hackDetails.hacks+' @ '+formatInterval(hackDetails.cooldown);
- function tt(text) {
- var t = 'Hacks available every 4 hours\n';
- t += 'Hack count:\t'+hackDetails.hacks+'\n';
- t += 'Cooldown time:\t'+formatInterval(hackDetails.cooldown)+'\n';
- t += 'Burnout time:\t'+formatInterval(hackDetails.burnout)+'\n';
+ var title = 'Hacks available every 4 hours\n'
+ + 'Hack count:\t'+hackDetails.hacks+'\n'
+ + 'Cooldown time:\t'+formatInterval(hackDetails.cooldown)+'\n'
+ + 'Burnout time:\t'+formatInterval(hackDetails.burnout);
- return ''+text+'';
- }
-
- return [tt('hacks'), tt(shortHackInfo)];
+ return ['hacks', shortHackInfo, title];
}
@@ -280,16 +274,12 @@ window.getMitigationText = function(d,linkCount) {
var mitigationShort = mitigationDetails.total;
if (mitigationDetails.excess) mitigationShort += ' (+'+mitigationDetails.excess+')';
- function tt(text) {
- var t = 'Total shielding:\t'+(mitigationDetails.shields+mitigationDetails.links)+'\n'
- + '- active:\t'+mitigationDetails.total+'\n'
- + '- excess:\t'+mitigationDetails.excess+'\n'
- + 'From\n'
- + '- shields:\t'+mitigationDetails.shields+'\n'
- + '- links:\t'+mitigationDetails.links;
+ var title = 'Total shielding:\t'+(mitigationDetails.shields+mitigationDetails.links)+'\n'
+ + '- active:\t'+mitigationDetails.total+'\n'
+ + '- excess:\t'+mitigationDetails.excess+'\n'
+ + 'From\n'
+ + '- shields:\t'+mitigationDetails.shields+'\n'
+ + '- links:\t'+mitigationDetails.links;
- return ''+text+'';
- }
-
- return [tt('shielding'), tt(mitigationShort)];
+ return ['shielding', mitigationShort, title];
}
From 42d5eb4e2f883b3899c9a9b2c73582358e199e0b Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Thu, 25 Jun 2015 20:05:53 +0100
Subject: [PATCH 20/86] fix for fallback tile sizes - auto-detection broke will
get things working for now...
---
code/map_data_calc_tools.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/map_data_calc_tools.js b/code/map_data_calc_tools.js
index aae87cea..047d3381 100755
--- a/code/map_data_calc_tools.js
+++ b/code/map_data_calc_tools.js
@@ -12,7 +12,7 @@
window.setupDataTileParams = function() {
// default values - used to fall back to if we can't detect those used in stock intel
- var DEFAULT_ZOOM_TO_TILES_PER_EDGE = [256,256,256,256,512,512,512,2048,2048,4096,4096,6500,6500,6500,18000,18000,36000];
+ var DEFAULT_ZOOM_TO_TILES_PER_EDGE = [60, 60, 60, 60, 60, 120, 500, 500, 2000, 4000, 4000, 8000, 32000, 64000];
var DEFAULT_ZOOM_TO_LEVEL = [8,8,8,8,7,7,7,6,6,5,4,4,3,2,2,1,1];
From 58a512823fc31c268ab7498abd5a31f499550eb3 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Thu, 25 Jun 2015 20:31:00 +0100
Subject: [PATCH 21/86] quick-n-dirty display of min link length instead of
portal level for zoom levels <= 14 fix detection of tiles per edge params -
array was shorter than before
---
code/extract_niantic_parameters.js | 7 +++--
code/status_bar.js | 45 ++++++++++++++++++++++++------
2 files changed, 41 insertions(+), 11 deletions(-)
diff --git a/code/extract_niantic_parameters.js b/code/extract_niantic_parameters.js
index d28bbbaf..92049c61 100644
--- a/code/extract_niantic_parameters.js
+++ b/code/extract_niantic_parameters.js
@@ -50,10 +50,10 @@ window.extractFromStock = function() {
}
if (justInts) {
- // current lengths are: 17: ZOOM_TO_LEVEL, 16: TILES_PER_EDGE
+ // current lengths are: 17: ZOOM_TO_LEVEL, 14: TILES_PER_EDGE
// however, slightly longer or shorter are a possibility in the future
- if (topObject.length >= 15 && topObject.length <= 18) {
+ if (topObject.length >= 13 && topObject.length <= 18) {
// a reasonable array length for tile parameters
// need to find two types:
// a. portal level limits. decreasing numbers, starting at 8
@@ -74,7 +74,8 @@ window.extractFromStock = function() {
}
} // end if (topObject[0] == 8)
- if (topObject[topObject.length-1] == 36000 || topObject[topObject.length-1] == 18000 || topObject[topObject.length-1] == 9000) {
+ // 2015-06-25 - changed to top value of 64000 - allow for them to double it just in case
+ if (topObject[topObject.length-1] >= 9000 && topObject[topObject.length-1] <= 128000) {
var increasing = true;
for (var i=1; i topObject[i]) {
diff --git a/code/status_bar.js b/code/status_bar.js
index 8aef2bb3..10dd8858 100644
--- a/code/status_bar.js
+++ b/code/status_bar.js
@@ -7,15 +7,44 @@ window.renderUpdateStatusTimer_ = undefined;
window.renderUpdateStatus = function() {
var progress = 1;
- // portal level display
- var t = '';
- if(!window.isSmartphone()) // space is valuable
- t += 'portals: ';
+ // portal/limk level display
+
+ var zoom = map.getZoom();
+ zoom = getDataZoomForMapZoom(zoom);
+
+ var minLinkLength;
+ if (zoom <= 4) minLinkLength = 200000;
+ else if (zoom <= 6) minLinkLength = 60000;
+ else if (zoom <= 7) minLinkLength = 10000;
+ else if (zoom <= 8) minLinkLength = 5000;
+ else if (zoom <= 10) minLinkLength = 2500;
+ else if (zoom <= 11) minLinkLength = 800;
+ else if (zoom <= 12) minLinkLength = 300;
+ else if (zoom <= 14) minLinkLength = 0; // 0 means 'all links, but not all portals'
+ else minLinkLength = -1; // -1 means 'all links and portals by min level'
+
var minlvl = getMinPortalLevel();
- if(minlvl === 0)
- t+= 'all';
- else
- t+= 'L'+minlvl+(minlvl<8?'+':'') + '';
+
+
+ var t = '';
+
+ if (minLinkLength == -1) {
+ if(!window.isSmartphone()) // space is valuable
+ t += 'portals: ';
+ if(minlvl === 0)
+ t += 'all';
+ else
+ t += 'L'+minlvl+(minlvl<8?'+':'') + '';
+ } else {
+ if(!window.isSmartphone()) // space is valuable
+ t += 'links: ';
+
+ if (minLinkLength > 0)
+ t += '>'+(minLinkLength>1000?minLinkLength/1000+'km':minLinkLength+'m')+'';
+ else
+ t += 'all links';
+ }
+
t +='';
From 9ba440f70d1fd6df6924be81111cb6a19df1cb3d Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Thu, 25 Jun 2015 21:46:28 +0100
Subject: [PATCH 22/86] move the minLinkLength stuff into
map_data_calc_tools.js - makes more sense there, and ready to be used
elsewhere if needed
---
code/map_data_calc_tools.js | 8 ++++++++
code/status_bar.js | 26 +++++++-------------------
2 files changed, 15 insertions(+), 19 deletions(-)
diff --git a/code/map_data_calc_tools.js b/code/map_data_calc_tools.js
index 047d3381..db51b1ac 100755
--- a/code/map_data_calc_tools.js
+++ b/code/map_data_calc_tools.js
@@ -15,9 +15,15 @@ window.setupDataTileParams = function() {
var DEFAULT_ZOOM_TO_TILES_PER_EDGE = [60, 60, 60, 60, 60, 120, 500, 500, 2000, 4000, 4000, 8000, 32000, 64000];
var DEFAULT_ZOOM_TO_LEVEL = [8,8,8,8,7,7,7,6,6,5,4,4,3,2,2,1,1];
+ // stock intel doesn't have this array (they use a switch statement instead), but this is far neater
+ var DEFAULT_ZOOM_TO_LINK_LENGTH = [200000,200000,200000,200000,200000,60000,60000,10000,5000,2500,2500,800,300,0,0];
window.TILE_PARAMS = {};
+ // not in stock to detect - we'll have to assume the above values...
+ window.TILE_PARAMS.ZOOM_TO_LINK_LENGTH = DEFAULT_ZOOM_TO_LINK_LENGTH;
+
+
if (niantic_params.ZOOM_TO_LEVEL && niantic_params.TILES_PER_EDGE) {
window.TILE_PARAMS.ZOOM_TO_LEVEL = niantic_params.ZOOM_TO_LEVEL;
window.TILE_PARAMS.TILES_PER_EDGE = niantic_params.TILES_PER_EDGE;
@@ -67,6 +73,8 @@ window.getMapZoomTileParameters = function(zoom) {
level: level,
maxLevel: window.TILE_PARAMS.ZOOM_TO_LEVEL[zoom] || 0, // for reference, for log purposes, etc
tilesPerEdge: window.TILE_PARAMS.TILES_PER_EDGE[zoom] || maxTilesPerEdge,
+ minLinkLength: window.TILE_PARAMS.ZOOM_TO_LINK_LENGTH[zoom] || 0,
+ noPortals: zoom < window.TILE_PARAMS.ZOOM_TO_LINK_LENGTH.length, // no portals returned at all when link length limits things
zoom: zoom // include the zoom level, for reference
};
}
diff --git a/code/status_bar.js b/code/status_bar.js
index 10dd8858..93a53c89 100644
--- a/code/status_bar.js
+++ b/code/status_bar.js
@@ -11,36 +11,24 @@ window.renderUpdateStatus = function() {
var zoom = map.getZoom();
zoom = getDataZoomForMapZoom(zoom);
-
- var minLinkLength;
- if (zoom <= 4) minLinkLength = 200000;
- else if (zoom <= 6) minLinkLength = 60000;
- else if (zoom <= 7) minLinkLength = 10000;
- else if (zoom <= 8) minLinkLength = 5000;
- else if (zoom <= 10) minLinkLength = 2500;
- else if (zoom <= 11) minLinkLength = 800;
- else if (zoom <= 12) minLinkLength = 300;
- else if (zoom <= 14) minLinkLength = 0; // 0 means 'all links, but not all portals'
- else minLinkLength = -1; // -1 means 'all links and portals by min level'
-
- var minlvl = getMinPortalLevel();
-
+ var tileParams = getMapZoomTileParameters(zoom);
var t = '';
- if (minLinkLength == -1) {
+ if (!tileParams.noPortals) {
+ // zoom level includes portals (and also all links/fields)
if(!window.isSmartphone()) // space is valuable
t += 'portals: ';
- if(minlvl === 0)
+ if(tileParams.level === 0)
t += 'all';
else
- t += 'L'+minlvl+(minlvl<8?'+':'') + '';
+ t += 'L'+tileParams.level+(tileParams.level<8?'+':'') + '';
} else {
if(!window.isSmartphone()) // space is valuable
t += 'links: ';
- if (minLinkLength > 0)
- t += '>'+(minLinkLength>1000?minLinkLength/1000+'km':minLinkLength+'m')+'';
+ if (tileParams.minLinkLength > 0)
+ t += '>'+(tileParams.minLinkLength>1000?tileParams.minLinkLength/1000+'km':tileParams.minLinkLength+'m')+'';
else
t += 'all links';
}
From 38870aba6349a3379975c6c720253a45c341f5a3 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Thu, 25 Jun 2015 22:22:49 +0100
Subject: [PATCH 23/86] more niantic tweaks to tile params, so defaults updated
also fix status bar bug introduced in previous commit
---
code/map_data_calc_tools.js | 12 +++++-------
code/status_bar.js | 2 +-
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/code/map_data_calc_tools.js b/code/map_data_calc_tools.js
index db51b1ac..e82fdb07 100755
--- a/code/map_data_calc_tools.js
+++ b/code/map_data_calc_tools.js
@@ -12,7 +12,7 @@
window.setupDataTileParams = function() {
// default values - used to fall back to if we can't detect those used in stock intel
- var DEFAULT_ZOOM_TO_TILES_PER_EDGE = [60, 60, 60, 60, 60, 120, 500, 500, 2000, 4000, 4000, 8000, 32000, 64000];
+ var DEFAULT_ZOOM_TO_TILES_PER_EDGE = [60,60,60,60,60,120,240,240,1000,2000,2000,4000,16000,32000];
var DEFAULT_ZOOM_TO_LEVEL = [8,8,8,8,7,7,7,6,6,5,4,4,3,2,2,1,1];
// stock intel doesn't have this array (they use a switch statement instead), but this is far neater
@@ -35,7 +35,7 @@ window.setupDataTileParams = function() {
debugger;
}
if ( JSON.stringify(niantic_params.TILES_PER_EDGE) != JSON.stringify(DEFAULT_ZOOM_TO_TILES_PER_EDGE)) {
- console.warn('Tile parameter ZOOM_TO_LEVEL have changed in stock intel. Detected correct values, but code should be updated');
+ console.warn('Tile parameter TILES_PER_EDGE have changed in stock intel. Detected correct values, but code should be updated');
debugger;
}
@@ -92,11 +92,9 @@ window.getDataZoomForMapZoom = function(zoom) {
}
if (window.CONFIG_ZOOM_SHOW_MORE_PORTALS) {
- // slightly unfriendly to the servers, requesting more, but smaller, tiles, for the 'unclaimed' level of detail
- // however, server load issues are all related to the map area in view, with no real issues related to detail level
- // therefore, I believel we can get away with these smaller tiles for one or two further zoom levels without issues
-
- if (zoom == 16) {
+ // as of 2015-06-25 stock site update, all zoom levels that retrieve portals (15+) use the same tile size
+ // therefore, it's no more load on the servers to fake it always to show unclaimed rather than L1+
+ if (zoom >= 15 && zoom <= 16) {
zoom = 17;
}
}
diff --git a/code/status_bar.js b/code/status_bar.js
index 93a53c89..29b11d73 100644
--- a/code/status_bar.js
+++ b/code/status_bar.js
@@ -22,7 +22,7 @@ window.renderUpdateStatus = function() {
if(tileParams.level === 0)
t += 'all';
else
- t += 'L'+tileParams.level+(tileParams.level<8?'+':'') + '';
+ t += 'L'+tileParams.level+(tileParams.level<8?'+':'') + '';
} else {
if(!window.isSmartphone()) // space is valuable
t += 'links: ';
From bb29578c78f19bf45535c48e60f49f80d8b414ee Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Thu, 25 Jun 2015 23:05:04 +0100
Subject: [PATCH 24/86] more updates chasing reprated Niantic updates debug
function to dump out the details of each zoom level tile parameters change
tile params 'noPortals' to 'hasPortals'
---
code/extract_niantic_parameters.js | 6 ++--
code/map_data_calc_tools.js | 47 ++++++++++++++++++++++++------
code/status_bar.js | 2 +-
3 files changed, 42 insertions(+), 13 deletions(-)
diff --git a/code/extract_niantic_parameters.js b/code/extract_niantic_parameters.js
index 92049c61..482f3a9b 100644
--- a/code/extract_niantic_parameters.js
+++ b/code/extract_niantic_parameters.js
@@ -53,7 +53,7 @@ window.extractFromStock = function() {
// current lengths are: 17: ZOOM_TO_LEVEL, 14: TILES_PER_EDGE
// however, slightly longer or shorter are a possibility in the future
- if (topObject.length >= 13 && topObject.length <= 18) {
+ if (topObject.length >= 12 && topObject.length <= 18) {
// a reasonable array length for tile parameters
// need to find two types:
// a. portal level limits. decreasing numbers, starting at 8
@@ -74,8 +74,8 @@ window.extractFromStock = function() {
}
} // end if (topObject[0] == 8)
- // 2015-06-25 - changed to top value of 64000 - allow for them to double it just in case
- if (topObject[topObject.length-1] >= 9000 && topObject[topObject.length-1] <= 128000) {
+ // 2015-06-25 - changed to top value of 64000, then to 32000 - allow for them to restore it just in case
+ if (topObject[topObject.length-1] >= 9000 && topObject[topObject.length-1] <= 64000) {
var increasing = true;
for (var i=1; i topObject[i]) {
diff --git a/code/map_data_calc_tools.js b/code/map_data_calc_tools.js
index e82fdb07..40cf7162 100755
--- a/code/map_data_calc_tools.js
+++ b/code/map_data_calc_tools.js
@@ -12,7 +12,7 @@
window.setupDataTileParams = function() {
// default values - used to fall back to if we can't detect those used in stock intel
- var DEFAULT_ZOOM_TO_TILES_PER_EDGE = [60,60,60,60,60,120,240,240,1000,2000,2000,4000,16000,32000];
+ var DEFAULT_ZOOM_TO_TILES_PER_EDGE = [1,1,1,40,40,80,80,320,1000,2000,2000,4000,8000,16000,16000,32000];
var DEFAULT_ZOOM_TO_LEVEL = [8,8,8,8,7,7,7,6,6,5,4,4,3,2,2,1,1];
// stock intel doesn't have this array (they use a switch statement instead), but this is far neater
@@ -50,6 +50,31 @@ window.setupDataTileParams = function() {
}
+window.debugMapZoomParameters = function() {
+
+ //for debug purposes, log the tile params used for each zoom level
+ console.log('DEBUG: Map Zoom Parameters');
+ var doneZooms = {};
+ for (var z=MIN_ZOOM; z<=21; z++) {
+ var ourZoom = getDataZoomForMapZoom(z);
+ console.log('DEBUG: map zoom '+z+': IITC requests '+ourZoom+(ourZoom!=z?' instead':''));
+ if (!doneZooms[ourZoom]) {
+ var params = getMapZoomTileParameters(ourZoom);
+ var msg = 'DEBUG: data zoom '+ourZoom;
+ if (params.hasPortals) {
+ msg += ' has portals, L'+params.level+'+';
+ } else {
+ msg += ' NO portals (was L'+params.level+'+)';
+ }
+ msg += ', minLinkLength='+params.minLinkLength;
+ msg += ', tiles per edge='+params.tilesPerEdge;
+ console.log(msg);
+ doneZooms[ourZoom] = true;
+ }
+ }
+}
+
+
window.getMapZoomTileParameters = function(zoom) {
@@ -60,12 +85,12 @@ window.getMapZoomTileParameters = function(zoom) {
var level = window.TILE_PARAMS.ZOOM_TO_LEVEL[zoom] || 0; // default to level 0 (all portals) if not in array
- if (window.CONFIG_ZOOM_SHOW_LESS_PORTALS_ZOOMED_OUT) {
- if (level <= 7 && level >= 4) {
- // reduce portal detail level by one - helps reduce clutter
- level = level+1;
- }
- }
+// if (window.CONFIG_ZOOM_SHOW_LESS_PORTALS_ZOOMED_OUT) {
+// if (level <= 7 && level >= 4) {
+// // reduce portal detail level by one - helps reduce clutter
+// level = level+1;
+// }
+// }
var maxTilesPerEdge = window.TILE_PARAMS.TILES_PER_EDGE[window.TILE_PARAMS.TILES_PER_EDGE.length-1];
@@ -74,7 +99,7 @@ window.getMapZoomTileParameters = function(zoom) {
maxLevel: window.TILE_PARAMS.ZOOM_TO_LEVEL[zoom] || 0, // for reference, for log purposes, etc
tilesPerEdge: window.TILE_PARAMS.TILES_PER_EDGE[zoom] || maxTilesPerEdge,
minLinkLength: window.TILE_PARAMS.ZOOM_TO_LINK_LENGTH[zoom] || 0,
- noPortals: zoom < window.TILE_PARAMS.ZOOM_TO_LINK_LENGTH.length, // no portals returned at all when link length limits things
+ hasPortals: zoom >= window.TILE_PARAMS.ZOOM_TO_LINK_LENGTH.length, // no portals returned at all when link length limits things
zoom: zoom // include the zoom level, for reference
};
}
@@ -110,7 +135,11 @@ window.getDataZoomForMapZoom = function(zoom) {
while (zoom > MIN_ZOOM) {
var newTileParams = getMapZoomTileParameters(zoom-1);
- if (newTileParams.tilesPerEdge != origTileParams.tilesPerEdge || newTileParams.level != origTileParams.level) {
+
+ 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 {
diff --git a/code/status_bar.js b/code/status_bar.js
index 29b11d73..97703792 100644
--- a/code/status_bar.js
+++ b/code/status_bar.js
@@ -15,7 +15,7 @@ window.renderUpdateStatus = function() {
var t = '';
- if (!tileParams.noPortals) {
+ if (tileParams.hasPortals) {
// zoom level includes portals (and also all links/fields)
if(!window.isSmartphone()) // space is valuable
t += 'portals: ';
From 9c487a30017b338cda7c14c651e15b9f0f4e2ef4 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Fri, 26 Jun 2015 02:13:53 +0100
Subject: [PATCH 25/86] and yet another update to the fallback defaults....
maybe Niantic should have load-tested the best values in dev before releasing
into production, rather than repeatedly changing it so many times? or at
least made it completely controlled by server-side code, so no client updates
needed for every experimental change...
---
code/map_data_calc_tools.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/map_data_calc_tools.js b/code/map_data_calc_tools.js
index 40cf7162..560a9fb9 100755
--- a/code/map_data_calc_tools.js
+++ b/code/map_data_calc_tools.js
@@ -12,7 +12,7 @@
window.setupDataTileParams = function() {
// default values - used to fall back to if we can't detect those used in stock intel
- var DEFAULT_ZOOM_TO_TILES_PER_EDGE = [1,1,1,40,40,80,80,320,1000,2000,2000,4000,8000,16000,16000,32000];
+ var DEFAULT_ZOOM_TO_TILES_PER_EDGE = [256,256,256,256,512,512,512,2048,2048,4096,4096,6500,6500,6500,18000,18000,36000];
var DEFAULT_ZOOM_TO_LEVEL = [8,8,8,8,7,7,7,6,6,5,4,4,3,2,2,1,1];
// stock intel doesn't have this array (they use a switch statement instead), but this is far neater
From 40b92235ea5ac3876ba028153c832a25b2b03267 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Fri, 26 Jun 2015 02:15:09 +0100
Subject: [PATCH 26/86] remove portals from the map sooner when the server
wouldn't return them bit hacky... but will do for now until I think of a good
way of handling things with the recent changes
---
code/map_data_request.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/code/map_data_request.js b/code/map_data_request.js
index 12ad93c8..4bef5c95 100644
--- a/code/map_data_request.js
+++ b/code/map_data_request.js
@@ -230,7 +230,8 @@ window.MapDataRequest.prototype.refresh = function() {
window.runHooks ('mapDataRefreshStart', {bounds: bounds, mapZoom: mapZoom, dataZoom: dataZoom, minPortalLevel: tileParams.level, tileBounds: dataBounds});
- this.render.startRenderPass(tileParams.level, dataBounds);
+//hack: fake the min level to 9999 when the data level doesn't include any portals
+ this.render.startRenderPass(tileParams.hasPortals?tileParams.level:9999, dataBounds);
this.render.processGameEntities(artifact.getArtifactEntities(),true);
From 6718e0d7773c406c20e4c249bdf4f5ce3b9c1a7e Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Fri, 26 Jun 2015 02:24:56 +0100
Subject: [PATCH 27/86] revert the hacky 'level 9999' thing - it hid that
Niantic reverted the changes remove the link distance thing - no longer
needed
---
code/map_data_calc_tools.js | 7 +++++--
code/map_data_request.js | 3 +--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/code/map_data_calc_tools.js b/code/map_data_calc_tools.js
index 560a9fb9..4ebad66f 100755
--- a/code/map_data_calc_tools.js
+++ b/code/map_data_calc_tools.js
@@ -15,8 +15,11 @@ window.setupDataTileParams = function() {
var DEFAULT_ZOOM_TO_TILES_PER_EDGE = [256,256,256,256,512,512,512,2048,2048,4096,4096,6500,6500,6500,18000,18000,36000];
var DEFAULT_ZOOM_TO_LEVEL = [8,8,8,8,7,7,7,6,6,5,4,4,3,2,2,1,1];
- // stock intel doesn't have this array (they use a switch statement instead), but this is far neater
- var DEFAULT_ZOOM_TO_LINK_LENGTH = [200000,200000,200000,200000,200000,60000,60000,10000,5000,2500,2500,800,300,0,0];
+// // stock intel doesn't have this array (they use a switch statement instead), but this is far neater
+// var DEFAULT_ZOOM_TO_LINK_LENGTH = [200000,200000,200000,200000,200000,60000,60000,10000,5000,2500,2500,800,300,0,0];
+//and looks like Niantic reverted the changes! an empty array will restore behaviour without removing the code.. as I
+//wouldn't be surprised if Niantic try and bring something like this back at some point...
+ var DEFAULT_ZOOM_TO_LINK_LENGTH = [];
window.TILE_PARAMS = {};
diff --git a/code/map_data_request.js b/code/map_data_request.js
index 4bef5c95..12ad93c8 100644
--- a/code/map_data_request.js
+++ b/code/map_data_request.js
@@ -230,8 +230,7 @@ window.MapDataRequest.prototype.refresh = function() {
window.runHooks ('mapDataRefreshStart', {bounds: bounds, mapZoom: mapZoom, dataZoom: dataZoom, minPortalLevel: tileParams.level, tileBounds: dataBounds});
-//hack: fake the min level to 9999 when the data level doesn't include any portals
- this.render.startRenderPass(tileParams.hasPortals?tileParams.level:9999, dataBounds);
+ this.render.startRenderPass(tileParams.level, dataBounds);
this.render.processGameEntities(artifact.getArtifactEntities(),true);
From 5da190862e16fabe06beedc7aa8e62c17564fef1 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Fri, 26 Jun 2015 23:11:19 +0100
Subject: [PATCH 28/86] niantic brought back the 'no portals, link length
limits' for zooms up to 15 again.... also, better warning when failing to
extract tile parameters from stock - as if this fails it's probably because
the values have changed and IITC will break
---
code/map_data_calc_tools.js | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/code/map_data_calc_tools.js b/code/map_data_calc_tools.js
index 4ebad66f..43d8d414 100755
--- a/code/map_data_calc_tools.js
+++ b/code/map_data_calc_tools.js
@@ -12,14 +12,11 @@
window.setupDataTileParams = function() {
// default values - used to fall back to if we can't detect those used in stock intel
- var DEFAULT_ZOOM_TO_TILES_PER_EDGE = [256,256,256,256,512,512,512,2048,2048,4096,4096,6500,6500,6500,18000,18000,36000];
+ var DEFAULT_ZOOM_TO_TILES_PER_EDGE = [1,1,1,40,40,80,80,320,1000,2000,2000,4000,8000,16000,16000,32000];
var DEFAULT_ZOOM_TO_LEVEL = [8,8,8,8,7,7,7,6,6,5,4,4,3,2,2,1,1];
-// // stock intel doesn't have this array (they use a switch statement instead), but this is far neater
-// var DEFAULT_ZOOM_TO_LINK_LENGTH = [200000,200000,200000,200000,200000,60000,60000,10000,5000,2500,2500,800,300,0,0];
-//and looks like Niantic reverted the changes! an empty array will restore behaviour without removing the code.. as I
-//wouldn't be surprised if Niantic try and bring something like this back at some point...
- var DEFAULT_ZOOM_TO_LINK_LENGTH = [];
+ // stock intel doesn't have this array (they use a switch statement instead), but this is far neater
+ var DEFAULT_ZOOM_TO_LINK_LENGTH = [200000,200000,200000,200000,200000,60000,60000,10000,5000,2500,2500,800,300,0,0];
window.TILE_PARAMS = {};
@@ -43,8 +40,12 @@ window.setupDataTileParams = function() {
}
} else {
- console.warn('Failed to detect both ZOOM_TO_LEVEL and TILES_PER_EDGE in the stock intel site - using internal defaults');
- debugger;
+ dialog({
+ title: 'IITC Warning',
+ html: "IITC failed to detect the ZOOM_TO_LEVEL and/or TILES_PER_EDGE settings from the stock intel site.
"
+ +"IITC is now using fallback default values. However, if detection has failed it's likely the values have changed."
+ +" IITC may not load the map if these default values are wrong.
",
+ });
window.TILE_PARAMS.ZOOM_TO_LEVEL = DEFAULT_ZOOM_TO_LEVEL;
window.TILE_PARAMS.TILES_PER_EDGE = DEFAULT_ZOOM_TO_TILES_PER_EDGE;
From f3190731d6de6f9e76f0d211d1cf7729d55a7697 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Sat, 27 Jun 2015 01:29:06 +0100
Subject: [PATCH 29/86] remove the 'hack' that ignored portals below the
selected level limit - not needed now Niantic have fixed the mission portal
issue increase the number of items rendered in the render queue batches -
should make IITC render a bit faster, especially now that the portals have
gone and instead there's a fair amount of duplicate data from links/fields
across multiple data tiles
---
code/map_data_render.js | 18 ++----------------
code/map_data_request.js | 4 ++--
2 files changed, 4 insertions(+), 18 deletions(-)
diff --git a/code/map_data_render.js b/code/map_data_render.js
index a113620b..2cb04b06 100644
--- a/code/map_data_render.js
+++ b/code/map_data_render.js
@@ -110,7 +110,7 @@ window.Render.prototype.processDeletedGameEntityGuids = function(deleted) {
}
-window.Render.prototype.processGameEntities = function(entities,ignoreLevel) {
+window.Render.prototype.processGameEntities = function(entities) {
// we loop through the entities three times - for fields, links and portals separately
// this is a reasonably efficient work-around for leafletjs limitations on svg render order
@@ -131,27 +131,13 @@ window.Render.prototype.processGameEntities = function(entities,ignoreLevel) {
}
}
- // 2015-03-12 - Niantic have been returning all mission portals to the client, ignoring portal level
- // and density filtering usually in use. this makes things unusable when viewing the global view, so we
- // filter these out
- var minLevel = ignoreLevel ? 0 : this.level;
- var ignoredCount = 0;
-
for (var i in entities) {
var ent = entities[i];
if (ent[2][0] == 'p' && !(ent[0] in this.deletedGuid)) {
- var portalLevel = ent[2][1] == 'N' ? 0 : parseInt(ent[2][4]);
- if (portalLevel >= minLevel) {
- this.createPortalEntity(ent);
- } else {
- ignoredCount++;
- }
-
+ this.createPortalEntity(ent);
}
}
-
- if (ignoredCount) console.log('Render: ignored '+ignoredCount+' portals below the level requested from the server');
}
diff --git a/code/map_data_request.js b/code/map_data_request.js
index 12ad93c8..c3b3b29c 100644
--- a/code/map_data_request.js
+++ b/code/map_data_request.js
@@ -57,7 +57,7 @@ window.MapDataRequest = function() {
// render queue
// number of items to process in each render pass. there are pros and cons to smaller and larger values
// (however, if using leaflet canvas rendering, it makes sense to push as much as possible through every time)
- this.RENDER_BATCH_SIZE = L.Path.CANVAS ? 1E9 : 500;
+ this.RENDER_BATCH_SIZE = L.Path.CANVAS ? 1E9 : 1500;
// delay before repeating the render loop. this gives a better chance for user interaction
this.RENDER_PAUSE = (typeof android === 'undefined') ? 0.1 : 0.2; //100ms desktop, 200ms mobile
@@ -233,7 +233,7 @@ window.MapDataRequest.prototype.refresh = function() {
this.render.startRenderPass(tileParams.level, dataBounds);
- this.render.processGameEntities(artifact.getArtifactEntities(),true);
+ this.render.processGameEntities(artifact.getArtifactEntities());
var logMessage = 'requesting data tiles at zoom '+dataZoom;
if (tileParams.level != tileParams.maxLevel) {
From 6cd18f8e46fa38279cb90ce3b61a10d13d2114b0 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Sat, 27 Jun 2015 01:35:48 +0100
Subject: [PATCH 30/86] bump version for critical fix release
---
main.js | 2 +-
mobile/AndroidManifest.xml | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/main.js b/main.js
index ff4652fe..7fb5b89e 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.23.1.@@DATETIMEVERSION@@
+// @version 0.24.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
diff --git a/mobile/AndroidManifest.xml b/mobile/AndroidManifest.xml
index 03d414e7..3fc18699 100644
--- a/mobile/AndroidManifest.xml
+++ b/mobile/AndroidManifest.xml
@@ -2,8 +2,8 @@
+ android:versionCode="100"
+ android:versionName="0.24.0">
Date: Sat, 27 Jun 2015 01:43:18 +0100
Subject: [PATCH 31/86] update website for new release
---
website/page/home.php | 11 +++++++++++
website/page/news.php | 11 +++++++++++
2 files changed, 22 insertions(+)
diff --git a/website/page/home.php b/website/page/home.php
index c9872ced..a6f1cbff 100644
--- a/website/page/home.php
+++ b/website/page/home.php
@@ -13,6 +13,17 @@ offers many more features. It is available for
Latest news
+27th June 2015
+
+IITC 0.24.0 has been released. This is a critical update needed to fix the map not loading any data.
+
+
+NOTE: Niantic have removed portals from the map data at all but the closest of zoom levels (L1+ - zoom 15+).
+The stock intel site creates dummy placeholder portals at the anchors for links, allowing you to click and open the
+portal details. However, IITC does not do this yet. It will take some time to modify IITC and the plugins to allow
+for such placeholder portals, so making a first release without them.
+
+
27th May 2015
IITC 0.23.0 has been released. This is a critical update needed to fix IITC after a Niantic site update.
diff --git a/website/page/news.php b/website/page/news.php
index b1fd8cad..3e918ec0 100644
--- a/website/page/news.php
+++ b/website/page/news.php
@@ -1,5 +1,16 @@
News
+27th June 2015
+
+IITC 0.24.0 has been released. This is a critical update needed to fix the map not loading any data.
+
+
+NOTE: Niantic have removed portals from the map data at all but the closest of zoom levels (L1+ - zoom 15+).
+The stock intel site creates dummy placeholder portals at the anchors for links, allowing you to click and open the
+portal details. However, IITC does not do this yet. It will take some time to modify IITC and the plugins to allow
+for such placeholder portals, so making a first release without them.
+
+
27th May 2015
IITC 0.23.0 has been released. This is a critical update needed to fix IITC after a Niantic site update.
From ae4817eb2bc8374141d126b5656bd2d43531bcbe Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Sat, 27 Jun 2015 03:50:29 +0100
Subject: [PATCH 32/86] bump dev version number after new release
---
main.js | 2 +-
mobile/AndroidManifest.xml | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/main.js b/main.js
index 7fb5b89e..2b2bd975 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.24.0.@@DATETIMEVERSION@@
+// @version 0.24.1.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
diff --git a/mobile/AndroidManifest.xml b/mobile/AndroidManifest.xml
index 3fc18699..4a6203e0 100644
--- a/mobile/AndroidManifest.xml
+++ b/mobile/AndroidManifest.xml
@@ -2,8 +2,8 @@
+ android:versionCode="101"
+ android:versionName="0.24.1">
Date: Sat, 27 Jun 2015 05:44:54 +0100
Subject: [PATCH 33/86] start of work on placeholder portals from link data not
yet working...
---
code/map_data_render.js | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/code/map_data_render.js b/code/map_data_render.js
index 2cb04b06..e755f7c4 100644
--- a/code/map_data_render.js
+++ b/code/map_data_render.js
@@ -249,6 +249,28 @@ window.Render.prototype.deleteFieldEntity = function(guid) {
}
+window.Render.prototype.createPlaceholderPortalEntity = function(guid,latE6,lngE6,team) {
+ // intel no longer returns portals at anything but the closest zoom
+ // stock intel creates 'placeholder' portals from the data in links/fields - IITC needs to do the same
+ // we only have the portal guid, lat/lng coords, and the faction - no other data
+ // having the guid, at least, allows the portal details to be loaded once it's selected. however,
+ // no highlighters, portal level numbers, portal names, useful counts of portals, etc are possible
+
+
+ var ent = [
+ guid, //ent[0] = guid
+ 0, //ent[1] = timestamp - zero will mean any other source of portal data will have a higher timestamp
+ //ent[2] = an array with the entity data
+ [ 'p', //0 - a portal
+ team, //1 - team
+ latE6, //2 - lat
+ lngE6 //3 - lng
+ ]
+ ];
+
+// this.createPortalEntity(ent);
+
+}
window.Render.prototype.createPortalEntity = function(ent) {
@@ -435,6 +457,14 @@ window.Render.prototype.createLinkEntity = function(ent,faked) {
window.links[ent[0]] = poly;
linksFactionLayers[poly.options.team].addLayer(poly);
+
+
+ // create placeholder entities for link start and end points
+ this.createPlaceholderPortalEntity(data.oGuid, data.oLatE6, data.oLngE6, data.team);
+ this.createPlaceholderPortalEntity(data.dGuid, data.dLatE6, data.dLngE6, data.team);
+
+
+
}
From 00b546cb9807f2033178afe0892d65caaab7ce6f Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Sun, 28 Jun 2015 19:14:17 +0100
Subject: [PATCH 34/86] placeholder portals created from link ends surprisingly
few issues, but i'm sure quite a few plugins break badly
---
code/entity_decode.js | 30 ++++++++++++++++++++--------
code/map_data_render.js | 43 +++++++++++++++++++----------------------
code/ornaments.js | 20 ++++++++++---------
code/portal_marker.js | 11 +++++++----
4 files changed, 60 insertions(+), 44 deletions(-)
diff --git a/code/entity_decode.js b/code/entity_decode.js
index 9199d1e6..c6d6dd70 100644
--- a/code/entity_decode.js
+++ b/code/entity_decode.js
@@ -37,15 +37,21 @@
}
- var summaryArrayLength = undefined;
+ var summaryArrayLength = 14;
+//there's also a 'placeholder' portal - generated from the data in links/fields. only has team/lat/lng
- function basePortalData(a) {
+ function corePortalData(a) {
return {
// a[0] == type (always 'p')
team: a[1],
latE6: a[2],
- lngE6: a[3],
+ lngE6: a[3]
+ }
+ };
+
+ function summaryPortalData(a) {
+ return {
level: a[4],
health: a[5],
resCount: a[6],
@@ -64,10 +70,16 @@
if (a[0] != 'p') throw 'Error: decodeArray.portalSUmmary - not a portal';
- if (summaryArrayLength===undefined) summaryArrayLength = a.length;
- if (summaryArrayLength!=a.length) console.warn('decodeArray.portalSUmmary: inconsistant map data portal array lengths');
+ if (a.length == 4) {
+ return corePortalData(a);
+ }
- return basePortalData(a);
+ if (a.length != summaryArrayLength) {
+ console.warn('Portal summary length changed - portal details likely broken!');
+ debugger;
+ }
+
+ return $.extend(corePortalData(a), summaryPortalData(a));
}
window.decodeArray.portalDetail = function(a) {
@@ -75,12 +87,14 @@
if (a[0] != 'p') throw 'Error: decodeArray.portalDetail - not a portal';
- if (summaryArrayLength===undefined) throw 'Error: decodeArray.portalDetail - not yet seen any portal summary data - cannot decode!';
+
+ //TODO look at the array values, make a better guess as to which index the mods start at, rather than using the hard-coded summaryArrayLength constant
+
// the portal details array is just an extension of the portal summary array
// to allow for niantic adding new items into the array before the extended details start,
// use the length of the summary array
- return $.extend(basePortalData(a),{
+ return $.extend(corePortalData(a), summaryPortalData(a),{
mods: a[summaryArrayLength+0].map(parseMod),
resonators:a[summaryArrayLength+1].map(parseResonator),
owner: a[summaryArrayLength+2],
diff --git a/code/map_data_render.js b/code/map_data_render.js
index e755f7c4..0d46ffc6 100644
--- a/code/map_data_render.js
+++ b/code/map_data_render.js
@@ -268,7 +268,7 @@ window.Render.prototype.createPlaceholderPortalEntity = function(guid,latE6,lngE
]
];
-// this.createPortalEntity(ent);
+ this.createPortalEntity(ent);
}
@@ -296,7 +296,7 @@ window.Render.prototype.createPortalEntity = function(ent) {
this.deletePortalEntity(ent[0]);
}
- var portalLevel = parseInt(ent[2][4]);
+ var portalLevel = parseInt(ent[2][4])||0;
var team = teamStringToId(ent[2][1]);
// the data returns unclaimed portals as level 1 - but IITC wants them treated as level 0
if (team == TEAM_NONE) portalLevel = 0;
@@ -409,6 +409,22 @@ window.Render.prototype.createFieldEntity = function(ent) {
window.Render.prototype.createLinkEntity = function(ent,faked) {
this.seenLinksGuid[ent[0]] = true; // flag we've seen it
+ var data = { // TODO add other properties and check correction direction
+// type: ent[2][0],
+ team: ent[2][1],
+ oGuid: ent[2][2],
+ oLatE6: ent[2][3],
+ oLngE6: ent[2][4],
+ dGuid: ent[2][5],
+ dLatE6: ent[2][6],
+ dLngE6: ent[2][7]
+ };
+
+ // create placeholder entities for link start and end points (before checking if the link itself already exists
+ this.createPlaceholderPortalEntity(data.oGuid, data.oLatE6, data.oLngE6, data.team);
+ this.createPlaceholderPortalEntity(data.dGuid, data.dLatE6, data.dLngE6, data.team);
+
+
// check if entity already exists
if (ent[0] in window.links) {
// yes. now, as sometimes links are 'faked', they have incomplete data. if the data we have is better, replace the data
@@ -423,17 +439,6 @@ window.Render.prototype.createLinkEntity = function(ent,faked) {
this.deleteLinkEntity(ent[0]); // option 2 - for now
}
- var data = { // TODO add other properties and check correction direction
-// type: ent[2][0],
- team: ent[2][1],
- oGuid: ent[2][2],
- oLatE6: ent[2][3],
- oLngE6: ent[2][4],
- dGuid: ent[2][5],
- dLatE6: ent[2][6],
- dLngE6: ent[2][7]
- };
-
var team = teamStringToId(ent[2][1]);
var latlngs = [
L.latLng(data.oLatE6/1E6, data.oLngE6/1E6),
@@ -457,14 +462,6 @@ window.Render.prototype.createLinkEntity = function(ent,faked) {
window.links[ent[0]] = poly;
linksFactionLayers[poly.options.team].addLayer(poly);
-
-
- // create placeholder entities for link start and end points
- this.createPlaceholderPortalEntity(data.oGuid, data.oLatE6, data.oLngE6, data.team);
- this.createPlaceholderPortalEntity(data.dGuid, data.dLatE6, data.dLngE6, data.team);
-
-
-
}
@@ -485,12 +482,12 @@ window.Render.prototype.rescalePortalMarkers = function() {
// add the portal to the visible map layer
window.Render.prototype.addPortalToMapLayer = function(portal) {
- portalsFactionLayers[parseInt(portal.options.level)][portal.options.team].addLayer(portal);
+ portalsFactionLayers[parseInt(portal.options.level)||0][portal.options.team].addLayer(portal);
}
window.Render.prototype.removePortalFromMapLayer = function(portal) {
//remove it from the portalsLevels layer
- portalsFactionLayers[parseInt(portal.options.level)][portal.options.team].removeLayer(portal);
+ portalsFactionLayers[parseInt(portal.options.level)||0][portal.options.team].removeLayer(portal);
}
diff --git a/code/ornaments.js b/code/ornaments.js
index efcbdad0..e5b35633 100644
--- a/code/ornaments.js
+++ b/code/ornaments.js
@@ -33,16 +33,18 @@ window.ornaments.addPortal = function(portal) {
var size = window.ornaments.OVERLAY_SIZE;
var latlng = portal.getLatLng();
- window.ornaments._portals[guid] = portal.options.data.ornaments.map(function(ornament) {
- var icon = L.icon({
- iconUrl: "//commondatastorage.googleapis.com/ingress.com/img/map_icons/marker_images/"+ornament+".png",
- iconSize: [size, size],
- iconAnchor: [size/2,size/2],
- className: 'no-pointer-events' // the clickable: false below still blocks events going through to the svg underneath
- });
+ if (portal.options.data.ornaments) {
+ window.ornaments._portals[guid] = portal.options.data.ornaments.map(function(ornament) {
+ var icon = L.icon({
+ iconUrl: "//commondatastorage.googleapis.com/ingress.com/img/map_icons/marker_images/"+ornament+".png",
+ iconSize: [size, size],
+ iconAnchor: [size/2,size/2],
+ className: 'no-pointer-events' // the clickable: false below still blocks events going through to the svg underneath
+ });
- return L.marker(latlng, {icon: icon, clickable: false, keyboard: false, opacity: window.ornaments.OVERLAY_OPACITY }).addTo(window.ornaments._layer);
- });
+ return L.marker(latlng, {icon: icon, clickable: false, keyboard: false, opacity: window.ornaments.OVERLAY_OPACITY }).addTo(window.ornaments._layer);
+ });
+ }
}
window.ornaments.removePortal = function(portal) {
diff --git a/code/portal_marker.js b/code/portal_marker.js
index 749d5d30..7f208078 100644
--- a/code/portal_marker.js
+++ b/code/portal_marker.js
@@ -30,9 +30,12 @@ window.setMarkerStyle = function(marker, selected) {
marker.setStyle(styleOptions);
- // FIXME? it's inefficient to set the marker style (above), then do it again inside the highlighter
- // the highlighter API would need to be changed for this to be improved though. will it be too slow?
- highlightPortal(marker);
+ // don't run highlighters if we only have placeholder data
+ if (marker.options.data.level !== undefined) {
+ // FIXME? it's inefficient to set the marker style (above), then do it again inside the highlighter
+ // the highlighter API would need to be changed for this to be improved though. will it be too slow?
+ highlightPortal(marker);
+ }
if (selected) {
marker.setStyle ({color: COLOR_SELECTED_PORTAL});
@@ -47,7 +50,7 @@ window.getMarkerStyleOptions = function(details) {
var LEVEL_TO_WEIGHT = [2, 2, 2, 2, 2, 3, 3, 4, 4];
var LEVEL_TO_RADIUS = [7, 7, 7, 7, 8, 8, 9,10,11];
- var level = Math.floor(details.level);
+ var level = Math.floor(details.level||0);
var lvlWeight = LEVEL_TO_WEIGHT[level] * Math.sqrt(scale);
var lvlRadius = LEVEL_TO_RADIUS[level] * scale;
From bf795e752022fca4bd3e965d5464601637a6dfab Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Sun, 28 Jun 2015 20:29:13 +0100
Subject: [PATCH 35/86] fix portal-names plugin to work with placeholder
portals
---
plugins/portal-names.user.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/portal-names.user.js b/plugins/portal-names.user.js
index 9fb04b44..5a892eb5 100644
--- a/plugins/portal-names.user.js
+++ b/plugins/portal-names.user.js
@@ -2,7 +2,7 @@
// @id iitc-plugin-portal-names@zaso
// @name IITC plugin: Portal Names
// @category Layer
-// @version 0.1.5.@@DATETIMEVERSION@@
+// @version 0.1.6.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
@@ -93,7 +93,7 @@ window.plugin.portalNames.updatePortalLabels = function() {
for (var guid in window.portals) {
var p = window.portals[guid];
- if (p._map) { // only consider portals added to the map
+ if (p._map && p.options.data.title) { // only consider portals added to the map and with a title
var point = map.project(p.getLatLng());
portalPoints[guid] = point;
}
From 8f1759d7c3f4c81b636b41500c4be1667178cfd2 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Sun, 28 Jun 2015 21:49:02 +0100
Subject: [PATCH 36/86] allow portal highlighters for placeholder portals -
several (e.g. uniques) work just fine fix several other highlighters to check
for required data on portals
---
code/portal_marker.js | 9 +++------
plugins/portal-highlighter-forgotten.user.js | 17 ++++++++++-------
plugins/portal-highlighter-level-color.user.js | 6 ++++--
...ortal-highlighter-missing-resonators.user.js | 2 +-
.../portal-highlighter-needs-recharge.user.js | 2 +-
plugins/show-portal-weakness.user.js | 2 +-
6 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/code/portal_marker.js b/code/portal_marker.js
index 7f208078..c88f78f0 100644
--- a/code/portal_marker.js
+++ b/code/portal_marker.js
@@ -30,12 +30,9 @@ window.setMarkerStyle = function(marker, selected) {
marker.setStyle(styleOptions);
- // don't run highlighters if we only have placeholder data
- if (marker.options.data.level !== undefined) {
- // FIXME? it's inefficient to set the marker style (above), then do it again inside the highlighter
- // the highlighter API would need to be changed for this to be improved though. will it be too slow?
- highlightPortal(marker);
- }
+ // FIXME? it's inefficient to set the marker style (above), then do it again inside the highlighter
+ // the highlighter API would need to be changed for this to be improved though. will it be too slow?
+ highlightPortal(marker);
if (selected) {
marker.setStyle ({color: COLOR_SELECTED_PORTAL});
diff --git a/plugins/portal-highlighter-forgotten.user.js b/plugins/portal-highlighter-forgotten.user.js
index 9fc2cc15..aaa1a150 100644
--- a/plugins/portal-highlighter-forgotten.user.js
+++ b/plugins/portal-highlighter-forgotten.user.js
@@ -27,19 +27,22 @@ window.plugin.portalHighlighterInactive = function() {};
window.plugin.portalHighlighterInactive.highlight = function(data) {
- var daysUnmodified = (new Date().getTime() - data.portal.options.timestamp) / (24*60*60*1000);
+ if (data.portal.options.timestamp > 0) {
- if (daysUnmodified >= 7) {
+ var daysUnmodified = (new Date().getTime() - data.portal.options.timestamp) / (24*60*60*1000);
- var fill_opacity = Math.min(1,((daysUnmodified-7)/24)*.85 + .15);
+ if (daysUnmodified >= 7) {
- var blue = Math.max(0,Math.min(255,Math.round((daysUnmodified-31)/62*255)));
+ var fill_opacity = Math.min(1,((daysUnmodified-7)/24)*.85 + .15);
- var colour = 'rgb(255,0,'+blue+')';
+ var blue = Math.max(0,Math.min(255,Math.round((daysUnmodified-31)/62*255)));
- var params = {fillColor: colour, fillOpacity: fill_opacity};
+ var colour = 'rgb(255,0,'+blue+')';
- data.portal.setStyle(params);
+ var params = {fillColor: colour, fillOpacity: fill_opacity};
+
+ data.portal.setStyle(params);
+ }
}
}
diff --git a/plugins/portal-highlighter-level-color.user.js b/plugins/portal-highlighter-level-color.user.js
index 9b8c173c..76572c3f 100644
--- a/plugins/portal-highlighter-level-color.user.js
+++ b/plugins/portal-highlighter-level-color.user.js
@@ -27,8 +27,10 @@ window.plugin.portalHighlighterPortalsLevelColor = function() {};
window.plugin.portalHighlighterPortalsLevelColor.colorLevel = function(data) {
var portal_level = data.portal.options.data.level;
- var opacity = .6;
- data.portal.setStyle({fillColor: COLORS_LVL[portal_level], fillOpacity: opacity});
+ if (portal_level !== undefined) {
+ var opacity = .6;
+ data.portal.setStyle({fillColor: COLORS_LVL[portal_level], fillOpacity: opacity});
+ }
}
var setup = function() {
diff --git a/plugins/portal-highlighter-missing-resonators.user.js b/plugins/portal-highlighter-missing-resonators.user.js
index 2bbf49e7..c3959d4a 100644
--- a/plugins/portal-highlighter-missing-resonators.user.js
+++ b/plugins/portal-highlighter-missing-resonators.user.js
@@ -30,7 +30,7 @@ window.plugin.portalsMissingResonators.highlight = function(data) {
if(data.portal.options.team != TEAM_NONE) {
var res_count = data.portal.options.data.resCount;
- if(res_count < 8) {
+ if(res_count !== undefined && res_count < 8) {
var fill_opacity = ((8-res_count)/8)*.85 + .15;
var color = 'red';
var params = {fillColor: color, fillOpacity: fill_opacity};
diff --git a/plugins/portal-highlighter-needs-recharge.user.js b/plugins/portal-highlighter-needs-recharge.user.js
index 7f8a18b8..bdee1253 100644
--- a/plugins/portal-highlighter-needs-recharge.user.js
+++ b/plugins/portal-highlighter-needs-recharge.user.js
@@ -29,7 +29,7 @@ window.plugin.portalHighlighterNeedsRecharge.highlight = function(data) {
var d = data.portal.options.data;
var health = d.health;
- if(data.portal.options.team != TEAM_NONE && health < 100) {
+ if(health !== undefined && data.portal.options.team != TEAM_NONE && health < 100) {
var color,fill_opacity;
if (health > 95) {
color = 'yellow';
diff --git a/plugins/show-portal-weakness.user.js b/plugins/show-portal-weakness.user.js
index 68592038..494aff8e 100644
--- a/plugins/show-portal-weakness.user.js
+++ b/plugins/show-portal-weakness.user.js
@@ -27,7 +27,7 @@ window.plugin.portalWeakness = function() {};
window.plugin.portalWeakness.highlightWeakness = function(data) {
- if(data.portal.options.team != TEAM_NONE) {
+ if(data.portal.options.resCount !== undefined && data.portal.options.data.health !== undefined && data.portal.options.team != TEAM_NONE) {
var res_count = data.portal.options.data.resCount;
var portal_health = data.portal.options.data.health;
From e0e6fd5c48062399a006fccb515b361ac3653721 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Sun, 28 Jun 2015 21:56:42 +0100
Subject: [PATCH 37/86] don't remove portals by level when starting a render
pass - unclaimed are shown when we ask for L1 - helps preserve more data as
you zoom out and links create 'placeholder' portals we already have more data
for
---
code/map_data_render.js | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/code/map_data_render.js b/code/map_data_render.js
index 0d46ffc6..36aef41f 100644
--- a/code/map_data_render.js
+++ b/code/map_data_render.js
@@ -25,7 +25,7 @@ window.Render.prototype.startRenderPass = function(level,bounds) {
// this will just avoid a few entity removals at start of render when they'll just be added again
var paddedBounds = bounds.pad(0.1);
- this.clearPortalsBelowLevelOrOutsideBounds(level,paddedBounds);
+ this.clearPortalsOutsideBounds(paddedBounds);
this.clearLinksOutsideBounds(paddedBounds);
this.clearFieldsOutsideBounds(paddedBounds);
@@ -34,12 +34,12 @@ window.Render.prototype.startRenderPass = function(level,bounds) {
this.rescalePortalMarkers();
}
-window.Render.prototype.clearPortalsBelowLevelOrOutsideBounds = function(level,bounds) {
+window.Render.prototype.clearPortalsOutsideBounds = function(bounds) {
var count = 0;
for (var guid in window.portals) {
var p = portals[guid];
- // clear portals below specified level - unless it's the selected portal, or it's relevant to artifacts
- if ((parseInt(p.options.level) < level || !bounds.contains(p.getLatLng())) && guid !== selectedPortal && !artifact.isInterestingPortal(guid)) {
+ // clear portals outside visible bounds - unless it's the selected portal, or it's relevant to artifacts
+ if (!bounds.contains(p.getLatLng()) && guid !== selectedPortal && !artifact.isInterestingPortal(guid)) {
this.deletePortalEntity(guid);
count++;
}
From b51052ca0b79fac46bc3eefda03770ac0ad35a17 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Sun, 28 Jun 2015 21:57:42 +0100
Subject: [PATCH 38/86] remove 'show-more-portals' config case - not currently
needed, so not messing with zoom level is more stock-like
---
code/map_data_calc_tools.js | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/code/map_data_calc_tools.js b/code/map_data_calc_tools.js
index 43d8d414..b1b9b304 100755
--- a/code/map_data_calc_tools.js
+++ b/code/map_data_calc_tools.js
@@ -120,13 +120,15 @@ window.getDataZoomForMapZoom = function(zoom) {
zoom = 21;
}
- if (window.CONFIG_ZOOM_SHOW_MORE_PORTALS) {
- // as of 2015-06-25 stock site update, all zoom levels that retrieve portals (15+) use the same tile size
- // therefore, it's no more load on the servers to fake it always to show unclaimed rather than L1+
- if (zoom >= 15 && zoom <= 16) {
- zoom = 17;
- }
- }
+// as of the 2015-06-26 niantic update, unclaimed portals are returned when we ask for L1+ - so this
+// is not needed at all
+// if (window.CONFIG_ZOOM_SHOW_MORE_PORTALS) {
+// // as of 2015-06-25 stock site update, all zoom levels that retrieve portals (15+) use the same tile size
+// // therefore, it's no more load on the servers to fake it always to show unclaimed rather than L1+
+// if (zoom >= 15 && zoom <= 16) {
+// zoom = 17;
+// }
+// }
if (!window.CONFIG_ZOOM_DEFAULT_DETAIL_LEVEL) {
From bed576808b4bfc8ffbf1f5b2bf7f1a32d1346476 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Mon, 29 Jun 2015 02:42:11 +0100
Subject: [PATCH 39/86] portal level number plugin - ignore placeholders
without a level set
---
plugins/portal-level-numbers.user.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/portal-level-numbers.user.js b/plugins/portal-level-numbers.user.js
index 8fc44ede..97e637a3 100644
--- a/plugins/portal-level-numbers.user.js
+++ b/plugins/portal-level-numbers.user.js
@@ -2,7 +2,7 @@
// @id iitc-plugin-portal-level-numbers@rongou
// @name IITC plugin: Portal Level Numbers
// @category Layer
-// @version 0.1.4.@@DATETIMEVERSION@@
+// @version 0.1.5.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
@@ -88,7 +88,7 @@ window.plugin.portalLevelNumbers.updatePortalLabels = function() {
for (var guid in window.portals) {
var p = window.portals[guid];
- if (p._map) { // only consider portals added to the map
+ if (p._map && p.options.data.level !== undefined) { // only consider portals added to the map, and that have a level set
var point = map.project(p.getLatLng());
portalPoints[guid] = point;
}
From 1fb27a75c456f4a3355e27b8dc325530e0616c45 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Mon, 29 Jun 2015 02:51:13 +0100
Subject: [PATCH 40/86] pass loaded portal details via a hook into the portal
render code - so placeholder portals get updated (highlighters, etc) as you
view them
---
code/map_data_render.js | 1 -
code/map_data_request.js | 7 +++++++
code/portal_detail.js | 6 +++++-
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/code/map_data_render.js b/code/map_data_render.js
index 36aef41f..69e04ff1 100644
--- a/code/map_data_render.js
+++ b/code/map_data_render.js
@@ -4,7 +4,6 @@
window.Render = function() {
-
this.portalMarkerScale = undefined;
}
diff --git a/code/map_data_request.js b/code/map_data_request.js
index c3b3b29c..29b44532 100644
--- a/code/map_data_request.js
+++ b/code/map_data_request.js
@@ -69,6 +69,13 @@ window.MapDataRequest = function() {
// ensure we have some initial map status
this.setStatus ('startup', undefined, -1);
+
+ // add a portalDetailLoaded hook, so we can use the exteneed details to update portals on the map
+ var _this = this;
+ addHook('portalDetailLoaded',function(data){
+ _this.render.processGameEntities([data.ent]);
+ });
+
}
diff --git a/code/portal_detail.js b/code/portal_detail.js
index 8e8f80a7..55400098 100644
--- a/code/portal_detail.js
+++ b/code/portal_detail.js
@@ -37,8 +37,12 @@ var handleResponse = function(guid, data, success) {
}
if (success) {
+
var dict = decodeArray.portalDetail(data.result);
+ // entity format, as used in map data
+ var ent = [guid,dict.timestamp,data.result];
+
cache.store(guid,dict);
//FIXME..? better way of handling sidebar refreshing...
@@ -47,7 +51,7 @@ var handleResponse = function(guid, data, success) {
renderPortalDetails(guid);
}
- window.runHooks ('portalDetailLoaded', {guid:guid, success:success, details:dict});
+ window.runHooks ('portalDetailLoaded', {guid:guid, success:success, details:dict, ent:ent});
} else {
if (data && data.error == "RETRY") {
From 02ac86fc003e4a2bc7132693d2a01050e188879b Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Mon, 29 Jun 2015 17:09:56 +0100
Subject: [PATCH 41/86] remove some long-dead code for portal titles - and fix
it so a title:null doesn't break IITC
---
code/portal_detail_display.js | 40 ++--------------------
code/portal_detail_display_tools.js | 53 -----------------------------
2 files changed, 3 insertions(+), 90 deletions(-)
diff --git a/code/portal_detail_display.js b/code/portal_detail_display.js
index 7d1851bc..f863d7ca 100644
--- a/code/portal_detail_display.js
+++ b/code/portal_detail_display.js
@@ -41,46 +41,13 @@ window.renderPortalDetails = function(guid) {
var img = fixPortalImageUrl(details ? details.image : data.image);
- var title = data.title;
+ var title = (details && details.title) || (data && data.title) || '(untitled)';
var lat = data.latE6/1E6;
var lng = data.lngE6/1E6;
- var imgTitle = details ? getPortalDescriptionFromDetails(details) : data.title;
- imgTitle += '\n\nClick to show full image.';
- var portalDetailObj = details ? window.getPortalDescriptionFromDetailsExtended(details) : undefined;
+ var imgTitle = title+'\n\nClick to show full image.';
- var portalDetailedDescription = '';
-
- if(portalDetailObj) {
- portalDetailedDescription = '';
-
- // TODO (once the data supports it) - portals can have multiple photos. display all, with navigation between them
- // (at this time the data isn't returned from the server - although a count of images IS returned!)
-
- if(portalDetailObj.submitter.name.length > 0) {
- if(portalDetailObj.submitter.team) {
- submitterSpan = '';
- } else {
- submitterSpan = '';
- }
- portalDetailedDescription += 'Photo by: | ' + submitterSpan
- + escapeHtmlSpecialChars(portalDetailObj.submitter.name) + ''+(portalDetailObj.submitter.voteCount !== undefined ? ' (' + portalDetailObj.submitter.voteCount + ' votes)' : '')+' |
';
- }
- if(portalDetailObj.submitter.link.length > 0) {
- portalDetailedDescription += 'Photo from: | ' + escapeHtmlSpecialChars(portalDetailObj.submitter.link) + ' |
';
- }
-
- if(portalDetailObj.description) {
- portalDetailedDescription += 'Description: | ' + escapeHtmlSpecialChars(portalDetailObj.description) + ' |
';
- }
-// if(d.descriptiveText.map.ADDRESS) {
-// portalDetailedDescription += 'Address: | ' + escapeHtmlSpecialChars(d.descriptiveText.map.ADDRESS) + ' |
';
-// }
-
- portalDetailedDescription += '
';
- }
// portal level. start with basic data - then extend with fractional info in tooltip if available
var levelInt = (teamStringToId(data.team) == TEAM_NONE) ? 0 : data.level;
@@ -127,7 +94,7 @@ window.renderPortalDetails = function(guid) {
.html('') //to ensure it's clear
.attr('class', TEAM_TO_CSS[teamStringToId(data.team)])
.append(
- $('').attr({class:'title'}).text(data.title),
+ $('').attr({class:'title'}).text(title),
$('').attr({
class: 'close',
@@ -141,7 +108,6 @@ window.renderPortalDetails = function(guid) {
.attr({class:'imgpreview', title:imgTitle, style:"background-image: url('"+img+"')"})
.append(
$('').attr({id:'level', title: levelDetails}).text(levelInt),
- $('').attr({class:'portalDetails'}).html(portalDetailedDescription),
$('
![]()
').attr({class:'hide', src:img})
),
diff --git a/code/portal_detail_display_tools.js b/code/portal_detail_display_tools.js
index 10daac5a..3df146c8 100644
--- a/code/portal_detail_display_tools.js
+++ b/code/portal_detail_display_tools.js
@@ -23,59 +23,6 @@ window.getRangeText = function(d) {
title];
}
-// generates description text from details for portal
-window.getPortalDescriptionFromDetails = function(details) {
- return details.title || '(untitled)';
-
-// var descObj = details.descriptiveText.map;
-// // FIXME: also get real description?
-// var desc = descObj.TITLE;
-// if(descObj.ADDRESS)
-// desc += '\n' + descObj.ADDRESS;
-//// if(descObj.ATTRIBUTION)
-//// desc += '\nby '+descObj.ATTRIBUTION+' ('+descObj.ATTRIBUTION_LINK+')';
-// return desc;
-}
-
-// Grabs more info, including the submitter name for the current main
-// portal image
-window.getPortalDescriptionFromDetailsExtended = function(details) {
- var descObj = details.title;
- var photoStreamObj = details.photoStreamInfo;
-
- var submitterObj = new Object();
- submitterObj.type = "";
- submitterObj.name = "";
- submitterObj.team = "";
- submitterObj.link = "";
- submitterObj.voteCount = undefined;
-
- if(photoStreamObj && photoStreamObj.hasOwnProperty("coverPhoto") && photoStreamObj.coverPhoto.hasOwnProperty("attributionMarkup")) {
- submitterObj.name = "Unknown";
-
- var attribution = photoStreamObj.coverPhoto.attributionMarkup;
- submitterObj.type = attribution[0];
- if(attribution[1].hasOwnProperty("plain"))
- submitterObj.name = attribution[1].plain;
- if(attribution[1].hasOwnProperty("team"))
- submitterObj.team = attribution[1].team;
- if(attribution[1].hasOwnProperty("attributionLink"))
- submitterObj.link = attribution[1].attributionLink;
- if(photoStreamObj.coverPhoto.hasOwnProperty("voteCount"))
- submitterObj.voteCount = photoStreamObj.coverPhoto.voteCount;
- }
-
-
- var portalDetails = {
- title: descObj.TITLE,
- description: descObj.DESCRIPTION,
- address: descObj.ADDRESS,
- submitter: submitterObj
- };
-
- return portalDetails;
-}
-
// given portal details, returns html code to display mod details.
window.getModDetails = function(d) {
From 570f7a0f9a16420ec760840cfcca5eb6a23c4429 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Mon, 29 Jun 2015 19:02:11 +0100
Subject: [PATCH 42/86] plugin: cache recently loaded portal details and always
render on the map
---
code/hooks.js | 3 +-
code/map_data_request.js | 3 ++
plugins/cache-details-on-map.user.js | 62 ++++++++++++++++++++++++++++
3 files changed, 67 insertions(+), 1 deletion(-)
create mode 100644 plugins/cache-details-on-map.user.js
diff --git a/code/hooks.js b/code/hooks.js
index 2fd82477..9cdd428d 100644
--- a/code/hooks.js
+++ b/code/hooks.js
@@ -18,6 +18,7 @@
// portalSelected: called when portal on map is selected/unselected.
// Provide guid of selected and unselected portal.
// mapDataRefreshStart: called when we start refreshing map data
+// mapDataEntityInject: called just as we start to render data. has callback to inject cached entities into the map render
// mapDataRefreshEnd: called when we complete the map data load
// portalAdded: called when a portal has been received and is about to
// be added to its layer group. Note that this does NOT
@@ -55,7 +56,7 @@
window._hooks = {}
window.VALID_HOOKS = [
'portalSelected', 'portalDetailsUpdated',
- 'mapDataRefreshStart', 'mapDataRefreshEnd',
+ 'mapDataRefreshStart', 'mapDataEntityInject', 'mapDataRefreshEnd',
'portalAdded', 'linkAdded', 'fieldAdded',
'publicChatDataAvailable', 'factionChatDataAvailable',
'requestFinished', 'nicknameClicked',
diff --git a/code/map_data_request.js b/code/map_data_request.js
index 29b44532..514eabd8 100644
--- a/code/map_data_request.js
+++ b/code/map_data_request.js
@@ -239,6 +239,9 @@ window.MapDataRequest.prototype.refresh = function() {
this.render.startRenderPass(tileParams.level, dataBounds);
+ var _render = this.render;
+ window.runHooks ('mapDataEntityInject', {callback: function(ents) { _render.processGameEntities(ents);}});
+
this.render.processGameEntities(artifact.getArtifactEntities());
diff --git a/plugins/cache-details-on-map.user.js b/plugins/cache-details-on-map.user.js
new file mode 100644
index 00000000..63a83111
--- /dev/null
+++ b/plugins/cache-details-on-map.user.js
@@ -0,0 +1,62 @@
+// ==UserScript==
+// @id iitc-plugin-cache-details-on-map@jonatkins
+// @name IITC plugin: Cache viewed portal details and always show them on the map
+// @category Cache
+// @version 0.1.0.@@DATETIMEVERSION@@
+// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
+// @updateURL @@UPDATEURL@@
+// @downloadURL @@DOWNLOADURL@@
+// @description [@@BUILDNAME@@-@@BUILDDATE@@] Cache the details of recently viewed portals and use this to populate the map when possible
+// @include https://www.ingress.com/intel*
+// @include http://www.ingress.com/intel*
+// @match https://www.ingress.com/intel*
+// @match http://www.ingress.com/intel*
+// @include https://www.ingress.com/mission/*
+// @include http://www.ingress.com/mission/*
+// @match https://www.ingress.com/mission/*
+// @match http://www.ingress.com/mission/*
+// @grant none
+// ==/UserScript==
+
+@@PLUGINSTART@@
+
+// PLUGIN START ////////////////////////////////////////////////////////
+
+
+// use own namespace for plugin
+window.plugin.cachePortalDetailsOnMap = function() {};
+
+window.plugin.cachePortalDetailsOnMap.MAX_AGE = 12*60*60; //12 hours max age for cached data
+
+window.plugin.cachePortalDetailsOnMap.portalDetailLoaded = function(data) {
+ window.plugin.cachePortalDetailsOnMap.cache[data.guid] = { loadtime: Date.now(), ent: data.ent };
+};
+
+window.plugin.cachePortalDetailsOnMap.entityInject = function(data) {
+ var maxAge = Date.now() - window.plugin.cachePortalDetailsOnMap.MAX_AGE*1000;
+
+ var ents = [];
+ for (var guid in window.plugin.cachePortalDetailsOnMap.cache) {
+ if (window.plugin.cachePortalDetailsOnMap.cache[guid].loadtime < maxAge) {
+ window.plugin.cachePortalDetailsOnMap.cache.delete(guid);
+ } else {
+ ents.push(window.plugin.cachePortalDetailsOnMap.cache[guid].ent);
+ }
+ }
+ data.callback(ents);
+};
+
+
+window.plugin.cachePortalDetailsOnMap.setup = function() {
+
+ window.plugin.cachePortalDetailsOnMap.cache = {};
+
+ addHook('portalDetailLoaded', window.plugin.cachePortalDetailsOnMap.portalDetailLoaded);
+ addHook('mapDataEntityInject', window.plugin.cachePortalDetailsOnMap.entityInject);
+};
+
+var setup = window.plugin.cachePortalDetailsOnMap.setup;
+
+// PLUGIN END //////////////////////////////////////////////////////////
+
+@@PLUGINEND@@
From 2886e0be078f8aee70223c79c18ff589849404cf Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Wed, 1 Jul 2015 11:59:17 +0100
Subject: [PATCH 43/86] doh! forgot syntax to delete object properties
---
plugins/cache-details-on-map.user.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/cache-details-on-map.user.js b/plugins/cache-details-on-map.user.js
index 63a83111..d13ed03e 100644
--- a/plugins/cache-details-on-map.user.js
+++ b/plugins/cache-details-on-map.user.js
@@ -38,7 +38,7 @@ window.plugin.cachePortalDetailsOnMap.entityInject = function(data) {
var ents = [];
for (var guid in window.plugin.cachePortalDetailsOnMap.cache) {
if (window.plugin.cachePortalDetailsOnMap.cache[guid].loadtime < maxAge) {
- window.plugin.cachePortalDetailsOnMap.cache.delete(guid);
+ delete window.plugin.cachePortalDetailsOnMap.cache[guid];
} else {
ents.push(window.plugin.cachePortalDetailsOnMap.cache[guid].ent);
}
From 282e184f56fe7ddbfc8a6eaa0c797272b877962f Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Wed, 1 Jul 2015 11:59:44 +0100
Subject: [PATCH 44/86] fix warning/debug break on details passed to summary
decode
---
code/entity_decode.js | 27 ++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)
diff --git a/code/entity_decode.js b/code/entity_decode.js
index c6d6dd70..edf2b5d5 100644
--- a/code/entity_decode.js
+++ b/code/entity_decode.js
@@ -37,10 +37,9 @@
}
- var summaryArrayLength = 14;
-
//there's also a 'placeholder' portal - generated from the data in links/fields. only has team/lat/lng
+ var CORE_PORTA_DATA_LENGTH = 4;
function corePortalData(a) {
return {
// a[0] == type (always 'p')
@@ -50,6 +49,7 @@
}
};
+ var SUMMARY_PORTAL_DATA_LENGTH = 14;
function summaryPortalData(a) {
return {
level: a[4],
@@ -65,16 +65,21 @@
};
};
+ var DETAILED_PORTAL_DATA_LENGTH = SUMMARY_PORTAL_DATA_LENGTH+4;
+
+
window.decodeArray.portalSummary = function(a) {
if (!a) return undefined;
if (a[0] != 'p') throw 'Error: decodeArray.portalSUmmary - not a portal';
- if (a.length == 4) {
+ if (a.length == CORE_PORTA_DATA_LENGTH) {
return corePortalData(a);
}
- if (a.length != summaryArrayLength) {
+ // NOTE: allow for either summary or detailed portal data to be passed in here, as details are sometimes
+ // passed into code only expecting summaries
+ if (a.length != SUMMARY_PORTAL_DATA_LENGTH && a.length != DETAILED_PORTAL_DATA_LENGTH) {
console.warn('Portal summary length changed - portal details likely broken!');
debugger;
}
@@ -87,18 +92,22 @@
if (a[0] != 'p') throw 'Error: decodeArray.portalDetail - not a portal';
+ if (a.length != DETAILED_PORTAL_DATA_LENGTH) {
+ console.warn('Portal detail length changed - portal details may be wrong');
+ debugger;
+ }
- //TODO look at the array values, make a better guess as to which index the mods start at, rather than using the hard-coded summaryArrayLength constant
+ //TODO look at the array values, make a better guess as to which index the mods start at, rather than using the hard-coded SUMMARY_PORTAL_DATA_LENGTH constant
// the portal details array is just an extension of the portal summary array
// to allow for niantic adding new items into the array before the extended details start,
// use the length of the summary array
return $.extend(corePortalData(a), summaryPortalData(a),{
- mods: a[summaryArrayLength+0].map(parseMod),
- resonators:a[summaryArrayLength+1].map(parseResonator),
- owner: a[summaryArrayLength+2],
- artifact: parseArtifact(a[summaryArrayLength+3]),
+ mods: a[SUMMARY_PORTAL_DATA_LENGTH+0].map(parseMod),
+ resonators:a[SUMMARY_PORTAL_DATA_LENGTH+1].map(parseResonator),
+ owner: a[SUMMARY_PORTAL_DATA_LENGTH+2],
+ artifact: parseArtifact(a[SUMMARY_PORTAL_DATA_LENGTH+3]),
});
}
From aa0393c518c0de34ba0d7c69d83a3b97a027e296 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Thu, 2 Jul 2015 00:25:55 +0100
Subject: [PATCH 45/86] niantic updated stock intel to show unclaimed from zoom
level 15 and closer - makes 'show more portals' redundant
---
code/map_data_calc_tools.js | 15 +++++----------
plugins/show-more-portals.user.js | 25 ++-----------------------
2 files changed, 7 insertions(+), 33 deletions(-)
diff --git a/code/map_data_calc_tools.js b/code/map_data_calc_tools.js
index b1b9b304..54736bb2 100755
--- a/code/map_data_calc_tools.js
+++ b/code/map_data_calc_tools.js
@@ -51,6 +51,11 @@ window.setupDataTileParams = function() {
window.TILE_PARAMS.TILES_PER_EDGE = DEFAULT_ZOOM_TO_TILES_PER_EDGE;
}
+ // 2015-07-01: niantic added code to the stock site that overrides the min zoom level for unclaimed portals to 15 and above
+ // instead of updating the zoom-to-level array. makes no sense really....
+ // we'll just chop off the array at that point, so the code defaults to level 0 (unclaimed) everywhere...
+ window.TILE_PARAMS.ZOOM_TO_LEVEL = window.TILE_PARAMS.ZOOM_TO_LEVEL.slice(0,15);
+
}
@@ -120,16 +125,6 @@ window.getDataZoomForMapZoom = function(zoom) {
zoom = 21;
}
-// as of the 2015-06-26 niantic update, unclaimed portals are returned when we ask for L1+ - so this
-// is not needed at all
-// if (window.CONFIG_ZOOM_SHOW_MORE_PORTALS) {
-// // as of 2015-06-25 stock site update, all zoom levels that retrieve portals (15+) use the same tile size
-// // therefore, it's no more load on the servers to fake it always to show unclaimed rather than L1+
-// if (zoom >= 15 && zoom <= 16) {
-// zoom = 17;
-// }
-// }
-
if (!window.CONFIG_ZOOM_DEFAULT_DETAIL_LEVEL) {
diff --git a/plugins/show-more-portals.user.js b/plugins/show-more-portals.user.js
index 58be1f7d..f6553cce 100644
--- a/plugins/show-more-portals.user.js
+++ b/plugins/show-more-portals.user.js
@@ -1,12 +1,12 @@
// ==UserScript==
// @id iitc-plugin-show-more-portals@jonatkins
// @name IITC plugin: Show more portals
-// @category Tweaks
+// @category Deleted
// @version 0.2.1.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
-// @description [@@BUILDNAME@@-@@BUILDDATE@@] Boost the detail level of portals shown so that unclaimed portals are visible one level saooner.
+// @description [@@BUILDNAME@@-@@BUILDDATE@@] Standard intel has changed to show all portals from zoom level 15, which is what this plugin used to force.
// @include https://www.ingress.com/intel*
// @include http://www.ingress.com/intel*
// @match https://www.ingress.com/intel*
@@ -18,24 +18,3 @@
// @grant none
// ==/UserScript==
-@@PLUGINSTART@@
-
-// PLUGIN START ////////////////////////////////////////////////////////
-
-
-// use own namespace for plugin
-window.plugin.showMorePortals = function() {};
-
-window.plugin.showMorePortals.setup = function() {
-
-// NOTE: the logic required is closely tied to the IITC+stock map detail level code - so the logic is moved there now
-// and just enabled by this flag
- window.CONFIG_ZOOM_SHOW_MORE_PORTALS=true;
-
-};
-
-var setup = window.plugin.showMorePortals.setup;
-
-// PLUGIN END //////////////////////////////////////////////////////////
-
-@@PLUGINEND@@
From c922ade636e12a5363a7dc294fddd22188bac11b Mon Sep 17 00:00:00 2001
From: fkloft
Date: Sat, 4 Jul 2015 16:30:24 +0200
Subject: [PATCH 46/86] Fix for portal search
---
code/search.js | 2 ++
1 file changed, 2 insertions(+)
diff --git a/code/search.js b/code/search.js
index ca446fb6..120ce055 100644
--- a/code/search.js
+++ b/code/search.js
@@ -225,6 +225,8 @@ addHook('search', function(query) {
$.each(portals, function(guid, portal) {
var data = portal.options.data;
+ if(!data.title) return;
+
if(data.title.toLowerCase().indexOf(term) !== -1) {
var team = portal.options.team;
var color = team==TEAM_NONE ? '#CCC' : COLORS[team];
From b3385c7f2cd8b79d9f2145fdda450050151755cd Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Tue, 7 Jul 2015 21:47:43 +0100
Subject: [PATCH 47/86] portal weakness: test for the correct value existing -
oops fix #1010
---
plugins/show-portal-weakness.user.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/show-portal-weakness.user.js b/plugins/show-portal-weakness.user.js
index 494aff8e..62aec54a 100644
--- a/plugins/show-portal-weakness.user.js
+++ b/plugins/show-portal-weakness.user.js
@@ -27,7 +27,7 @@ window.plugin.portalWeakness = function() {};
window.plugin.portalWeakness.highlightWeakness = function(data) {
- if(data.portal.options.resCount !== undefined && data.portal.options.data.health !== undefined && data.portal.options.team != TEAM_NONE) {
+ if(data.portal.options.data.resCount !== undefined && data.portal.options.data.health !== undefined && data.portal.options.team != TEAM_NONE) {
var res_count = data.portal.options.data.resCount;
var portal_health = data.portal.options.data.health;
From aca3799a6a2394db99e7734eaf31e2d2a8c222e1 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Tue, 7 Jul 2015 22:51:05 +0100
Subject: [PATCH 48/86] ignore server-side faked links, that Niantic generate
from the field data they're not useful - and it would make more sense to do
it client-side if there was a need for it
---
code/map_data_render.js | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/code/map_data_render.js b/code/map_data_render.js
index 69e04ff1..fc17f824 100644
--- a/code/map_data_render.js
+++ b/code/map_data_render.js
@@ -406,6 +406,13 @@ window.Render.prototype.createFieldEntity = function(ent) {
}
window.Render.prototype.createLinkEntity = function(ent,faked) {
+ // Niantic have been faking link entities, based on data from fields
+ // these faked links are sent along with the real portal links, causing duplicates
+ // the faked ones all have longer GUIDs, based on the field GUID (with _ab, _ac, _bc appended)
+ var fakedLink = new RegExp("^[0-9a-f]{32}\.b_[ab][bc]$"); //field GUIDs always end with ".b" - faked links append the edge identifier
+ if (fakedLink.test(ent[0])) return;
+
+
this.seenLinksGuid[ent[0]] = true; // flag we've seen it
var data = { // TODO add other properties and check correction direction
From 77e55cba996ce3b37bdcc7f4076d2c3bf8c4193e Mon Sep 17 00:00:00 2001
From: fkloft
Date: Thu, 9 Jul 2015 18:04:03 +0200
Subject: [PATCH 49/86] [show-linked-portals] fix for recent intel changes
---
plugins/show-linked-portals.user.js | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/plugins/show-linked-portals.user.js b/plugins/show-linked-portals.user.js
index 4efcc8cb..eaecc16d 100644
--- a/plugins/show-linked-portals.user.js
+++ b/plugins/show-linked-portals.user.js
@@ -2,7 +2,7 @@
// @id iitc-plugin-show-linked-portals@fstopienski
// @name IITC plugin: Show linked portals
// @category Portal Info
-// @version 0.3.0.@@DATETIMEVERSION@@
+// @version 0.3.1.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
@@ -61,7 +61,7 @@ window.plugin.showLinkedPortal.portalDetail = function (data) {
var title;
var data = (portals[guid] && portals[guid].options.data) || portalDetail.get(guid) || null;
- if(data) {
+ if(data && data.title) {
title = data.title;
div.append($('
').attr({
'src': fixPortalImageUrl(data.image),
@@ -73,7 +73,7 @@ window.plugin.showLinkedPortal.portalDetail = function (data) {
div
.addClass('outOfRange')
.append($('')
- .html('Portal out of range.
' + lengthShort));
+ .html('Portal not loaded.
' + lengthShort));
}
div
From c859a144f98cb819f1d51d62d5c2e2dd3fcfce82 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Fri, 10 Jul 2015 07:51:28 +0100
Subject: [PATCH 50/86] artifact: niantic finally removed the old artifact API
- we now have to use the far less useful new one re-did the display of
target/shard on the portal details - better like this I think
---
code/artifact.js | 307 ++++++++++++++--------------------
code/entity_decode.js | 32 +++-
code/portal_detail_display.js | 40 ++---
style.css | 9 +
4 files changed, 177 insertions(+), 211 deletions(-)
diff --git a/code/artifact.js b/code/artifact.js
index b5335b8f..b1ef4e03 100644
--- a/code/artifact.js
+++ b/code/artifact.js
@@ -35,23 +35,7 @@ window.artifact.requestData = function() {
if (isIdle()) {
artifact.idle = true;
} else {
- // new API available in stock (2015-05-21) - 'getArtifactPortals'
- // stock still uses this one, and the new method doesn't yet return anything, but they might be changing things soon...
-//2015-06-13 - stock intel update using the new API
-//above method takes no params, returns a list of portals. however, no longer
-//1. a distinction between target portals and artifact portals
-//2. some shard details in the portal summary 'unknown12' variable
-// a. no sign of fragment numbers in this summary data - only in portal details
-// b. not sure how resistance/enlightened targets are identified. so far, most portals have
-// "[[["lightman"]], []]" (fragment at portal?)
-// aod two have
-// "[[["lightman"]], [["lightman"]]]"
-// best guess - first array is a list of artifact types (but not numbers) at a portal
-// - second array is a list of the target types for a portal
-// (so "[[[]], [["lightman"]]]" would be for a target without any fragments at it
-
-
- window.postAjax('artifacts', {}, artifact.handleSuccess, artifact.handleError);
+ window.postAjax('getArtifactPortals', {}, artifact.handleSuccess, artifact.handleError);
}
}
@@ -81,34 +65,14 @@ window.artifact.handleFailure = function(data) {
window.artifact.processData = function(data) {
- if (data.error || !data.artifacts) {
- console.warn('Failed to find artifacts in artifact response');
+ if (data.error || !data.result) {
+ console.warn('Failed to find result in getArtifactPortals response');
return;
}
artifact.clearData();
- $.each (data.artifacts, function(i,artData) {
- // if we have no descriptions for a type, we don't know about it
- if (!artifact.getArtifactDescriptions(artData.artifactId)) {
- // jarvis and amar artifacts - fragmentInfos and targetInfos
- // (future types? completely unknown at this time!)
- console.warn('Note: unknown artifactId '+artData.artifactId+' - guessing how to handle it');
- }
-
- artifact.artifactTypes[artData.artifactId] = artData.artifactId;
-
- if (artData.fragmentInfos) {
- artifact.processFragmentInfos (artData.artifactId, artData.fragmentInfos);
- }
-
- if (artData.targetInfos) {
- artifact.processTargetInfos (artData.artifactId, artData.targetInfos);
- }
-
- // other data in future? completely unknown!
- });
-
+ artifact.processResult(data.result);
// redraw the artifact layer
artifact.updateLayer();
@@ -117,38 +81,52 @@ window.artifact.processData = function(data) {
window.artifact.clearData = function() {
-
artifact.portalInfo = {};
artifact.artifactTypes = {};
+
+ artifact.entities = [];
}
-window.artifact.processFragmentInfos = function (id, fragments) {
- $.each(fragments, function(i, fragment) {
- if (!artifact.portalInfo[fragment.portalGuid]) {
- artifact.portalInfo[fragment.portalGuid] = { _entityData: fragment.portalInfo };
+
+window.artifact.processResult = function (portals) {
+ // portals is an object, keyed from the portal GUID, containing the portal entity array
+
+ for (var guid in portals) {
+ var ent = portals[guid];
+ var data = decodeArray.portalSummary(ent);
+
+ // we no longer know the faction for the target portals, and we don't know which fragment numbers are at the portals
+ // all we know, from the portal summary data, for each type of artifact, is that each artifact portal is
+ // - a target portal or not - no idea for which faction
+ // - has one (or more) fragments, or not
+
+ if (!artifact.portalInfo[guid]) artifact.portalInfo[guid] = {};
+
+ // store the decoded data - needed for lat/lng for layer markers
+ artifact.portalInfo[guid]._data = data;
+
+ for(var type in data.artifactBrief.target) {
+ if (!artifact.artifactTypes[type]) artifact.artifactTypes[type] = {};
+
+ if (!artifact.portalInfo[guid][type]) artifact.portalInfo[guid][type] = {};
+
+ artifact.portalInfo[guid][type].target = TEAM_NONE; // as we no longer know the team...
}
- if (!artifact.portalInfo[fragment.portalGuid][id]) artifact.portalInfo[fragment.portalGuid][id] = {};
+ for(var type in data.artifactBrief.fragment) {
+ if (!artifact.artifactTypes[type]) artifact.artifactTypes[type] = {};
- if (!artifact.portalInfo[fragment.portalGuid][id].fragments) artifact.portalInfo[fragment.portalGuid][id].fragments = [];
+ if (!artifact.portalInfo[guid][type]) artifact.portalInfo[guid][type] = {};
- $.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 };
+ artifact.portalInfo[guid][type].fragments = true; //as we no longer have a list of the fragments there
}
- if (!artifact.portalInfo[target.portalGuid][id]) artifact.portalInfo[target.portalGuid][id] = {};
- artifact.portalInfo[target.portalGuid][id].target = target.team === 'RESISTANCE' ? TEAM_RES : TEAM_ENL;
- });
+ // let's pre-generate the entities needed to render the map - array of [guid, timestamp, ent_array]
+ artifact.entities.push ( [guid, data.timestamp, ent] );
+
+ }
+
}
window.artifact.getArtifactTypes = function() {
@@ -159,30 +137,9 @@ window.artifact.isArtifact = function(type) {
return type in artifact.artifactTypes;
}
-window.artifact.getArtifactDescriptions = function(type) {
- var descriptions = {
- 'jarvis': { 'title': "Jarvis Shards", 'fragmentName': "shards" },
- 'amar': { 'title': "Amar Artifacts", 'fragmentName': "artifacts" },
- 'helios': { 'title': "Helios Artifacts", 'fragmentName': "artifacts" },
- 'shonin': { 'title': "Sh\u014Dnin Shards", 'fragmentName': "shards" },
- 'lightman': { 'title': "Lightman Shards", 'fragmentName': "shards" },
- };
-
- return descriptions[type];
-}
-
// 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;
+ return artifact.entities;
}
window.artifact.getInterestingPortals = function() {
@@ -199,103 +156,72 @@ window.artifact.getPortalData = function(guid,artifactId) {
return artifact.portalInfo[guid] && artifact.portalInfo[guid][artifactId];
}
+// get the target(s) at a specified portal. returns 'false'y if the portal isn't a target
+window.artifact.getPortalTarget = function(guid) {
+ targets = {};
+ if (artifact.portalInfo[guid]) {
+ for (var type in artifact.artifactTypes) {
+ if (artifact.portalInfo[guid][type].target !== undefined) {
+ targets[type] = artifact.portalInfo[guid][type].target;
+ }
+ }
+ }
+
+ return Object.keys(targets).length == 0 ? null : targets;
+
+}
+
window.artifact.updateLayer = function() {
artifact._layer.clearLayers();
$.each(artifact.portalInfo, function(guid,data) {
- var latlng = L.latLng ([data._entityData[2]/1E6, data._entityData[3]/1E6]);
+ var latlng = L.latLng ([data._data.latE6/1E6, data._data.lngE6/1E6]);
- // jarvis shard icon
- var iconUrl = undefined;
- var iconSize = 0;
- var opacity = 1.0;
+ $.each(data, function(type,detail) {
- // redundant as of 2014-02-05 - jarvis shards removed
- if (data.jarvis) {
- 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
+ // we'll construct the URL form the type - stock seems to do that now
- var count = data.jarvis.fragments ? data.jarvis.fragments.length : 0;
+ var iconUrl;
+ if (data[type].target !== undefined) {
+ // target portal
+ var iconUrl = '//commondatastorage.googleapis.com/ingress.com/img/map_icons/marker_images/'+type+'_shard_target.png'
+ var iconSize = 100/2;
+ var opacity = 1.0;
+
+ 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, opacity: opacity });
+
+ artifact._layer.addLayer(marker);
+
+ } else if (data[type].fragments) {
+ // fragment(s) at portal
+
+ var iconUrl = '//commondatastorage.googleapis.com/ingress.com/img/map_icons/marker_images/'+type+'_shard.png'
+ var iconSize = 60/2;
+ var opacity = 0.6;
+
+ 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, opacity: opacity });
+
+ artifact._layer.addLayer(marker);
- 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
- } else 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
- opacity = 0.6; // these often hide portals - let's make them semi transparent
}
- }
- // 2014-02-06: a guess at whats needed for the new artifacts
- if (data.amar) {
- if (data.amar.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
+ }); //end $.each(data, function(type,detail)
- var count = data.amar.fragments ? data.amar.fragments.length : 0;
-
- iconUrl = '//commondatastorage.googleapis.com/ingress.com/img/map_icons/marker_images/amar_shard_target_'+count+'.png';
- iconSize = 100/2; // 100 pixels - half that size works better
- } else if (data.amar.fragments) {
- iconUrl = '//commondatastorage.googleapis.com/ingress.com/img/map_icons/marker_images/amar_shard.png';
- iconSize = 60/2; // 60 pixels - half that size works better
- opacity = 0.6; // these often hide portals - let's make them semi transparent
- }
- }
-
- // 2014-08-09 - helios artifacts. original guess was slightly wrong
- if (data.helios) {
- if (data.helios.target) {
- // target portal - show the target marker. helios target marker doesn't fill like the earlier jarvis/amar targets
- iconUrl = '//commondatastorage.googleapis.com/ingress.com/img/map_icons/marker_images/helios_shard_target.png';
- iconSize = 100/2; // 100 pixels - half that size works better
- } else if (data.helios.fragments) {
- iconUrl = '//commondatastorage.googleapis.com/ingress.com/img/map_icons/marker_images/helios_shard.png';
- iconSize = 60/2; // 60 pixels - half that size works better
- opacity = 0.6; // these often hide portals - let's make them semi transparent
- }
- }
-
- // 2015-03-05 - shonin shards
- if (data.shonin) {
- if (data.shonin.target) {
- // target portal - show the target marker.
- iconUrl = '//commondatastorage.googleapis.com/ingress.com/img/map_icons/marker_images/shonin_shard_target.png';
- iconSize = 100/2; // 100 pixels - half that size works better
- } else if (data.shonin.fragments) {
- iconUrl = '//commondatastorage.googleapis.com/ingress.com/img/map_icons/marker_images/shonin_shard.png';
- iconSize = 60/2; // 60 pixels - half that size works better
- opacity = 0.6; // these often hide portals - let's make them semi transparent
- }
- }
-
- // 2015-04-22 - lightman fragments (guessed)
- if (data.lightman) {
- if (data.lightman.target) {
- // target portal - show the target marker.
- iconUrl = '//commondatastorage.googleapis.com/ingress.com/img/map_icons/marker_images/lightman_shard_target.png';
- iconSize = 100/2; // 100 pixels - half that size works better
- } else if (data.lightman.fragments) {
- iconUrl = '//commondatastorage.googleapis.com/ingress.com/img/map_icons/marker_images/lightman_shard.png';
- iconSize = 60/2; // 60 pixels - half that size works better
- opacity = 0.6; // these often hide portals - let's make them semi transparent
- }
- }
-
- 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, opacity: opacity });
-
- artifact._layer.addLayer(marker);
- } else {
- console.warn('Oops! no URL for artifact portal icon?!');
- }
- });
+ }); //end $.each(artifact.portalInfo, function(guid,data)
}
@@ -309,9 +235,9 @@ window.artifact.showArtifactList = function() {
var first = true;
$.each(artifact.artifactTypes, function(type,type2) {
- var description = artifact.getArtifactDescriptions(type);
-
- var name = description ? description.title : ('unknown artifact type: '+type);
+ // no nice way to convert the Niantic internal name into the correct display name
+ // (we do get the description string once a portal with that shard type is selected - could cache that somewhere?)
+ var name = type.substr(0,1).toUpperCase() + type.substr(1) + ' shards';
if (!first) html += '
';
first = false;
@@ -326,29 +252,33 @@ window.artifact.showArtifactList = function() {
if (type in data) {
// this portal has data for this artifact type - add it to the table
- var sortVal = 0;
-
- var onclick = 'zoomToAndShowPortal(\''+guid+'\',['+data._entityData[2]/1E6+','+data._entityData[3]/1E6+'])';
- var row = ''+escapeHtmlSpecialChars(data._entityData[8])+' | ';
+ var onclick = 'zoomToAndShowPortal(\''+guid+'\',['+data._data.latE6/1E6+','+data._data.lngE6/1E6+'])';
+ var row = '
'+escapeHtmlSpecialChars(data._data.title)+' | ';
row += '';
- if (data[type].target) {
- row += ''+(data[type].target==TEAM_RES?'Resistance':'Enlightened')+' target ';
- sortVal = 100000+data[type].target;
+ if (data[type].target !== undefined) {
+ if (data[type].target == TEAM_NONE) {
+ row += 'Target Portal ';
+ } else {
+ row += ''+(data[type].target==TEAM_RES?'Resistance':'Enlightened')+' target ';
+ }
}
if (data[type].fragments) {
- if (data[type].target) {
+ if (data[type].target !== undefined) {
row += ' ';
}
- var fragmentName = description ? description.fragmentName : 'fragment';
- row += ''+fragmentName+': #'+data[type].fragments.join(', #')+' ';
- sortVal = Math.min.apply(null, data[type].fragments); // use min shard number at portal as sort key
+ var fragmentName = 'shard';
+// row += ''+fragmentName+': #'+data[type].fragments.join(', #')+' ';
+ row += ''+fragmentName+': yes ';
}
row += ' |
';
+ // sort by target portals first, then by portal GUID
+ var sortVal = (data[type].target !== undefined ? 'A' : 'Z') + guid;
+
tableRows.push ( [sortVal, row] );
}
});
@@ -360,7 +290,9 @@ window.artifact.showArtifactList = function() {
// sort the rows
tableRows.sort(function(a,b) {
- return a[0]-b[0];
+ if (a[0] == b[0]) return 0;
+ else if (a[0] < b[0]) return -1;
+ else return 1;
});
// and add them to the table
@@ -371,6 +303,13 @@ window.artifact.showArtifactList = function() {
});
+ html += "
"
+ + "In Summer 2015, Niantic changed the data format for artifact portals. We no longer know:
"
+ + "- Which team each target portal is for - only that it is a target
"
+ + "- Which shards are at each portal, just that it has one or more shards
"
+ + "You can select a portal and the detailed data contains the list of shard numbers, but there's still no"
+ + " more information on targets.
";
+
dialog({
title: 'Artifacts',
html: html,
diff --git a/code/entity_decode.js b/code/entity_decode.js
index edf2b5d5..5a6398f4 100644
--- a/code/entity_decode.js
+++ b/code/entity_decode.js
@@ -25,7 +25,33 @@
energy: arr[2],
};
}
- function parseArtifact(arr) {
+ function parseArtifactBrief(arr) {
+ if (arr === null) return null;
+
+ // array index 0 is for fragments at the portal. index 1 is for target portals
+ // each of those is two dimensional - not sure why. part of this is to allow for multiple types of artifacts,
+ // with their own targets, active at once - but one level for the array is enough for that
+
+ // making a guess - first level is for different artifact types, second index would allow for
+ // extra data for that artifact type
+
+ function decodeArtifactArray(arr) {
+ var result = {};
+ for (var i=0; iforce amplifier',
'×'+attackValues.force_amplifier]);
- // artifact details
-
- // 2014-02-06: stock site changed from supporting 'jarvis shards' to 'amar artifacts'(?) - so let's see what we can do to be generic...
- $.each(artifact.getArtifactTypes(),function(index,type) {
- var artdata = artifact.getPortalData (guid, type);
- if (artdata) {
- var details = artifact.getArtifactDescriptions(type);
- if (details) {
- // the genFourColumnTable function below doesn't handle cases where one column is null and the other isn't - so default to *something* in both columns
- var target = ['',''], shards = [details.fragmentName,'(none)'];
- if (artdata.target) {
- target = ['target', ''+(artdata.target==TEAM_RES?'Resistance':'Enlightened')+''];
- }
- if (artdata.fragments) {
- shards = [details.fragmentName, '#'+artdata.fragments.join(', #')];
- }
-
- randDetailsData.push (target, shards);
- } else {
- console.warn('Unknown artifact type '+type+': no names, so cannot display');
- }
- }
- });
-
randDetails = '' + genFourColumnTable(randDetailsData) + '
';
+
+ // artifacts - tacked on after (but not as part of) the 'randdetails' table
+ // instead of using the existing columns....
+
+ // fill in target status from the artifact code
+ var targets = artifact.getPortalTarget(guid);
+ if (targets) {
+//currently (2015-07-10) we no longer know the team each target portal is for - so we'll just show the artifact type(s)
+ randDetails += 'Target portal: '+Object.keys(targets).map(function(x) { return x.substr(0,1).toUpperCase()+x.substr(1); }).join(', ')+'
';
+ }
+
+ // shards - taken directly from the portal details
+ if (d.artifactDetail) {
+ randDetails += 'Shards: '+d.artifactDetail.displayName+' #'+d.artifactDetail.fragments.join(', ')+'
';
+ }
+
}
return randDetails;
diff --git a/style.css b/style.css
index 9578d1dc..b0ab156c 100644
--- a/style.css
+++ b/style.css
@@ -711,6 +711,15 @@ h3 {
cursor: help;
}
+#artifact_target, #artifact_fragments {
+ margin-top: 4px;
+ margin-bottom: 4px;
+
+ margin-left: 8px;
+ margin-right: 8px;
+}
+
+
/* resonators */
#resodetails {
margin-bottom: 0px;
From 12f84721faf23c0b0b7440969e666d087e43275f Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Fri, 10 Jul 2015 08:14:56 +0100
Subject: [PATCH 51/86] why bother going through the artifact layers to get the
target data - it's already in the portal details!!
---
code/artifact.js | 17 +----------------
code/portal_detail_display.js | 7 +++----
2 files changed, 4 insertions(+), 20 deletions(-)
diff --git a/code/artifact.js b/code/artifact.js
index b1ef4e03..8d61552b 100644
--- a/code/artifact.js
+++ b/code/artifact.js
@@ -156,21 +156,6 @@ window.artifact.getPortalData = function(guid,artifactId) {
return artifact.portalInfo[guid] && artifact.portalInfo[guid][artifactId];
}
-// get the target(s) at a specified portal. returns 'false'y if the portal isn't a target
-window.artifact.getPortalTarget = function(guid) {
- targets = {};
- if (artifact.portalInfo[guid]) {
- for (var type in artifact.artifactTypes) {
- if (artifact.portalInfo[guid][type].target !== undefined) {
- targets[type] = artifact.portalInfo[guid][type].target;
- }
- }
- }
-
- return Object.keys(targets).length == 0 ? null : targets;
-
-}
-
window.artifact.updateLayer = function() {
artifact._layer.clearLayers();
@@ -237,7 +222,7 @@ window.artifact.showArtifactList = function() {
$.each(artifact.artifactTypes, function(type,type2) {
// no nice way to convert the Niantic internal name into the correct display name
// (we do get the description string once a portal with that shard type is selected - could cache that somewhere?)
- var name = type.substr(0,1).toUpperCase() + type.substr(1) + ' shards';
+ var name = type.capitalize() + ' shards';
if (!first) html += '
';
first = false;
diff --git a/code/portal_detail_display.js b/code/portal_detail_display.js
index b72012e0..dc4793df 100644
--- a/code/portal_detail_display.js
+++ b/code/portal_detail_display.js
@@ -190,11 +190,10 @@ window.getPortalMiscDetails = function(guid,d) {
// artifacts - tacked on after (but not as part of) the 'randdetails' table
// instead of using the existing columns....
- // fill in target status from the artifact code
- var targets = artifact.getPortalTarget(guid);
- if (targets) {
+ if (d.artifactBrief && d.artifactBrief.target && Object.keys(d.artifactBrief.target).length > 0) {
+ var targets = Object.keys(d.artifactBrief.target);
//currently (2015-07-10) we no longer know the team each target portal is for - so we'll just show the artifact type(s)
- randDetails += 'Target portal: '+Object.keys(targets).map(function(x) { return x.substr(0,1).toUpperCase()+x.substr(1); }).join(', ')+'
';
+ randDetails += 'Target portal: '+targets.map(function(x) { return x.capitalize(); }).join(', ')+'
';
}
// shards - taken directly from the portal details
From 7031a421e1adab5a32b614bc5a9756fd548b6340 Mon Sep 17 00:00:00 2001
From: fkloft
Date: Tue, 14 Jul 2015 18:52:46 +0200
Subject: [PATCH 52/86] [uniques] update for recent Niantic change
deploy messages in log don't contain the resonator level any more
---
plugins/uniques.user.js | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/plugins/uniques.user.js b/plugins/uniques.user.js
index ed33718f..fdb03900 100644
--- a/plugins/uniques.user.js
+++ b/plugins/uniques.user.js
@@ -99,6 +99,17 @@ window.plugin.uniques.onPublicChatDataAvailable = function(data) {
&& markup[0][0] == 'PLAYER'
&& markup[0][1].plain == nick
&& markup[1][0] == 'TEXT'
+ && markup[1][1].plain == ' deployed a Resonator on '
+ && markup[2][0] == 'PORTAL') {
+ // search for "x deployed a Resonator on z"
+ var portal = markup[4][1];
+ var guid = window.findPortalGuidByPositionE6(portal.latE6, portal.lngE6);
+ if(guid) plugin.uniques.setPortalVisited(guid);
+ } else if(plext.plextType == 'SYSTEM_BROADCAST'
+ && markup.length==3
+ && markup[0][0] == 'PLAYER'
+ && markup[0][1].plain == nick
+ && markup[1][0] == 'TEXT'
&& markup[1][1].plain == ' captured '
&& markup[2][0] == 'PORTAL') {
// search for "x captured y"
From 45d07d026a1514656654c6a915d1ac82857666f4 Mon Sep 17 00:00:00 2001
From: fkloft
Date: Tue, 14 Jul 2015 18:59:30 +0200
Subject: [PATCH 53/86] [uniques] avoid unnecessary resyncs
---
plugins/uniques.user.js | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/plugins/uniques.user.js b/plugins/uniques.user.js
index fdb03900..c4dca21e 100644
--- a/plugins/uniques.user.js
+++ b/plugins/uniques.user.js
@@ -2,7 +2,7 @@
// @id iitc-plugin-uniques@3ch01c
// @name IITC plugin: Uniques
// @category Misc
-// @version 0.2.3.@@DATETIMEVERSION@@
+// @version 0.2.4.@@DATETIMEVERSION@@
// @namespace https://github.com/3ch01c/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
@@ -199,6 +199,8 @@ window.plugin.uniques.updateCheckedAndHighlight = function(guid) {
window.plugin.uniques.setPortalVisited = function(guid) {
var uniqueInfo = plugin.uniques.uniques[guid];
if (uniqueInfo) {
+ if(uniqueInfo.visited) return;
+
uniqueInfo.visited = true;
} else {
plugin.uniques.uniques[guid] = {
@@ -214,6 +216,8 @@ window.plugin.uniques.setPortalVisited = function(guid) {
window.plugin.uniques.setPortalCaptured = function(guid) {
var uniqueInfo = plugin.uniques.uniques[guid];
if (uniqueInfo) {
+ if(uniqueInfo.visited && uniqueInfo.captured) return;
+
uniqueInfo.visited = true;
uniqueInfo.captured = true;
} else {
@@ -238,6 +242,8 @@ window.plugin.uniques.updateVisited = function(visited, guid) {
};
}
+ if(visited == uniqueInfo.visited) return;
+
if (visited) {
uniqueInfo.visited = true;
} else { // not visited --> not captured
@@ -260,6 +266,8 @@ window.plugin.uniques.updateCaptured = function(captured, guid) {
};
}
+ if(captured == uniqueInfo.captured) return;
+
if (captured) { // captured --> visited
uniqueInfo.captured = true;
uniqueInfo.visited = true;
From ed0cedfc81f4c8b503f420b9300c52e9c370dc7a Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Mon, 20 Jul 2015 09:34:03 +0100
Subject: [PATCH 54/86] placeholder portals - default style is thinner and
dashed outline, to distinguish them from other low level portals handy when
panning around when portals are visible, as placeholders will still exist for
links before data loading is complete
---
code/portal_marker.js | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/code/portal_marker.js b/code/portal_marker.js
index c88f78f0..b9bfb764 100644
--- a/code/portal_marker.js
+++ b/code/portal_marker.js
@@ -52,6 +52,13 @@ window.getMarkerStyleOptions = function(details) {
var lvlWeight = LEVEL_TO_WEIGHT[level] * Math.sqrt(scale);
var lvlRadius = LEVEL_TO_RADIUS[level] * scale;
+ var dashArray = null;
+ // thinner and dashed outline for placeholder portals
+ if (details.team != TEAM_NONE && level==0) {
+ lvlWeight = 1;
+ dashArray = [1,2];
+ }
+
var options = {
radius: lvlRadius,
stroke: true,
@@ -61,7 +68,7 @@ window.getMarkerStyleOptions = function(details) {
fill: true,
fillColor: COLORS[details.team],
fillOpacity: 0.5,
- dashArray: null
+ dashArray: dashArray
};
return options;
From 757a2a2c0eaac08fe8e4f2cb10528a96865d6638 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Mon, 20 Jul 2015 23:03:05 +0100
Subject: [PATCH 55/86] fix index of portal in new format COMM entries
---
plugins/uniques.user.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/uniques.user.js b/plugins/uniques.user.js
index c4dca21e..c14b4077 100644
--- a/plugins/uniques.user.js
+++ b/plugins/uniques.user.js
@@ -102,7 +102,7 @@ window.plugin.uniques.onPublicChatDataAvailable = function(data) {
&& markup[1][1].plain == ' deployed a Resonator on '
&& markup[2][0] == 'PORTAL') {
// search for "x deployed a Resonator on z"
- var portal = markup[4][1];
+ var portal = markup[2][1];
var guid = window.findPortalGuidByPositionE6(portal.latE6, portal.lngE6);
if(guid) plugin.uniques.setPortalVisited(guid);
} else if(plext.plextType == 'SYSTEM_BROADCAST'
From 5a5a5a21fb9c383ce7a93babe9f4cad3e9d750fa Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Sun, 26 Jul 2015 08:10:55 +0100
Subject: [PATCH 56/86] show-linked-portals: prevent multiple instances of the
click handler being installed onto the #portaldetails div fixes multiple
bookmark stars, amongst other things
---
plugins/show-linked-portals.user.js | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/plugins/show-linked-portals.user.js b/plugins/show-linked-portals.user.js
index eaecc16d..e813e50d 100644
--- a/plugins/show-linked-portals.user.js
+++ b/plugins/show-linked-portals.user.js
@@ -43,6 +43,8 @@ window.plugin.showLinkedPortal.portalDetail = function (data) {
var c = 1;
+ $('',{id:'showLinkedPortalContainer'}).appendTo('#portaldetails');
+
function renderLinkedPortal(linkGuid) {
if(c > 16) return;
@@ -89,7 +91,7 @@ window.plugin.showLinkedPortal.portalDetail = function (data) {
.append($('
').html(lengthFull))
.html(),
})
- .appendTo('#portaldetails');
+ .appendTo('#showLinkedPortalContainer');
c++;
}
@@ -101,10 +103,10 @@ window.plugin.showLinkedPortal.portalDetail = function (data) {
$('
')
.addClass('showLinkedPortalLink showLinkedPortalOverflow')
.text(length-16 + ' more')
- .appendTo('#portaldetails');
+ .appendTo('#showLinkedPortalContainer');
}
- $('#portaldetails')
+ $('#showLinkedPortalContainer')
.on('click', '.showLinkedPortalLink', plugin.showLinkedPortal.onLinkedPortalClick)
.on('mouseover', '.showLinkedPortalLink', plugin.showLinkedPortal.onLinkedPortalMouseOver)
.on('mouseout', '.showLinkedPortalLink', plugin.showLinkedPortal.onLinkedPortalMouseOut);
From 0d88cfd8bafb3488f2857e1f0d201a5d87b5c5cb Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Sun, 26 Jul 2015 08:11:48 +0100
Subject: [PATCH 57/86] bookmarks: additional protection against multiple
bookmark stars being added to the portal details
---
plugins/bookmarks-by-zaso.user.js | 36 ++++++++++++++++++++-----------
1 file changed, 23 insertions(+), 13 deletions(-)
diff --git a/plugins/bookmarks-by-zaso.user.js b/plugins/bookmarks-by-zaso.user.js
index 02155ace..7a399bcc 100644
--- a/plugins/bookmarks-by-zaso.user.js
+++ b/plugins/bookmarks-by-zaso.user.js
@@ -292,26 +292,36 @@
}
// Append a 'star' flag in sidebar.
+ window.plugin.bookmarks.onPortalSelectedPending = false;
window.plugin.bookmarks.onPortalSelected = function() {
$('.bkmrksStar').remove();
if(window.selectedPortal == null) return;
- setTimeout(function() { // the sidebar is constructed after firing the hook
- if(typeof(Storage) === "undefined") {
- $('#portaldetails > .imgpreview').after(plugin.bookmarks.htmlDisabledMessage);
- return;
- }
+ if (!window.plugin.bookmarks.onPortalSelectedPending) {
+ window.plugin.bookmarks.onPortalSelectedPending = true;
- // Prepend a star to mobile status-bar
- if(window.plugin.bookmarks.isSmart) {
- $('#updatestatus').prepend(plugin.bookmarks.htmlStar);
- $('#updatestatus .bkmrksStar').attr('title', '');
- }
+ setTimeout(function() { // the sidebar is constructed after firing the hook
+ window.plugin.bookmarks.onPortalSelectedPending = false;
+
+ $('.bkmrksStar').remove();
+
+ if(typeof(Storage) === "undefined") {
+ $('#portaldetails > .imgpreview').after(plugin.bookmarks.htmlDisabledMessage);
+ return;
+ }
+
+ // Prepend a star to mobile status-bar
+ if(window.plugin.bookmarks.isSmart) {
+ $('#updatestatus').prepend(plugin.bookmarks.htmlStar);
+ $('#updatestatus .bkmrksStar').attr('title', '');
+ }
+
+ $('#portaldetails > h3.title').before(plugin.bookmarks.htmlStar);
+ window.plugin.bookmarks.updateStarPortal();
+ }, 0);
+ }
- $('#portaldetails > h3.title').before(plugin.bookmarks.htmlStar);
- window.plugin.bookmarks.updateStarPortal();
- }, 0);
}
// Update the status of the star (when a portal is selected from the map/bookmarks-list)
From 5c43225642cf61edcaa1bed79fc128bb2f274646 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Sun, 26 Jul 2015 08:12:14 +0100
Subject: [PATCH 58/86] create placeholder portals from the field vertices they
should already be created from links, but it's handy to select anchors of
ghost fields, and there's the odd edge case where the links were too short
for some edges of a field
---
code/map_data_render.js | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/code/map_data_render.js b/code/map_data_render.js
index fc17f824..57abf462 100644
--- a/code/map_data_render.js
+++ b/code/map_data_render.js
@@ -357,6 +357,18 @@ window.Render.prototype.createPortalEntity = function(ent) {
window.Render.prototype.createFieldEntity = function(ent) {
this.seenFieldsGuid[ent[0]] = true; // flag we've seen it
+ var data = {
+// type: ent[2][0],
+ team: ent[2][1],
+ points: ent[2][2].map(function(arr) { return {guid: arr[0], latE6: arr[1], lngE6: arr[2] }; })
+ };
+
+ //create placeholder portals for field corners. we already do links, but there are the odd case where this is useful
+ for (var i=0; i<3; i++) {
+ var p=data.points[i];
+ this.createPlaceholderPortalEntity(p.guid, p.latE6, p.lngE6, data.team);
+ }
+
// check if entity already exists
if(ent[0] in window.fields) {
// yes. in theory, we should never get updated data for an existing field. they're created, and they're destroyed - never changed
@@ -371,12 +383,6 @@ window.Render.prototype.createFieldEntity = function(ent) {
this.deleteFieldEntity(ent[0]); // option 2, for now
}
- var data = {
-// type: ent[2][0],
- team: ent[2][1],
- points: ent[2][2].map(function(arr) { return {guid: arr[0], latE6: arr[1], lngE6: arr[2] }; })
- };
-
var team = teamStringToId(ent[2][1]);
var latlngs = [
L.latLng(data.points[0].latE6/1E6, data.points[0].lngE6/1E6),
From 631d459f56cc4abf7332e72efd25fcb7e32935a1 Mon Sep 17 00:00:00 2001
From: fkloft
Date: Mon, 10 Aug 2015 22:16:09 +0200
Subject: [PATCH 59/86] [missions] fix mission permalinks not working if
mission is not in cache
fixed issue #1034
---
plugins/missions.user.js | 41 ++++++++++++++++++++++------------------
1 file changed, 23 insertions(+), 18 deletions(-)
diff --git a/plugins/missions.user.js b/plugins/missions.user.js
index 99dbc2db..63846503 100644
--- a/plugins/missions.user.js
+++ b/plugins/missions.user.js
@@ -2,7 +2,7 @@
// @id iitc-plugin-missions@jonatkins
// @name IITC plugin: Missions
// @category Info
-// @version 0.1.1.@@DATETIMEVERSION@@
+// @version 0.1.2.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
@@ -228,13 +228,17 @@ window.plugin.missions = {
},
zoomToMission: function(mission) {
+ map.fitBounds(this.getMissionBounds(mission), {maxZoom: 17});
+ },
+
+ getMissionBounds: function(mission) {
var latlngs = mission.waypoints.filter(function(waypoint) {
return !!waypoint.portal;
}).map(function(waypoint) {
return [waypoint.portal.latE6/1E6, waypoint.portal.lngE6/1E6];
});
- map.fitBounds(L.latLngBounds(latlngs), {maxZoom: 17});
+ return L.latLngBounds(latlngs);
},
loadMissionsInBounds: function(bounds, callback, errorcallback) {
@@ -857,10 +861,21 @@ window.plugin.missions = {
},
// called after IITC and all plugin loaded
- registerFieldForSyncing: function() {
- if(!window.plugin.sync) return;
- window.plugin.sync.registerMapForSync('missions', 'checkedMissions', this.syncCallback.bind(this), this.syncInitialed.bind(this));
- window.plugin.sync.registerMapForSync('missions', 'checkedWaypoints', this.syncCallback.bind(this), this.syncInitialed.bind(this));
+ onIITCLoaded: function() {
+ var match = location.pathname.match(/\/mission\/([0-9a-z.]+)/);
+ if(match && match[1]) {
+ var mid = match[1];
+
+ this.loadMission(mid, function(mission) {
+ this.openMission(mid);
+ this.zoomToMission(mission);
+ }.bind(this));
+ }
+
+ if(window.plugin.sync) {
+ window.plugin.sync.registerMapForSync('missions', 'checkedMissions', this.syncCallback.bind(this), this.syncInitialed.bind(this));
+ window.plugin.sync.registerMapForSync('missions', 'checkedWaypoints', this.syncCallback.bind(this), this.syncInitialed.bind(this));
+ }
},
// called after local or remote change uploaded
@@ -962,12 +977,7 @@ window.plugin.missions = {
// mission may be a cached mission or contain the full details
if(mission.waypoints) {
- var latlngs = mission.waypoints.filter(function(waypoint) {
- return !!waypoint.portal;
- }).map(function(waypoint) {
- return [waypoint.portal.latE6/1E6, waypoint.portal.lngE6/1E6];
- });
- result.bounds = L.latLngBounds(latlngs)
+ result.bounds = this.getMissionBounds(mission);
}
if(mission.typeNum) {
result.icon = this.missionTypeImages[mission.typeNum] || this.missionTypeImages[0];
@@ -1078,13 +1088,8 @@ window.plugin.missions = {
window.addHook('plugin-missions-missions-refreshed', this.onMissionsRefreshed.bind(this));
window.addHook('plugin-missions-waypoint-changed', this.onWaypointChanged.bind(this));
window.addHook('plugin-missions-waypoints-refreshed', this.onWaypointsRefreshed.bind(this));
- window.addHook('iitcLoaded', this.registerFieldForSyncing.bind(this));
- var match = location.pathname.match(/\/mission\/([0-9a-z.]+)/);
- if(match && match[1]) {
- var mid = match[1];
- this.openMission(mid);
- }
+ window.addHook('iitcLoaded', this.onIITCLoaded.bind(this));
}
};
From 6fd11aee16e5a8ffdb48d6a23219017f9dce00fc Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Sat, 12 Sep 2015 10:54:25 +0100
Subject: [PATCH 60/86] fix detecting version string
---
code/extract_niantic_parameters.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/code/extract_niantic_parameters.js b/code/extract_niantic_parameters.js
index 482f3a9b..264194c6 100644
--- a/code/extract_niantic_parameters.js
+++ b/code/extract_niantic_parameters.js
@@ -6,9 +6,9 @@ window.extractFromStock = function() {
window.niantic_params = {}
// extract the former nemesis.dashboard.config.CURRENT_VERSION from the code
- var reVersion = new RegExp('[a-z]=[a-z].getData\\(\\);[a-z].v="([a-f0-9]{40})";');
+ var reVersion = new RegExp('"X-CSRFToken".*[a-z].v="([a-f0-9]{40})";');
- var minified = new RegExp('^[a-zA-Z$][a-zA-Z$0-9]$');
+ var minified = new RegExp('^[a-zA-Z$][a-zA-Z$0-9]?$');
for (var topLevel in window) {
if (minified.test(topLevel)) {
From 9d2f579906a171609dc3c636163a27eb7cdfa2f4 Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Sat, 12 Sep 2015 11:00:32 +0100
Subject: [PATCH 61/86] bump version number as earlier versions are broken
---
main.js | 2 +-
mobile/AndroidManifest.xml | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/main.js b/main.js
index 2b2bd975..5e975816 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.24.1.@@DATETIMEVERSION@@
+// @version 0.25.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
diff --git a/mobile/AndroidManifest.xml b/mobile/AndroidManifest.xml
index 4a6203e0..b48a3c11 100644
--- a/mobile/AndroidManifest.xml
+++ b/mobile/AndroidManifest.xml
@@ -2,8 +2,8 @@
+ android:versionCode="102"
+ android:versionName="0.25.0">
Date: Sat, 12 Sep 2015 18:08:06 +0100
Subject: [PATCH 62/86] website: update for new release
---
website/page/home.php | 33 ++++++++++-----------------------
website/page/news.php | 17 +++++++++++++++++
2 files changed, 27 insertions(+), 23 deletions(-)
diff --git a/website/page/home.php b/website/page/home.php
index a6f1cbff..9c606346 100644
--- a/website/page/home.php
+++ b/website/page/home.php
@@ -13,34 +13,21 @@ offers many more features. It is available for
Latest news
-27th June 2015
+12th September 2015
-IITC 0.24.0 has been released. This is a critical update needed to fix the map not loading any data.
+IITC 0.25.0 has been released. This is a critical update to fix things after a Niantic site update.
-NOTE: Niantic have removed portals from the map data at all but the closest of zoom levels (L1+ - zoom 15+).
-The stock intel site creates dummy placeholder portals at the anchors for links, allowing you to click and open the
-portal details. However, IITC does not do this yet. It will take some time to modify IITC and the plugins to allow
-for such placeholder portals, so making a first release without them.
-
-
-27th May 2015
-
-IITC 0.23.0 has been released. This is a critical update needed to fix IITC after a Niantic site update.
-
-
-8th May 2015
-
-IITC 0.22.3 has been released. Changes include
+Other changes include
-- Lightman Shards supported
-- Workaround for map loading not reaching 100%
-- IITC Mobile: fix dialogs not appearing on Android 5 with the System WebView update
-- Remove unnecessary prompt on botguard script response
-- Plugin: Missions - full mission support
-- Plugin: show-linked-portals - more details shown
-- Plugin: show-more-portals - enabled again for one zoom level
+- "Placeholder portals". Like stock intel, IITC creates clickable portals at the end of links. Portal highlighters
+won't work on these as they don't contain enough information
+- Artifacts loading fixed after a change in data format by Niantic
+- 'show-more-portals' plugin is no longer required - Niantic now return all portals at zoom 15, rather than zoom 17
+- New plugin: "cache-details-on-map". Caches the portal details as you select portals, and keeps these portals on the map
+even when you zoom out
+- and other tweaks/bugfixes
Older news
diff --git a/website/page/news.php b/website/page/news.php
index 3e918ec0..97642796 100644
--- a/website/page/news.php
+++ b/website/page/news.php
@@ -1,5 +1,22 @@
News
+12th September 2015
+
+IITC 0.25.0 has been released. This is a critical update to fix things after a Niantic site update.
+
+
+Other changes include
+
+
+- "Placeholder portals". Like stock intel, IITC creates clickable portals at the end of links. Portal highlighters
+won't work on these as they don't contain enough information
+- Artifacts loading fixed after a change in data format by Niantic
+- 'show-more-portals' plugin is no longer required - Niantic now return all portals at zoom 15, rather than zoom 17
+- New plugin: "cache-details-on-map". Caches the portal details as you select portals, and keeps these portals on the map
+even when you zoom out
+- and other tweaks/bugfixes
+
+
27th June 2015
IITC 0.24.0 has been released. This is a critical update needed to fix the map not loading any data.
From cb21291a2084053f2b65579cd88392e53f4d5888 Mon Sep 17 00:00:00 2001
From: fkloft
Date: Tue, 15 Sep 2015 19:24:12 +0200
Subject: [PATCH 63/86] mapquest now requires an API token, but openstreetmap
has fixed its SSL certificate, so use that one again
---
main.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/main.js b/main.js
index 5e975816..614f9d5c 100644
--- a/main.js
+++ b/main.js
@@ -168,8 +168,8 @@ window.RANGE_INDICATOR_COLOR = 'red'
window.MIN_ZOOM = 3;
window.DEFAULT_PORTAL_IMG = '//commondatastorage.googleapis.com/ingress.com/img/default-portal-image.png';
-//window.NOMINATIM = '//nominatim.openstreetmap.org/search?format=json&limit=1&q=';
-window.NOMINATIM = '//open.mapquestapi.com/nominatim/v1/search.php?format=json&polygon_geojson=1&q=';
+//window.NOMINATIM = '//open.mapquestapi.com/nominatim/v1/search.php?format=json&polygon_geojson=1&q=';
+window.NOMINATIM = '//nominatim.openstreetmap.org/search?format=json&polygon_geojson=1&q=';
// INGRESS CONSTANTS /////////////////////////////////////////////////
// http://decodeingress.me/2012/11/18/ingress-portal-levels-and-link-range/
From 90d22881e7a76b88958de7e155c219a50fa3e35e Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Thu, 17 Sep 2015 16:40:03 +0100
Subject: [PATCH 64/86] bump version after release
---
main.js | 2 +-
mobile/AndroidManifest.xml | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/main.js b/main.js
index 614f9d5c..0b8c9539 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.25.0.@@DATETIMEVERSION@@
+// @version 0.25.1.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
diff --git a/mobile/AndroidManifest.xml b/mobile/AndroidManifest.xml
index b48a3c11..4e1d59c5 100644
--- a/mobile/AndroidManifest.xml
+++ b/mobile/AndroidManifest.xml
@@ -2,8 +2,8 @@
+ android:versionCode="103"
+ android:versionName="0.25.1">
Date: Thu, 17 Sep 2015 16:51:41 +0100
Subject: [PATCH 65/86] bump version after release
---
main.js | 2 +-
mobile/AndroidManifest.xml | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/main.js b/main.js
index 0b8c9539..8b81085a 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.25.1.@@DATETIMEVERSION@@
+// @version 0.25.2.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
diff --git a/mobile/AndroidManifest.xml b/mobile/AndroidManifest.xml
index 4e1d59c5..aefbd9f8 100644
--- a/mobile/AndroidManifest.xml
+++ b/mobile/AndroidManifest.xml
@@ -2,8 +2,8 @@
+ android:versionCode="104"
+ android:versionName="0.25.2">
Date: Thu, 17 Sep 2015 17:33:40 +0100
Subject: [PATCH 66/86] website: update for minor release
---
website/page/home.php | 2 ++
website/page/news.php | 3 +++
2 files changed, 5 insertions(+)
diff --git a/website/page/home.php b/website/page/home.php
index 9c606346..7a141575 100644
--- a/website/page/home.php
+++ b/website/page/home.php
@@ -29,5 +29,7 @@ won't work on these as they don't contain enough information
even when you zoom out
and other tweaks/bugfixes
+Update 17th September 2015
+IITC 0.25.1 released. This fixes search not working after MapQuest made a change to their API.
Older news
diff --git a/website/page/news.php b/website/page/news.php
index 97642796..e58c0c39 100644
--- a/website/page/news.php
+++ b/website/page/news.php
@@ -16,6 +16,9 @@ won't work on these as they don't contain enough information
even when you zoom out
and other tweaks/bugfixes
+Update 17th September 2015
+IITC 0.25.1 released. This fixes search not working after MapQuest made a change to their API.
+
27th June 2015
From c91e461a1e9feb72822e7762aaa6c5a7d8ffdcfc Mon Sep 17 00:00:00 2001
From: Michael Dever
Date: Mon, 5 Oct 2015 22:19:13 +0100
Subject: [PATCH 67/86] Fix grammer issue in #1012
---
code/send_request.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/send_request.js b/code/send_request.js
index f11bdc05..be6d5712 100644
--- a/code/send_request.js
+++ b/code/send_request.js
@@ -95,7 +95,7 @@ window.outOfDateUserPrompt = function()
dialog({
title: 'Reload IITC',
- html: 'IITC is using an outdated version code. This will happen when Niantic update the standard intel site.
'
+ html: 'IITC is using an outdated version code. This will happen when Niantic updates the standard intel site.
'
+'You need to reload the page to get the updated changes.
'
+'If you have just reloaded the page, then an old version of the standard site script is cached somewhere.'
+'In this case, try clearing your cache, or waiting 15-30 minutes for the stale data to expire.
',
From 6f8fbe60d38b01782b8d92bdc20fa4470645f186 Mon Sep 17 00:00:00 2001
From: Michael Dever
Date: Mon, 5 Oct 2015 22:26:30 +0100
Subject: [PATCH 68/86] Remove unreachable return statement, fixing #1043
---
external/s2geometry.js | 2 --
1 file changed, 2 deletions(-)
diff --git a/external/s2geometry.js b/external/s2geometry.js
index 4f7976e7..d6b6841a 100644
--- a/external/s2geometry.js
+++ b/external/s2geometry.js
@@ -212,8 +212,6 @@ S2.S2Cell.FromLatLng = function(latLng,level) {
var ij = STToIJ(st,level);
return S2.S2Cell.FromFaceIJ (faceuv[0], ij, level);
-
- return result;
};
S2.S2Cell.FromFaceIJ = function(face,ij,level) {
From 2f781dab81eebdb96828716023903b682d4c3e5d Mon Sep 17 00:00:00 2001
From: Jon Atkins
Date: Thu, 8 Oct 2015 16:06:47 +0100
Subject: [PATCH 69/86] trying alternative startup code - actually checks for
PLAYER being set - and just accesses it directly rather than messing around
parsing