ingress-intel-total-conversion/plugins/default-intel-detail.user.js
Jon Atkins f22d185b5b 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
2013-11-24 04:59:41 +00:00

52 lines
2.3 KiB
JavaScript

// ==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@@