Merge branch 'gh-pages' into scoreboard

This commit is contained in:
vita10gy 2013-02-26 20:39:25 -06:00
commit d6b7a7fdac
34 changed files with 1390 additions and 337 deletions

View File

@ -32,6 +32,7 @@ Please follow the these guidelines. Some are just preference, others are good pr
- comments: `// this is a comment` - comments: `// this is a comment`
- quotes: Use single-quotes for JavaScript and double-quotes for HTML content. Example: `$('body').append('<div id="soup">Soup!</div>');`. - quotes: Use single-quotes for JavaScript and double-quotes for HTML content. Example: `$('body').append('<div id="soup">Soup!</div>');`.
- there is no length limit on lines, but try to keep them short where suitable - there is no length limit on lines, but try to keep them short where suitable
- ensure you remove *all* trailing whitespace before submitting your patch. If you editor doesnt detect those for you, try `grep -nE "[[:space:]]+$" «filename»`
Sending patches Sending patches
@ -63,12 +64,15 @@ How do I report bugs?
--------------------- ---------------------
**Try this first**: **Try this first**:
- update the user script and all its plugins. Even if you think there is no update. - update the user script and all its plugins.
- after updating, go to the intel page. - after updating, go to the intel page.
- press `SHIFT+F5` (or shift-click the reload button). Wait for the page to load. - press `SHIFT+F5` (or shift-click the reload button). Wait for the page to load.
- press `CTRL+F5`, same as above. - press `CTRL+F5`, same as above.
If your issue persists, continue. Provide **all** of the information below, even if you dont think this is necessary. You can also try to [install the most recent developer version (“nightly”)]
(https://www.dropbox.com/sh/lt9p0s40kt3cs6m/3xzpyiVBnF) and repeat the steps above. Maybe your issue has already been fixed? The nightly versions will update to the next stable release, so you dont need to worry about that.
If your issue persists, continue. The next step is to look for existing issues, maybe someone else has a similar problem. You can look [through the existing issues](https://github.com/breunigs/ingress-intel-total-conversion/issues?sort=updated&state=open) or use the search function on the top right. If your issue persists, open a new issue and provide **all** of the information below, even if you dont think this is necessary.
- a descriptive title - a descriptive title
- your browser and its version - your browser and its version

22
NEWS.md
View File

@ -1,5 +1,22 @@
CHANGES IN 0.7 CHANGES IN 0.7.5 0.7.8
============== ========================
This is an emergency release to keep IITC working with Niantics switch to HTTPS. It appears they will roll it out for everyone soon, so IITC now requires HTTPS for everyone; support for HTTP was dropped to keep things sane. Additionally, the following things were changed from 0.7.1:
- Feature: the “gmaps” link for each portal has been replaced with a “poslinks” one. It offers Google Maps, OpenStreetMap and QR-Codes for easy transfer to your mobile phone (by Merovius).
- Feature: the exact capture time is now shown in a tooltip in the portal details (by j16sdiz)
- Change: most scripts are now included in the UserScript directly. Was the easiest solution to the HTTPS issue.
- Change: minor improvements when render limit is about to be hit.
- Bugfix: map base layer wasnt always remembered in Chrome
- Bugfix: QR Code rendering broken (in 0.7.5, fixed in 0.7.6)
- Bugfix: Script broken in Firefox sometimes (fixed in 0.7.7)
- Bugfix: some graphics were not available due to GitHubs limits. Affected plugins: draw tools and player tracker. Need to update IITC and both plugins for the fix to come into effect. (fixed in 0.7.8)
CHANGES IN 0.7 / 0.7.1
----------------------
- 0.7.1 fixes an oversight that prevented some portals from showing (by saithis)
### General ### General
- from now on there will be [nightly builds](https://www.dropbox.com/sh/lt9p0s40kt3cs6m/3xzpyiVBnF) available. You need to manually update them if you want to stay on nightly. You should be offered to update to the next release version, though. Be sure to [have read the guide on how to report bugs](https://github.com/breunigs/ingress-intel-total-conversion/blob/gh-pages/HACKING.md#how-do-i-report-bugs) before using a nightly version. - from now on there will be [nightly builds](https://www.dropbox.com/sh/lt9p0s40kt3cs6m/3xzpyiVBnF) available. You need to manually update them if you want to stay on nightly. You should be offered to update to the next release version, though. Be sure to [have read the guide on how to report bugs](https://github.com/breunigs/ingress-intel-total-conversion/blob/gh-pages/HACKING.md#how-do-i-report-bugs) before using a nightly version.
@ -49,7 +66,6 @@ CHANGES IN 0.6 / 0.61
- **SECURITY**: Chat was vulnerable to XSS attacks. Update as soon as - **SECURITY**: Chat was vulnerable to XSS attacks. Update as soon as
possible. possible.
- Feature: [**more plugins**](https://github.com/breunigs/ingress-intel-total-conversion/tree/gh-pages/plugins#readme) - Feature: [**more plugins**](https://github.com/breunigs/ingress-intel-total-conversion/tree/gh-pages/plugins#readme)
- weakened portals: highlights portals with few resonators or ones - weakened portals: highlights portals with few resonators or ones
that are decayed, making it easier to see where that are decayed, making it easier to see where

View File

@ -19,7 +19,7 @@ IITC can be [extended with the use of plugins](https://github.com/breunigs/ingre
Install Install
------- -------
Current version is 0.7. [See NEWS.md for details](https://github.com/breunigs/ingress-intel-total-conversion/blob/gh-pages/NEWS.md). Current version is 0.7.8. [See NEWS.md for details](https://github.com/breunigs/ingress-intel-total-conversion/blob/gh-pages/NEWS.md).
[**INSTALL**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/dist/total-conversion-build.user.js) [**INSTALL**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/dist/total-conversion-build.user.js)
@ -40,12 +40,16 @@ Current version is 0.7. [See NEWS.md for details](https://github.com/breunigs/in
- Confirm once again. - Confirm once again.
- Reload page. - Reload page.
*Note:* Tampermonkey is optional. However, it offers auto-update, shows correct version numbers and installing user scripts is much easier. If you have installed the scripts directly into Chrome before, I recommend you switch to Tampermonkey. To do so, uninstall the IITC scripts and click each install link again. Follow the procedure explained above. **NOTE: You still need to manually update IITC with Tampermonkey.** There is a bug in the current stable release. It has been fixed in Tampermonkeys development version. Until it is released, you need to manually update IITC.
*Note:* Tampermonkey is optional. However, it ~~offers auto-update~~, shows correct version numbers and installing user scripts is much easier. If you have installed the scripts directly into Chrome before, I recommend you switch to Tampermonkey. To do so, uninstall the IITC scripts and click each install link again. Follow the procedure explained above.
### Opera ### Opera
- Download the script: [download](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/dist/total-conversion-build.user.js) - Download the script: [download](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/dist/total-conversion-build.user.js)
- put it into your user_js folder (thats `~/.opera/user_js` on Unix). If you cant find it [see Operas docs](http://www.opera.com/docs/userjs/using/#writingscripts). - put it into your user_js folder (thats `~/.opera/user_js` on Unix). If you cant find it [see Operas docs](http://www.opera.com/docs/userjs/using/#writingscripts).
- reload the page - [visit `opera:config` and check `UserJavaScriptonHTTPS` or click here to take you there](opera:config#UserPrefs|UserJavaScriptonHTTPS).
- click save on the bottom of the settings page
- reload the Intel Map, no need to restart Opera
*Note*: You need to update the scripts manually. *Note*: You need to update the scripts manually.
@ -58,22 +62,27 @@ Reporting Issues
[tutorial / guide / please read / **free candy**](https://github.com/breunigs/ingress-intel-total-conversion/blob/gh-pages/HACKING.md#how-do-i-report-bugs) [tutorial / guide / please read / **free candy**](https://github.com/breunigs/ingress-intel-total-conversion/blob/gh-pages/HACKING.md#how-do-i-report-bugs)
Contributing How can I help? // Contribution
------------ -------------------------------
Please do! First of all, its very nice you want to help. There are several equally important ways you can. Some require a technical background and some dont:
- **answering help requests:** often people are asking how to do specific things in bug reports or are asking for things that already exist. Kindly point them to what theyre looking for and maybe consider updating the user guide, if it lacks on that topic.
(Obviously, Resistance folks must send in complete patches while Enlightenment gals and guys may just open feature request ☺). If you want to hack the source, please [read HACKING.md for details](https://github.com/breunigs/ingress-intel-total-conversion/blob/gh-pages/HACKING.md) . - **asking for more information:** Sometimes a bug report contains barely enough information to grasp whats going on. Ask the reporter for the parts that you believe might be helpful, like the browser used. Similarily, if someone requests a feature make sure the description is accurate. Depending on the request, a concrete proposal on how to display this to the user might be helpful.
- **finding bugs / regressions:** If you are closer to the development of IITC, its usually easier for you to spot misbehaviours or bugs that have been recently introduces. Opening tickets for those, ideally with a step by step guide to reproduce the issue is very helpful.
- **hacking / sending patches:** Of course, if you want to contribute source code to the project thats fine as well. Please [read HACKING.md for details](https://github.com/breunigs/ingress-intel-total-conversion/blob/gh-pages/HACKING.md).
**So far, these people have contributed:** **So far, these people have contributed:**
[Bananeweizen](https://github.com/Bananeweizen), [Bananeweizen](https://github.com/Bananeweizen),
[blakjakau](https://github.com/blakjakau), [blakjakau](https://github.com/blakjakau),
[boombuler](https://github.com/boombuler),
[cmrn](https://github.com/cmrn), [cmrn](https://github.com/cmrn),
[epf](https://github.com/epf), [epf](https://github.com/epf),
[integ3r](https://github.com/integ3r), [integ3r](https://github.com/integ3r),
[j16sdiz](https://github.com/j16sdiz),
[JasonMillward](https://github.com/JasonMillward), [JasonMillward](https://github.com/JasonMillward),
[jonatkins](https://github.com/jonatkins), [jonatkins](https://github.com/jonatkins),
[Merovius](https://github.com/Merovius),
[mledoze](https://github.com/mledoze), [mledoze](https://github.com/mledoze),
[OshiHidra](https://github.com/OshiHidra), [OshiHidra](https://github.com/OshiHidra),
[phoenixsong6](https://github.com/phoenixsong6), [phoenixsong6](https://github.com/phoenixsong6),
@ -97,5 +106,6 @@ This project is licensed under the permissive ISC license. Parts imported from o
- [leaflet.js; custom license (but appears free)](http://leafletjs.com/) - [leaflet.js; custom license (but appears free)](http://leafletjs.com/)
- [leaflet.draw.js; by jacobtoye; MIT](https://github.com/Leaflet/Leaflet.draw) - [leaflet.draw.js; by jacobtoye; MIT](https://github.com/Leaflet/Leaflet.draw)
- [`leaflet_google.js` by Pavel Shramov; same as Leaftlet](https://github.com/shramov/leaflet-plugins) (modified, though) - [`leaflet_google.js` by Pavel Shramov; same as Leaftlet](https://github.com/shramov/leaflet-plugins) (modified, though)
- [jquery.qrcode.js by Jerome Etienne; MIT](https://github.com/jeromeetienne/jquery-qrcode)
- StackOverflow-CopyPasta is attributed in the source; [CC-Wiki](https://creativecommons.org/licenses/by-sa/3.0/) - StackOverflow-CopyPasta is attributed in the source; [CC-Wiki](https://creativecommons.org/licenses/by-sa/3.0/)
- all Ingress/Niantic related stuff obviously remains non-free and is still copyrighted by Niantic/Google - all Ingress/Niantic related stuff obviously remains non-free and is still copyrighted by Niantic/Google

View File

@ -33,7 +33,7 @@ The chat is split up into several categories. It usually only shows messages for
**The chat categories are:** **The chat categories are:**
- full: shows all automated messages *(23:57 \<apj\> destroyed an L3 Resonator on Two Spikes)* - full: shows all automated messages *(23:57 \<apj\> destroyed an L3 Resonator on Two Spikes)*
- compact: shows only the latest automated message per user - compact: shows only the latest automated message per user
- public: shows user generated public messages (both Enlightenment and Resistance can read it) - public: shows user generated public messages (both Enlightened and Resistance can read it)
- faction: shows messages for own faction (e.g. only Resistance can read Resistance messages) - faction: shows messages for own faction (e.g. only Resistance can read Resistance messages)
**Posting messages:** **Posting messages:**
@ -117,7 +117,7 @@ Starting from the top, the sidebar shows this information:
“Random Details” are displayed in four columns. The outer ones show the data while the inner ones are the titles. “Random Details” are displayed in four columns. The outer ones show the data while the inner ones are the titles.
- owner: who deployed the first resonator after it has been neutral/unclaimed. - owner: who deployed the first resonator after it has been neutral/unclaimed.
- since: when was the first resonator deployed after it has been neutral/unclaimed. - since: when was the first resonator deployed after it has been neutral/unclaimed. The reasonators decay every 24hrs from capture. Move the cursor over it to show the full date time.
- range: shows how far links made from this portal can be. Click on the value to zoom out to link range. The red circle shows how far links may reach. - range: shows how far links made from this portal can be. Click on the value to zoom out to link range. The red circle shows how far links may reach.
- energy: shows current and maximum energy if fully charged. The tooltip contains the exact numbers. - energy: shows current and maximum energy if fully charged. The tooltip contains the exact numbers.
- links: shows incoming and outgoing links. The tooltip explains the icons. - links: shows incoming and outgoing links. The tooltip explains the icons.
@ -139,7 +139,7 @@ The nickname to the left and right show who deployed this resonator. The bars in
- Portal link: use it show others a portal. IITC users will automatically zoomed to the location and shown portal details as soon as theyre available. Vanilla map users will only be zoomed to location. - Portal link: use it show others a portal. IITC users will automatically zoomed to the location and shown portal details as soon as theyre available. Vanilla map users will only be zoomed to location.
- Report issue: redirects you to Niantic report issue page. Allows you to copy all required information before going there. - Report issue: redirects you to Niantic report issue page. Allows you to copy all required information before going there.
- GMaps: shows you the portals location in Google Maps for routing and similar purposes. - poslinks: Shows you a QR-Code containing the geolocation of the portal as well as a link for Google Maps and Openstreetmap. If your QR-Code App supports GEO-codes (most do) you can scan it and pass the portal location directly to a routing-app.
#### Redeeming, General Links and functions #### Redeeming, General Links and functions
- Redeem code: allows you to redeem codes to receive goodies. If you copied them from the Internet, they are probably invalid already. - Redeem code: allows you to redeem codes to receive goodies. If you copied them from the Internet, they are probably invalid already.

View File

@ -1,20 +1,36 @@
#!/usr/bin/env python3 #!/usr/bin/env python
import glob import glob
import time import time
import re
import io
def readfile(fn): def readfile(fn):
with open(fn, 'Ur', encoding='utf8') as f: with io.open(fn, 'Ur', encoding='utf8') as f:
return f.read() return f.read()
def loaderString(var):
fn = var.group(1)
return readfile(fn).replace('\n', '\\n').replace('\'', '\\\'')
def loaderRaw(var):
fn = var.group(1)
return readfile(fn)
c = '\n\n'.join(map(readfile, glob.glob('code/*'))) c = '\n\n'.join(map(readfile, glob.glob('code/*')))
n = time.strftime('%Y-%m-%d-%H%M%S') n = time.strftime('%Y-%m-%d-%H%M%S')
m = readfile('main.js').replace('@@BUILDDATE@@', n) m = readfile('main.js')
m = m.split('@@INJECTHERE@@') m = m.split('@@INJECTHERE@@')
m.insert(1, c) m.insert(1, c)
t = '\n\n'.join(m) m = '\n\n'.join(m)
with open('iitc-debug.user.js', 'w', encoding='utf8') as f: m = m.replace('@@BUILDDATE@@', n)
f.write(t) m = re.sub('@@INCLUDERAW:([0-9a-zA-Z_./-]+)@@', loaderRaw, m)
m = re.sub('@@INCLUDESTRING:([0-9a-zA-Z_./-]+)@@', loaderString, m)
with io.open('iitc-debug.user.js', 'w', encoding='utf8') as f:
f.write(m)
# vim: ai si ts=4 sw=4 sts=4 et # vim: ai si ts=4 sw=4 sts=4 et

View File

@ -58,10 +58,6 @@ window.setupMap = function() {
{zoomControl: !(localStorage['iitc.zoom.buttons'] === 'false')} {zoomControl: !(localStorage['iitc.zoom.buttons'] === 'false')}
)); ));
try {
map.addLayer(views[readCookie('ingress.intelmap.type')]);
} catch(e) { map.addLayer(views[0]); }
var addLayers = {}; var addLayers = {};
portalsLayers = []; portalsLayers = [];
@ -91,6 +87,14 @@ window.setupMap = function() {
}, addLayers); }, addLayers);
map.addControl(window.layerChooser); map.addControl(window.layerChooser);
// set the map AFTER adding the layer chooser, or Chrome reorders the
// layers. This likely leads to broken layer selection because the
// views/cookie order does not match the layer chooser order.
try {
map.addLayer(views[readCookie('ingress.intelmap.type')]);
} catch(e) { map.addLayer(views[0]); }
map.attributionControl.setPrefix(''); map.attributionControl.setPrefix('');
// listen for changes and store them in cookies // listen for changes and store them in cookies
map.on('moveend', window.storeMapPosition); map.on('moveend', window.storeMapPosition);
@ -227,13 +231,17 @@ window.setupDialogs = function() {
} }
window.setupQRLoadLib = function() {
@@INCLUDERAW:external/jquery.qrcode.min.js@@
}
// BOOTING /////////////////////////////////////////////////////////// // BOOTING ///////////////////////////////////////////////////////////
function boot() { function boot() {
window.debug.console.overwriteNativeIfRequired(); window.debug.console.overwriteNativeIfRequired();
console.log('loading done, booting. Built: ' + window.iitcBuildDate); console.log('loading done, booting. Built: @@BUILDDATE@@');
if(window.deviceID) console.log('Your device ID: ' + window.deviceID); if(window.deviceID) console.log('Your device ID: ' + window.deviceID);
window.runOnSmartphonesBeforeBoot(); window.runOnSmartphonesBeforeBoot();
@ -255,6 +263,7 @@ function boot() {
window.setupPlayerStat(); window.setupPlayerStat();
window.setupTooltips(); window.setupTooltips();
window.chat.setup(); window.chat.setup();
window.setupQRLoadLib();
// read here ONCE, so the URL is only evaluated one time after the // read here ONCE, so the URL is only evaluated one time after the
// necessary data has been loaded. // necessary data has been loaded.
urlPortal = getURLParam('pguid'); urlPortal = getURLParam('pguid');
@ -287,26 +296,17 @@ function boot() {
// Copyright (c) 2010 Chris O'Hara <cohara87@gmail.com>. MIT Licensed // Copyright (c) 2010 Chris O'Hara <cohara87@gmail.com>. MIT Licensed
function asyncLoadScript(a){return function(b,c){var d=document.createElement("script");d.type="text/javascript",d.src=a,d.onload=b,d.onerror=c,d.onreadystatechange=function(){var a=this.readyState;if(a==="loaded"||a==="complete")d.onreadystatechange=null,b()},head.insertBefore(d,head.firstChild)}}(function(a){a=a||{};var b={},c,d;c=function(a,d,e){var f=a.halt=!1;a.error=function(a){throw a},a.next=function(c){c&&(f=!1);if(!a.halt&&d&&d.length){var e=d.shift(),g=e.shift();f=!0;try{b[g].apply(a,[e,e.length,g])}catch(h){a.error(h)}}return a};for(var g in b){if(typeof a[g]=="function")continue;(function(e){a[e]=function(){var g=Array.prototype.slice.call(arguments);if(e==="onError"){if(d)return b.onError.apply(a,[g,g.length]),a;var h={};return b.onError.apply(h,[g,g.length]),c(h,null,"onError")}return g.unshift(e),d?(a.then=a[e],d.push(g),f?a:a.next()):c({},[g],e)}})(g)}return e&&(a.then=a[e]),a.call=function(b,c){c.unshift(b),d.unshift(c),a.next(!0)},a.next()},d=a.addMethod=function(d){var e=Array.prototype.slice.call(arguments),f=e.pop();for(var g=0,h=e.length;g<h;g++)typeof e[g]=="string"&&(b[e[g]]=f);--h||(b["then"+d.substr(0,1).toUpperCase()+d.substr(1)]=f),c(a)},d("chain",function(a){var b=this,c=function(){if(!b.halt){if(!a.length)return b.next(!0);try{null!=a.shift().call(b,c,b.error)&&c()}catch(d){b.error(d)}}};c()}),d("run",function(a,b){var c=this,d=function(){c.halt||--b||c.next(!0)},e=function(a){c.error(a)};for(var f=0,g=b;!c.halt&&f<g;f++)null!=a[f].call(c,d,e)&&d()}),d("defer",function(a){var b=this;setTimeout(function(){b.next(!0)},a.shift())}),d("onError",function(a,b){var c=this;this.error=function(d){c.halt=!0;for(var e=0;e<b;e++)a[e].call(c,d)}})})(this);var head=document.getElementsByTagName("head")[0]||document.documentElement;addMethod("load",function(a,b){for(var c=[],d=0;d<b;d++)(function(b){c.push(asyncLoadScript(a[b]))})(d);this.call("run",c)}) function asyncLoadScript(a){return function(b,c){var d=document.createElement("script");d.type="text/javascript",d.src=a,d.onload=b,d.onerror=c,d.onreadystatechange=function(){var a=this.readyState;if(a==="loaded"||a==="complete")d.onreadystatechange=null,b()},head.insertBefore(d,head.firstChild)}}(function(a){a=a||{};var b={},c,d;c=function(a,d,e){var f=a.halt=!1;a.error=function(a){throw a},a.next=function(c){c&&(f=!1);if(!a.halt&&d&&d.length){var e=d.shift(),g=e.shift();f=!0;try{b[g].apply(a,[e,e.length,g])}catch(h){a.error(h)}}return a};for(var g in b){if(typeof a[g]=="function")continue;(function(e){a[e]=function(){var g=Array.prototype.slice.call(arguments);if(e==="onError"){if(d)return b.onError.apply(a,[g,g.length]),a;var h={};return b.onError.apply(h,[g,g.length]),c(h,null,"onError")}return g.unshift(e),d?(a.then=a[e],d.push(g),f?a:a.next()):c({},[g],e)}})(g)}return e&&(a.then=a[e]),a.call=function(b,c){c.unshift(b),d.unshift(c),a.next(!0)},a.next()},d=a.addMethod=function(d){var e=Array.prototype.slice.call(arguments),f=e.pop();for(var g=0,h=e.length;g<h;g++)typeof e[g]=="string"&&(b[e[g]]=f);--h||(b["then"+d.substr(0,1).toUpperCase()+d.substr(1)]=f),c(a)},d("chain",function(a){var b=this,c=function(){if(!b.halt){if(!a.length)return b.next(!0);try{null!=a.shift().call(b,c,b.error)&&c()}catch(d){b.error(d)}}};c()}),d("run",function(a,b){var c=this,d=function(){c.halt||--b||c.next(!0)},e=function(a){c.error(a)};for(var f=0,g=b;!c.halt&&f<g;f++)null!=a[f].call(c,d,e)&&d()}),d("defer",function(a){var b=this;setTimeout(function(){b.next(!0)},a.shift())}),d("onError",function(a,b){var c=this;this.error=function(d){c.halt=!0;for(var e=0;e<b;e++)a[e].call(c,d)}})})(this);var head=document.getElementsByTagName("head")[0]||document.documentElement;addMethod("load",function(a,b){for(var c=[],d=0;d<b;d++)(function(b){c.push(asyncLoadScript(a[b]))})(d);this.call("run",c)})
try { console.log('Loading included JS now'); } catch(e) {}
@@INCLUDERAW:external/leaflet.js@@
// modified version of https://github.com/shramov/leaflet-plugins. Also // modified version of https://github.com/shramov/leaflet-plugins. Also
// contains the default Ingress map style. // contains the default Ingress map style.
var LEAFLETGOOGLE = 'http://breunigs.github.com/ingress-intel-total-conversion/dist/leaflet_google.js'; @@INCLUDERAW:external/leaflet_google.js@@
@@INCLUDERAW:external/autolink.js@@
try { console.log('done loading included JS'); } catch(e) {}
var JQUERY = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'; var JQUERY = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js';
var JQUERYUI = 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js'; var JQUERYUI = 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js';
var LEAFLET = 'http://cdn.leafletjs.com/leaflet-0.5/leaflet.js';
var AUTOLINK = 'http://breunigs.github.com/ingress-intel-total-conversion/dist/autolink.js';
var EMPTY = 'data:text/javascript;base64,';
// dont download resources which have been injected already
var ir = window && window.internalResources ? window.internalResources : [];
if(ir.indexOf('jquery') !== -1) JQUERY = EMPTY;
if(ir.indexOf('jqueryui') !== -1) JQUERYUI = EMPTY;
if(ir.indexOf('leaflet') !== -1) LEAFLET = EMPTY;
if(ir.indexOf('autolink') !== -1) AUTOLINK = EMPTY;
if(ir.indexOf('leafletgoogle') !== -1) LEAFLETGOOGLE = EMPTY;
// after all scripts have loaded, boot the actual app // after all scripts have loaded, boot the actual app
load(JQUERY, LEAFLET, AUTOLINK).then(LEAFLETGOOGLE, JQUERYUI).onError(function (err) { load(JQUERY).then(JQUERYUI).thenRun(boot);
alert('Could not all resources, the script likely wont work.\n\nIf this happend the first time for you, its probably a temporary issue. Just wait a bit and try again.\n\nIf you installed the script for the first time and this happens:\n try disabling NoScript if you have it installed\n press CTRL+SHIFT+K in Firefox or CTRL+SHIFT+I in Chrome/Opera and reload the page. Additional info may be available in the console.\n Open an issue at https://github.com/breunigs/ingress-intel-total-conversion/issues');
}).thenRun(boot);

View File

@ -15,7 +15,7 @@ window.updateGameScore = function(data) {
var es = '<span class="enl" style="width:'+ep+'%;">&nbsp;'+Math.round(ep)+'%</span>'; var es = '<span class="enl" style="width:'+ep+'%;">&nbsp;'+Math.round(ep)+'%</span>';
$('#gamestat').html(rs+es).one('click', function() { window.updateGameScore() }); $('#gamestat').html(rs+es).one('click', function() { window.updateGameScore() });
// help cursor via “#gamestat span” // help cursor via “#gamestat span”
$('#gamestat').attr('title', 'Resistance:\t'+r+' MindUnits\nEnlightenment:\t'+e+' MindUnits'); $('#gamestat').attr('title', 'Resistance:\t'+r+' MindUnits\nEnlightened:\t'+e+' MindUnits');
window.setTimeout('window.updateGameScore', REFRESH_GAME_SCORE*1000); window.setTimeout('window.updateGameScore', REFRESH_GAME_SCORE*1000);
} }

View File

@ -43,13 +43,17 @@
// redrawn. It is called early on in the // redrawn. It is called early on in the
// code/map_data.js#renderPortal as long as there was an // code/map_data.js#renderPortal as long as there was an
// old portal for the guid. // old portal for the guid.
// checkRenderLimit: callback is passed the argument of
// {reached : false} to indicate that the renderlimit is reached
// set reached to true.
window._hooks = {} window._hooks = {}
window.VALID_HOOKS = ['portalAdded', 'portalDetailsUpdated', window.VALID_HOOKS = ['portalAdded', 'portalDetailsUpdated',
'publicChatDataAvailable', 'portalDataLoaded', 'beforePortalReRender']; 'publicChatDataAvailable', 'portalDataLoaded', 'beforePortalReRender',
'checkRenderLimit'];
window.runHooks = function(event, data) { window.runHooks = function(event, data) {
if(VALID_HOOKS.indexOf(event) === -1) throw('Unknown event type: ' + event); if(VALID_HOOKS.indexOf(event) === -1) throw('Unknown event type: ' + event);

View File

@ -261,8 +261,11 @@ window.renderPortal = function(ent) {
// pre-loads player names for high zoom levels // pre-loads player names for high zoom levels
loadPlayerNamesForPortal(ent[2]); loadPlayerNamesForPortal(ent[2]);
var lvWeight = Math.max(2, portalLevel / 1.5); var lvWeight = Math.max(2, Math.floor(portalLevel) / 1.5);
var lvRadius = Math.max(portalLevel + 3, 5); var lvRadius = Math.floor(portalLevel) + 4;
if(team === window.TEAM_NONE) {
lvRadius = 7;
}
var p = L.circleMarker(latlng, { var p = L.circleMarker(latlng, {
radius: lvRadius + (L.Browser.mobile ? PORTAL_RADIUS_ENLARGE_MOBILE : 0), radius: lvRadius + (L.Browser.mobile ? PORTAL_RADIUS_ENLARGE_MOBILE : 0),
@ -481,9 +484,19 @@ window.renderLink = function(ent) {
weight:2, weight:2,
clickable: false, clickable: false,
guid: ent[0], guid: ent[0],
smoothFactor: 10 smoothFactor: 0 // doesnt work for two points anyway, so disable
}); });
// determine which links are very short and dont render them at all.
// in most cases this will go unnoticed, but improve rendering speed.
poly._map = window.map;
poly.projectLatlngs();
var op = poly._originalPoints;
var dist = Math.abs(op[0].x - op[1].x) + Math.abs(op[0].y - op[1].y);
if(dist <= 10) {
return;
}
if(!getPaddedBounds().intersects(poly.getBounds())) return; if(!getPaddedBounds().intersects(poly.getBounds())) return;
poly.on('remove', function() { delete window.links[this.options.guid]; }); poly.on('remove', function() { delete window.links[this.options.guid]; });
@ -512,17 +525,28 @@ window.renderField = function(ent) {
[reg.vertexB.location.latE6/1E6, reg.vertexB.location.lngE6/1E6], [reg.vertexB.location.latE6/1E6, reg.vertexB.location.lngE6/1E6],
[reg.vertexC.location.latE6/1E6, reg.vertexC.location.lngE6/1E6] [reg.vertexC.location.latE6/1E6, reg.vertexC.location.lngE6/1E6]
]; ];
var poly = L.polygon(latlngs, { var poly = L.polygon(latlngs, {
fillColor: COLORS[team], fillColor: COLORS[team],
fillOpacity: 0.25, fillOpacity: 0.25,
stroke: false, stroke: false,
clickable: false, clickable: false,
smoothFactor: 10, smoothFactor: 0, // hiding small fields will be handled below
vertices: ent[2].capturedRegion, vertices: reg,
lastUpdate: ent[1], lastUpdate: ent[1],
guid: ent[0], guid: ent[0],
data: ent[2]}); data: ent[2]});
// determine which fields are too small to be rendered and dont
// render them, so they dont count towards the maximum fields limit.
// This saves some DOM operations as well, but given the relatively
// low amount of fields there isnt much to gain.
// The algorithm is the same as used by Leaflet.
poly._map = window.map;
poly.projectLatlngs();
var count = L.LineUtil.simplify(poly._originalPoints, 6).length;
if(count <= 2) return;
if(!getPaddedBounds().intersects(poly.getBounds())) return; if(!getPaddedBounds().intersects(poly.getBounds())) return;
poly.on('remove', function() { delete window.fields[this.options.guid]; }); poly.on('remove', function() { delete window.fields[this.options.guid]; });

View File

@ -26,7 +26,10 @@ window.renderPortalDetails = function(guid) {
: null; : null;
var playerText = player ? ['owner', player] : null; var playerText = player ? ['owner', player] : null;
var time = d.captured ? unixTimeToString(d.captured.capturedTime) : null; var time = d.captured
? '<span title="' + unixTimeToString(d.captured.capturedTime, true) + '">'
+ unixTimeToString(d.captured.capturedTime) + '</span>'
: null;
var sinceText = time ? ['since', time] : null; var sinceText = time ? ['since', time] : null;
var linkedFields = ['fields', d.portalV2.linkedFields.length]; var linkedFields = ['fields', d.portalV2.linkedFields.length];
@ -41,13 +44,15 @@ window.renderPortalDetails = function(guid) {
var resoDetails = '<table id="resodetails">' + getResonatorDetails(d) + '</table>'; var resoDetails = '<table id="resodetails">' + getResonatorDetails(d) + '</table>';
setPortalIndicators(d); setPortalIndicators(d);
var img = d.imageByUrl && d.imageByUrl.imageUrl ? d.imageByUrl.imageUrl : DEFAULT_PORTAL_IMG; var img = d.imageByUrl && d.imageByUrl.imageUrl
? d.imageByUrl.imageUrl.replace(/^http:/, 'https:')
: DEFAULT_PORTAL_IMG;
var lat = d.locationE6.latE6; var lat = d.locationE6.latE6;
var lng = d.locationE6.lngE6; var lng = d.locationE6.lngE6;
var perma = 'http://ingress.com/intel?latE6='+lat+'&lngE6='+lng+'&z=17&pguid='+guid; var perma = 'http://ingress.com/intel?latE6='+lat+'&lngE6='+lng+'&z=17&pguid='+guid;
var imgTitle = 'title="'+getPortalDescriptionFromDetails(d)+'\n\nClick to show full image."'; var imgTitle = 'title="'+getPortalDescriptionFromDetails(d)+'\n\nClick to show full image."';
var gmaps = 'https://maps.google.com/?q='+lat/1E6+','+lng/1E6; var poslinks = 'window.showPortalPosLinks('+lat/1E6+','+lng/1E6+')';
var postcard = 'Send in a postcard. Will put it online after receiving. Address:\\n\\nStefan Breunig\\nINF 305 R045\\n69120 Heidelberg\\nGermany'; var postcard = 'Send in a postcard. Will put it online after receiving. Address:\\n\\nStefan Breunig\\nINF 305 R045\\n69120 Heidelberg\\nGermany';
$('#portaldetails') $('#portaldetails')
@ -63,7 +68,7 @@ window.renderPortalDetails = function(guid) {
+ randDetails + randDetails
+ resoDetails + resoDetails
+ '<div class="linkdetails">'+ '<aside><a href="'+perma+'">portal link</a></aside>' + '<div class="linkdetails">'+ '<aside><a href="'+perma+'">portal link</a></aside>'
+ '<aside><a href="'+gmaps+'" target="_blank">gmaps</a></aside>' + '<aside><a onclick="'+poslinks+'">poslinks</a></aside>'
+ '<aside><a onclick="alert(\''+postcard+'\');">donate</a></aside>' + '<aside><a onclick="alert(\''+postcard+'\');">donate</a></aside>'
+ '<aside><a onclick="window.reportPortalIssue()">report issue</a></aside>' + '<aside><a onclick="window.reportPortalIssue()">report issue</a></aside>'
+ '</div>' + '</div>'

View File

@ -54,7 +54,7 @@ window.postAjax = function(action, data, success, error) {
// use full URL to avoid issues depending on how people set their // use full URL to avoid issues depending on how people set their
// slash. See: // slash. See:
// https://github.com/breunigs/ingress-intel-total-conversion/issues/56 // https://github.com/breunigs/ingress-intel-total-conversion/issues/56
url: 'http://www.ingress.com/rpc/dashboard.'+action, url: 'https://www.ingress.com/rpc/dashboard.'+action,
type: 'POST', type: 'POST',
data: data, data: data,
dataType: 'json', dataType: 'json',
@ -96,8 +96,16 @@ window.rangeLinkClick = function() {
window.smartphone.mapButton.click(); window.smartphone.mapButton.click();
} }
window.showPortalPosLinks = function(lat, lng) {
var qrcode = '<div id="qrcode"></div>';
var script = '<script>$(\'#qrcode\').qrcode({text:\'GEO:'+lat+','+lng+'\'});</script>';
var gmaps = '<a href="https://maps.google.com/?q='+lat+','+lng+'">gmaps</a>';
var osm = '<a href="http://www.openstreetmap.org/?mlat='+lat+'&mlon='+lng+'&zoom=16">OSM</a>';
alert('<div style="text-align: center;">' + qrcode + script + gmaps + ' ' + osm + '</div>');
}
window.reportPortalIssue = function(info) { window.reportPortalIssue = function(info) {
var t = 'Redirecting you to a Google Help Page. Once there, click on “Contact Us” in the upper right corner.\n\nThe text box contains all necessary information. Press CTRL+C to copy it.'; var t = 'Redirecting you to a Google Help Page.\n\nThe text box contains all necessary information. Press CTRL+C to copy it.';
var d = window.portals[window.selectedPortal].options.details; var d = window.portals[window.selectedPortal].options.details;
var info = 'Your Nick: ' + PLAYER.nickname + ' ' var info = 'Your Nick: ' + PLAYER.nickname + ' '
@ -107,7 +115,7 @@ window.reportPortalIssue = function(info) {
//codename, approx addr, portalname //codename, approx addr, portalname
if(prompt(t, info) !== null) if(prompt(t, info) !== null)
location.href = 'https://support.google.com/ingress?hl=en'; location.href = 'https://support.google.com/ingress?hl=en&contact=1';
} }
window._storedPaddedBounds = undefined; window._storedPaddedBounds = undefined;
@ -117,6 +125,7 @@ window.getPaddedBounds = function() {
window._storedPaddedBounds = null; window._storedPaddedBounds = null;
}); });
} }
if(renderLimitReached(0.7)) return window.map.getBounds();
if(window._storedPaddedBounds) return window._storedPaddedBounds; if(window._storedPaddedBounds) return window._storedPaddedBounds;
var p = window.map.getBounds().pad(VIEWPORT_PAD_RATIO); var p = window.map.getBounds().pad(VIEWPORT_PAD_RATIO);
@ -124,11 +133,19 @@ window.getPaddedBounds = function() {
return p; return p;
} }
window.renderLimitReached = function() { // returns true if the render limit has been reached. The default ratio
if(Object.keys(portals).length >= MAX_DRAWN_PORTALS) return true; // is 1, which means it will tell you if there are more items drawn than
if(Object.keys(links).length >= MAX_DRAWN_LINKS) return true; // acceptable. A value of 0.9 will tell you if 90% of the amount of
if(Object.keys(fields).length >= MAX_DRAWN_FIELDS) return true; // acceptable entities have been drawn. You can use this to heuristi-
return false; // cally detect if the render limit will be hit.
window.renderLimitReached = function(ratio) {
ratio = ratio || 1;
if(Object.keys(portals).length*ratio >= MAX_DRAWN_PORTALS) return true;
if(Object.keys(links).length*ratio >= MAX_DRAWN_LINKS) return true;
if(Object.keys(fields).length*ratio >= MAX_DRAWN_FIELDS) return true;
var param = { 'reached': false };
window.runHooks('checkRenderLimit', param);
return param.reached;
} }
window.getMinPortalLevel = function() { window.getMinPortalLevel = function() {

169
dist/delaunay.js vendored Normal file
View File

@ -0,0 +1,169 @@
// Source from https://github.com/ironwallaby/delaunay
window.delaunay = function() {};
window.delaunay.Triangle = function (a, b, c) {
this.a = a
this.b = b
this.c = c
var A = b.x - a.x,
B = b.y - a.y,
C = c.x - a.x,
D = c.y - a.y,
E = A * (a.x + b.x) + B * (a.y + b.y),
F = C * (a.x + c.x) + D * (a.y + c.y),
G = 2 * (A * (c.y - b.y) - B * (c.x - b.x)),
minx, miny, dx, dy
/* If the points of the triangle are collinear, then just find the
* extremes and use the midpoint as the center of the circumcircle. */
if(Math.abs(G) < 0.000001) {
minx = Math.min(a.x, b.x, c.x)
miny = Math.min(a.y, b.y, c.y)
dx = (Math.max(a.x, b.x, c.x) - minx) * 0.5
dy = (Math.max(a.y, b.y, c.y) - miny) * 0.5
this.x = minx + dx
this.y = miny + dy
this.r = dx * dx + dy * dy
}
else {
this.x = (D*E - B*F) / G
this.y = (A*F - C*E) / G
dx = this.x - a.x
dy = this.y - a.y
this.r = dx * dx + dy * dy
}
}
function byX(a, b) {
return b.x - a.x
}
function dedup(edges) {
var j = edges.length,
a, b, i, m, n
outer: while(j) {
b = edges[--j]
a = edges[--j]
i = j
while(i) {
n = edges[--i]
m = edges[--i]
if((a === m && b === n) || (a === n && b === m)) {
edges.splice(j, 2)
edges.splice(i, 2)
j -= 2
continue outer
}
}
}
}
window.delaunay.triangulate = function (vertices) {
/* Bail if there aren't enough vertices to form any triangles. */
if(vertices.length < 3)
return []
/* Ensure the vertex array is in order of descending X coordinate
* (which is needed to ensure a subquadratic runtime), and then find
* the bounding box around the points. */
vertices.sort(byX)
var i = vertices.length - 1,
xmin = vertices[i].x,
xmax = vertices[0].x,
ymin = vertices[i].y,
ymax = ymin
while(i--) {
if(vertices[i].y < ymin) ymin = vertices[i].y
if(vertices[i].y > ymax) ymax = vertices[i].y
}
/* Find a supertriangle, which is a triangle that surrounds all the
* vertices. This is used like something of a sentinel value to remove
* cases in the main algorithm, and is removed before we return any
* results.
*
* Once found, put it in the "open" list. (The "open" list is for
* triangles who may still need to be considered; the "closed" list is
* for triangles which do not.) */
var dx = xmax - xmin,
dy = ymax - ymin,
dmax = (dx > dy) ? dx : dy,
xmid = (xmax + xmin) * 0.5,
ymid = (ymax + ymin) * 0.5,
open = [
new window.delaunay.Triangle(
{x: xmid - 20 * dmax, y: ymid - dmax, __sentinel: true},
{x: xmid , y: ymid + 20 * dmax, __sentinel: true},
{x: xmid + 20 * dmax, y: ymid - dmax, __sentinel: true}
)
],
closed = [],
edges = [],
j, a, b
/* Incrementally add each vertex to the mesh. */
i = vertices.length
while(i--) {
/* For each open triangle, check to see if the current point is
* inside it's circumcircle. If it is, remove the triangle and add
* it's edges to an edge list. */
edges.length = 0
j = open.length
while(j--) {
/* If this point is to the right of this triangle's circumcircle,
* then this triangle should never get checked again. Remove it
* from the open list, add it to the closed list, and skip. */
dx = vertices[i].x - open[j].x
if(dx > 0 && dx * dx > open[j].r) {
closed.push(open[j])
open.splice(j, 1)
continue
}
/* If not, skip this triangle. */
dy = vertices[i].y - open[j].y
if(dx * dx + dy * dy > open[j].r)
continue
/* Remove the triangle and add it's edges to the edge list. */
edges.push(
open[j].a, open[j].b,
open[j].b, open[j].c,
open[j].c, open[j].a
)
open.splice(j, 1)
}
/* Remove any doubled edges. */
dedup(edges)
/* Add a new triangle for each edge. */
j = edges.length
while(j) {
b = edges[--j]
a = edges[--j]
open.push(new window.delaunay.Triangle(a, b, vertices[i]))
}
}
/* Copy any remaining open triangles to the closed list, and then
* remove any triangles that share a vertex with the supertriangle. */
Array.prototype.push.apply(closed, open)
i = closed.length
while(i--)
if(closed[i].a.__sentinel ||
closed[i].b.__sentinel ||
closed[i].c.__sentinel)
closed.splice(i, 1)
/* Yay, we're done! */
return closed
}

BIN
dist/images/layers.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 973 B

File diff suppressed because one or more lines are too long

28
external/jquery.qrcode.min.js vendored Normal file
View File

@ -0,0 +1,28 @@
(function(r){r.fn.qrcode=function(h){var s;function u(a){this.mode=s;this.data=a}function o(a,c){this.typeNumber=a;this.errorCorrectLevel=c;this.modules=null;this.moduleCount=0;this.dataCache=null;this.dataList=[]}function q(a,c){if(void 0==a.length)throw Error(a.length+"/"+c);for(var d=0;d<a.length&&0==a[d];)d++;this.num=Array(a.length-d+c);for(var b=0;b<a.length-d;b++)this.num[b]=a[b+d]}function p(a,c){this.totalCount=a;this.dataCount=c}function t(){this.buffer=[];this.length=0}u.prototype={getLength:function(){return this.data.length},
write:function(a){for(var c=0;c<this.data.length;c++)a.put(this.data.charCodeAt(c),8)}};o.prototype={addData:function(a){this.dataList.push(new u(a));this.dataCache=null},isDark:function(a,c){if(0>a||this.moduleCount<=a||0>c||this.moduleCount<=c)throw Error(a+","+c);return this.modules[a][c]},getModuleCount:function(){return this.moduleCount},make:function(){if(1>this.typeNumber){for(var a=1,a=1;40>a;a++){for(var c=p.getRSBlocks(a,this.errorCorrectLevel),d=new t,b=0,e=0;e<c.length;e++)b+=c[e].dataCount;
for(e=0;e<this.dataList.length;e++)c=this.dataList[e],d.put(c.mode,4),d.put(c.getLength(),j.getLengthInBits(c.mode,a)),c.write(d);if(d.getLengthInBits()<=8*b)break}this.typeNumber=a}this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(a,c){this.moduleCount=4*this.typeNumber+17;this.modules=Array(this.moduleCount);for(var d=0;d<this.moduleCount;d++){this.modules[d]=Array(this.moduleCount);for(var b=0;b<this.moduleCount;b++)this.modules[d][b]=null}this.setupPositionProbePattern(0,0);this.setupPositionProbePattern(this.moduleCount-
7,0);this.setupPositionProbePattern(0,this.moduleCount-7);this.setupPositionAdjustPattern();this.setupTimingPattern();this.setupTypeInfo(a,c);7<=this.typeNumber&&this.setupTypeNumber(a);null==this.dataCache&&(this.dataCache=o.createData(this.typeNumber,this.errorCorrectLevel,this.dataList));this.mapData(this.dataCache,c)},setupPositionProbePattern:function(a,c){for(var d=-1;7>=d;d++)if(!(-1>=a+d||this.moduleCount<=a+d))for(var b=-1;7>=b;b++)-1>=c+b||this.moduleCount<=c+b||(this.modules[a+d][c+b]=
0<=d&&6>=d&&(0==b||6==b)||0<=b&&6>=b&&(0==d||6==d)||2<=d&&4>=d&&2<=b&&4>=b?!0:!1)},getBestMaskPattern:function(){for(var a=0,c=0,d=0;8>d;d++){this.makeImpl(!0,d);var b=j.getLostPoint(this);if(0==d||a>b)a=b,c=d}return c},createMovieClip:function(a,c,d){a=a.createEmptyMovieClip(c,d);this.make();for(c=0;c<this.modules.length;c++)for(var d=1*c,b=0;b<this.modules[c].length;b++){var e=1*b;this.modules[c][b]&&(a.beginFill(0,100),a.moveTo(e,d),a.lineTo(e+1,d),a.lineTo(e+1,d+1),a.lineTo(e,d+1),a.endFill())}return a},
setupTimingPattern:function(){for(var a=8;a<this.moduleCount-8;a++)null==this.modules[a][6]&&(this.modules[a][6]=0==a%2);for(a=8;a<this.moduleCount-8;a++)null==this.modules[6][a]&&(this.modules[6][a]=0==a%2)},setupPositionAdjustPattern:function(){for(var a=j.getPatternPosition(this.typeNumber),c=0;c<a.length;c++)for(var d=0;d<a.length;d++){var b=a[c],e=a[d];if(null==this.modules[b][e])for(var f=-2;2>=f;f++)for(var i=-2;2>=i;i++)this.modules[b+f][e+i]=-2==f||2==f||-2==i||2==i||0==f&&0==i?!0:!1}},setupTypeNumber:function(a){for(var c=
j.getBCHTypeNumber(this.typeNumber),d=0;18>d;d++){var b=!a&&1==(c>>d&1);this.modules[Math.floor(d/3)][d%3+this.moduleCount-8-3]=b}for(d=0;18>d;d++)b=!a&&1==(c>>d&1),this.modules[d%3+this.moduleCount-8-3][Math.floor(d/3)]=b},setupTypeInfo:function(a,c){for(var d=j.getBCHTypeInfo(this.errorCorrectLevel<<3|c),b=0;15>b;b++){var e=!a&&1==(d>>b&1);6>b?this.modules[b][8]=e:8>b?this.modules[b+1][8]=e:this.modules[this.moduleCount-15+b][8]=e}for(b=0;15>b;b++)e=!a&&1==(d>>b&1),8>b?this.modules[8][this.moduleCount-
b-1]=e:9>b?this.modules[8][15-b-1+1]=e:this.modules[8][15-b-1]=e;this.modules[this.moduleCount-8][8]=!a},mapData:function(a,c){for(var d=-1,b=this.moduleCount-1,e=7,f=0,i=this.moduleCount-1;0<i;i-=2)for(6==i&&i--;;){for(var g=0;2>g;g++)if(null==this.modules[b][i-g]){var n=!1;f<a.length&&(n=1==(a[f]>>>e&1));j.getMask(c,b,i-g)&&(n=!n);this.modules[b][i-g]=n;e--; -1==e&&(f++,e=7)}b+=d;if(0>b||this.moduleCount<=b){b-=d;d=-d;break}}}};o.PAD0=236;o.PAD1=17;o.createData=function(a,c,d){for(var c=p.getRSBlocks(a,
c),b=new t,e=0;e<d.length;e++){var f=d[e];b.put(f.mode,4);b.put(f.getLength(),j.getLengthInBits(f.mode,a));f.write(b)}for(e=a=0;e<c.length;e++)a+=c[e].dataCount;if(b.getLengthInBits()>8*a)throw Error("code length overflow. ("+b.getLengthInBits()+">"+8*a+")");for(b.getLengthInBits()+4<=8*a&&b.put(0,4);0!=b.getLengthInBits()%8;)b.putBit(!1);for(;!(b.getLengthInBits()>=8*a);){b.put(o.PAD0,8);if(b.getLengthInBits()>=8*a)break;b.put(o.PAD1,8)}return o.createBytes(b,c)};o.createBytes=function(a,c){for(var d=
0,b=0,e=0,f=Array(c.length),i=Array(c.length),g=0;g<c.length;g++){var n=c[g].dataCount,h=c[g].totalCount-n,b=Math.max(b,n),e=Math.max(e,h);f[g]=Array(n);for(var k=0;k<f[g].length;k++)f[g][k]=255&a.buffer[k+d];d+=n;k=j.getErrorCorrectPolynomial(h);n=(new q(f[g],k.getLength()-1)).mod(k);i[g]=Array(k.getLength()-1);for(k=0;k<i[g].length;k++)h=k+n.getLength()-i[g].length,i[g][k]=0<=h?n.get(h):0}for(k=g=0;k<c.length;k++)g+=c[k].totalCount;d=Array(g);for(k=n=0;k<b;k++)for(g=0;g<c.length;g++)k<f[g].length&&
(d[n++]=f[g][k]);for(k=0;k<e;k++)for(g=0;g<c.length;g++)k<i[g].length&&(d[n++]=i[g][k]);return d};s=4;for(var j={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,
78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(a){for(var c=a<<10;0<=j.getBCHDigit(c)-j.getBCHDigit(j.G15);)c^=j.G15<<j.getBCHDigit(c)-j.getBCHDigit(j.G15);return(a<<10|c)^j.G15_MASK},getBCHTypeNumber:function(a){for(var c=a<<12;0<=j.getBCHDigit(c)-
j.getBCHDigit(j.G18);)c^=j.G18<<j.getBCHDigit(c)-j.getBCHDigit(j.G18);return a<<12|c},getBCHDigit:function(a){for(var c=0;0!=a;)c++,a>>>=1;return c},getPatternPosition:function(a){return j.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,c,d){switch(a){case 0:return 0==(c+d)%2;case 1:return 0==c%2;case 2:return 0==d%3;case 3:return 0==(c+d)%3;case 4:return 0==(Math.floor(c/2)+Math.floor(d/3))%2;case 5:return 0==c*d%2+c*d%3;case 6:return 0==(c*d%2+c*d%3)%2;case 7:return 0==(c*d%3+(c+d)%2)%2;default:throw Error("bad maskPattern:"+
a);}},getErrorCorrectPolynomial:function(a){for(var c=new q([1],0),d=0;d<a;d++)c=c.multiply(new q([1,l.gexp(d)],0));return c},getLengthInBits:function(a,c){if(1<=c&&10>c)switch(a){case 1:return 10;case 2:return 9;case s:return 8;case 8:return 8;default:throw Error("mode:"+a);}else if(27>c)switch(a){case 1:return 12;case 2:return 11;case s:return 16;case 8:return 10;default:throw Error("mode:"+a);}else if(41>c)switch(a){case 1:return 14;case 2:return 13;case s:return 16;case 8:return 12;default:throw Error("mode:"+
a);}else throw Error("type:"+c);},getLostPoint:function(a){for(var c=a.getModuleCount(),d=0,b=0;b<c;b++)for(var e=0;e<c;e++){for(var f=0,i=a.isDark(b,e),g=-1;1>=g;g++)if(!(0>b+g||c<=b+g))for(var h=-1;1>=h;h++)0>e+h||c<=e+h||0==g&&0==h||i==a.isDark(b+g,e+h)&&f++;5<f&&(d+=3+f-5)}for(b=0;b<c-1;b++)for(e=0;e<c-1;e++)if(f=0,a.isDark(b,e)&&f++,a.isDark(b+1,e)&&f++,a.isDark(b,e+1)&&f++,a.isDark(b+1,e+1)&&f++,0==f||4==f)d+=3;for(b=0;b<c;b++)for(e=0;e<c-6;e++)a.isDark(b,e)&&!a.isDark(b,e+1)&&a.isDark(b,e+
2)&&a.isDark(b,e+3)&&a.isDark(b,e+4)&&!a.isDark(b,e+5)&&a.isDark(b,e+6)&&(d+=40);for(e=0;e<c;e++)for(b=0;b<c-6;b++)a.isDark(b,e)&&!a.isDark(b+1,e)&&a.isDark(b+2,e)&&a.isDark(b+3,e)&&a.isDark(b+4,e)&&!a.isDark(b+5,e)&&a.isDark(b+6,e)&&(d+=40);for(e=f=0;e<c;e++)for(b=0;b<c;b++)a.isDark(b,e)&&f++;a=Math.abs(100*f/c/c-50)/5;return d+10*a}},l={glog:function(a){if(1>a)throw Error("glog("+a+")");return l.LOG_TABLE[a]},gexp:function(a){for(;0>a;)a+=255;for(;256<=a;)a-=255;return l.EXP_TABLE[a]},EXP_TABLE:Array(256),
LOG_TABLE:Array(256)},m=0;8>m;m++)l.EXP_TABLE[m]=1<<m;for(m=8;256>m;m++)l.EXP_TABLE[m]=l.EXP_TABLE[m-4]^l.EXP_TABLE[m-5]^l.EXP_TABLE[m-6]^l.EXP_TABLE[m-8];for(m=0;255>m;m++)l.LOG_TABLE[l.EXP_TABLE[m]]=m;q.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var c=Array(this.getLength()+a.getLength()-1),d=0;d<this.getLength();d++)for(var b=0;b<a.getLength();b++)c[d+b]^=l.gexp(l.glog(this.get(d))+l.glog(a.get(b)));return new q(c,0)},mod:function(a){if(0>
this.getLength()-a.getLength())return this;for(var c=l.glog(this.get(0))-l.glog(a.get(0)),d=Array(this.getLength()),b=0;b<this.getLength();b++)d[b]=this.get(b);for(b=0;b<a.getLength();b++)d[b]^=l.gexp(l.glog(a.get(b))+c);return(new q(d,0)).mod(a)}};p.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],
[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,
116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,
43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,
3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,
55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,
45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];p.getRSBlocks=function(a,c){var d=p.getRsBlockTable(a,c);if(void 0==d)throw Error("bad rs block @ typeNumber:"+a+"/errorCorrectLevel:"+c);for(var b=d.length/3,e=[],f=0;f<b;f++)for(var h=d[3*f+0],g=d[3*f+1],j=d[3*f+2],l=0;l<h;l++)e.push(new p(g,j));return e};p.getRsBlockTable=function(a,c){switch(c){case 1:return p.RS_BLOCK_TABLE[4*(a-1)+0];case 0:return p.RS_BLOCK_TABLE[4*(a-1)+1];case 3:return p.RS_BLOCK_TABLE[4*
(a-1)+2];case 2:return p.RS_BLOCK_TABLE[4*(a-1)+3]}};t.prototype={get:function(a){return 1==(this.buffer[Math.floor(a/8)]>>>7-a%8&1)},put:function(a,c){for(var d=0;d<c;d++)this.putBit(1==(a>>>c-d-1&1))},getLengthInBits:function(){return this.length},putBit:function(a){var c=Math.floor(this.length/8);this.buffer.length<=c&&this.buffer.push(0);a&&(this.buffer[c]|=128>>>this.length%8);this.length++}};"string"===typeof h&&(h={text:h});h=r.extend({},{render:"canvas",width:256,height:256,typeNumber:-1,
correctLevel:2,background:"#ffffff",foreground:"#000000"},h);return this.each(function(){var a;if("canvas"==h.render){a=new o(h.typeNumber,h.correctLevel);a.addData(h.text);a.make();var c=document.createElement("canvas");c.width=h.width;c.height=h.height;for(var d=c.getContext("2d"),b=h.width/a.getModuleCount(),e=h.height/a.getModuleCount(),f=0;f<a.getModuleCount();f++)for(var i=0;i<a.getModuleCount();i++){d.fillStyle=a.isDark(f,i)?h.foreground:h.background;var g=Math.ceil((i+1)*b)-Math.floor(i*b),
j=Math.ceil((f+1)*b)-Math.floor(f*b);d.fillRect(Math.round(i*b),Math.round(f*e),g,j)}}else{a=new o(h.typeNumber,h.correctLevel);a.addData(h.text);a.make();c=r("<table></table>").css("width",h.width+"px").css("height",h.height+"px").css("border","0px").css("border-collapse","collapse").css("background-color",h.background);d=h.width/a.getModuleCount();b=h.height/a.getModuleCount();for(e=0;e<a.getModuleCount();e++){f=r("<tr></tr>").css("height",b+"px").appendTo(c);for(i=0;i<a.getModuleCount();i++)r("<td></td>").css("width",
d+"px").css("background-color",a.isDark(e,i)?h.foreground:h.background).appendTo(f)}}a=c;jQuery(a).appendTo(this)})}})(jQuery);

457
external/leaflet.css vendored Normal file
View File

@ -0,0 +1,457 @@
/* required styles */
.leaflet-map-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-pane,
.leaflet-overlay-pane,
.leaflet-shadow-pane,
.leaflet-marker-pane,
.leaflet-popup-pane,
.leaflet-overlay-pane svg,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
position: absolute;
left: 0;
top: 0;
}
.leaflet-container {
overflow: hidden;
-ms-touch-action: none;
}
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.leaflet-marker-icon,
.leaflet-marker-shadow {
display: block;
}
/* map is broken in FF if you have max-width: 100% on tiles */
.leaflet-container img {
max-width: none !important;
}
/* stupid Android 2 doesn't understand "max-width: none" properly */
.leaflet-container img.leaflet-image-layer {
max-width: 15000px !important;
}
.leaflet-tile {
filter: inherit;
visibility: hidden;
}
.leaflet-tile-loaded {
visibility: inherit;
}
.leaflet-zoom-box {
width: 0;
height: 0;
}
.leaflet-tile-pane { z-index: 2; }
.leaflet-objects-pane { z-index: 3; }
.leaflet-overlay-pane { z-index: 4; }
.leaflet-shadow-pane { z-index: 5; }
.leaflet-marker-pane { z-index: 6; }
.leaflet-popup-pane { z-index: 7; }
/* control positioning */
.leaflet-control {
position: relative;
z-index: 7;
pointer-events: auto;
}
.leaflet-top,
.leaflet-bottom {
position: absolute;
z-index: 1000;
pointer-events: none;
}
.leaflet-top {
top: 0;
}
.leaflet-right {
right: 0;
}
.leaflet-bottom {
bottom: 0;
}
.leaflet-left {
left: 0;
}
.leaflet-control {
float: left;
clear: both;
}
.leaflet-right .leaflet-control {
float: right;
}
.leaflet-top .leaflet-control {
margin-top: 10px;
}
.leaflet-bottom .leaflet-control {
margin-bottom: 10px;
}
.leaflet-left .leaflet-control {
margin-left: 10px;
}
.leaflet-right .leaflet-control {
margin-right: 10px;
}
/* zoom and fade animations */
.leaflet-fade-anim .leaflet-tile,
.leaflet-fade-anim .leaflet-popup {
opacity: 0;
-webkit-transition: opacity 0.2s linear;
-moz-transition: opacity 0.2s linear;
-o-transition: opacity 0.2s linear;
transition: opacity 0.2s linear;
}
.leaflet-fade-anim .leaflet-tile-loaded,
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
opacity: 1;
}
.leaflet-zoom-anim .leaflet-zoom-animated {
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
-moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
-o-transition: -o-transform 0.25s cubic-bezier(0,0,0.25,1);
transition: transform 0.25s cubic-bezier(0,0,0.25,1);
}
.leaflet-zoom-anim .leaflet-tile,
.leaflet-pan-anim .leaflet-tile,
.leaflet-touching .leaflet-zoom-animated {
-webkit-transition: none;
-moz-transition: none;
-o-transition: none;
transition: none;
}
.leaflet-zoom-anim .leaflet-zoom-hide {
visibility: hidden;
}
/* cursors */
.leaflet-clickable {
cursor: pointer;
}
.leaflet-container {
cursor: -webkit-grab;
cursor: -moz-grab;
}
.leaflet-popup-pane,
.leaflet-control {
cursor: auto;
}
.leaflet-dragging,
.leaflet-dragging .leaflet-clickable,
.leaflet-dragging .leaflet-container {
cursor: move;
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
}
/* visual tweaks */
.leaflet-container {
background: #ddd;
outline: 0;
}
.leaflet-container a {
color: #0078A8;
}
.leaflet-container a.leaflet-active {
outline: 2px solid orange;
}
.leaflet-zoom-box {
border: 2px dotted #05f;
background: white;
opacity: 0.5;
}
/* general typography */
.leaflet-container {
font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;
}
/* general toolbar styles */
.leaflet-bar {
box-shadow: 0 0 8px rgba(0,0,0,0.4);
border: 1px solid #888;
-webkit-border-radius: 5px;
border-radius: 5px;
}
.leaflet-bar-part {
background-color: rgba(255, 255, 255, 0.8);
border-bottom: 1px solid #aaa;
}
.leaflet-bar-part-top {
-webkit-border-radius: 4px 4px 0 0;
border-radius: 4px 4px 0 0;
}
.leaflet-bar-part-bottom {
-webkit-border-radius: 0 0 4px 4px;
border-radius: 0 0 4px 4px;
border-bottom: none;
}
.leaflet-touch .leaflet-bar {
-webkit-border-radius: 10px;
border-radius: 10px;
}
.leaflet-touch .leaflet-bar-part {
border-bottom: 4px solid rgba(0,0,0,0.3);
}
.leaflet-touch .leaflet-bar-part-top {
-webkit-border-radius: 7px 7px 0 0;
border-radius: 7px 7px 0 0;
}
.leaflet-touch .leaflet-bar-part-bottom {
-webkit-border-radius: 0 0 7px 7px;
border-radius: 0 0 7px 7px;
border-bottom: none;
}
/* zoom control */
.leaflet-container .leaflet-control-zoom {
margin-left: 13px;
margin-top: 12px;
}
.leaflet-control-zoom a {
width: 22px;
height: 22px;
text-align: center;
text-decoration: none;
color: black;
}
.leaflet-control-zoom a,
.leaflet-control-layers-toggle {
background-position: 50% 50%;
background-repeat: no-repeat;
display: block;
}
.leaflet-control-zoom a:hover {
background-color: #fff;
color: #777;
}
.leaflet-control-zoom-in {
font: bold 18px/24px Arial, Helvetica, sans-serif;
}
.leaflet-control-zoom-out {
font: bold 23px/20px Tahoma, Verdana, sans-serif;
}
.leaflet-control-zoom a.leaflet-control-zoom-disabled {
cursor: default;
background-color: rgba(255, 255, 255, 0.8);
color: #bbb;
}
.leaflet-touch .leaflet-control-zoom a {
width: 30px;
height: 30px;
}
.leaflet-touch .leaflet-control-zoom-in {
font-size: 24px;
line-height: 29px;
}
.leaflet-touch .leaflet-control-zoom-out {
font-size: 28px;
line-height: 24px;
}
/* layers control */
.leaflet-control-layers {
box-shadow: 0 1px 7px rgba(0,0,0,0.4);
background: #f8f8f9;
-webkit-border-radius: 8px;
border-radius: 8px;
}
.leaflet-control-layers-toggle {
background-image: url(https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/dist/images/layers.png);
width: 36px;
height: 36px;
}
.leaflet-touch .leaflet-control-layers-toggle {
width: 44px;
height: 44px;
}
.leaflet-control-layers .leaflet-control-layers-list,
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
display: none;
}
.leaflet-control-layers-expanded .leaflet-control-layers-list {
display: block;
position: relative;
}
.leaflet-control-layers-expanded {
padding: 6px 10px 6px 6px;
color: #333;
background: #fff;
}
.leaflet-control-layers-selector {
margin-top: 2px;
position: relative;
top: 1px;
}
.leaflet-control-layers label {
display: block;
}
.leaflet-control-layers-separator {
height: 0;
border-top: 1px solid #ddd;
margin: 5px -10px 5px -6px;
}
/* attribution and scale controls */
.leaflet-container .leaflet-control-attribution {
background-color: rgba(255, 255, 255, 0.7);
box-shadow: 0 0 5px #bbb;
margin: 0;
}
.leaflet-control-attribution,
.leaflet-control-scale-line {
padding: 0 5px;
color: #333;
}
.leaflet-container .leaflet-control-attribution,
.leaflet-container .leaflet-control-scale {
font-size: 11px;
}
.leaflet-left .leaflet-control-scale {
margin-left: 5px;
}
.leaflet-bottom .leaflet-control-scale {
margin-bottom: 5px;
}
.leaflet-control-scale-line {
border: 2px solid #777;
border-top: none;
color: black;
line-height: 1.1;
padding: 2px 5px 1px;
font-size: 11px;
text-shadow: 1px 1px 1px #fff;
background-color: rgba(255, 255, 255, 0.5);
box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.2);
white-space: nowrap;
overflow: hidden;
}
.leaflet-control-scale-line:not(:first-child) {
border-top: 2px solid #777;
border-bottom: none;
margin-top: -2px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
.leaflet-control-scale-line:not(:first-child):not(:last-child) {
border-bottom: 2px solid #777;
}
.leaflet-touch .leaflet-control-attribution,
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-control-zoom {
box-shadow: none;
}
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-control-zoom {
border: 4px solid rgba(0,0,0,0.3);
}
/* popup */
.leaflet-popup {
position: absolute;
text-align: center;
}
.leaflet-popup-content-wrapper {
padding: 1px;
text-align: left;
-webkit-border-radius: 20px;
border-radius: 20px;
}
.leaflet-popup-content {
margin: 14px 20px;
line-height: 1.4;
}
.leaflet-popup-content p {
margin: 18px 0;
}
.leaflet-popup-tip-container {
margin: 0 auto;
width: 40px;
height: 20px;
position: relative;
overflow: hidden;
}
.leaflet-popup-tip {
width: 15px;
height: 15px;
padding: 1px;
margin: -8px auto 0;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
background: white;
box-shadow: 0 3px 14px rgba(0,0,0,0.4);
}
.leaflet-container a.leaflet-popup-close-button {
position: absolute;
top: 0;
right: 0;
padding: 4px 5px 0 0;
text-align: center;
width: 18px;
height: 14px;
font: 16px/14px Tahoma, Verdana, sans-serif;
color: #c3c3c3;
text-decoration: none;
font-weight: bold;
background: transparent;
}
.leaflet-container a.leaflet-popup-close-button:hover {
color: #999;
}
.leaflet-popup-scrolled {
overflow: auto;
border-bottom: 1px solid #ddd;
border-top: 1px solid #ddd;
}
/* div icon */
.leaflet-div-icon {
background: #fff;
border: 1px solid #666;
}
.leaflet-editing-icon {
-webkit-border-radius: 2px;
border-radius: 2px;
}

8
external/leaflet.js vendored Normal file

File diff suppressed because one or more lines are too long

BIN
images/layers.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 973 B

39
main.js
View File

@ -1,25 +1,32 @@
// ==UserScript== // ==UserScript==
// @id ingress-intel-total-conversion@breunigs // @id ingress-intel-total-conversion@breunigs
// @name intel map total conversion // @name intel map total conversion
// @version 0.6-@@BUILDDATE@@ // @version 0.7.7-@@BUILDDATE@@
// @namespace https://github.com/breunigs/ingress-intel-total-conversion // @namespace https://github.com/breunigs/ingress-intel-total-conversion
// @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/dist/total-conversion-build.user.js // @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/dist/total-conversion-build.user.js
// @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/dist/total-conversion-build.user.js // @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/dist/total-conversion-build.user.js
// @description total conversion for the ingress intel map. // @description total conversion for the ingress intel map.
// @include http://www.ingress.com/intel* // @include http://www.ingress.com/intel*
// @include https://www.ingress.com/intel*
// @match http://www.ingress.com/intel* // @match http://www.ingress.com/intel*
// @match https://www.ingress.com/intel*
// ==/UserScript== // ==/UserScript==
// REPLACE ORIG SITE /////////////////////////////////////////////////// // REPLACE ORIG SITE ///////////////////////////////////////////////////
if(document.getElementsByTagName('html')[0].getAttribute('itemscope') != null) if(document.getElementsByTagName('html')[0].getAttribute('itemscope') != null)
throw('Ingress Intel Website is down, not a userscript issue.'); throw('Ingress Intel Website is down, not a userscript issue.');
window.iitcBuildDate = '@@BUILDDATE@@'; window.iitcBuildDate = '@@BUILDDATE@@';
// disable vanilla JS // disable vanilla JS
window.onload = function() {}; window.onload = function() {};
if(window.location.protocol !== 'https:') {
var redir = window.location.href.replace(/^http:/, 'https:');
window.location = redir;
throw('Need to load HTTPS version.');
}
// rescue user data from original page // rescue user data from original page
var scr = document.getElementsByTagName('script'); var scr = document.getElementsByTagName('script');
for(var x in scr) { for(var x in scr) {
@ -51,32 +58,18 @@ for(var i = 0; i < d.length; i++) {
// player information is now available in a hash like this: // player information is now available in a hash like this:
// window.PLAYER = {"ap": "123", "energy": 123, "available_invites": 123, "nickname": "somenick", "team": "ALIENS||RESISTANCE"}; // window.PLAYER = {"ap": "123", "energy": 123, "available_invites": 123, "nickname": "somenick", "team": "ALIENS||RESISTANCE"};
var ir = window.internalResources || [];
var mainstyle = 'http://breunigs.github.com/ingress-intel-total-conversion/style.css?@@BUILDDATE@@';
var smartphone = 'http://breunigs.github.com/ingress-intel-total-conversion/mobile/smartphone.css?@@BUILDDATE@@';
var leaflet = 'http://cdn.leafletjs.com/leaflet-0.5/leaflet.css';
var coda = 'http://fonts.googleapis.com/css?family=Coda';
// remove complete page. We only wanted the user-data and the pages // remove complete page. We only wanted the user-data and the pages
// security context so we can access the API easily. Setup as much as // security context so we can access the API easily. Setup as much as
// possible without requiring scripts. // possible without requiring scripts.
document.getElementsByTagName('head')[0].innerHTML = '' document.getElementsByTagName('head')[0].innerHTML = ''
//~ + '<link rel="stylesheet" type="text/css" href="http://0.0.0.0:8000/style.css"/>'
+ '<title>Ingress Intel Map</title>' + '<title>Ingress Intel Map</title>'
+ (ir.indexOf('mainstyle') === -1 + '<style>@@INCLUDESTRING:style.css@@</style>'
? '<link rel="stylesheet" type="text/css" href="'+mainstyle+'"/>' + '<style>@@INCLUDESTRING:external/leaflet.css@@</style>'
: '')
+ (ir.indexOf('leafletcss') === -1
? '<link rel="stylesheet" type="text/css" href="'+leaflet+'"/>'
: '')
// this navigator check is also used in code/smartphone.js // this navigator check is also used in code/smartphone.js
+ (ir.indexOf('smartphonecss') === -1 && navigator.userAgent.match(/Android.*Mobile/) + (navigator.userAgent.match(/Android.*Mobile/)
? '<link rel="stylesheet" type="text/css" href="'+smartphone+'"/>' ? + '<style>@@INCLUDESTRING:mobile/smartphone.css@@</style>'
: '') : '')
+ (ir.indexOf('codafont') === -1 + '<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Coda"/>';
? '<link rel="stylesheet" type="text/css" href="'+coda+'"/>'
: '');
document.getElementsByTagName('body')[0].innerHTML = '' document.getElementsByTagName('body')[0].innerHTML = ''
+ '<div id="map">Loading, please wait</div>' + '<div id="map">Loading, please wait</div>'
@ -158,7 +151,7 @@ window.MAX_DRAWN_FIELDS = 200;
window.RESONATOR_DISPLAY_ZOOM_LEVEL = 17; window.RESONATOR_DISPLAY_ZOOM_LEVEL = 17;
window.COLOR_SELECTED_PORTAL = '#f00'; window.COLOR_SELECTED_PORTAL = '#f00';
window.COLORS = ['#FFCE00', '#0088FF', '#03FE03']; // none, res, enl window.COLORS = ['#FFCE00', '#0088FF', '#03DC03']; // none, res, enl
window.COLORS_LVL = ['#000', '#FECE5A', '#FFA630', '#FF7315', '#E40000', '#FD2992', '#EB26CD', '#C124E0', '#9627F4']; window.COLORS_LVL = ['#000', '#FECE5A', '#FFA630', '#FF7315', '#E40000', '#FD2992', '#EB26CD', '#C124E0', '#9627F4'];
window.COLORS_MOD = {VERY_RARE: '#F78AF6', RARE: '#AD8AFF', COMMON: '#84FBBD'}; window.COLORS_MOD = {VERY_RARE: '#F78AF6', RARE: '#AD8AFF', COMMON: '#84FBBD'};
@ -179,7 +172,7 @@ window.RANGE_INDICATOR_COLOR = 'red'
window.PORTAL_RADIUS_ENLARGE_MOBILE = 5; window.PORTAL_RADIUS_ENLARGE_MOBILE = 5;
window.DEFAULT_PORTAL_IMG = 'http://commondatastorage.googleapis.com/ingress/img/default-portal-image.png'; window.DEFAULT_PORTAL_IMG = 'https://commondatastorage.googleapis.com/ingress/img/default-portal-image.png';
window.NOMINATIM = 'http://nominatim.openstreetmap.org/search?format=json&limit=1&q='; window.NOMINATIM = 'http://nominatim.openstreetmap.org/search?format=json&limit=1&q=';
// INGRESS CONSTANTS ///////////////////////////////////////////////// // INGRESS CONSTANTS /////////////////////////////////////////////////

View File

@ -81,7 +81,7 @@ window.animTitle = {
setTimeout( function() { setTimeout( function() {
document.body.appendChild(subTitle); document.body.appendChild(subTitle);
android.loadBehind('http://www.ingress.com/intel'); android.loadBehind('https://www.ingress.com/intel');
}, 3000); }, 3000);
}, },
} }

View File

@ -1,10 +0,0 @@
#!/bin/sh
./build.py
cp iitc-debug.user.js dist/total-conversion-build.user.js
cp style.css dist/style.css
cp external/* dist/
rm -r dist/images/
cp -r images/ dist/images/
echo 'Change path of style.css to dist/style.css'

View File

@ -12,10 +12,12 @@ Available Plugins
- [**Compute AP Stats**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/compute-ap-stats.user.js) Shows the potential AP an agent could obtain by destroying and rebuilding all the portals in the current zoom area. - [**Compute AP Stats**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/compute-ap-stats.user.js) Shows the potential AP an agent could obtain by destroying and rebuilding all the portals in the current zoom area.
- [**Draw Tools**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/draw-tools.user.js) allows to draw circles and lines on the map to aid you with planning your next big field. [View screenshot](http://breunigs.github.com/ingress-intel-total-conversion/screenshots/plugin_draw_tools.png) - [**Draw Tools**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/draw-tools.user.js) allows to draw circles and lines on the map to aid you with planning your next big field. [View screenshot](http://breunigs.github.com/ingress-intel-total-conversion/screenshots/plugin_draw_tools.png)
- [**Guess Player Level**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/guess-player-levels.user.js) looks for the highest placed resonator per player in the current view to guess the player level. - [**Guess Player Level**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/guess-player-levels.user.js) looks for the highest placed resonator per player in the current view to guess the player level.
- [**Highlight Weakened Portals**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/show-portal-weakness.user.js) fill portals with red to indicate portal's state of disrepair. The brighter the color the more attention needed (recharge, shields, resonators). A dashed portal means a resonator is missing. - [**Highlight Weakened Portals**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/show-portal-weakness.user.js) fill portals with red to indicate portal's state of disrepair. The brighter the color the more attention needed (recharge, shields, resonators). A dashed portal means a resonator is missing. Red, needs energy and shields. Orange, only needs energy (either recharge or resonators). Yellow, only needs shields.
- [**Max-Links**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/max-links.user.js) Calculates how to link the portals to create the maximum number of fields. [View screenshot](http://breunigs.github.com/ingress-intel-total-conversion/screenshots/plugin_max_links.png)
- [**Player Tracker**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/player-tracker.user.js) Draws trails for user actions in the last hour. At the last known location theres a tooltip that shows the data in a table. [View screenshot](http://breunigs.github.com/ingress-intel-total-conversion/screenshots/plugin_player_tracker.png). - [**Player Tracker**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/player-tracker.user.js) Draws trails for user actions in the last hour. At the last known location theres a tooltip that shows the data in a table. [View screenshot](http://breunigs.github.com/ingress-intel-total-conversion/screenshots/plugin_player_tracker.png).
- [**Render Limit Increase**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/render-limit-increase.user.js) increases render limits. Good for high density areas (e.g. London, UK) and faster PCs. - [**Render Limit Increase**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/render-limit-increase.user.js) increases render limits. Good for high density areas (e.g. London, UK) and faster PCs.
- [**Resonator Display Zoom Level Decrease**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/resonator-display-zoom-level-decrease.user.js) Resonator start displaying earlier. - [**Resonator Display Zoom Level Decrease**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/resonator-display-zoom-level-decrease.user.js) Resonator start displaying earlier.
- [**Resonator Energy in Portal Detail**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/reso-energy-pct-in-portal-detail.user.js) Resonator energy in percent is displayed in the portal detals.
- [**Show Portal Address**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/show-address.user.js) Shows portal address in the side panel. - [**Show Portal Address**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/show-address.user.js) Shows portal address in the side panel.
### available only with the development version ### available only with the development version

View File

@ -1,13 +1,13 @@
// ==UserScript== // ==UserScript==
// @id iitc-plugin-compute-ap-stats@Hollow011 // @id iitc-plugin-compute-ap-stats@Hollow011
// @name iitc: Compute AP statistics // @name iitc: Compute AP statistics
// @version 0.2 // @version 0.2.1
// @namespace https://github.com/breunigs/ingress-intel-total-conversion // @namespace https://github.com/breunigs/ingress-intel-total-conversion
// @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/compute-ap-stats.user.js // @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/compute-ap-stats.user.js
// @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/compute-ap-stats.user.js // @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/compute-ap-stats.user.js
// @description Tries to determine overal AP stats for the current zoom // @description Tries to determine overal AP stats for the current zoom
// @include http://www.ingress.com/intel* // @include https://www.ingress.com/intel*
// @match http://www.ingress.com/intel* // @match https://www.ingress.com/intel*
// ==/UserScript== // ==/UserScript==
function wrapper() { function wrapper() {

View File

@ -1,13 +1,13 @@
// ==UserScript== // ==UserScript==
// @id iitc-plugin-draw-tools@breunigs // @id iitc-plugin-draw-tools@breunigs
// @name iitc: draw tools // @name iitc: draw tools
// @version 0.2 // @version 0.2.2
// @namespace https://github.com/breunigs/ingress-intel-total-conversion // @namespace https://github.com/breunigs/ingress-intel-total-conversion
// @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/draw-tools.user.js // @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/draw-tools.user.js
// @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/draw-tools.user.js // @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/draw-tools.user.js
// @description Allows you to draw things into the current map so you may plan your next move // @description Allows you to draw things into the current map so you may plan your next move
// @include http://www.ingress.com/intel* // @include https://www.ingress.com/intel*
// @match http://www.ingress.com/intel* // @match https://www.ingress.com/intel*
// ==/UserScript== // ==/UserScript==
function wrapper() { function wrapper() {
@ -29,12 +29,15 @@ var DRAW_TOOLS_SHAPE_OPTIONS = {
window.plugin.drawTools = function() {}; window.plugin.drawTools = function() {};
window.plugin.drawTools.loadExternals = function() { window.plugin.drawTools.loadExternals = function() {
var base = 'http://breunigs.github.com/ingress-intel-total-conversion/dist'; var base = 'https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/dist';
//~ var base = 'http://0.0.0.0:8000/dist'; //~ var base = 'http://0.0.0.0:8000/dist';
$('head').append('<link rel="stylesheet" href="'+base+'/leaflet.draw.0.1.6.css" />');
load(base+'/leaflet.draw.0.1.6.js').thenRun(window.plugin.drawTools.boot); load(base+'/leaflet.draw.0.1.6.js').thenRun(window.plugin.drawTools.boot);
// overwrite default Leaflet Marker icon.
L.Icon.Default.imagePath = base + '/images'; // FIXME: this is currently manually included from
// external/leaflet.draw.0.1.6.css. It should either be loaded remotely
// automatically or the buildscript should include it here, similar to
// how it works for the main script.
$('head').append('<style>.leaflet-container .leaflet-control-draw {margin-left: 13px;margin-top: 12px;}.leaflet-control-draw a {background-position: 50% 50%;background-repeat: no-repeat;display: block;width: 22px;height: 22px;}.leaflet-control-draw a:hover {background-color: #fff;}.leaflet-touch .leaflet-control-draw a {width: 27px;height: 27px;}.leaflet-control-draw-polyline {background-image: url(https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/dist/images/draw-polyline.png);}.leaflet-control-draw-polygon {background-image: url(https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/dist/images/draw-polygon.png);}.leaflet-control-draw-rectangle {background-image: url(https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/dist/images/draw-rectangle.png);}.leaflet-control-draw-circle {background-image: url(https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/dist/images/draw-circle.png);}.leaflet-control-draw-marker {background-image: url(https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/dist/images/draw-marker-icon.png);}.leaflet-mouse-marker {background-color: #fff;cursor: crosshair;}.leaflet-draw-label {background-color: #fff;border: 1px solid #ccc;color: #222;font: 12px/18px "Helvetica Neue", Arial, Helvetica, sans-serif;margin-left: 20px;margin-top: -21px;padding: 2px 4px;position: absolute;white-space: nowrap;z-index: 6;}.leaflet-error-draw-label {background-color: #F2DEDE;border-color: #E6B6BD;color: #B94A48;}.leaflet-draw-label-single {margin-top: -12px}.leaflet-draw-label-subtext {color: #999;}.leaflet-draw-guide-dash {font-size: 1%;opacity: 0.6;position: absolute;width: 5px;height: 5px;}.leaflet-flash-anim {-webkit-animation-duration: 0.66s; -moz-animation-duration: 0.66s; -o-animation-duration: 0.66s; animation-duration: 0.66s;-webkit-animation-fill-mode: both; -moz-animation-fill-mode: both; -o-animation-fill-mode: both; animation-fill-mode: both;-webkit-animation-name: leaflet-flash; -moz-animation-name: leaflet-flash; -o-animation-name: leaflet-flash; animation-name: leaflet-flash;}@-webkit-keyframes leaflet-flash {0%, 50%, 100% { opacity: 1; }25%, 75% { opacity: 0.3; }}@-moz-keyframes leaflet-flash {0%, 50%, 100% { opacity: 1; }25%, 75% { opacity: 0.3; }}@-o-keyframes leaflet-flash {0%, 50%, 100% { opacity: 1; }25%, 75% { opacity: 0.3; }}@keyframes leaflet-flash {0%, 50%, 100% { opacity: 1; }25%, 75% { opacity: 0; }}</style>');
} }

View File

@ -1,13 +1,13 @@
// ==UserScript== // ==UserScript==
// @id iitc-plugin-guess-player-levels@breunigs // @id iitc-plugin-guess-player-levels@breunigs
// @name iitc: guess player level // @name iitc: guess player level
// @version 0.2 // @version 0.2.1
// @namespace https://github.com/breunigs/ingress-intel-total-conversion // @namespace https://github.com/breunigs/ingress-intel-total-conversion
// @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/guess-player-levels.user.js // @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/guess-player-levels.user.js
// @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/guess-player-levels.user.js // @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/guess-player-levels.user.js
// @description Tries to determine player levels from the data available in the current view // @description Tries to determine player levels from the data available in the current view
// @include http://www.ingress.com/intel* // @include https://www.ingress.com/intel*
// @match http://www.ingress.com/intel* // @match https://www.ingress.com/intel*
// ==/UserScript== // ==/UserScript==
function wrapper() { function wrapper() {
@ -88,7 +88,7 @@ window.plugin.guessPlayerLevels.guess = function() {
}); });
var s = 'the players have at least the following level:\n\n'; var s = 'the players have at least the following level:\n\n';
s += 'Resistance:\t&nbsp;&nbsp;&nbsp;\tEnlightenment:\t\n'; s += 'Resistance:\t&nbsp;&nbsp;&nbsp;\tEnlightened:\t\n';
var namesR = plugin.guessPlayerLevels.sort(playersRes); var namesR = plugin.guessPlayerLevels.sort(playersRes);
var namesE = plugin.guessPlayerLevels.sort(playersEnl); var namesE = plugin.guessPlayerLevels.sort(playersEnl);

137
plugins/max-links.user.js Normal file
View File

@ -0,0 +1,137 @@
// ==UserScript==
// @id max-links@boombuler
// @name iitc: Max-Links-Plugin
// @version 0.2
// @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/max-links.user.js
// @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/max-links.user.js
// @description Calculates how to link the portals to create the maximum number of fields.
// @include https://www.ingress.com/intel*
// @match https://www.ingress.com/intel*
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function')
window.plugin = function() {};
// PLUGIN START ////////////////////////////////////////////////////////
// use own namespace for plugin
window.plugin.maxLinks = function() {};
// const values
window.plugin.maxLinks.MAX_DRAWN_LINKS = 400;
window.plugin.maxLinks.MAX_DRAWN_LINKS_INCREASED_LIMIT = 1000;
window.plugin.maxLinks.STROKE_STYLE = {
color: '#FF0000',
opacity: 1,
weight:2,
clickable: false,
smoothFactor: 10
};
window.plugin.maxLinks._delaunayScriptLocation = 'https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/dist/delaunay.js';
window.plugin.maxLinks.layer = null;
window.plugin.maxLinks._updating = false;
window.plugin.maxLinks._renderLimitReached = false;
window.plugin.maxLinks.updateLayer = function() {
if (window.plugin.maxLinks._updating ||
window.plugin.maxLinks.layer === null ||
!window.map.hasLayer(window.plugin.maxLinks.layer))
return;
window.plugin.maxLinks._updating = true;
window.plugin.maxLinks.layer.clearLayers();
var locations = [];
var minX = 0;
var minY = 0;
$.each(window.portals, function(guid, portal) {
var loc = portal.options.details.locationE6;
var nloc = { x: loc.lngE6, y: loc.latE6 };
if (nloc.x < minX)
minX = nloc.x;
if (nloc.y < minY)
minY = nloc.y;
locations.push(nloc);
});
$.each(locations, function(idx, nloc) {
nloc.x += Math.abs(minX);
nloc.y += Math.abs(minY);
});
var triangles = window.delaunay.triangulate(locations);
var drawnLinks = 0;
window.plugin.maxLinks._renderLimitReached = false;
var renderlimit = window.USE_INCREASED_RENDER_LIMIT ?
window.plugin.maxLinks.MAX_DRAWN_LINKS_INCREASED_LIMIT :
window.plugin.maxLinks.MAX_DRAWN_LINKS;
$.each(triangles, function(idx, triangle) {
if (drawnLinks <= renderlimit) {
triangle.draw(window.plugin.maxLinks.layer, minX, minY)
drawnLinks += 3;
} else {
window.plugin.maxLinks._renderLimitReached = true;
}
});
window.plugin.maxLinks._updating = false;
window.renderUpdateStatus();
}
window.plugin.maxLinks.setup = function() {
load(window.plugin.maxLinks._delaunayScriptLocation).thenRun(function() {
window.delaunay.Triangle.prototype.draw = function(layer, divX, divY) {
var drawLine = function(src, dest) {
var poly = L.polyline([[(src.y + divY)/1E6, (src.x + divX)/1E6], [(dest.y + divY)/1E6, (dest.x + divX)/1E6]], window.plugin.maxLinks.STROKE_STYLE);
poly.addTo(layer);
};
drawLine(this.a, this.b);
drawLine(this.b, this.c);
drawLine(this.c, this.a);
}
window.plugin.maxLinks.layer = L.layerGroup([]);
window.addHook('checkRenderLimit', function(e) {
if (window.map.hasLayer(window.plugin.maxLinks.layer) &&
window.plugin.maxLinks._renderLimitReached)
e.reached = true;
});
window.addHook('portalDataLoaded', function(e) {
if (window.map.hasLayer(window.plugin.maxLinks.layer))
window.plugin.maxLinks.updateLayer();
});
window.map.on('layeradd', function(e) {
if (e.layer === window.plugin.maxLinks.layer)
window.plugin.maxLinks.updateLayer();
});
window.map.on('zoomend moveend', window.plugin.maxLinks.updateLayer);
window.layerChooser.addOverlay(window.plugin.maxLinks.layer, 'Maximum Links');
});
}
var setup = window.plugin.maxLinks.setup;
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);

View File

@ -1,13 +1,13 @@
// ==UserScript== // ==UserScript==
// @id iitc-plugin-player-tracker@breunigs // @id iitc-plugin-player-tracker@breunigs
// @name iitc: player tracker // @name iitc: player tracker
// @version 0.5 // @version 0.6.1
// @namespace https://github.com/breunigs/ingress-intel-total-conversion // @namespace https://github.com/breunigs/ingress-intel-total-conversion
// @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/player-tracker.user.js // @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/player-tracker.user.js
// @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/player-tracker.user.js // @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/player-tracker.user.js
// @description draws trails for the path a user went onto the map. Only draws the last hour. Does not request chat data on its own, even if that would be useful. // @description draws trails for the path a user went onto the map. Only draws the last hour. Does not request chat data on its own, even if that would be useful.
// @include http://www.ingress.com/intel* // @include https://www.ingress.com/intel*
// @match http://www.ingress.com/intel* // @match https://www.ingress.com/intel*
// ==/UserScript== // ==/UserScript==
function wrapper() { function wrapper() {
@ -163,13 +163,14 @@ window.plugin.playerTracker.processNewData = function(data) {
} }
window.plugin.playerTracker.getLatLngFromEvent = function(ev) { window.plugin.playerTracker.getLatLngFromEvent = function(ev) {
var lats = $.map(ev.latlngs, function(ll) { return [ll[0]] }); var lats = 0;
var lngs = $.map(ev.latlngs, function(ll) { return [ll[1]] }); var lngs = 0;
var latmax = Math.max.apply(null, lats); $.each(ev.latlngs, function() {
var latmin = Math.min.apply(null, lats); lats += this[0];
var lngmax = Math.max.apply(null, lngs); lngs += this[1];
var lngmin = Math.min.apply(null, lngs); });
return L.latLng((latmax + latmin) / 2, (lngmax + lngmin) / 2);
return L.latLng(lats / ev.latlngs.length, lngs / ev.latlngs.length);
} }
window.plugin.playerTracker.ago = function(time, now) { window.plugin.playerTracker.ago = function(time, now) {

View File

@ -1,13 +1,13 @@
// ==UserScript== // ==UserScript==
// @id iitc-plugin-render-limit-increase@jonatkins // @id iitc-plugin-render-limit-increase@jonatkins
// @name iitc: render limit increase // @name iitc: render limit increase
// @version 0.1 // @version 0.1.1
// @namespace https://github.com/breunigs/ingress-intel-total-conversion // @namespace https://github.com/breunigs/ingress-intel-total-conversion
// @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/render-limit-increase.user.js // @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/render-limit-increase.user.js
// @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/render-limit-increase.user.js // @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/render-limit-increase.user.js
// @description Increase the render limits, so less likely to be hit in higher density areas // @description Increase the render limits, so less likely to be hit in higher density areas
// @include http://www.ingress.com/intel* // @include https://www.ingress.com/intel*
// @match http://www.ingress.com/intel* // @match https://www.ingress.com/intel*
// ==/UserScript== // ==/UserScript==
function wrapper() { function wrapper() {
@ -39,7 +39,7 @@ window.plugin.renderLimitIncrease.setHigherLimits = function() {
window.MAX_DRAWN_PORTALS = 3000; window.MAX_DRAWN_PORTALS = 3000;
window.MAX_DRAWN_LINKS = 1000; window.MAX_DRAWN_LINKS = 1000;
window.MAX_DRAWN_FIELDS = 500; window.MAX_DRAWN_FIELDS = 500;
window.USE_INCREASED_RENDER_LIMIT = true; // Used for other plugins
}; };
var setup = window.plugin.renderLimitIncrease.setHigherLimits; var setup = window.plugin.renderLimitIncrease.setHigherLimits;

View File

@ -1,13 +1,13 @@
// ==UserScript== // ==UserScript==
// @id iitc-plugin-reso-energy-pct-in-portal-detail@xelio // @id iitc-plugin-reso-energy-pct-in-portal-detail@xelio
// @name iitc: reso energy pct in portal detail // @name iitc: reso energy pct in portal detail
// @version 0.1 // @version 0.1.1
// @namespace https://github.com/breunigs/ingress-intel-total-conversion // @namespace https://github.com/breunigs/ingress-intel-total-conversion
// @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/reso-energy-pct-in-portal-detail.user.js // @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/reso-energy-pct-in-portal-detail.user.js
// @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/reso-energy-pct-in-portal-detail.user.js // @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/reso-energy-pct-in-portal-detail.user.js
// @description Show resonator energy percentage on resonator energy bar in portal detail panel. // @description Show resonator energy percentage on resonator energy bar in portal detail panel.
// @include http://www.ingress.com/intel* // @include https://www.ingress.com/intel*
// @match http://www.ingress.com/intel* // @match https://www.ingress.com/intel*
// ==/UserScript== // ==/UserScript==
function wrapper() { function wrapper() {

View File

@ -1,13 +1,13 @@
// ==UserScript== // ==UserScript==
// @id iitc-plugin-resonator-display-zoom-level-decrease@xelio // @id iitc-plugin-resonator-display-zoom-level-decrease@xelio
// @name iitc: resonator display zoom level decrease // @name iitc: resonator display zoom level decrease
// @version 1.0 // @version 1.0.1
// @namespace https://github.com/breunigs/ingress-intel-total-conversion // @namespace https://github.com/breunigs/ingress-intel-total-conversion
// @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/resonator-display-zoom-level-decrease.user.js // @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/resonator-display-zoom-level-decrease.user.js
// @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/resonator-display-zoom-level-decrease.user.js // @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/resonator-display-zoom-level-decrease.user.js
// @description Resonator start display earlier // @description Resonator start display earlier
// @include http://www.ingress.com/intel* // @include https://www.ingress.com/intel*
// @match http://www.ingress.com/intel* // @match https://www.ingress.com/intel*
// ==/UserScript== // ==/UserScript==
function wrapper() { function wrapper() {

View File

@ -1,13 +1,13 @@
// ==UserScript== // ==UserScript==
// @id iitc-plugin-show-address@vita10gy // @id iitc-plugin-show-address@vita10gy
// @name iitc: show portal address in sidebar // @name iitc: show portal address in sidebar
// @version 0.2 // @version 0.2.1
// @namespace https://github.com/breunigs/ingress-intel-total-conversion // @namespace https://github.com/breunigs/ingress-intel-total-conversion
// @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/show-address.user.js // @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/show-address.user.js
// @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/show-address.user.js // @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/show-address.user.js
// @description Portal address will show in the sidebar. // @description Portal address will show in the sidebar.
// @include http://www.ingress.com/intel* // @include https://www.ingress.com/intel*
// @match http://www.ingress.com/intel* // @match https://www.ingress.com/intel*
// ==/UserScript== // ==/UserScript==
function wrapper() { function wrapper() {

View File

@ -1,13 +1,13 @@
// ==UserScript== // ==UserScript==
// @id iitc-plugin-show-portal-weakness@vita10gy // @id iitc-plugin-show-portal-weakness@vita10gy
// @name iitc: show portal weakness // @name iitc: show portal weakness
// @version 0.2 // @version 0.3.1
// @namespace https://github.com/breunigs/ingress-intel-total-conversion // @namespace https://github.com/breunigs/ingress-intel-total-conversion
// @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/show-portal-weakness.user.js // @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/show-portal-weakness.user.js
// @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/show-portal-weakness.user.js // @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/show-portal-weakness.user.js
// @description Uses the fill color of the portals to denote if the portal is weak (Needs recharging, missing a resonator, needs shields) // @description Uses the fill color of the portals to denote if the portal is weak (Needs recharging, missing a resonator, needs shields) Red, needs energy and shields. Orange, only needs energy (either recharge or resonators). Yellow, only needs shields.
// @include http://www.ingress.com/intel* // @include https://www.ingress.com/intel*
// @match http://www.ingress.com/intel* // @match https://www.ingress.com/intel*
// ==/UserScript== // ==/UserScript==
function wrapper() { function wrapper() {
@ -24,46 +24,51 @@ window.plugin.portalWeakness.portalAdded = function(data) {
var d = data.portal.options.details; var d = data.portal.options.details;
var portal_weakness = 0; var portal_weakness = 0;
if(getTeam(d) != 0) if(getTeam(d) !== 0) {
{ var only_shields = true;
if(window.getTotalPortalEnergy(d)> 0 && window.getCurrentPortalEnergy(d) < window.getTotalPortalEnergy(d)) var missing_shields = 0;
{ if(window.getTotalPortalEnergy(d) > 0 && window.getCurrentPortalEnergy(d) < window.getTotalPortalEnergy(d)) {
portal_weakness = 1 - (window.getCurrentPortalEnergy(d)/window.getTotalPortalEnergy(d)); portal_weakness = 1 - (window.getCurrentPortalEnergy(d)/window.getTotalPortalEnergy(d));
only_shields = false;
} }
//Ding the portal for every missing sheild. //Ding the portal for every missing sheild.
$.each(d.portalV2.linkedModArray, function(ind, mod) $.each(d.portalV2.linkedModArray, function(ind, mod) {
{ if(mod === null) {
if(mod == null) missing_shields++;
{ portal_weakness += .08;
portal_weakness += .03;
} }
}); });
//Ding the portal for every missing resonator. //Ding the portal for every missing resonator.
var resCount = 0; var resCount = 0;
$.each(d.resonatorArray.resonators, function(ind, reso) $.each(d.resonatorArray.resonators, function(ind, reso) {
{ if(reso === null) {
if(reso == null) {
portal_weakness += .125; portal_weakness += .125;
} only_shields = false;
else { } else {
resCount++; resCount++;
} }
}); });
if(portal_weakness<0) { if(portal_weakness < 0) {
portal_weakness = 0; portal_weakness = 0;
} }
if(portal_weakness>1) if(portal_weakness > 1) {
{
portal_weakness = 1; portal_weakness = 1;
} }
if(portal_weakness>0) if(portal_weakness > 0) {
{ var fill_opacity = portal_weakness*.7 + .3;
var color = 'red'; var color = 'orange';
var fill_opacity = Math.round((portal_weakness*.8 + .2)*100)/100; if(only_shields) {
var params = {fillColor: color, fillOpacity: fill_opacity, radius: data.portal.options.radius+1}; color = 'yellow';
if(resCount<8) //If only shields are missing, make portal yellow
{ // but fill more than usual since pale yellow is basically invisible
fill_opacity = missing_shields*.15 + .1;
} else if(missing_shields > 0) {
color = 'red';
}
fill_opacity = Math.round(fill_opacity*100)/100;
var params = {fillColor: color, fillOpacity: fill_opacity};
if(resCount < 8) {
// Hole per missing resonator // Hole per missing resonator
var dash = new Array(8-resCount + 1).join("1,4,") + "100,0" var dash = new Array(8-resCount + 1).join("1,4,") + "100,0"
params["dashArray"] = dash; params["dashArray"] = dash;

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

View File

@ -688,6 +688,10 @@ aside {
max-width: 700px !important; max-width: 700px !important;
} }
.ui-dialog a {
color: #0000ca;
}
.ui-dialog-buttonpane { .ui-dialog-buttonpane {
background: #F2F2F2; background: #F2F2F2;
padding: 12px; padding: 12px;