fkloft eba7d388a0 Enable IITC on mission permalink
Hint: to change a lot of scripts, execute this:

    sed -r '/\/\/ @match\s+http:\/\/www.ingress.com\/intel/r /tmp/includefile' -i~ *.user.js

`/tmp/includefile` should contain these lines: (no trailing newline!)

    // @include        https://www.ingress.com/mission/*
    // @include        http://www.ingress.com/mission/*
    // @match          https://www.ingress.com/mission/*
    // @match          http://www.ingress.com/mission/*
2015-04-13 17:28:30 +02:00

47 lines
1.9 KiB
JavaScript

// ==UserScript==
// @id iitc-plugin-scale-bar@breunigs
// @name IITC plugin: scale bar
// @category Controls
// @version 0.1.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
// @description [@@BUILDNAME@@-@@BUILDDATE@@] Show scale bar on the map.
// @include https://www.ingress.com/intel*
// @include http://www.ingress.com/intel*
// @match https://www.ingress.com/intel*
// @match http://www.ingress.com/intel*
// @include https://www.ingress.com/mission/*
// @include http://www.ingress.com/mission/*
// @match https://www.ingress.com/mission/*
// @match http://www.ingress.com/mission/*
// @grant none
// ==/UserScript==
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
// use own namespace for plugin
window.plugin.scaleBar = function() {};
window.plugin.scaleBar.setup = function() {
// Before you ask: yes, I explicitely turned off imperial units. Imperial units
// are worse than Internet Explorer 6 whirring fans combined. Upgrade to the metric
// system already.
if (window.isSmartphone()) {
$('head').append('<style>.leaflet-control-scale { position: absolute; bottom: 15px; right: 0px; margin-bottom: 20px !important; } </style>');
window.map.addControl(new L.Control.Scale({position: 'bottomright', imperial: false, maxWidth: 100}));
} else {
$('head').append('<style>.leaflet-control-scale { position: absolute; top: 2px; left: 40px; } </style>');
window.map.addControl(new L.Control.Scale({position: 'topleft', imperial: false, maxWidth: 200}));
}
};
var setup = window.plugin.scaleBar.setup;
// PLUGIN END //////////////////////////////////////////////////////////
@@PLUGINEND@@