From 27bb6f058e24f449e61ca0313a558bb4f5486f70 Mon Sep 17 00:00:00 2001 From: Mike Castle Date: Fri, 22 Nov 2013 23:31:05 -0800 Subject: [PATCH 01/12] Spell checking, d-g. --- code/boot.js | 2 +- code/map_data_cache.js | 2 +- code/map_data_render.js | 2 +- external/L.Geodesic.js | 4 ++-- mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java | 2 +- mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java | 4 ++-- plugins/ap-list.user.js | 2 +- plugins/basemap-yandex.user.js | 2 +- plugins/bookmarks-by-zaso.user.js | 2 +- plugins/keys.user.js | 2 +- plugins/portals-list.user.js | 2 +- plugins/scoreboard.user.js | 2 +- plugins/show-address.user.js | 2 +- plugins/sync.user.js | 6 +++--- 14 files changed, 18 insertions(+), 18 deletions(-) diff --git a/code/boot.js b/code/boot.js index 7d39eceb..d4120b2f 100644 --- a/code/boot.js +++ b/code/boot.js @@ -163,7 +163,7 @@ window.setupMap = function() { if(!isLayerGroupDisplayed('Links', true)) hiddenLayer.push(linksLayer); // faction-specific layers - // these layers don't actually contain any data. instead, everytime they're added/removed from the map, + // these layers don't actually contain any data. instead, every time they're added/removed from the map, // the matching sub-layers within the above portals/fields/links are added/removed from their parent with // the below 'onoverlayadd/onoverlayremovve' events var factionLayers = [L.layerGroup(), L.layerGroup(), L.layerGroup()]; diff --git a/code/map_data_cache.js b/code/map_data_cache.js index a04070fc..f5b90579 100644 --- a/code/map_data_cache.js +++ b/code/map_data_cache.js @@ -5,7 +5,7 @@ window.DataCache = function() { // stock site nemesis.dashboard.DataManager.CACHE_EXPIRY_MS_ = 18E4 - so should be 2 mins cache time this.REQUEST_CACHE_FRESH_AGE = 120; // if younger than this, use data in the cache rather than fetching from the server - // stale cache entries can be updated (that's what the optional 'timestampMs' field in getThinnedEntnties is + // stale cache entries can be updated (that's what the optional 'timestampMs' field in getThinnedEntities is // for, retrieving deltas) so use a long max age to take advantage of this // however, ther must be an overall limit on the maximum age of data from the servers, otherwise the deletedEntity // entries would grow indefinitely. an hour seems reasonable from experience with the data, so 55 mins max cache time diff --git a/code/map_data_render.js b/code/map_data_render.js index e88a7a39..1a651875 100644 --- a/code/map_data_render.js +++ b/code/map_data_render.js @@ -7,7 +7,7 @@ window.Render = function() { // when there are lots of portals close together, we only add some of them to the map // the idea is to keep the impression of the dense set of portals, without rendering them all - this.CLUSTER_SIZE = L.Browser.mobile ? 16 : 8; // the map is divited into squares of this size in pixels for clustering purposes. mobile uses larger markers, so therefore larger clustering areas + this.CLUSTER_SIZE = L.Browser.mobile ? 16 : 8; // the map is divided into squares of this size in pixels for clustering purposes. mobile uses larger markers, so therefore larger clustering areas this.CLUSTER_PORTAL_LIMIT = 4; // no more than this many portals are drawn in each cluster square // link length, in pixels, to be visible. use the portal cluster size, as shorter than this is likely hidden diff --git a/external/L.Geodesic.js b/external/L.Geodesic.js index 05a5f930..20955133 100644 --- a/external/L.Geodesic.js +++ b/external/L.Geodesic.js @@ -88,9 +88,9 @@ Modified by qnstie 2013-07-17 to maintain compatibility with Leaflet.draw latlngs[i] = L.latLng(latlngs[i]); } - // geodrsic calculations have issues when crossing the anti-meridian. so offset the points + // geodesic calculations have issues when crossing the anti-meridian. so offset the points // so this isn't an issue, then add back the offset afterwards - // a center longitude would be ideal - but the start point logitude will be 'good enougn' + // a center longitude would be ideal - but the start point logitude will be 'good enough' var lngOffset = latlngs[0].lng; // points are wrapped after being offset relative to the first point coordinate, so they're diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java b/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java index e9e45845..92bcc447 100644 --- a/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java +++ b/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java @@ -527,7 +527,7 @@ public class IITC_Mobile extends Activity implements OnSharedPreferenceChangeLis } } - // vp=f enables mDesktopMode mode...vp=m is the defaul mobile view + // vp=f enables mDesktopMode mode...vp=m is the default mobile view private String addUrlParam(String url) { if (mDesktopMode) { return (url + "?vp=f"); diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java b/mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java index 6ef09738..f1e8af47 100644 --- a/mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java +++ b/mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java @@ -289,9 +289,9 @@ public class IITC_WebViewClient extends WebViewClient { return new WebResourceResponse("text/css", "UTF-8", STYLE); // } else if (url.contains("gen_dashboard.js")) { // // define initialize function to get rid of JS ReferenceError on intel page's 'onLoad' -// String gen_dashboad_replacement = "window.initialize = function() {}"; +// String gen_dashboard_replacement = "window.initialize = function() {}"; // return new WebResourceResponse("text/javascript", "UTF-8", -// new ByteArrayInputStream(gen_dashboad_replacement.getBytes())); +// new ByteArrayInputStream(gen_dashboard_replacement.getBytes())); } else if (url.contains("/css/ap_icons.css") || url.contains("/css/map_icons.css") || url.contains("/css/common.css") diff --git a/plugins/ap-list.user.js b/plugins/ap-list.user.js index 8f34e0e7..9a2b99bd 100644 --- a/plugins/ap-list.user.js +++ b/plugins/ap-list.user.js @@ -579,7 +579,7 @@ window.plugin.apList.getShieldsEffect = function(portal) { // Sorting done by loop through the options, get the property by // property chain of each option, compare the property of two object // with the ordering of option and return the result when the first -// differece is found. +// difference is found. window.plugin.apList.comparePortal = function(a,b) { var result = 0; var options = plugin.apList.sortOptions[plugin.apList.sortBy]; diff --git a/plugins/basemap-yandex.user.js b/plugins/basemap-yandex.user.js index 5e65092e..88c07573 100644 --- a/plugins/basemap-yandex.user.js +++ b/plugins/basemap-yandex.user.js @@ -25,7 +25,7 @@ window.plugin.mapTileYandex = function() {}; window.plugin.mapTileYandex.setup = function() { //a few options on language are available, including en-US. Oddly, the detail available on the maps varies -//dependong on the language +//depending on the language var yandexApiJs = '//api-maps.yandex.ru/2.0-stable/?load=package.standard&lang=ru-RU' load(yandexApiJs).thenRun(window.plugin.mapTileYandex.addLayer); diff --git a/plugins/bookmarks-by-zaso.user.js b/plugins/bookmarks-by-zaso.user.js index ef694fcc..e59b4a32 100644 --- a/plugins/bookmarks-by-zaso.user.js +++ b/plugins/bookmarks-by-zaso.user.js @@ -730,7 +730,7 @@ window.plugin.bookmarks.syncCallback = function(pluginName, fieldName, e, fullUpdated) { if(fieldName === window.plugin.bookmarks.KEY.field) { window.plugin.bookmarks.storeLocal(window.plugin.bookmarks.KEY); - // All data is replaced if other client update the data duing this client offline, + // All data is replaced if other client update the data during this client offline, if(fullUpdated) { window.plugin.bookmarks.refreshBkmrks(); return; diff --git a/plugins/keys.user.js b/plugins/keys.user.js index bd9984a7..d1aa488a 100644 --- a/plugins/keys.user.js +++ b/plugins/keys.user.js @@ -107,7 +107,7 @@ window.plugin.keys.registerFieldForSyncing = function() { window.plugin.keys.syncCallback = function(pluginName, fieldName, e, fullUpdated) { if(fieldName === 'keys') { plugin.keys.storeLocal(plugin.keys.KEY); - // All data is replaced if other client update the data duing this client offline, + // All data is replaced if other client update the data during this client offline, // fire 'pluginKeysRefreshAll' to notify a full update if(fullUpdated) { plugin.keys.updateDisplayCount(); diff --git a/plugins/portals-list.user.js b/plugins/portals-list.user.js index a39c50b9..8031be7b 100644 --- a/plugins/portals-list.user.js +++ b/plugins/portals-list.user.js @@ -355,7 +355,7 @@ window.plugin.portalslist.stats = function(sortBy) { return html; } -// A little helper functon so the above isn't so messy +// A little helper function so the above isn't so messy window.plugin.portalslist.portalTableSort = function(name, by) { var retVal = 'data-sort="' + name + '"'; if(name === by) { diff --git a/plugins/scoreboard.user.js b/plugins/scoreboard.user.js index 7aa1756e..d80cc819 100644 --- a/plugins/scoreboard.user.js +++ b/plugins/scoreboard.user.js @@ -216,7 +216,7 @@ window.plugin.scoreboard.playerTable = function(sortBy) { return scoreHtml; } -// A little helper functon so the above isn't so messy +// A little helper function so the above isn't so messy window.plugin.scoreboard.playerTableSort = function(name, by) { var retVal = 'data-sort="' + name + '"'; if(name === by) { diff --git a/plugins/show-address.user.js b/plugins/show-address.user.js index b4765ce5..8b938a77 100644 --- a/plugins/show-address.user.js +++ b/plugins/show-address.user.js @@ -22,7 +22,7 @@ window.plugin.portalAddress = function() {}; window.plugin.portalAddress.portalDetail = function(data) { - // If there's 4 sets of comma delimieted info the last one is the + // If there's 4 sets of comma delimited info the last one is the // country, so get rid of it. If the country is in the [2] then it // doesn't matter because address is usually short enough to fit. var d = data.portalDetails.portalV2; diff --git a/plugins/sync.user.js b/plugins/sync.user.js index 24a5a6c7..0cf0961d 100644 --- a/plugins/sync.user.js +++ b/plugins/sync.user.js @@ -60,7 +60,7 @@ window.plugin.sync.updateMap = function(pluginName, fieldName, keyArray) { // example: plugin.sync.registerMapForSync('keys', 'keysdata', plugin.keys.updateCallback, plugin.keys.initializedCallback) // which register plugin.keys.keysdata // -// updateCallback function format: function(pluginName, fieldName, eventObejct, fullUpdated) +// updateCallback function format: function(pluginName, fieldName, eventObject, fullUpdated) // updateCallback will be fired when local or remote pushed update to Google Realtime API // fullUpdated is true when remote update occur during local client offline, all data is replaced by remote data // eventObject is a ValueChangedEvent, is null if fullUpdated is true @@ -68,7 +68,7 @@ window.plugin.sync.updateMap = function(pluginName, fieldName, keyArray) { // detail of ValueChangedEvent refer to following url // https://developers.google.com/drive/realtime/reference/gapi.drive.realtime.ValueChangedEvent // -// initializedCallback funciton format: function(pluginName, fieldName) +// initializedCallback function format: function(pluginName, fieldName) // initializedCallback will be fired when the CollaborativeMap finished initialize and good to use window.plugin.sync.registerMapForSync = function(pluginName, fieldName, callback, initializedCallback) { var options, registeredMap; @@ -244,7 +244,7 @@ window.plugin.sync.RegisteredMap.prototype.loadRealtimeDocument = function(callb } else if(e.type === gapi.drive.realtime.ErrorType.NOT_FOUND) { _this.forceFileSearch = true; } else if(e.type === gapi.drive.realtime.ErrorType.CLIENT_ERROR) { - // Workaround: if Realtime API open a second docuemnt and the file do not exist, + // Workaround: if Realtime API open a second document and the file do not exist, // it will rasie 'CLIENT_ERROR' instead of 'NOT_FOUND'. So we do a force file search here. _this.forceFileSearch = true; } else { From e6305a0aa97d5da658720cae046d3f07ed25d298 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Sat, 23 Nov 2013 09:01:22 +0000 Subject: [PATCH 02/12] getAvgResDist - return a small, but non-zero, value for zero distance resonator deployments (zero is already assumed to be no resonators deployed) portal-highlighter-bad-deployment-distance: highlight colour based on resonatror range: purple: likely 0m deployment (spoofer?), red <10m, orange under 24m, yellow under 36m otherwise no highlight --- code/portal_info.js | 4 +++- ...portal-highlighter-bad-deployment-distance.user.js | 11 +++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/code/portal_info.js b/code/portal_info.js index 569f8f0f..fd27b4ee 100644 --- a/code/portal_info.js +++ b/code/portal_info.js @@ -91,7 +91,9 @@ window.getAvgResoDist = function(d) { var sum = 0, resos = 0; $.each(d.resonatorArray.resonators, function(ind, reso) { if(!reso) return true; - sum += parseInt(reso.distanceToPortal); + var resDist = parseInt(reso.distanceToPortal); + if (resDist == 0) resDist = 0.01; // set a non-zero but very small distance for zero deployment distance. allows the return value to distinguish between zero deployment distance average and zero resonators + sum += resDist; resos++; }); return resos ? sum/resos : 0; diff --git a/plugins/portal-highlighter-bad-deployment-distance.user.js b/plugins/portal-highlighter-bad-deployment-distance.user.js index 2f44eb32..73c0cc3b 100644 --- a/plugins/portal-highlighter-bad-deployment-distance.user.js +++ b/plugins/portal-highlighter-bad-deployment-distance.user.js @@ -2,7 +2,7 @@ // @id iitc-plugin-highlight-bad-deployment-distance@cathesaurus // @name IITC plugin: highlight badly-deployed portals // @category Highlighter -// @version 0.1.0.@@DATETIMEVERSION@@ +// @version 0.1.1.@@DATETIMEVERSION@@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ // @downloadURL @@DOWNLOADURL@@ @@ -25,12 +25,15 @@ window.plugin.portalHighlighterBadDeploymentDistance.highlight = function(data) var d = data.portal.options.details; var portal_deployment = 0; if(getTeam(d) !== 0) { - if(window.getAvgResoDist(d) > 0 && window.getAvgResoDist(d) < window.HACK_RANGE*0.9) { - portal_deployment = (window.HACK_RANGE - window.getAvgResoDist(d))/window.HACK_RANGE; + var avgDist = window.getAvgResoDist(d); + if(avgDist > 0 && avgDist < window.HACK_RANGE*0.9) { + portal_deployment = (window.HACK_RANGE - avgDist)/window.HACK_RANGE; } if(portal_deployment > 0) { var fill_opacity = portal_deployment*.85 + .15; - color = 'red'; + // magenta for *exceptionally* close deployments (spoofing? under 1m average), then shades of + // red, orange and yellow for further out + color = avgDist < 1 ? 'magenta' : avgDist < (window.HACK_RANGE*.25) ? 'red' : avgDist < (window.HACK_RANGE*.6) ? 'orange' : 'yellow'; var params = {fillColor: color, fillOpacity: fill_opacity}; data.portal.setStyle(params); } From 44ee4c7200c8d8e318732323d2d515118731b247 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Sun, 24 Nov 2013 01:03:45 +0000 Subject: [PATCH 03/12] request munging: call the stock site nemesis.dashboard.requests.normalizeParamCount function, to add in dummy parameters to requests for #656 number 1 --- code/munge.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/code/munge.js b/code/munge.js index 9641cc16..56fe5a96 100644 --- a/code/munge.js +++ b/code/munge.js @@ -326,6 +326,16 @@ window.requestDataMunge = function(data) { }; var newdata = munge(data); + + try { + newdata = nemesis.dashboard.requests.normalizeParamCount(newdata); + } catch(e) { + if (!window._mungeHaveLoggedError) { + console.warn('Failed to call the stock site normalizeParamCount() function: '+e); + window._mungeHaveLoggedError = true; + } + } + return newdata; } From 1501f98f9ba5bb3c154045c003b3f573f5e7a868 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Sun, 24 Nov 2013 01:04:45 +0000 Subject: [PATCH 04/12] limit the number of player names resolved in one go, to prevent excessive requests for #656 number 4 --- code/player_names.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/player_names.js b/code/player_names.js index 7914c706..e9475a03 100644 --- a/code/player_names.js +++ b/code/player_names.js @@ -66,6 +66,12 @@ window.resolvePlayerNames = function() { //limit per request. stock site is never more than 13 (8 res, 4 mods, owner) //testing shows 15 works and 20 fails var MAX_RESOLVE_PLAYERS_PER_REQUEST = 15; + var MAX_RESOLVE_REQUESTS = 8; + + if (window.playersToResolve.length > MAX_RESOLVE_PLAYERS_PER_REQUEST*MAX_RESOLVE_REQUESTS) { + console.log('Warning: player name resolve queue had '+window.playersToResolve.length+' entries. Limiting to the first '+MAX_RESOLVE_PLAYERS_PER_REQUEST*MAX_RESOLVE_REQUESTS+' to prevent excessive requests'); + window.playersToResolve = playersToResolve.slice(0,MAX_RESOLVE_PLAYERS_PER_REQUEST*MAX_RESOLVE_REQUESTS); + } var p = window.playersToResolve.slice(0,MAX_RESOLVE_PLAYERS_PER_REQUEST); window.playersToResolve = playersToResolve.slice(MAX_RESOLVE_PLAYERS_PER_REQUEST); From d58ba079b8fd91b36fba100074168781e22c9373 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Sun, 24 Nov 2013 01:32:46 +0000 Subject: [PATCH 05/12] COMM: correctly use the ascendingTimestampOrder flag when retrieving new COMM messages. this matches the stock intel site, and prevents gaps occuring when filling in entries after resuming from idle related to #656 no 2 --- code/chat.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/chat.js b/code/chat.js index fc88c670..2c3779fa 100644 --- a/code/chat.js +++ b/code/chat.js @@ -106,6 +106,9 @@ window.chat.genPostData = function(isFaction, storageHash, getOlderMsgs) { // Currently this edge case is not handled. Let’s see if this is a // problem in crowded areas. $.extend(data, {minTimestampMs: min}); + // when requesting with an acutal minimum timestamp, request oldest rather than newest first. + // this matches the stock intel site, and ensures no gaps when continuing after an extended idle period + if (min > -1) $.extend(data, {ascendingTimestampOrder: true}); } return data; } From 1bfe89c041281135074f383f6835d06f3e093c8e Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Sun, 24 Nov 2013 01:34:13 +0000 Subject: [PATCH 06/12] reduce the number of 'all' comm messages retrieved in one go to 50 at a time related to #656 no 2 --- main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.js b/main.js index c0645c7b..3600df45 100644 --- a/main.js +++ b/main.js @@ -142,7 +142,7 @@ window.CHAT_MIN_RANGE = 6; window.VIEWPORT_PAD_RATIO = 0.3; // how many items to request each query -window.CHAT_PUBLIC_ITEMS = 200; +window.CHAT_PUBLIC_ITEMS = 50; window.CHAT_FACTION_ITEMS = 50; // how many pixels to the top before requesting new data window.CHAT_REQUEST_SCROLL_TOP = 200; From 47d453793c95fb1a68c45d800d0dd61ada7c6f97 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Sun, 24 Nov 2013 01:48:00 +0000 Subject: [PATCH 07/12] re-order the common method name & version parameters in the JSON requests to match the stock intel site for #656 --- code/utils_misc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/utils_misc.js b/code/utils_misc.js index 7933f3bc..f4c0d8c7 100644 --- a/code/utils_misc.js +++ b/code/utils_misc.js @@ -146,7 +146,7 @@ window.postAjax = function(action, data, success, error) { // and of the 'version' parameter (we assume it's a version - if missing/wrong that's what the error refers to) versionStr = mungeOneString(versionStr); - var post_data = JSON.stringify(window.requestDataMunge($.extend({method: methodName, version: versionStr}, data))); + var post_data = JSON.stringify(window.requestDataMunge($.extend({}, data, {method: methodName, version: versionStr}))); var remove = function(data, textStatus, jqXHR) { window.requests.remove(jqXHR); }; var errCnt = function(jqXHR) { window.failedRequestCount++; window.requests.remove(jqXHR); }; var result = $.ajax({ From bba65198600014a3c193f063967e3bf153d4d251 Mon Sep 17 00:00:00 2001 From: Mike Castle Date: Sat, 23 Nov 2013 19:16:20 -0800 Subject: [PATCH 08/12] Spell checking, h-r. --- build.py | 2 +- code/chat.js | 2 +- code/game_status.js | 2 +- code/map_data_request.js | 8 ++++---- code/munge.js | 12 ++++++------ code/utils_misc.js | 2 +- external/leaflet.draw.js | 6 +++--- mobile/src/com/cradle/iitc_mobile/IITC_WebView.java | 2 +- plugins/ap-list.user.js | 4 ++-- plugins/bookmarks-by-zaso.user.js | 2 +- plugins/player-tracker.user.js | 2 +- plugins/portal-highlighter-can-make-level.user.js | 2 +- website/code/desktop-download.php | 2 +- website/code/url/url_to_absolute.php | 2 +- website/page/home.php | 2 +- website/page/news.php | 2 +- 16 files changed, 27 insertions(+), 27 deletions(-) diff --git a/build.py b/build.py index ed01442e..97f808e6 100755 --- a/build.py +++ b/build.py @@ -121,7 +121,7 @@ def loaderMD(var): filemd5 = hashlib.md5(file.encode('utf8')).hexdigest() # check if file has already been parsed by the github api if fn in files and filemd5 in files[fn]: - # use the stored copy if nothing has changed to avoid hiting the api more then the 60/hour when not signed in + # use the stored copy if nothing has changed to avoid hitting the api more then the 60/hour when not signed in db.close() return files[fn][filemd5] else: diff --git a/code/chat.js b/code/chat.js index fc88c670..0f90fceb 100644 --- a/code/chat.js +++ b/code/chat.js @@ -90,7 +90,7 @@ window.chat.genPostData = function(isFaction, storageHash, getOlderMsgs) { } else { // ask for newer chat var min = storageHash.newestTimestamp; - // the inital request will have both timestamp values set to -1, + // the initial request will have both timestamp values set to -1, // thus we receive the newest desiredNumItems. After that, we will // only receive messages with a timestamp greater or equal to min // above. diff --git a/code/game_status.js b/code/game_status.js index a7ca60f0..10fe8d2c 100644 --- a/code/game_status.js +++ b/code/game_status.js @@ -11,7 +11,7 @@ window.updateGameScore = function(data) { } // hacky - but here is as good as any for a location - // the niantic servers have attempted to obsfucate the client/server protocol, by munging the request parameters + // the niantic servers have attempted to obfuscate the client/server protocol, by munging the request parameters // detecting which munge set should be used is tricky - even the stock site gets it wrong sometimes // to detect the problem and try a different set is easiest in a place where there's only a single request of that type // sent at once, and it has no extra parameters. this method matches those requirements diff --git a/code/map_data_request.js b/code/map_data_request.js index 6e4123e0..05fa2e94 100644 --- a/code/map_data_request.js +++ b/code/map_data_request.js @@ -27,7 +27,7 @@ window.MapDataRequest = function() { // try to maintain at least this may tiles in each request, by reducing the number of requests as needed this.MIN_TILES_PER_REQUEST = 4; - // number of times to retty a tile after a 'bad' error (i.e. not a timeout) + // number of times to retry a tile after a 'bad' error (i.e. not a timeout) this.MAX_TILE_RETRIES = 3; // refresh timers @@ -44,10 +44,10 @@ window.MapDataRequest = function() { // this gives a chance of other requests finishing, allowing better grouping of retries in new requests this.RUN_QUEUE_DELAY = 0.5; - // delay before re-queueing tiles in failed requests + // delay before requeuing tiles in failed requests this.BAD_REQUEST_REQUEUE_DELAY = 5; // longer delay before retrying a completely failed request - as in this case the servers are struggling - // a delay before processing the queue after requeueing tiles. this gives a chance for other requests to finish + // a delay before processing the queue after requeuing tiles. this gives a chance for other requests to finish // or other requeue actions to happen before the queue is processed, allowing better grouping of requests // however, the queue may be processed sooner if a previous timeout was set this.REQUEUE_DELAY = 1; @@ -451,7 +451,7 @@ window.MapDataRequest.prototype.handleResponse = function (data, tiles, success) var timeoutTiles = []; if (!success || !data || !data.result) { - console.warn("Request.handleResponse: request failed - requeing..."); + console.warn("Request.handleResponse: request failed - requeuing..."); //request failed - requeue all the tiles(?) diff --git a/code/munge.js b/code/munge.js index 9641cc16..deb96c28 100644 --- a/code/munge.js +++ b/code/munge.js @@ -16,7 +16,7 @@ var requestParameterMunges = [ // set 7 - 2013-11-06 { - 'dashboard.getArtifactInfo': 'artifacts', // GET_ARTIFACT_INFO: new (and not obfsucated?!) + 'dashboard.getArtifactInfo': 'artifacts', // GET_ARTIFACT_INFO: new (and not obfuscated?!) 'dashboard.getGameScore': 'yol4dxx5ufqolhk2', // GET_GAME_SCORE 'dashboard.getPaginatedPlextsV2': '7b83j2z81rtk6101', // GET_PAGINATED_PLEXTS 'dashboard.getThinnedEntitiesV4': '46su4lrisoq28gxh', // GET_THINNED_ENTITIES @@ -59,7 +59,7 @@ var requestParameterMunges = [ // set 8 - 2013-11-07 { - 'dashboard.getArtifactInfo': 'artifacts', // GET_ARTIFACT_INFO: new (and not obfsucated?!) + 'dashboard.getArtifactInfo': 'artifacts', // GET_ARTIFACT_INFO: new (and not obfuscated?!) 'dashboard.getGameScore': 'lls4clhel87apzpa', // GET_GAME_SCORE 'dashboard.getPaginatedPlextsV2': 'r6n2xgcd8wjsm4og', // GET_PAGINATED_PLEXTS 'dashboard.getThinnedEntitiesV4': '1ybigzcf2sifu34b', // GET_THINNED_ENTITIES @@ -102,7 +102,7 @@ var requestParameterMunges = [ // set 9 - 2013-11-1 { - 'dashboard.getArtifactInfo': 'artifacts', // GET_ARTIFACT_INFO: new (and not obfsucated?!) + 'dashboard.getArtifactInfo': 'artifacts', // GET_ARTIFACT_INFO: new (and not obfuscated?!) 'dashboard.getGameScore': '9w8phj2dccvns3t9', // GET_GAME_SCORE 'dashboard.getPaginatedPlextsV2': '3b1nc3ub0sd1704x', // GET_PAGINATED_PLEXTS 'dashboard.getThinnedEntitiesV4': '2xa55qj41qrhfhas', // GET_THINNED_ENTITIES @@ -149,9 +149,9 @@ var requestParameterMunges = [ var activeRequestMungeSet = undefined; -// in the recent stock site updates, their javascript code has been less obsfucated, but also the munge parameters +// in the recent stock site updates, their javascript code has been less obfuscated, but also the munge parameters // change on every release. I can only assume it's now an integrated step in the build/release system, rather -// than continued efforts to block iitc. the lighter obsfucation on the code makes it easier to parse and find +// than continued efforts to block iitc. the lighter obfuscation on the code makes it easier to parse and find // the munges in the code - so let's attempt that function extractMungeFromStock() { try { @@ -216,7 +216,7 @@ function extractMungeFromStock() { foundMunges.latE6 = result[3] || result[4]; foundMunges.lngE6 = result[5] || result[6]; var chatTab = result[7] || result[8]; - if (chatTab != foundMunges.chatTab) throw 'Error: inconsistant munge parsing for chatTab'; + if (chatTab != foundMunges.chatTab) throw 'Error: inconsistent munge parsing for chatTab'; // LOOKUP_PLAYERS var reg = new RegExp('LOOKUP_PLAYERS, {'+mungeRegExpLit+'a}'); diff --git a/code/utils_misc.js b/code/utils_misc.js index 7933f3bc..11ff7a30 100644 --- a/code/utils_misc.js +++ b/code/utils_misc.js @@ -283,7 +283,7 @@ window.getPortalDataZoom = function() { // (mobile: a float somehow gets through in some cases!) var z = parseInt(mapZoom); - // limiting the mazimum zoom level for data retrieval reduces the number of requests at high zoom levels + // limiting the maximum zoom level for data retrieval reduces the number of requests at high zoom levels // (as all portal data is retrieved at z=17, why retrieve multiple z=18 tiles when fewer z=17 would do?) // very effective along with the new cache code if (z > 17) z=17; diff --git a/external/leaflet.draw.js b/external/leaflet.draw.js index acd64e15..cf479e6b 100644 --- a/external/leaflet.draw.js +++ b/external/leaflet.draw.js @@ -201,7 +201,7 @@ L.Draw.Polyline = L.Draw.Feature.extend({ fill: false, clickable: true }, - metric: true, // Whether to use the metric meaurement system or imperial + metric: true, // Whether to use the metric measurement system or imperial zIndexOffset: 2000 // This should be > than the highest z-index any map layers }, @@ -808,7 +808,7 @@ L.Draw.Circle = L.Draw.SimpleShape.extend({ fillOpacity: 0.2, clickable: true }, - metric: true // Whether to use the metric meaurement system or imperial + metric: true // Whether to use the metric measurement system or imperial }, initialize: function (map, options) { @@ -2523,7 +2523,7 @@ L.EditToolbar.Edit = L.Handler.extend({ pathOptions; // Don't do anything if this layer is a marker but doesn't have an icon. Markers - // should usually have icons. If using Leaflet.draw with Leafler.markercluster there + // should usually have icons. If using Leaflet.draw with Leaflet.markercluster there // is a chance that a marker doesn't. if (isMarker && !layer._icon) { return; diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_WebView.java b/mobile/src/com/cradle/iitc_mobile/IITC_WebView.java index 5dfc2ed2..c0c0fccf 100644 --- a/mobile/src/com/cradle/iitc_mobile/IITC_WebView.java +++ b/mobile/src/com/cradle/iitc_mobile/IITC_WebView.java @@ -175,7 +175,7 @@ public class IITC_WebView extends WebView { // if in edit text mode, don't load javascript otherwise the keyboard closes. HitTestResult testResult = getHitTestResult(); if (testResult != null && testResult.getType() == HitTestResult.EDIT_TEXT_TYPE) { - // let window.show(...) interupt input + // let window.show(...) interrupt input // window.show(...) is called if one of the action bar buttons // is clicked if (!js.startsWith("window.show(")) { diff --git a/plugins/ap-list.user.js b/plugins/ap-list.user.js index 9a2b99bd..4fc2bb23 100644 --- a/plugins/ap-list.user.js +++ b/plugins/ap-list.user.js @@ -592,7 +592,7 @@ window.plugin.apList.comparePortal = function(a,b) { aProperty = aProperty[propertyName]; bProperty = bProperty[propertyName]; }); - // compare next porperty if equal + // compare next property if equal if(aProperty === bProperty) return true; result = (aProperty > bProperty ? 1 : -1) * option.order; @@ -619,7 +619,7 @@ window.plugin.apList.disableCache = function() { window.plugin.apList.selectPortal = function(guid) { // Add error catching to avoid following link of portal if error - // occured in renderPortalDetails or hooked plugin + // occurred in renderPortalDetails or hooked plugin try { renderPortalDetails(guid); } catch(e) { diff --git a/plugins/bookmarks-by-zaso.user.js b/plugins/bookmarks-by-zaso.user.js index e59b4a32..9044b01d 100644 --- a/plugins/bookmarks-by-zaso.user.js +++ b/plugins/bookmarks-by-zaso.user.js @@ -916,7 +916,7 @@ // Fired when a bookmarks/folder is removed, added or sorted, also when a folder is opened/closed. if($.inArray('pluginBkmrksEdit', window.VALID_HOOKS) < 0) { window.VALID_HOOKS.push('pluginBkmrksEdit'); } - // Fired when the "Bookmarks Options" panell is opened (you can add new options); + // Fired when the "Bookmarks Options" panel is opened (you can add new options); if($.inArray('pluginBkmrksOpenOpt', window.VALID_HOOKS) < 0) { window.VALID_HOOKS.push('pluginBkmrksOpenOpt'); } // Fired when the sync is finished; if($.inArray('pluginBkmrksSyncEnd', window.VALID_HOOKS) < 0) { window.VALID_HOOKS.push('pluginBkmrksSyncEnd'); } diff --git a/plugins/player-tracker.user.js b/plugins/player-tracker.user.js index 0e9bf789..d7fa45c5 100644 --- a/plugins/player-tracker.user.js +++ b/plugins/player-tracker.user.js @@ -303,7 +303,7 @@ window.plugin.playerTracker.drawData = function() { var last = playerData.events[evtsLength-1]; var ago = plugin.playerTracker.ago; - // tooltip for marker - no HYML - and not shown on touchscreen devices + // tooltip for marker - no HTML - and not shown on touchscreen devices var tooltip = isTouchDev ? '' : (playerData.nick+', '+ago(last.time, now)+' ago'); // popup for marker diff --git a/plugins/portal-highlighter-can-make-level.user.js b/plugins/portal-highlighter-can-make-level.user.js index 2c0a91fe..9514981c 100644 --- a/plugins/portal-highlighter-can-make-level.user.js +++ b/plugins/portal-highlighter-can-make-level.user.js @@ -56,7 +56,7 @@ window.plugin.portalHighligherPortalsCanMakeLevel.getHighlighter = function(lvl) var setup = function() { - // This is the maximum level of a portal a user can be the "last peice of" + // This is the maximum level of a portal a user can be the "last piece of" // yes, even a level 1 can be the difference in bumping a portal up to level 7 var max_can_complete = 7; if(PLAYER.level === 8) { diff --git a/website/code/desktop-download.php b/website/code/desktop-download.php index 5f1046e1..6342c7e7 100644 --- a/website/code/desktop-download.php +++ b/website/code/desktop-download.php @@ -122,7 +122,7 @@ function iitcDesktopPluginDownloadTable ( $build ) # remove 'IITC Plugin: ' prefix if it's there, for neatness $name = preg_replace ( '/^IITC plugin: /i', '', $details['@name'] ); - # format extended version info in less prominant font + # format extended version info in less prominent font $version = preg_replace ( '/^(\d+\.\d+\.\d+)\.(\d{8}\.\d{1,6})/', '\1
.\2', $details['@version'] ); # remove unneeded prefix from description diff --git a/website/code/url/url_to_absolute.php b/website/code/url/url_to_absolute.php index c6df5c24..3a11723b 100644 --- a/website/code/url/url_to_absolute.php +++ b/website/code/url/url_to_absolute.php @@ -444,7 +444,7 @@ function join_url( $parts, $encode=FALSE) * * RFC3986 specifies the allowed characters in the URL as well as * reserved characters in the URL. This function replaces all the - * disallowed characters in the URL with their repective percent + * disallowed characters in the URL with their respective percent * encodings. Already encoded characters are not encoded again, * such as '%20' is not encoded to '%2520'. * diff --git a/website/page/home.php b/website/page/home.php index fd9f2740..077d5d1e 100644 --- a/website/page/home.php +++ b/website/page/home.php @@ -61,7 +61,7 @@ scripts to match.

16th October 2013

-IITC 0.14.3 and IITC MObile 0.7.4 have just been released. This is a critical update required to work with the latest +IITC 0.14.3 and IITC Mobile 0.7.4 have just been released. This is a critical update required to work with the latest changes Niantic have made to the standard intel site. Additionally, the draw-tools plugin now snaps points to portals when creating lines/polygons/markers (was actually in 0.14.2 release), a bugfix relating to IITC not realising who 'you' are, causing some highlighters to break, and a handful of other tweaks/bugfixes. diff --git a/website/page/news.php b/website/page/news.php index 3466bace..54f82cac 100644 --- a/website/page/news.php +++ b/website/page/news.php @@ -48,7 +48,7 @@ scripts to match.

16th October 2013

-IITC 0.14.3 and IITC MObile 0.7.4 have just been released. This is a critical update required to work with the latest +IITC 0.14.3 and IITC Mobile 0.7.4 have just been released. This is a critical update required to work with the latest changes Niantic have made to the standard intel site. Additionally, the draw-tools plugin now snaps points to portals when creating lines/polygons/markers (was actually in 0.14.2 release), a bugfix relating to IITC not realising who 'you' are, causing some highlighters to break, and a handful of other tweaks/bugfixes. From 27806a3be7545279da7d5ff12fe8772d8859a73f Mon Sep 17 00:00:00 2001 From: Mike Castle Date: Sat, 23 Nov 2013 19:24:43 -0800 Subject: [PATCH 09/12] Spell check, missed one. --- code/map_data_request.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/map_data_request.js b/code/map_data_request.js index 05fa2e94..cc9ab868 100644 --- a/code/map_data_request.js +++ b/code/map_data_request.js @@ -267,7 +267,7 @@ window.MapDataRequest.prototype.refresh = function() { // so as far as plugins are concerned, it should be treated as a finished request window.runHooks('requestFinished', {success: true}); - console.log ('done request preperation (cleared out-of-bounds and invalid for zoom, and rendered cached data)'); + console.log ('done request preparation (cleared out-of-bounds and invalid for zoom, and rendered cached data)'); if (Object.keys(this.queuedTiles).length > 0) { // queued requests - don't start processing the download queue immediately - start it after a short delay From f22d185b5b90330b41391557ac5673e650e7ace4 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Sun, 24 Nov 2013 04:59:41 +0000 Subject: [PATCH 10/12] updates to the portal detail level handling - iitc now defaults to lower detail than the standard intel site when zoomed out - it loads much faster, shows more than enough for general use, and is less likely to trigger 'excessive requests' issues - show more portals plugin: updated for interface changes - show-less-portals-zoomed-out: deleted (this is now the IITC default) - new plugin: default-intel-detail - restores the original IITC behaviour on zoom to portal detail level mapping. not recommended for #656 number 3 --- code/map_data_request.js | 4 +- code/request_handling.js | 8 +-- code/utils_misc.js | 35 +++----------- plugins/default-intel-detail.user.js | 51 ++++++++++++++++++++ plugins/show-less-portals-zoomed-out.user.js | 49 ++----------------- plugins/show-more-portals.user.js | 25 ++++------ 6 files changed, 74 insertions(+), 98 deletions(-) create mode 100644 plugins/default-intel-detail.user.js diff --git a/code/map_data_request.js b/code/map_data_request.js index cc9ab868..64ea0d2c 100644 --- a/code/map_data_request.js +++ b/code/map_data_request.js @@ -91,7 +91,7 @@ window.MapDataRequest.prototype.mapMoveStart = function() { window.MapDataRequest.prototype.mapMoveEnd = function() { var bounds = clampLatLngBounds(map.getBounds()); - var zoom = getPortalDataZoom(); + var zoom = map.getZoom(); if (this.fetchedDataParams) { // we have fetched (or are fetching) data... @@ -180,7 +180,7 @@ window.MapDataRequest.prototype.refresh = function() { var bounds = clampLatLngBounds(map.getBounds()); - var zoom = getPortalDataZoom(); + var zoom = map.getZoom(); var minPortalLevel = getMinPortalLevelForZoom(zoom); //DEBUG: resize the bounds so we only retrieve some data diff --git a/code/request_handling.js b/code/request_handling.js index 4ae1d3fb..7dac5a55 100644 --- a/code/request_handling.js +++ b/code/request_handling.js @@ -67,13 +67,7 @@ window.startRefreshTimeout = function(override) { window.requests._quickRefreshPending = false; t = REFRESH*1000; - // new getThinnedEntitiesV4 involves a LOT more requests when zoomed out above a data level of 13 - // so, to give the refresh a chance to complete (and also reduce load on niantic servers), boost the refresh interval - // in this case - // (TODO: complete rewrite of refresh+request handling. don't start timer until complete, and retry error=TIMEOUT requests) - if (getPortalDataZoom() <=12 ) t = t*4; - - var adj = ZOOM_LEVEL_ADJ * (18 - getPortalDataZoom()); + var adj = ZOOM_LEVEL_ADJ * (18 - map.getZoom()); if(adj > 0) t += adj*1000; } var next = new Date(new Date().getTime() + t).toLocaleTimeString(); diff --git a/code/utils_misc.js b/code/utils_misc.js index 2a860341..11ed6545 100644 --- a/code/utils_misc.js +++ b/code/utils_misc.js @@ -276,41 +276,20 @@ window.androidPermalink = function() { } -window.getPortalDataZoom = function() { - var mapZoom = map.getZoom(); - - // make sure we're dealing with an integer here - // (mobile: a float somehow gets through in some cases!) - var z = parseInt(mapZoom); - - // limiting the maximum zoom level for data retrieval reduces the number of requests at high zoom levels - // (as all portal data is retrieved at z=17, why retrieve multiple z=18 tiles when fewer z=17 would do?) - // very effective along with the new cache code - if (z > 17) z=17; - - //sanity check - should never happen - if (z < 0) z=0; - - return z; -} - - window.getMinPortalLevelForZoom = function(z) { - // try to use the zoom-to-level mapping from the stock intel page, if available - var ZOOM_TO_LEVEL; - try { - ZOOM_TO_LEVEL = nemesis.dashboard.zoomlevel.ZOOM_TO_LOD_; - } catch(e) { - //based on code from stock gen_dashboard.js - ZOOM_TO_LEVEL = [8, 8, 8, 8, 7, 7, 6, 6, 5, 4, 4, 3, 3, 2, 2, 1, 1]; - } + + // these values are from the stock intel map. however, they're too detailed for reasonable speed, and increasing + // detail at a higher zoom level shows enough detail still, AND speeds up IITC considerably +//var ZOOM_TO_LEVEL = [8, 8, 8, 8, 7, 7, 6, 6, 5, 4, 4, 3, 3, 2, 2, 1, 1]; + var ZOOM_TO_LEVEL = [8, 8, 8, 8, 8, 8, 7, 7, 6, 5, 4, 4, 3, 2, 2, 1, 1]; + var l = ZOOM_TO_LEVEL[z] || 0; return l; } window.getMinPortalLevel = function() { - var z = getPortalDataZoom(); + var z = map.getZoom(); return getMinPortalLevelForZoom(z); } diff --git a/plugins/default-intel-detail.user.js b/plugins/default-intel-detail.user.js new file mode 100644 index 00000000..8bcc0ef2 --- /dev/null +++ b/plugins/default-intel-detail.user.js @@ -0,0 +1,51 @@ +// ==UserScript== +// @id iitc-plugin-default-intel-detail@jonatkins +// @name IITC plugin: Default intel detail level +// @category Tweaks +// @version 0.1.0.@@DATETIMEVERSION@@ +// @namespace https://github.com/jonatkins/ingress-intel-total-conversion +// @updateURL @@UPDATEURL@@ +// @downloadURL @@DOWNLOADURL@@ +// @description [@@BUILDNAME@@-@@BUILDDATE@@] Use the portal level detail levels from the standard intel site. By default, IITC shows less detail when zoomed out, as this is enough for general use, is more friendly to the niantic servers, and loads much faster. This plugin restores the default zoom level to portal level mapping. Note: using this plugin causes a larger number of requests to the intel server, and at high resolutions can cause excessive requests to be made (yes: the default intel site also has this problem!), so it is not recommended except for low resolution screens. +// @include https://www.ingress.com/intel* +// @include http://www.ingress.com/intel* +// @match https://www.ingress.com/intel* +// @match http://www.ingress.com/intel* +// @grant none +// ==/UserScript== + +@@PLUGINSTART@@ + +// PLUGIN START //////////////////////////////////////////////////////// + + +// use own namespace for plugin +window.plugin.defaultIntelDetail = function() {}; + +window.plugin.defaultIntelDetail.setup = function() { + + var stockIntelDetail = nemesis.dashboard.zoomlevel.ZOOM_TO_LOD_; + + // save the original function - so we can chain to it for levels we don't modify + var origGetMinPortalLevelForZoom = window.getMinPortalLevelForZoom; + + // replace the window.getMinPortalLevelForZoom function - modify behaviour when L1+ or L3+ portals are shown + + window.getMinPortalLevelForZoom = function(z) { + // for the further out zoom levels, use the stock intel site detail levels + if (z <= 11) { + return stockIntelDetail[z]; + } + // for the closer zoom levels, stock intel and IITC default is the same. falling back + // in this case allows this plugin to work alongside show-more-portals + return origGetMinPortalLevelForZoom(z); + } + + +}; + +var setup = window.plugin.defaultIntelDetail.setup; + +// PLUGIN END ////////////////////////////////////////////////////////// + +@@PLUGINEND@@ diff --git a/plugins/show-less-portals-zoomed-out.user.js b/plugins/show-less-portals-zoomed-out.user.js index c701f7a7..ddace55d 100644 --- a/plugins/show-less-portals-zoomed-out.user.js +++ b/plugins/show-less-portals-zoomed-out.user.js @@ -1,12 +1,12 @@ // ==UserScript== // @id iitc-plugin-show-less-portals@jonatkins // @name IITC plugin: Show less portals when zoomed out -// @category Tweaks -// @version 0.1.4.@@DATETIMEVERSION@@ +// @category Deleted +// @version 0.2.0.@@DATETIMEVERSION@@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ // @downloadURL @@DOWNLOADURL@@ -// @description [@@BUILDNAME@@-@@BUILDDATE@@] Decrease the portal detail level used when zoomed out. This can speed up map loading, decrease the amount of data used, and solve excessive request issues. Only applies when zoomed out to show no closer than L3 portals. May stop display of the smaller links/fields. +// @description [@@BUILDNAME@@-@@BUILDDATE@@] IITC now defaults to showing fewer portals when zoomed out, making this plugin unnecessary // @include https://www.ingress.com/intel* // @include http://www.ingress.com/intel* // @match https://www.ingress.com/intel* @@ -14,46 +14,3 @@ // @grant none // ==/UserScript== -@@PLUGINSTART@@ - -// PLUGIN START //////////////////////////////////////////////////////// - - -// use own namespace for plugin -window.plugin.showLessPortals = function() {}; - -window.plugin.showLessPortals.setup = function() { - - // save the original function - so we can chain to it for levels we don't modify - var origGetPortalDataZoom = window.getPortalDataZoom; - - // replace the window.getPortalDataZoom function - modify behaviour when zoomed close - - window.getPortalDataZoom = function() { - var mapZoom = map.getZoom(); - - // the latest intel site update, as of 2013-10-16, requests a silly number of map tiles at the larger zoom levels - // IITC matches the behaviour by default, but it makes sense to reduce the detail level sooner - - // at the largest scale zooms - move back two levels - if (mapZoom <= 7) { - return Math.max(mapZoom-2,0); - } - - // intermediate zoom levels - move back one - if (mapZoom <= 11) { - return Math.max(mapZoom-1,0); - } - - // otherwise revert to default behaviour - return origGetPortalDataZoom(); - } - - -}; - -var setup = window.plugin.showLessPortals.setup; - -// PLUGIN END ////////////////////////////////////////////////////////// - -@@PLUGINEND@@ diff --git a/plugins/show-more-portals.user.js b/plugins/show-more-portals.user.js index 443e9d09..11cc5d99 100644 --- a/plugins/show-more-portals.user.js +++ b/plugins/show-more-portals.user.js @@ -2,11 +2,11 @@ // @id iitc-plugin-show-more-portals@jonatkins // @name IITC plugin: Show more portals // @category Tweaks -// @version 0.1.5.@@DATETIMEVERSION@@ +// @version 0.1.6.@@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 when normally L1+ portals would be shown, and L2+ are visible when normally L3+ are shown +// @description [@@BUILDNAME@@-@@BUILDDATE@@] Boost the detail level of portals shown so that unclaimed portals are visible when normally L1+ portals would be shown, and L2+ are visible when normally L3+ are shown. Recent protocol changes by Niantic means this no longer sends more requests than the standard intel site, and can mean fewer requests. // @include https://www.ingress.com/intel* // @include http://www.ingress.com/intel* // @match https://www.ingress.com/intel* @@ -25,29 +25,24 @@ window.plugin.showMorePortals = function() {}; window.plugin.showMorePortals.setup = function() { // save the original function - so we can chain to it for levels we don't modify - var origGetPortalDataZoom = window.getPortalDataZoom; + var origGetMinPortalLevelForZoom = window.getMinPortalLevelForZoom; - // replace the window.getPortalDataZoom function - modify behaviour when zoomed close + // replace the window.getMinPortalLevelForZoom function - modify behaviour when L1+ or L3+ portals are shown - window.getPortalDataZoom = function() { - var mapZoom = map.getZoom(); + window.getMinPortalLevelForZoom = function(z) { + var level = origGetMinPortalLevelForZoom(z); // as of 2013-10-16... // the stock site uses the same tile size for both L1+ portals and all portals // therefore, changing the L1+ zoom levels into all portals zoom level is not unfriendly to the servers + // and the same applies for L2+ and L3+ detail levels // (in some ways it's nicer, as IITC caches better) - if (mapZoom >= 15) { - return 17; - } - // and, the same scale for L2+ and L3+ portals. again, forcing the level down isn't unfriendly to the servers - // (ditto on the caching) - if (mapZoom >= 12) { - return 13; - } + if (level == 1) level = 0; + if (level == 3) level = 2; - return origGetPortalDataZoom(); + return level; } From 4a9b13eade879fcec7c6a8fffc56d7766e72509a Mon Sep 17 00:00:00 2001 From: Mike Castle Date: Sun, 24 Nov 2013 00:19:25 -0800 Subject: [PATCH 11/12] Spell checking, s-z, plus a couple of missed ones. --- HACKING.md | 4 ++-- code/boot.js | 2 +- code/map_data_cache.js | 2 +- code/map_data_render.js | 4 ++-- code/munge.js | 2 +- code/portal_detail_display.js | 2 +- code/status_bar.js | 2 +- external/L.Geodesic.js | 2 +- .../cradle/iitc_mobile/IITC_DeviceAccountLogin.java | 2 +- plugins/basemap-stamen.user.js | 6 +++--- plugins/bookmarks-by-zaso.user.js | 10 +++++----- plugins/keys.user.js | 2 +- plugins/portal-counts.user.js | 2 +- plugins/portal-defense.user.js | 2 +- plugins/portal-highlighter-my-portals.user.js | 2 +- plugins/portals-list.user.js | 4 ++-- style.css | 2 +- website/code/desktop-download.php | 2 +- website/index.php | 2 +- website/page/faq.php | 2 +- website/page/news.php | 2 +- 21 files changed, 30 insertions(+), 30 deletions(-) diff --git a/HACKING.md b/HACKING.md index 64e1903b..2ea4bfcf 100644 --- a/HACKING.md +++ b/HACKING.md @@ -1,7 +1,7 @@ Hacking ======= -Execute `./build.py` to effectively concatenate `main.js` with all the files in `code/`. It generates the user script which may be installed into your browser. Do not modify `ttic-debug.user.js` manually, because it is automatically generated. Instead, modify the files in `code/` and have that file built for you. The files in `dist/` are for release only and should not be touched by you. +Execute `./build.py` to effectively concatenate `main.js` with all the files in `code/`. It generates the user script which may be installed into your browser. Do not modify `iitc-debug.user.js` manually, because it is automatically generated. Instead, modify the files in `code/` and have that file built for you. The files in `dist/` are for release only and should not be touched by you. `style.css` contains most styles required for the user-script. The extra ones can be found in `code/boot.js#window.setupStyles`. Only CSS rules that depend on config variables should be defined there. @@ -23,7 +23,7 @@ My dev setup is like this: Code Style ---------- -Please follow the these guidelines. Some are just preference, others are good pratice. +Please follow the these guidelines. Some are just preference, others are good practice. - use identity operators: `===` and `!==`. [Why do I want this?](http://stackoverflow.com/a/359509/1684530) - jQuery is your friend - indent using two spaces diff --git a/code/boot.js b/code/boot.js index f9953a46..78c0ecbc 100644 --- a/code/boot.js +++ b/code/boot.js @@ -251,7 +251,7 @@ window.setupMap = function() { map.on('moveend', function(e) { // two limits on map position - // we wrap longitude (the L.LatLng 'wrap' method) - so we don't find outselves looking beyond +-180 degrees + // we wrap longitude (the L.LatLng 'wrap' method) - so we don't find ourselves looking beyond +-180 degrees // then latitude is clamped with the clampLatLng function (to the 85 deg north/south limits) var newPos = clampLatLng(map.getCenter().wrap()); if (!map.getCenter().equals(newPos)) { diff --git a/code/map_data_cache.js b/code/map_data_cache.js index f5b90579..e6caf3b9 100644 --- a/code/map_data_cache.js +++ b/code/map_data_cache.js @@ -7,7 +7,7 @@ window.DataCache = function() { // stale cache entries can be updated (that's what the optional 'timestampMs' field in getThinnedEntities is // for, retrieving deltas) so use a long max age to take advantage of this - // however, ther must be an overall limit on the maximum age of data from the servers, otherwise the deletedEntity + // however, there must be an overall limit on the maximum age of data from the servers, otherwise the deletedEntity // entries would grow indefinitely. an hour seems reasonable from experience with the data, so 55 mins max cache time // this.REQUEST_CACHE_MAX_AGE = 55*60; // maximum cache age. entries are deleted from the cache after this time //UPDATE: this timestampMs parameter doesn't work, so reduced max age to limit RAM usage diff --git a/code/map_data_render.js b/code/map_data_render.js index 1a651875..df354c4b 100644 --- a/code/map_data_render.js +++ b/code/map_data_render.js @@ -127,7 +127,7 @@ window.Render.prototype.processGameEntities = function(entities) { // is considered complete window.Render.prototype.endRenderPass = function() { - // check to see if there's eny entities we haven't seen. if so, delete them + // check to see if there are any entities we haven't seen. if so, delete them for (var guid in window.portals) { // special case for selected portal - it's kept even if not seen if (!(guid in this.seenPortalsGuid) && guid !== selectedPortal) { @@ -567,7 +567,7 @@ window.Render.prototype.resetPortalClusters = function() { } -// add the portal to the visiable map layer unless we pass the cluster limits +// add the portal to the visible map layer unless we pass the cluster limits window.Render.prototype.addPortalToMapLayer = function(portal) { var cid = this.getPortalClusterID(portal); diff --git a/code/munge.js b/code/munge.js index deb96c28..3630f177 100644 --- a/code/munge.js +++ b/code/munge.js @@ -238,7 +238,7 @@ function extractMungeFromStock() { var activeMunge = null; -// attempt to guess the munge set in use, by looking therough the functions of the stock intel page for one of the munged params +// attempt to guess the munge set in use, by looking through the functions of the stock intel page for one of the munged params window.detectActiveMungeSet = function() { // first, try and parse the stock functions and extract the munges directly diff --git a/code/portal_detail_display.js b/code/portal_detail_display.js index 03820882..3562844f 100644 --- a/code/portal_detail_display.js +++ b/code/portal_detail_display.js @@ -54,7 +54,7 @@ window.renderPortalDetails = function(guid) { //(at some future point we can iterate through all the artifact types and add rows as needed) var jarvisArtifact = artifact.getPortalData (guid, 'jarvis'); if (jarvisArtifact) { - // the genFourColumnTable function below doesn't handle cases where one column is null and the other isn't - so default to *someting* in both columns + // 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 = ['shards','(none)']; if (jarvisArtifact.target) { target = ['target', ''+(jarvisArtifact.target==TEAM_RES?'Resistance':'Enlightened')+'']; diff --git a/code/status_bar.js b/code/status_bar.js index cd034767..df3b2a0f 100644 --- a/code/status_bar.js +++ b/code/status_bar.js @@ -6,7 +6,7 @@ window.renderUpdateStatus = function() { // portal level display var t = ''; - if(!window.isSmartphone()) // space is valueable + if(!window.isSmartphone()) // space is valuable t += 'portals: '; var minlvl = getMinPortalLevel(); if(minlvl === 0) diff --git a/external/L.Geodesic.js b/external/L.Geodesic.js index 20955133..8a6ef59e 100644 --- a/external/L.Geodesic.js +++ b/external/L.Geodesic.js @@ -90,7 +90,7 @@ Modified by qnstie 2013-07-17 to maintain compatibility with Leaflet.draw // geodesic calculations have issues when crossing the anti-meridian. so offset the points // so this isn't an issue, then add back the offset afterwards - // a center longitude would be ideal - but the start point logitude will be 'good enough' + // a center longitude would be ideal - but the start point longitude will be 'good enough' var lngOffset = latlngs[0].lng; // points are wrapped after being offset relative to the first point coordinate, so they're diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_DeviceAccountLogin.java b/mobile/src/com/cradle/iitc_mobile/IITC_DeviceAccountLogin.java index fb8e1890..90215244 100644 --- a/mobile/src/com/cradle/iitc_mobile/IITC_DeviceAccountLogin.java +++ b/mobile/src/com/cradle/iitc_mobile/IITC_DeviceAccountLogin.java @@ -155,7 +155,7 @@ public class IITC_DeviceAccountLogin implements AccountManagerCallback { String result = value.getResult().getString(AccountManager.KEY_AUTHTOKEN); if (result != null) { - // authentication succeded, we can load the given url, which will redirect + // authentication succeeded, we can load the given url, which will redirect // back to the intel map mWebView.loadUrl(result); mActivity.loginSucceeded(); diff --git a/plugins/basemap-stamen.user.js b/plugins/basemap-stamen.user.js index babbade4..80e6a3c6 100644 --- a/plugins/basemap-stamen.user.js +++ b/plugins/basemap-stamen.user.js @@ -27,9 +27,9 @@ window.plugin.mapTileStamen.addLayer = function() { var types = { 'toner': [ 'Toner', 'png', 0, 20 ], -// 'toner-hybrid': [ ' Toner Hybrid', 'png', 0, 20 ], // transparent layer. could be usefun over satelliate imagery or similar -// 'toner-labels': [ 'Toner Labels', 'png', 0, 20 ], // transparent layer. could be usefun over satelliate imagery or similar -// 'toner-lines': [ 'Toner Lines', 'png', 0, 20 ], // transparent layer. could be usefun over satelliate imagery or similar +// 'toner-hybrid': [ ' Toner Hybrid', 'png', 0, 20 ], // transparent layer. could be useful over satellite imagery or similar +// 'toner-labels': [ 'Toner Labels', 'png', 0, 20 ], // transparent layer. could be useful over satellite imagery or similar +// 'toner-lines': [ 'Toner Lines', 'png', 0, 20 ], // transparent layer. could be useful over satellite imagery or similar 'toner-background': [ 'Toner Background', 'png', 0, 20 ], 'toner-lite': [ 'Toner Lite', 'png', 0, 20 ], 'watercolor': [ 'Watercolor', 'jpg', 1, 16 ], diff --git a/plugins/bookmarks-by-zaso.user.js b/plugins/bookmarks-by-zaso.user.js index 9044b01d..3349e846 100644 --- a/plugins/bookmarks-by-zaso.user.js +++ b/plugins/bookmarks-by-zaso.user.js @@ -543,8 +543,8 @@ localStorage[window.plugin.bookmarks.KEY_STORAGE] = promptAction; window.plugin.bookmarks.refreshBkmrks(); window.runHooks('pluginBkmrksEdit', {"target": "all", "action": "import"}); - console.log('BOOKMARKS: resetted and imported bookmarks'); - window.plugin.bookmarks.optAlert('Succesful. '); + console.log('BOOKMARKS: reset and imported bookmarks'); + window.plugin.bookmarks.optAlert('Successful. '); } } @@ -556,8 +556,8 @@ window.plugin.bookmarks.loadStorage(); window.plugin.bookmarks.refreshBkmrks(); window.runHooks('pluginBkmrksEdit', {"target": "all", "action": "reset"}); - console.log('BOOKMARKS: resetted all bookmarks'); - window.plugin.bookmarks.optAlert('Succesful. '); + console.log('BOOKMARKS: reset all bookmarks'); + window.plugin.bookmarks.optAlert('Successful. '); } } @@ -709,7 +709,7 @@ }, window.plugin.bookmarks.SYNC_DELAY); } - // Store the upadteQueue in updatingQueue and upload + // Store the updateQueue in updatingQueue and upload window.plugin.bookmarks.syncNow = function() { if(!window.plugin.bookmarks.enableSync) return; $.extend(window.plugin.bookmarks.updatingQueue, window.plugin.bookmarks.updateQueue); diff --git a/plugins/keys.user.js b/plugins/keys.user.js index d1aa488a..7ba1697b 100644 --- a/plugins/keys.user.js +++ b/plugins/keys.user.js @@ -86,7 +86,7 @@ window.plugin.keys.delaySync = function() { }, plugin.keys.SYNC_DELAY); } -// Store the upadteQueue in updatingQueue and upload +// Store the updateQueue in updatingQueue and upload window.plugin.keys.syncNow = function() { if(!plugin.keys.enableSync) return; $.extend(plugin.keys.updatingQueue, plugin.keys.updateQueue); diff --git a/plugins/portal-counts.user.js b/plugins/portal-counts.user.js index 08020cb9..b511d6e8 100644 --- a/plugins/portal-counts.user.js +++ b/plugins/portal-counts.user.js @@ -32,7 +32,7 @@ // use own namespace for plugin window.plugin.portalcounts = function() {}; -//count portals for each level avalaible on the map +//count portals for each level available on the map window.plugin.portalcounts.getPortals = function(){ //console.log('** getPortals'); var retval=false; diff --git a/plugins/portal-defense.user.js b/plugins/portal-defense.user.js index 000a2cf5..9f95ce4d 100644 --- a/plugins/portal-defense.user.js +++ b/plugins/portal-defense.user.js @@ -152,7 +152,7 @@ var setup = function() { window.plugin.portalDefense.currentDisplay = window.plugin.portalDefense.getDisplay(); map.on('zoomend', window.plugin.portalDefense.showOrHide); - // this layer is added to tha layer chooser, to be toggled on/off + // this layer is added to the layer chooser, to be toggled on/off window.plugin.portalDefense.regionLayerGroup = new L.LayerGroup(); // this layer is added into the above layer, and removed from it when we zoom out too far diff --git a/plugins/portal-highlighter-my-portals.user.js b/plugins/portal-highlighter-my-portals.user.js index 63a9f216..583e9e0d 100644 --- a/plugins/portal-highlighter-my-portals.user.js +++ b/plugins/portal-highlighter-my-portals.user.js @@ -6,7 +6,7 @@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ // @downloadURL @@DOWNLOADURL@@ -// @description [@@BUILDNAME@@-@@BUILDDATE@@] Uses the fill color of the portals to denote portals you have a hand in. Orange is just ownership. Yellow is sheilds. Red is Resonators. Red trumps both, yellow trumps orange. +// @description [@@BUILDNAME@@-@@BUILDDATE@@] Uses the fill color of the portals to denote portals you have a hand in. Orange is just ownership. Yellow is shields. Red is Resonators. Red trumps both, yellow trumps orange. // @include https://www.ingress.com/intel* // @include http://www.ingress.com/intel* // @match https://www.ingress.com/intel* diff --git a/plugins/portals-list.user.js b/plugins/portals-list.user.js index 8031be7b..2b439f92 100644 --- a/plugins/portals-list.user.js +++ b/plugins/portals-list.user.js @@ -26,7 +26,7 @@ * 0.0.10: Fixed persistent css problem with alert * 0.0.9 : bugs hunt * 0.0.8 : Aborted to avoid problems with Niantic (export portals informations as csv or kml file) -* 0.0.7 : more informations avalaible via tooltips (who deployed, energy, ...), new E/AP column +* 0.0.7 : more informations available via tooltips (who deployed, energy, ...), new E/AP column * 0.0.6 : Add power charge information into a new column + bugfix * 0.0.5 : Filter portals by clicking on 'All portals', 'Res Portals' or 'Enl Portals' * 0.0.4 : Add link to portals name, one click to display full information in portal panel, double click to zoom on portal, hover to show address @@ -49,7 +49,7 @@ window.plugin.portalslist.enlP = 0; window.plugin.portalslist.resP = 0; window.plugin.portalslist.filter=0; -//fill the listPortals array with portals avalaible on the map (level filtered portals will not appear in the table) +//fill the listPortals array with portals avaliable on the map (level filtered portals will not appear in the table) window.plugin.portalslist.getPortals = function() { //filter : 0 = All, 1 = Res, 2 = Enl //console.log('** getPortals'); diff --git a/style.css b/style.css index fe408f59..4dffc9fa 100644 --- a/style.css +++ b/style.css @@ -115,7 +115,7 @@ a:hover { padding-left: 8px; } -/* hide the usual seperator */ +/* hide the usual separator */ .leaflet-control-layers-separator { display: none; } diff --git a/website/code/desktop-download.php b/website/code/desktop-download.php index 6342c7e7..daf05809 100644 --- a/website/code/desktop-download.php +++ b/website/code/desktop-download.php @@ -52,7 +52,7 @@ function iitcDesktopPluginDownloadTable ( $build ) 'Map Tiles' => "Alternative map layers", 'Tweaks' => "Adjust IITC settings", 'Misc' => "Unclassified plugins", - 'Obsolete' => "Plugins that are no longer recommended, due to being superceeded by others or similar", + 'Obsolete' => "Plugins that are no longer recommended, due to being superceded by others or similar", 'Deleted' => "Deleted plugins - listed here for reference only. No download available" ); diff --git a/website/index.php b/website/index.php index 62f57091..43e61f2a 100644 --- a/website/index.php +++ b/website/index.php @@ -130,7 +130,7 @@ foreach ( $pages as $key => $name ) print "$name\n"; - # after 'mobile', add a horizontal seperator + # after 'mobile', add a horizontal separator if ( $key == 'test' ) print "

  • "; } diff --git a/website/page/faq.php b/website/page/faq.php index e88156ea..4374caa1 100644 --- a/website/page/faq.php +++ b/website/page/faq.php @@ -100,7 +100,7 @@ The colour within the square shows the state of the data: The status message at the bottom-right of the screen gives a summary.
      -
    • If all requests were succesful/fresh from cache (i.e. all green borders) the status is 'Done'.
    • +
    • If all requests were successful/fresh from cache (i.e. all green borders) the status is 'Done'.
    • If some requests failed, but cached data was available (i.e. some red border/yellow fill) the status is 'Out of date'.
    • If some requests failed, but no cached data was available (i.e. some red border/red fill) the status is 'Error'.
    diff --git a/website/page/news.php b/website/page/news.php index 54f82cac..d8fd58e0 100644 --- a/website/page/news.php +++ b/website/page/news.php @@ -230,7 +230,7 @@ IITC version 0.12.0 has been released. This contains quite a few changes and new
  • Sync plugin - to sync data from the 'Keys' addon to multiple computers via Google Drive
  • ... and many other tweaks, bug fixes, etc
  • -IITC Mobile 0.4.0 is also released. THis has also had major work. Along with the above, it includes a +IITC Mobile 0.4.0 is also released. This has also had major work. Along with the above, it includes a new in-app layer chooser and chat/map switcher, and authentication has been revamped to use the native Android authentication rather than entering your password.

    From 01cfda107778e74bae294792e63b8d0aed99a018 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Sun, 24 Nov 2013 21:17:10 +0000 Subject: [PATCH 12/12] bumpped jquery + jqueryui versions. now the stock intel site no longer includes any version of these there are no advantages to non-current releases --- code/boot.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/boot.js b/code/boot.js index f9953a46..f359934b 100644 --- a/code/boot.js +++ b/code/boot.js @@ -600,8 +600,8 @@ try { console.log('Loading included JS now'); } catch(e) {} try { console.log('done loading included JS'); } catch(e) {} //note: no protocol - so uses http or https as used on the current page -var JQUERY = '//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js'; -var JQUERYUI = '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js'; +var JQUERY = '//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js'; +var JQUERYUI = '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js'; // after all scripts have loaded, boot the actual app load(JQUERY).then(JQUERYUI).thenRun(boot);