commit
5bfe719c13
@ -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
|
||||
|
2
build.py
2
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:
|
||||
|
@ -176,7 +176,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()];
|
||||
@ -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)) {
|
||||
@ -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);
|
||||
|
@ -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.
|
||||
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -5,9 +5,9 @@ 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
|
||||
// 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
|
||||
|
@ -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
|
||||
@ -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);
|
||||
|
@ -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;
|
||||
@ -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
|
||||
@ -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
|
||||
@ -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(?)
|
||||
|
||||
|
@ -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}');
|
||||
@ -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
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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', '<span class="'+TEAM_TO_CSS[jarvisArtifact.target]+'">'+(jarvisArtifact.target==TEAM_RES?'Resistance':'Enlightened')+'</span>'];
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
@ -6,7 +6,7 @@ window.renderUpdateStatus = function() {
|
||||
|
||||
// portal level display
|
||||
var t = '<span class="help portallevel" title="Indicates portal levels displayed. Zoom in to display lower level portals.">';
|
||||
if(!window.isSmartphone()) // space is valueable
|
||||
if(!window.isSmartphone()) // space is valuable
|
||||
t += '<b>portals</b>: ';
|
||||
var minlvl = getMinPortalLevel();
|
||||
if(minlvl === 0)
|
||||
|
@ -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({
|
||||
@ -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 mazimum 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);
|
||||
}
|
||||
|
||||
|
4
external/L.Geodesic.js
vendored
4
external/L.Geodesic.js
vendored
@ -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 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
|
||||
|
6
external/leaflet.draw.js
vendored
6
external/leaflet.draw.js
vendored
@ -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;
|
||||
|
2
main.js
2
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;
|
||||
|
@ -155,7 +155,7 @@ public class IITC_DeviceAccountLogin implements AccountManagerCallback<Bundle> {
|
||||
|
||||
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();
|
||||
|
@ -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");
|
||||
|
@ -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(")) {
|
||||
|
@ -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")
|
||||
|
@ -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];
|
||||
@ -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) {
|
||||
|
@ -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 ],
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
@ -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;
|
||||
@ -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'); }
|
||||
|
51
plugins/default-intel-detail.user.js
Normal file
51
plugins/default-intel-detail.user.js
Normal file
@ -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@@
|
@ -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);
|
||||
@ -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();
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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*
|
||||
|
@ -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');
|
||||
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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@@
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -115,7 +115,7 @@ a:hover {
|
||||
padding-left: 8px;
|
||||
}
|
||||
|
||||
/* hide the usual seperator */
|
||||
/* hide the usual separator */
|
||||
.leaflet-control-layers-separator {
|
||||
display: none;
|
||||
}
|
||||
|
@ -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"
|
||||
);
|
||||
|
||||
@ -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<br><small class="muted">.\2</small>', $details['@version'] );
|
||||
|
||||
# remove unneeded prefix from description
|
||||
|
@ -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'.
|
||||
*
|
||||
|
@ -130,7 +130,7 @@ foreach ( $pages as $key => $name )
|
||||
|
||||
print "<li".($page == $key ? ' class="active"' :'')."><a href=\"$url\">$name</a></li>\n";
|
||||
|
||||
# after 'mobile', add a horizontal seperator
|
||||
# after 'mobile', add a horizontal separator
|
||||
if ( $key == 'test' )
|
||||
print "<li class=\"divider\"></li>";
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ The colour within the square shows the state of the data:
|
||||
</ul>
|
||||
The status message at the bottom-right of the screen gives a summary.
|
||||
<ul>
|
||||
<li>If all requests were succesful/fresh from cache (i.e. all green borders) the status is 'Done'.</li>
|
||||
<li>If all requests were successful/fresh from cache (i.e. all green borders) the status is 'Done'.</li>
|
||||
<li>If some requests failed, but cached data was available (i.e. some red border/yellow fill) the status is 'Out of date'.</li>
|
||||
<li>If some requests failed, but no cached data was available (i.e. some red border/red fill) the status is 'Error'.</li>
|
||||
</ul>
|
||||
|
@ -61,7 +61,7 @@ scripts to match.
|
||||
|
||||
<h4>16th October 2013</h4>
|
||||
<p>
|
||||
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.
|
||||
|
@ -48,7 +48,7 @@ scripts to match.
|
||||
|
||||
<h4>16th October 2013</h4>
|
||||
<p>
|
||||
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.
|
||||
@ -230,7 +230,7 @@ IITC version 0.12.0 has been released. This contains quite a few changes and new
|
||||
<li>Sync plugin - to sync data from the 'Keys' addon to multiple computers via Google Drive</li>
|
||||
<li>... and many other tweaks, bug fixes, etc</li>
|
||||
</ul>
|
||||
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.
|
||||
</p>
|
||||
|
Loading…
x
Reference in New Issue
Block a user