Merge branch 'master' into location

This commit is contained in:
vita10gy 2013-04-15 00:14:56 -05:00
commit 594e55cdc6
18 changed files with 8456 additions and 65 deletions

2
Makefile Normal file
View File

@ -0,0 +1,2 @@
default:
./build.py

View File

@ -42,7 +42,7 @@
// array to change order or add additional values to the // array to change order or add additional values to the
// details of a portal. // details of a portal.
// beforePortalReRender: the callback argument is // beforePortalReRender: the callback argument is
// {portal: ent[2], oldPortal : d, reRender : false}. // {portal: ent[2], oldPortal : d, portalGuid: ent[0], reRender : false}.
// The callback needs to update the value of reRender to // The callback needs to update the value of reRender to
// true if the plugin has a reason to have the portal // true if the plugin has a reason to have the portal
// redrawn. It is called early on in the // redrawn. It is called early on in the

View File

@ -264,7 +264,7 @@ window.renderPortal = function(ent) {
u = u || oo.level !== portalLevel; u = u || oo.level !== portalLevel;
// Allow plugins to add additional conditions as to when a portal gets re-rendered // Allow plugins to add additional conditions as to when a portal gets re-rendered
var hookData = {portal: ent[2], oldPortal: oo.details, reRender: false}; var hookData = {portal: ent[2], oldPortal: oo.details, portalGuid: ent[0], reRender: false};
runHooks('beforePortalReRender', hookData); runHooks('beforePortalReRender', hookData);
u = u || hookData.reRender; u = u || hookData.reRender;

View File

@ -58,7 +58,8 @@ window.renderPortalDetails = function(guid) {
$('#portaldetails') $('#portaldetails')
.attr('class', TEAM_TO_CSS[getTeam(d)]) .attr('class', TEAM_TO_CSS[getTeam(d)])
.html('' .html(''
+ '<h3 ondblclick="renderPortalDetails(null);">'+d.portalV2.descriptiveText.TITLE+'</h3>' + '<h3 class="title">'+d.portalV2.descriptiveText.TITLE+'</h3>'
+ '<span class="close" onclick="unselectOldPortal();" title="Close">X</span>'
// help cursor via “.imgpreview img” // help cursor via “.imgpreview img”
+ '<div class="imgpreview" '+imgTitle+' style="background-image: url('+img+')">' + '<div class="imgpreview" '+imgTitle+' style="background-image: url('+img+')">'
+ '<img class="hide" src="'+img+'"/>' + '<img class="hide" src="'+img+'"/>'
@ -67,10 +68,10 @@ window.renderPortalDetails = function(guid) {
+ '<div class="mods">'+getModDetails(d)+'</div>' + '<div class="mods">'+getModDetails(d)+'</div>'
+ randDetails + randDetails
+ resoDetails + resoDetails
+ '<div class="linkdetails"><aside><a href="'+perma+'" onclick="return androidCopy(this.href)" >portal link</a></aside>' + '<div class="linkdetails">'
+ '<aside><a onclick="'+poslinks+'">poslinks</a></aside>' + '<aside><a href="'+perma+'" onclick="return androidCopy(this.href)" title="Create a URL link to this portal" >Portal link</a></aside>'
+ '<aside><a onclick="alert(\''+postcard+'\');">donate</a></aside>' + '<aside><a onclick="'+poslinks+'" title="Link to alternative maps (Google, etc)">Map links</a></aside>'
+ '<aside><a onclick="window.reportPortalIssue()">report issue</a></aside>' + '<aside><a onclick="window.reportPortalIssue()" title="Report issues with this portal to Niantic/Google">Report issue</a></aside>'
+ '</div>' + '</div>'
); );

View File

@ -1,5 +1,4 @@
// REDEEMING ///////////////////////////////////////////////////////// // REDEEMING /////////////////////////////////////////////////////////
window.handleRedeemResponse = function(data, textStatus, jqXHR) { window.handleRedeemResponse = function(data, textStatus, jqXHR) {
@ -27,6 +26,7 @@ window.handleRedeemResponse = function(data, textStatus, jqXHR) {
var resonators = {}; var resonators = {};
var bursts = {}; var bursts = {};
var shields = {}; var shields = {};
var cubes = {};
for(var i in data.result.inventoryAward) { for(var i in data.result.inventoryAward) {
var acquired = data.result.inventoryAward[i][2]; var acquired = data.result.inventoryAward[i][2];
@ -45,6 +45,10 @@ window.handleRedeemResponse = function(data, textStatus, jqXHR) {
var level = acquired.resourceWithLevels.level var level = acquired.resourceWithLevels.level
if(!bursts[level]) bursts[level] = 0; if(!bursts[level]) bursts[level] = 0;
bursts[level] += 1; bursts[level] += 1;
} else if(acquired.resourceWithLevels.resourceType === 'POWER_CUBE') {
var level = acquired.resourceWithLevels.level
if(!cubes[level]) cubes[level] = 0;
cubes[level] += 1;
} }
} }
} }
@ -59,12 +63,16 @@ window.handleRedeemResponse = function(data, textStatus, jqXHR) {
if(count >= 2) text += ' ('+count+')'; if(count >= 2) text += ' ('+count+')';
tblResult.append($('<tr ><td style="color: ' +window.COLORS_LVL[lvl]+ ';">L' +lvl+ '</td><td>' + text + '</td></tr>')); tblResult.append($('<tr ><td style="color: ' +window.COLORS_LVL[lvl]+ ';">L' +lvl+ '</td><td>' + text + '</td></tr>'));
}); });
$.each(cubes, function(lvl, count) {
var text = 'Power Cube';
if(count >= 2) text += ' ('+count+')';
tblResult.append($('<tr ><td style="color: ' +window.COLORS_LVL[lvl]+ ';">L' +lvl+ '</td><td>' + text + '</td></tr>'));
});
$.each(shields, function(lvl, count) { $.each(shields, function(lvl, count) {
var text = 'Portal Shield'; var text = 'Portal Shield';
if(count >= 2) text += ' ('+count+')'; if(count >= 2) text += ' ('+count+')';
tblResult.append($('<tr><td>'+lvl+'</td><td>'+text+'</td></tr>')); tblResult.append($('<tr><td>'+lvl+'</td><td>'+text+'</td></tr>'));
}); });
alert(tblResult, true); alert(tblResult, true);
} }
} }

View File

@ -136,8 +136,8 @@ window.showPortalPosLinks = function(lat, lng, name) {
} else { } else {
var qrcode = '<div id="qrcode"></div>'; var qrcode = '<div id="qrcode"></div>';
var script = '<script>$(\'#qrcode\').qrcode({text:\'GEO:'+lat+','+lng+'\'});</script>'; var script = '<script>$(\'#qrcode\').qrcode({text:\'GEO:'+lat+','+lng+'\'});</script>';
var gmaps = '<a href="https://maps.google.com/?q='+lat+','+lng+portal_name+'">gmaps</a>'; var gmaps = '<a href="https://maps.google.com/?q='+lat+','+lng+portal_name+'">Google maps</a>';
var osm = '<a href="http://www.openstreetmap.org/?mlat='+lat+'&mlon='+lng+'&zoom=16">OSM</a>'; var osm = '<a href="http://www.openstreetmap.org/?mlat='+lat+'&mlon='+lng+'&zoom=16">OpenStreetMap</a>';
var latLng = '<span>'+lat+','+lng +'</span>'; var latLng = '<span>'+lat+','+lng +'</span>';
alert('<div style="text-align: center;">' + qrcode + script + gmaps + ' ' + osm + '<br />' + latLng + '</div>'); alert('<div style="text-align: center;">' + qrcode + script + gmaps + ' ' + osm + '<br />' + latLng + '</div>');
} }

8339
external/leaflet-src.js vendored Normal file

File diff suppressed because it is too large Load Diff

6
external/leaflet.js vendored

File diff suppressed because one or more lines are too long

View File

@ -138,6 +138,27 @@
"level": 1, "level": 1,
"resourceType": "EMITTER_A" "resourceType": "EMITTER_A"
} }
}],
[ "00000000000000000000000000000000.5",
1365809491413, {
"accessLevel" : {
"failure" : {
"isAllowed" : false,
"requiredLevel" : 4
},
"requiredLevel" : 4
},
"inInventory" : {
"acquisitionTimestampMs" : "1365809491260",
"playerId" : "00000000000000000000000000000000.c"
},
"powerCube" : {
"energy" : 4000
},
"resourceWithLevels" : {
"level" : 4,
"resourceType" : "POWER_CUBE"
}
}] }]
], ],
"playerEntity": ["00000000000000000000000000000000.c", "playerEntity": ["00000000000000000000000000000000.c",
@ -155,6 +176,10 @@
"mediaHighWaterMarks": { "mediaHighWaterMarks": {
"General": 8, "General": 8,
"RESISTANCE": 9 "RESISTANCE": 9
},
"notificationSettings" : {
"maySendPromoEmail" : false,
"shouldSendEmail" : true
} }
} }
}] }]
@ -285,6 +310,27 @@
"level": 1, "level": 1,
"resourceType": "EMITTER_A" "resourceType": "EMITTER_A"
} }
}],
[ "00000000000000000000000000000000.5",
1365809491413, {
"accessLevel" : {
"failure" : {
"isAllowed" : false,
"requiredLevel" : 4
},
"requiredLevel" : 4
},
"inInventory" : {
"acquisitionTimestampMs" : "1365809491260",
"playerId" : "00000000000000000000000000000000.c"
},
"powerCube" : {
"energy" : 4000
},
"resourceWithLevels" : {
"level" : 4,
"resourceType" : "POWER_CUBE"
}
}] }]
], ],
"xmAward": "300" "xmAward": "300"

View File

@ -92,8 +92,9 @@ document.getElementsByTagName('body')[0].innerHTML = ''
+ ' <div id="portaldetails"></div>' + ' <div id="portaldetails"></div>'
+ ' <input id="redeem" placeholder="Redeem code…" type="text"/>' + ' <input id="redeem" placeholder="Redeem code…" type="text"/>'
+ ' <div id="toolbox">' + ' <div id="toolbox">'
+ ' <a onmouseover="setPermaLink(this)" onclick="setPermaLink(this);return androidCopy(this.href)" >Permalink</a>' + ' <a onmouseover="setPermaLink(this)" onclick="setPermaLink(this);return androidCopy(this.href)" title="URL link to this map view">Permalink</a>'
+ ' <a onclick="window.aboutIITC()" style="cursor: help">About&nbsp;IITC</a></div>' + ' <a onclick="window.aboutIITC()" style="cursor: help">About IITC</a>'
+ ' </div>'
+ ' </div>' + ' </div>'
+ '</div>' + '</div>'
+ '<div id="updatestatus"></div>' + '<div id="updatestatus"></div>'

View File

@ -23,7 +23,7 @@ if(typeof window.plugin !== 'function') window.plugin = function() {};
window.plugin.guessPlayerLevels = function() {}; window.plugin.guessPlayerLevels = function() {};
window.plugin.guessPlayerLevels.setupCallback = function() { window.plugin.guessPlayerLevels.setupCallback = function() {
$('#toolbox').append(' <a onclick="window.plugin.guessPlayerLevels.guess()">Guess&nbsp;player&nbsp;levels</a>'); $('#toolbox').append(' <a onclick="window.plugin.guessPlayerLevels.guess()" title="Show player level guesses based on resonator placement in displayed portals">Guess player levels</a>');
addHook('portalAdded', window.plugin.guessPlayerLevels.extractPortalData); addHook('portalAdded', window.plugin.guessPlayerLevels.extractPortalData);
} }

View File

@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @id iitc-plugin-ipas-link@graphracer // @id iitc-plugin-ipas-link@graphracer
// @name IITC Plugin: simulate an attack on portal // @name IITC Plugin: simulate an attack on portal
// @version 0.1.0.@@DATETIMEVERSION@@ // @version 0.1.1.@@DATETIMEVERSION@@
// @namespace https://github.com/xosofox/IPAS // @namespace https://github.com/xosofox/IPAS
// @updateURL @@UPDATEURL@@ // @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@ // @downloadURL @@DOWNLOADURL@@
@ -27,7 +27,7 @@ window.plugin.ipasLink.setupCallback = function() {
} }
window.plugin.ipasLink.addLink = function(d) { window.plugin.ipasLink.addLink = function(d) {
$('.linkdetails').append('<aside style="text-align: center; display: block"><a href="http://ipas.graphracer.com/index.html#' + window.plugin.ipasLink.getHash(d.portalDetails) + '" target="ipaswindow">simulate attack with IPAS</a></aside>'); $('.linkdetails').append('<aside><a href="http://ipas.graphracer.com/index.html#' + window.plugin.ipasLink.getHash(d.portalDetails) + '" target="ipaswindow" title="Use IAPS to simulate an attack on this portal">Simulate attack</a></aside>');
} }
window.plugin.ipasLink.getHash = function(d) { window.plugin.ipasLink.getHash = function(d) {

View File

@ -266,6 +266,7 @@ window.plugin.playerTracker.drawData = function() {
if(window.plugin.guessPlayerLevels !== undefined && if(window.plugin.guessPlayerLevels !== undefined &&
window.plugin.guessPlayerLevels.fetchLevelByPlayer !== undefined) { window.plugin.guessPlayerLevels.fetchLevelByPlayer !== undefined) {
var playerLevel = window.plugin.guessPlayerLevels.fetchLevelByPlayer(pguid); var playerLevel = window.plugin.guessPlayerLevels.fetchLevelByPlayer(pguid);
if (playerLevel === undefined) playerLevel = 1; //if player level unknown, assume level 1
if(playerLevel !== undefined) { if(playerLevel !== undefined) {
title += '<span style="font-weight:bold;margin-left:10px;">Level ' title += '<span style="font-weight:bold;margin-left:10px;">Level '
+ playerLevel + playerLevel

View File

@ -99,7 +99,7 @@ window.plugin.portalcounts.getPortals = function(){
} }
var setup = function() { var setup = function() {
$('#toolbox').append(' <a onclick="window.plugin.portalcounts.getPortals()">Portal&sbsp;counts</a>'); $('#toolbox').append(' <a onclick="window.plugin.portalcounts.getPortals()" title="Display a summary of portals in the current view">Portal counts</a>');
$('head').append('<style>' + $('head').append('<style>' +
'#portalcounts table {margin-top:5px; border-collapse: collapse; empty-cells: show; width:100%; clear: both;}' + '#portalcounts table {margin-top:5px; border-collapse: collapse; empty-cells: show; width:100%; clear: both;}' +
'#portalcounts table td, #portalcounts table th {border-bottom: 1px solid #0b314e; padding:3px; color:white; background-color:#1b415e}' + '#portalcounts table td, #portalcounts table th {border-bottom: 1px solid #0b314e; padding:3px; color:white; background-color:#1b415e}' +

View File

@ -403,7 +403,7 @@ window.plugin.portalslist.getPortalLink = function(portal,guid) {
} }
var setup = function() { var setup = function() {
$('#toolbox').append(' <a onclick="window.plugin.portalslist.displayPL(0)">Portals&nbsp;list</a>'); $('#toolbox').append(' <a onclick="window.plugin.portalslist.displayPL(0)" title="Display a list of portals in the current view">Portals list</a>');
$('head').append('<style>' + $('head').append('<style>' +
'.ui-dialog-portalslist {position: absolute !important; top: 10px !important; left: 30px !important;max-width:800px !important; width:733px !important;}' + '.ui-dialog-portalslist {position: absolute !important; top: 10px !important; left: 30px !important;max-width:800px !important; width:733px !important;}' +
'#portalslist table {margin-top:5px; border-collapse: collapse; empty-cells: show; width:100%; clear: both;}' + '#portalslist table {margin-top:5px; border-collapse: collapse; empty-cells: show; width:100%; clear: both;}' +

View File

@ -389,7 +389,7 @@ window.plugin.scoreboard.fieldArea = function(field) {
} }
var setup = function() { var setup = function() {
$('#toolbox').append(' <a onclick="window.plugin.scoreboard.display()">Scoreboard</a>'); $('#toolbox').append(' <a onclick="window.plugin.scoreboard.display()" title="Display a scoreboard per team for the current view">Scoreboard</a>');
$('head').append('<style>' + $('head').append('<style>' +
'.ui-dialog-scoreboard {max-width:600px !important; width:600px !important;}' + '.ui-dialog-scoreboard {max-width:600px !important; width:600px !important;}' +
'#scoreboard table {margin-top:10px; border-collapse: collapse; empty-cells: show; width:100%; clear: both;}' + '#scoreboard table {margin-top:10px; border-collapse: collapse; empty-cells: show; width:100%; clear: both;}' +

View File

@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @id iitc-plugin-show-linked-portals@fstopienski // @id iitc-plugin-show-linked-portals@fstopienski
// @name IITC plugin: Show linked portals // @name IITC plugin: Show linked portals
// @version 0.0.3.@@DATETIMEVERSION@@ // @version 0.0.4.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@ // @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@ // @downloadURL @@DOWNLOADURL@@
@ -100,10 +100,10 @@ var setup = function () {
'.showLinkedPortalLink9,.showLinkedPortalLink10,.showLinkedPortalLink11,.showLinkedPortalLink12 {left: 59px}' + '.showLinkedPortalLink9,.showLinkedPortalLink10,.showLinkedPortalLink11,.showLinkedPortalLink12 {left: 59px}' +
'.showLinkedPortalLink13,.showLinkedPortalLink14,.showLinkedPortalLink15,.showLinkedPortalLink16 {right: 65px}' + '.showLinkedPortalLink13,.showLinkedPortalLink14,.showLinkedPortalLink15,.showLinkedPortalLink16 {right: 65px}' +
'.showLinkedPortalLink1,.showLinkedPortalLink5,.showLinkedPortalLink9,.showLinkedPortalLink13 {top: 100px; }' + '.showLinkedPortalLink1,.showLinkedPortalLink5,.showLinkedPortalLink9,.showLinkedPortalLink13 {top: 25px; }' +
'.showLinkedPortalLink2,.showLinkedPortalLink6,.showLinkedPortalLink10,.showLinkedPortalLink14 {top: 144px; }' + '.showLinkedPortalLink2,.showLinkedPortalLink6,.showLinkedPortalLink10,.showLinkedPortalLink14 {top: 69px; }' +
'.showLinkedPortalLink3,.showLinkedPortalLink7,.showLinkedPortalLink11,.showLinkedPortalLink15 {top: 188px; }' + '.showLinkedPortalLink3,.showLinkedPortalLink7,.showLinkedPortalLink11,.showLinkedPortalLink15 {top: 113px; }' +
'.showLinkedPortalLink4,.showLinkedPortalLink8,.showLinkedPortalLink12,.showLinkedPortalLink16 {top: 232px; }' + '.showLinkedPortalLink4,.showLinkedPortalLink8,.showLinkedPortalLink12,.showLinkedPortalLink16 {top: 157px; }' +
'#level{text-align:center; margin-right: 0px;}' + '#level{text-align:center; margin-right: 0px;}' +
'</style>'); '</style>');
window.plugin.showLinkedPortal.setupCallback(); window.plugin.showLinkedPortal.setupCallback();

View File

@ -45,7 +45,7 @@ body {
margin-top: -31px; /* -(toggle height / 2) */ margin-top: -31px; /* -(toggle height / 2) */
line-height: 10px; line-height: 10px;
position: absolute; position: absolute;
top: 340px; /* (sidebar height / 2) */ top: 325px; /* (sidebar height / 2) */
z-index: 3001; z-index: 3001;
background-color: rgba(8, 48, 78, 0.9); background-color: rgba(8, 48, 78, 0.9);
color: #FFCE00; color: #FFCE00;
@ -615,58 +615,51 @@ h3 {
margin-left: -6px; margin-left: -6px;
text-shadow: 0.0em 0.0em 0.3em #808080; text-shadow: 0.0em 0.0em 0.3em #808080;
} }
/* links below resos */ /* links below resos */
.linkdetails { .linkdetails {
margin-bottom: 0px; margin-bottom: 0px;
}
aside {
display: inline-block;
padding-right: 9px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
text-align: center; text-align: center;
} }
.linkdetails aside a{ .linkdetails aside {
display: inline-block;
white-space: nowrap;
font-size: 12px; font-size: 12px;
margin-left: 5px;
margin-right: 5px;
} }
.linkdetails aside:last-child {
padding-right: 0;
}
.linkdetails aside:nth-child(1) {
text-align: right;
width:88px;
}
.linkdetails aside:nth-child(2) {
text-align: right;
width:67px;
}
.linkdetails aside:nth-child(4) {
margin-left:13px;
}
#toolbox { #toolbox {
padding: 2px; font-size: 12px;
font-size:90%; text-align: left; /* centre didn't look as nice here as it did above in .linkdetails */
} }
#toolbox > a { #toolbox > a {
padding: 2px; margin-left: 5px;
padding-right:6px; margin-right: 5px;
white-space: nowrap;
} }
/* a common portal display takes this much space (prevents moving /* a common portal display takes this much space (prevents moving
* content when first selecting a portal) */ * content when first selecting a portal) */
#portaldetails { #portaldetails {
min-height: 495px; min-height: 485px;
position: relative; /* so the below '#portaldetails .close' is relative to this */
}
#portaldetails .close {
position: absolute;
top: -2px;
right: 2px;
cursor: pointer;
color: #FFCE00;
font-family: "Arial", sans;
font-size: 16px;
} }