This commit is contained in:
vita10gy
2013-03-05 22:55:26 -06:00
parent 62cf315797
commit 8573675d98
17 changed files with 220 additions and 53 deletions

View File

@ -18,6 +18,8 @@ Available Plugins
- [**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 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.
- [**Scale Bar**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/scale-bar.user.js) Shows a scale bar in the top left corner. [View screenshot](http://breunigs.github.com/ingress-intel-total-conversion/scre
enshots/plugin_scale_bar.png)
- [**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

View File

@ -1,7 +1,7 @@
// ==UserScript==
// @id iitc-plugin-guess-player-levels@breunigs
// @name iitc: guess player level
// @version 0.2.1
// @version 0.3
// @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
// @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/guess-player-levels.user.js
@ -92,19 +92,30 @@ window.plugin.guessPlayerLevels.guess = function() {
var namesR = plugin.guessPlayerLevels.sort(playersRes);
var namesE = plugin.guessPlayerLevels.sort(playersEnl);
var totallvlR = 0;
var totallvlE = 0;
var max = Math.max(namesR.length, namesE.length);
for(var i = 0; i < max; i++) {
var nickR = namesR[i];
var lvlR = playersRes[nickR];
var lineR = nickR ? nickR + ':\t' + lvlR : '\t';
if(!isNaN(parseInt(lvlR)))
totallvlR += parseInt(lvlR);
var nickE = namesE[i];
var lvlE = playersEnl[nickE];
var lineE = nickE ? nickE + ':\t' + lvlE : '\t';
s += lineR + '\t\t' + lineE + '\n';
if(!isNaN(parseInt(lvlE)))
totallvlE += parseInt(lvlE);
s += '\n'+lineR + '\t' + lineE + '\n';
}
s += '\nTotal level :\t'+totallvlR+'\tTotal level :\t'+totallvlE;
s += '\nTotal player:\t'+namesR.length+'\tTotal player:\t'+namesE.length;
var averageR = 0, averageE = 0;
if (namesR.length > 0) averageR = (totallvlR/namesR.length);
if (namesE.length > 0) averageE = (totallvlE/namesE.length);
s += '\nAverage level:\t'+averageR.toFixed(2)+'\tAverage level:\t'+averageE.toFixed(2);
s += '\n\nIf there are some unresolved names, simply try again.'
console.log(s);
alert(s);

View File

@ -204,9 +204,9 @@ window.plugin.playerTracker.drawData = function() {
var evtsLength = playerData.events.length;
var last = playerData.events[evtsLength-1];
var ago = plugin.playerTracker.ago;
var color = playerData.team === 'ALIENS' ? '#029C02' : '#00789C';
var cssClass = playerData.team === 'ALIENS' ? 'enl' : 'res';
var title =
'<span style="font-weight:bold; color:'+color+'">' + playerData.nick + '</span>\n'
'<span class="nickname '+ cssClass+'" style="font-weight:bold;">' + playerData.nick + '</span>\n'
+ ago(last.time, now) + ' minutes ago\n'
+ last.name;
// show previous data in tooltip

48
plugins/scale-bar.user.js Normal file
View File

@ -0,0 +1,48 @@
// ==UserScript==
// @id iitc-plugin-scale-bar@breunigs
// @name iitc: scale bar
// @version 0.1
// @namespace https://github.com/breunigs/ingress-intel-total-conversion
// @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/scale-bar.user.js
// @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/scale-bar.user.js
// @description shows scale bar on the map
// @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.scaleBar = function() {};
window.plugin.scaleBar.setup = function() {
$('head').append('<style>.leaflet-control-scale { position: absolute; top: 2px; left: 40px; } </style>');
// Before you ask: yes, I explicitely turned off imperial units. Imperial units
// are worse than Internet Explorer 6 whirring fans combined. Upgrade to the metric
// system already.
window.map.addControl(new L.Control.Scale({position: 'topleft', imperial: false}));
};
var setup = window.plugin.scaleBar.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);