Merge branch 'master' of github.com:jonatkins/ingress-intel-total-conversion

This commit is contained in:
Philipp Schaefer 2013-12-15 18:52:24 +01:00
commit 1dee77bef9
8 changed files with 52 additions and 24 deletions

BIN
assets/prefer-iitc.psd Normal file

Binary file not shown.

View File

@ -58,19 +58,23 @@ Modified by qnstie 2013-07-17 to maintain compatibility with Leaflet.draw
// loop ends before 'segments' is reached - we don't add the very last point here but outside the loop
// (this was to fix a bug - https://github.com/jonatkins/ingress-intel-total-conversion/issues/471
// rounding errors? maths bug? not sure - but it solves the issue! and is a slight optimisation)
for (i = 1; i < segments; i++) {
// http://williams.best.vwh.net/avform.htm#Intermediate
// modified to handle longitude above +-180 degrees
f = i / segments;
A = Math.sin((1-f)*d) / Math.sin(d);
B = Math.sin(f*d) / Math.sin(d);
x = A * Math.cos(lat1) * Math.cos(0) + B * Math.cos(lat2) * Math.cos(dLng);
y = A * Math.cos(lat1) * Math.sin(0) + B * Math.cos(lat2) * Math.sin(dLng);
z = A * Math.sin(lat1) + B * Math.sin(lat2);
fLat = r2d * Math.atan2(z, Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)));
fLng = r2d * (Math.atan2(y, x)+lng1);
// UPDATE: there still seem to be rounding errors on relatively short links - but only on mobile.
// let's only add intermediate points if there's two or more
if (segments >= 3) {
for (i = 1; i < segments; i++) {
// http://williams.best.vwh.net/avform.htm#Intermediate
// modified to handle longitude above +-180 degrees
f = i / segments;
A = Math.sin((1-f)*d) / Math.sin(d);
B = Math.sin(f*d) / Math.sin(d);
x = A * Math.cos(lat1) * Math.cos(0) + B * Math.cos(lat2) * Math.cos(dLng);
y = A * Math.cos(lat1) * Math.sin(0) + B * Math.cos(lat2) * Math.sin(dLng);
z = A * Math.sin(lat1) + B * Math.sin(lat2);
fLat = r2d * Math.atan2(z, Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)));
fLng = r2d * (Math.atan2(y, x)+lng1);
convertedPoints.push(L.latLng([fLat, fLng]));
convertedPoints.push(L.latLng([fLat, fLng]));
}
}
// push the final point unmodified
convertedPoints.push(L.latLng(endLatlng));

View File

@ -0,0 +1,26 @@
// ==UserScript==
// @id iitc-digital-bumper-sticker
// @name IITC Digital Bumper Sticker
// @category Stock
// @version 0.1.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
// @description [@@BUILDNAME@@-@@BUILDDATE@@] Adds a "I'd rather be using IITC" logo to the standard intel map.
// @include https://www.ingress.com/intel*
// @include http://www.ingress.com/intel*
// @match https://www.ingress.com/intel*
// @match http://www.ingress.com/intel*
// @grant none
// ==/UserScript==
var logoDiv = document.createElement('div');
logoDiv.setAttribute('style', "position: fixed; left: 20px; top: 130px; z-index: auto; pointer-events: none;");
var img = document.createElement('img');
img.setAttribute('src', 'http://iitc.jonatkins.com/assets/img/prefer-iitc-200.png');
logoDiv.appendChild(img);
var targetContainer = document.getElementById('dashboard_container');
targetContainer.appendChild(logoDiv);

View File

@ -64,16 +64,14 @@ window.plugin.portalslist.getPortals = function() {
retval=true;
var d = portal.options.data;
var teamN = window.TEAM_NONE;
var teamN = portal.options.team;
switch (d.team){
case 'RESISTANCE' :
switch (teamN){
case TEAM_RES:
window.plugin.portalslist.resP++;
teamN = window.TEAM_RES
break;
case 'ENLIGHTENED' :
case TEAM_ENL:
window.plugin.portalslist.enlP++;
teamN = window.TEAM_ENL;
break;
}
var l = window.getPortalLinks(i);
@ -155,17 +153,17 @@ window.plugin.portalslist.portalTable = function(sortBy, sortOrder, filter) {
+ '<th ' + sort('level', sortBy, -1) + '>Level</th>'
+ '<th title="Team" ' + sort('teamN', sortBy, -1) + '>Team</th>'
+ '<th ' + sort('health', sortBy, -1) + '>Health</th>'
+ '<th ' + sort('resCount', sortBy, -1) + '>Resonator Count</th>'
+ '<th ' + sort('linkCount', sortBy, -1) + '>Link Count</th>'
+ '<th ' + sort('fieldCount', sortBy, -1) + '>Field Count</th>'
+ '<th ' + sort('resCount', sortBy, -1) + '>Resonators</th>'
+ '<th ' + sort('linkCount', sortBy, -1) + '>Links</th>'
+ '<th ' + sort('fieldCount', sortBy, -1) + '>Fields</th>'
$.each(portals, function(ind, portal) {
if (filter === TEAM_NONE || filter === portal.teamN) {
html += '<tr class="' + (portal.teamN === window.TEAM_RES ? 'res' : (portal.teamN === window.TEAM_ENL ? 'enl' : 'neutral')) + '">'
+ '<td style="">' + window.plugin.portalslist.getPortalLink(portal, portal.guid) + '</td>'
+ '<td class="L' + Math.floor(portal.level) +'">' + portal.level + '</td>'
+ '<td style="text-align:center;">' + portal.team + '</td>';
+ '<td class="L' + portal.level +'" style="background-color: '+COLORS_LVL[portal.level]+'">' + portal.level + '</td>'
+ '<td style="text-align:center;">' + portal.team.substr(0,3) + '</td>';
html += '<td style="cursor:help" title="'+ portal.health +'">' + portal.health + '</td>'
+ '<td>' + portal.resCount + '</td>'
@ -260,7 +258,7 @@ var setup = function() {
'#portalslist .filterRes { margin-top: 10px; background-color: #005684 }' +
'#portalslist .filterEnl { margin-top: 10px; background-color: #017f01 }' +
'#portalslist .disclaimer { margin-top: 10px; font-size:10px; }' +
'#portalslist .portalTitle { display: inline-block; width: 160px !important; min-width: 160px !important; max-width: 160px !important; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }' +
'#portalslist .portalTitle { display: inline-block; width: 240px !important; min-width: 240px !important; max-width: 160px !important; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }' +
'</style>');
// Setup sorting
$(document).on('click.portalslist', '#portalslist table th', function() {

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB