Merge branch 'master' into highlighter
This commit is contained in:
@ -23,7 +23,7 @@ if(typeof window.plugin !== 'function') window.plugin = function() {};
|
||||
window.plugin.guessPlayerLevels = function() {};
|
||||
|
||||
window.plugin.guessPlayerLevels.setupCallback = function() {
|
||||
$('#toolbox').append('<a onclick="window.plugin.guessPlayerLevels.guess()">guess player levels</a> ');
|
||||
$('#toolbox').append(' <a onclick="window.plugin.guessPlayerLevels.guess()">Guess player levels</a>');
|
||||
addHook('portalAdded', window.plugin.guessPlayerLevels.extractPortalData);
|
||||
}
|
||||
|
||||
|
@ -23,19 +23,23 @@ if(typeof window.plugin !== 'function') window.plugin = function() {};
|
||||
window.plugin.ipasLink = function() {};
|
||||
|
||||
window.plugin.ipasLink.setupCallback = function() {
|
||||
addHook('portalDetailsUpdated', window.plugin.ipasLink.addLink);
|
||||
addHook('portalDetailsUpdated', window.plugin.ipasLink.addLink);
|
||||
}
|
||||
|
||||
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 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>');
|
||||
}
|
||||
|
||||
window.plugin.ipasLink.getHash = function(d) {
|
||||
var hashParts=[];
|
||||
$.each(d.resonatorArray.resonators, function(ind, reso) {
|
||||
hashParts.push(reso.level + "," + reso.distanceToPortal + "," + reso.energyTotal);
|
||||
});
|
||||
return hashParts.join(";")+"|" + "0,0,0,0"; //shields not implemented yet
|
||||
var hashParts=[];
|
||||
$.each(d.resonatorArray.resonators, function(ind, reso) {
|
||||
if (reso) {
|
||||
hashParts.push(reso.level + "," + reso.distanceToPortal + "," + reso.energyTotal);
|
||||
} else {
|
||||
hashParts.push(1 + "," + 35 + "," + 0); // Dummy values, the only important one is energy=0
|
||||
}
|
||||
});
|
||||
return hashParts.join(";")+"|" + "0,0,0,0"; //shields not implemented yet
|
||||
}
|
||||
|
||||
var setup = function() {
|
||||
@ -57,4 +61,3 @@ if(window.iitcLoaded && typeof setup === 'function') {
|
||||
var script = document.createElement('script');
|
||||
script.appendChild(document.createTextNode('('+ wrapper +')();'));
|
||||
(document.body || document.head || document.documentElement).appendChild(script);
|
||||
|
||||
|
@ -62,6 +62,8 @@ window.plugin.playerTracker.setup = function() {
|
||||
window.plugin.playerTracker.zoomListener();
|
||||
});
|
||||
window.plugin.playerTracker.zoomListener();
|
||||
|
||||
plugin.playerTracker.setupUserSearch();
|
||||
}
|
||||
|
||||
window.plugin.playerTracker.stored = {};
|
||||
@ -341,8 +343,57 @@ window.plugin.playerTracker.handleData = function(data) {
|
||||
plugin.playerTracker.drawData();
|
||||
}
|
||||
|
||||
window.plugin.playerTracker.findUserPosition = function(nick) {
|
||||
nick = nick.toLowerCase();
|
||||
var foundPlayerData = undefined;
|
||||
$.each(plugin.playerTracker.stored, function(pguid, playerData) {
|
||||
if (playerData.nick.toLowerCase() === nick) {
|
||||
foundPlayerData = playerData;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
if (!foundPlayerData) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var evtsLength = foundPlayerData.events.length;
|
||||
var last = foundPlayerData.events[evtsLength-1];
|
||||
return plugin.playerTracker.getLatLngFromEvent(last);
|
||||
}
|
||||
|
||||
window.plugin.playerTracker.centerMapOnUser = function(nick) {
|
||||
var position = plugin.playerTracker.findUserPosition(nick);
|
||||
|
||||
if (position === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
map.setView(position, map.getZoom());
|
||||
}
|
||||
|
||||
window.plugin.playerTracker.onNicknameClicked = function(info) {
|
||||
if (info.event.ctrlKey) {
|
||||
plugin.playerTracker.centerMapOnUser(info.nickname);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
window.plugin.playerTracker.onGeoSearch = function(search) {
|
||||
if (/^@/.test(search)) {
|
||||
plugin.playerTracker.centerMapOnUser(search.replace(/^@/, ''));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
window.plugin.playerTracker.setupUserSearch = function() {
|
||||
addHook('nicknameClicked', window.plugin.playerTracker.onNicknameClicked);
|
||||
addHook('geoSearch', window.plugin.playerTracker.onGeoSearch);
|
||||
|
||||
var geoSearch = $('#geosearch');
|
||||
var beforeEllipsis = /(.*)…/.exec(geoSearch.attr('placeholder'))[1];
|
||||
geoSearch.attr('placeholder', beforeEllipsis + ' or @player…');
|
||||
}
|
||||
|
||||
|
||||
var setup = plugin.playerTracker.setup;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// ==UserScript==
|
||||
// @id iitc-plugin-portals-count@yenky
|
||||
// @name IITC plugin: Show total counts of portals
|
||||
// @version 0.0.6.@@DATETIMEVERSION@@
|
||||
// @version 0.0.7.@@DATETIMEVERSION@@
|
||||
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
|
||||
// @updateURL @@UPDATEURL@@
|
||||
// @downloadURL @@DOWNLOADURL@@
|
||||
@ -99,8 +99,7 @@ window.plugin.portalcounts.getPortals = function(){
|
||||
}
|
||||
|
||||
var setup = function() {
|
||||
$('body').append('<div id="portalcounts" style="display:none;"></div>');
|
||||
$('#toolbox').append('<a onclick="window.plugin.portalcounts.getPortals()">Portalcounts</a>');
|
||||
$('#toolbox').append(' <a onclick="window.plugin.portalcounts.getPortals()">Portal&sbsp;counts</a>');
|
||||
$('head').append('<style>' +
|
||||
'#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}' +
|
||||
|
@ -1,7 +1,7 @@
|
||||
// ==UserScript==
|
||||
// @id iitc-plugin-portals-list@teo96
|
||||
// @name IITC plugin: show list of portals
|
||||
// @version 0.0.9.@@DATETIMEVERSION@@
|
||||
// @version 0.0.10.@@DATETIMEVERSION@@
|
||||
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
|
||||
// @updateURL @@UPDATEURL@@
|
||||
// @downloadURL @@DOWNLOADURL@@
|
||||
@ -119,7 +119,7 @@ window.plugin.portalslist.displayPL = function() {
|
||||
} else {
|
||||
html = '<table><tr><td>Nothing to Show !</td></tr></table>';
|
||||
};
|
||||
alert('<div id="portalslist">' + html + '</div>');
|
||||
alert('<div id="portalslist">' + html + '</div>', true, function() {$(".ui-dialog").removeClass('ui-dialog-portalslist');});
|
||||
$(".ui-dialog").addClass('ui-dialog-portalslist');
|
||||
|
||||
// Setup sorting
|
||||
@ -403,8 +403,7 @@ window.plugin.portalslist.getPortalLink = function(portal,guid) {
|
||||
}
|
||||
|
||||
var setup = function() {
|
||||
$('body').append('<div id="portalslist" style="display:none;"></div>');
|
||||
$('#toolbox').append('<a onclick="window.plugin.portalslist.displayPL(0)">Portals List</a>');
|
||||
$('#toolbox').append(' <a onclick="window.plugin.portalslist.displayPL(0)">Portals list</a>');
|
||||
$('head').append('<style>' +
|
||||
'.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;}' +
|
||||
|
@ -1,7 +1,7 @@
|
||||
// ==UserScript==
|
||||
// @id iitc-plugin-scoreboard@vita10gy
|
||||
// @name IITC plugin: show a localized scoreboard.
|
||||
// @version 0.1.5.@@DATETIMEVERSION@@
|
||||
// @version 0.1.6.@@DATETIMEVERSION@@
|
||||
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
|
||||
// @updateURL @@UPDATEURL@@
|
||||
// @downloadURL @@DOWNLOADURL@@
|
||||
@ -362,7 +362,7 @@ window.plugin.scoreboard.display = function() {
|
||||
scoreHtml += 'You need something in view.';
|
||||
}
|
||||
|
||||
alert('<div id="scoreboard">' + scoreHtml + '</div>');
|
||||
alert('<div id="scoreboard">' + scoreHtml + '</div>', true, function() {$(".ui-dialog").removeClass('ui-dialog-scoreboard');});
|
||||
$(".ui-dialog").addClass('ui-dialog-scoreboard');
|
||||
|
||||
// Setup sorting
|
||||
@ -389,8 +389,7 @@ window.plugin.scoreboard.fieldArea = function(field) {
|
||||
}
|
||||
|
||||
var setup = function() {
|
||||
$('body').append('<div id="scoreboard" style="display:none;"></div>');
|
||||
$('#toolbox').append('<a onclick="window.plugin.scoreboard.display()">scoreboard</a>');
|
||||
$('#toolbox').append(' <a onclick="window.plugin.scoreboard.display()">Scoreboard</a>');
|
||||
$('head').append('<style>' +
|
||||
'.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;}' +
|
||||
|
Reference in New Issue
Block a user