Merge branch 'gh-pages' into scoreboard
This commit is contained in:
commit
95c040eeec
@ -40,9 +40,7 @@ Current version is 0.7.8. [See NEWS.md for details](https://github.com/breunigs/
|
|||||||
- Confirm once again.
|
- Confirm once again.
|
||||||
- Reload page.
|
- Reload page.
|
||||||
|
|
||||||
**NOTE: You still need to manually update IITC with Tampermonkey.** There is a bug in the current stable release. It has been fixed in Tampermonkey’s 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.
|
||||||
|
|
||||||
*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)
|
||||||
@ -93,7 +91,8 @@ First of all, it’s very nice you want to help. There are several equally impor
|
|||||||
[tpenner](https://github.com/tpenner),
|
[tpenner](https://github.com/tpenner),
|
||||||
[vita10gy](https://github.com/vita10gy),
|
[vita10gy](https://github.com/vita10gy),
|
||||||
[Xelio](https://github.com/Xelio),
|
[Xelio](https://github.com/Xelio),
|
||||||
[ZauberNerd](https://github.com/ZauberNerd)
|
[ZauberNerd](https://github.com/ZauberNerd),
|
||||||
|
[waynn](https://github.com/waynn)
|
||||||
|
|
||||||
|
|
||||||
Attribution & License
|
Attribution & License
|
||||||
|
22
USERGUIDE.md
22
USERGUIDE.md
@ -21,8 +21,8 @@ General Usage
|
|||||||
-------------
|
-------------
|
||||||
|
|
||||||
- many things have more information in tooltips. Let your cursor rest over stuff to show the tooltip. *Hint:* your cursor changes into a question mark / help cursor if there’s a tooltip available.
|
- many things have more information in tooltips. Let your cursor rest over stuff to show the tooltip. *Hint:* your cursor changes into a question mark / help cursor if there’s a tooltip available.
|
||||||
- single left click on portals to show details
|
- single left click on portals to show details.
|
||||||
- double left click on portals to zoom in to them
|
- double left click on portals to zoom in to them.
|
||||||
|
|
||||||
|
|
||||||
Chat
|
Chat
|
||||||
@ -37,7 +37,7 @@ The chat is split up into several categories. It usually only shows messages for
|
|||||||
- 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:**
|
||||||
- You can post in the faction and public categories only
|
- You can post in the faction and public categories only.
|
||||||
- Your message will be tagged with the coordinates in the center of the map.
|
- Your message will be tagged with the coordinates in the center of the map.
|
||||||
- Your zoom level does not matter. Zooming out will not show your messages to more users.
|
- Your zoom level does not matter. Zooming out will not show your messages to more users.
|
||||||
|
|
||||||
@ -45,7 +45,10 @@ The chat is split up into several categories. It usually only shows messages for
|
|||||||
Map Display
|
Map Display
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
You can customize many aspects of how the map is rendered in the layer chooser. The layer chooser is available from the icon in the top right corner, left of the sidebar.
|
You can customize many aspects of how the map is rendered in the layer chooser.
|
||||||
|
|
||||||
|
**Layer Chooser:**
|
||||||
|
The layer chooser is available from the icon in the top right corner, left of the sidebar. The top entries are background maps and you can only have one of them active at a time. The entries on the bottom can be displayed in any combination you like. *Hint:* (NIGHLTY ONLY) Modifier-click an entry to quickly hide all other layers. The modifier may be either of these: shift, ctrl, alt, meta. Modifier-click the entry again to select all layers.
|
||||||
|
|
||||||
**Background / Street Map / Base Layer:**
|
**Background / Street Map / Base Layer:**
|
||||||
All these refer to the same thing. The base layer is stored across sessions. The default one uses OpenStreetMap data with a style that resembles the default Ingress one. There are other styles available.
|
All these refer to the same thing. The base layer is stored across sessions. The default one uses OpenStreetMap data with a style that resembles the default Ingress one. There are other styles available.
|
||||||
@ -62,7 +65,7 @@ Resonators are shown at their actual positions if you zoom in close enough. They
|
|||||||
They are handled the same way portals are, see above.
|
They are handled the same way portals are, see above.
|
||||||
|
|
||||||
**Other:**
|
**Other:**
|
||||||
When you select a portal its outer ring becomes red. There’s also a small yellow circle around it which depicts the hack range. You need to be in hack range to hack the portal or update its resonators or mods.
|
When you select a portal its outer ring becomes red. There’s also a small yellow circle around it which depicts the hack range. You need to be in hack range to hack the portal or upgrade its resonators or mods.
|
||||||
|
|
||||||
If you are zoomed out quite a bit, there’s a larger red circle. This is the link range. Only portals within this link range can be linked while standing at the selected portal. [Click the range in the sidebar to zoom to link range for the selected portal](#random-details).
|
If you are zoomed out quite a bit, there’s a larger red circle. This is the link range. Only portals within this link range can be linked while standing at the selected portal. [Click the range in the sidebar to zoom to link range for the selected portal](#random-details).
|
||||||
|
|
||||||
@ -72,7 +75,7 @@ If you are zoomed out quite a bit, there’s a larger red circle. This is the li
|
|||||||
Map Status / Updates
|
Map Status / Updates
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
It shows if there are currently operations pending. This includes chat updates as well as map data requests. Updates happen every 45s to 90s, depending on how far zoomed in you are. Zoom in closer for faster updates.
|
It shows if there are operations currently pending. This includes chat updates as well as map data requests. Updates happen every 45s to 90s, depending on how far zoomed in you are. Zoom in closer for faster updates.
|
||||||
|
|
||||||
It also shows which portals are being loaded/shown. Zoom in to see lower level portals. This is a limit of the server and not IITC. Portals levels that cannot be shown are also striked through in the layer chooser.
|
It also shows which portals are being loaded/shown. Zoom in to see lower level portals. This is a limit of the server and not IITC. Portals levels that cannot be shown are also striked through in the layer chooser.
|
||||||
|
|
||||||
@ -88,18 +91,19 @@ Sidebar
|
|||||||
The sidebar is mainly used to show game stats and portal details. However, it also allows you to perform certain actions.
|
The sidebar is mainly used to show game stats and portal details. However, it also allows you to perform certain actions.
|
||||||
|
|
||||||
### General usage:
|
### General usage:
|
||||||
- single click a portal to show details about it in the sidebar
|
- single click a portal to show details about it in the sidebar.
|
||||||
- the portal information is updated automatically, as long as the selected portal is kept in view and you do not zoom out too much.
|
- the portal information is updated automatically, as long as the selected portal is kept in view and you do not zoom out too much.
|
||||||
- the sidebar may be collapsed. Click the triangle button that stands out at the left hand side.
|
- the sidebar may be collapsed. Click the triangle button that stands out at the left hand side.
|
||||||
- the sidebar **can be scrolled** if your screen is too small. Use your scroll wheel.
|
- the sidebar **can be scrolled** if your screen is too small. Use your scroll wheel.
|
||||||
- almost anything has tooltips. See [General usage](#general-usage) above.
|
- almost everything has tooltips. See [General usage](#general-usage) above.
|
||||||
|
|
||||||
### Details:
|
### Details:
|
||||||
Starting from the top, the sidebar shows this information:
|
Starting from the top, the sidebar shows this information:
|
||||||
|
|
||||||
#### logged in user, global MU, search
|
#### logged in user, global MU, search
|
||||||
- Details about you, the logged in user. This is only updated if you reload the page. This is a limitation of Ingress, not IITC.
|
- Details about you, the logged in user. This is only updated if you reload the page. This is a limitation of Ingress, not IITC.
|
||||||
- it shows your current level followed by your nick
|
- it shows your current level followed by your nickname
|
||||||
|
- hovering over your nickname allows you to sign out (NIGHTLY ONLY)
|
||||||
- to the right, it shows to percentages. The upper one, e.g. “XM: 37%” tells you how much your XM bar is filled. The lower one, e.g. “level: 37%“ tells you that you have gathered 37% of the AP required for the next level. It shows “max level” if you have reached max level.
|
- to the right, it shows to percentages. The upper one, e.g. “XM: 37%” tells you how much your XM bar is filled. The lower one, e.g. “level: 37%“ tells you that you have gathered 37% of the AP required for the next level. It shows “max level” if you have reached max level.
|
||||||
- the tooltip mainly shows you absolute numbers instead of percentages. It also shows how many invites you have.
|
- the tooltip mainly shows you absolute numbers instead of percentages. It also shows how many invites you have.
|
||||||
- The next bar is a visual representation of global MindUnits (MU) per faction. It is updated every now and then. The tooltip shows the absolute MU count per faction.
|
- The next bar is a visual representation of global MindUnits (MU) per faction. It is updated every now and then. The tooltip shows the absolute MU count per faction.
|
||||||
|
31
code/boot.js
31
code/boot.js
@ -23,6 +23,25 @@ window.setupLargeImagePreview = function() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// adds listeners to the layer chooser such that a long press hides
|
||||||
|
// all custom layers except the long pressed one.
|
||||||
|
window.setupLayerChooserSelectOne = function() {
|
||||||
|
$('.leaflet-control-layers-overlays').on('click', 'label', function(e) {
|
||||||
|
if(!e || !(e.metaKey || e.ctrlKey || e.shiftKey || e.altKey)) return;
|
||||||
|
|
||||||
|
var isChecked = $(this).find('input').is(':checked');
|
||||||
|
var checkSize = $('.leaflet-control-layers-overlays input:checked').length;
|
||||||
|
if((isChecked && checkSize === 1) || checkSize === 0) {
|
||||||
|
// if nothing is selected or the users long-clicks the only
|
||||||
|
// selected element, assume all boxes should be checked again
|
||||||
|
$('.leaflet-control-layers-overlays input:not(:checked)').click();
|
||||||
|
} else {
|
||||||
|
// uncheck all
|
||||||
|
$('.leaflet-control-layers-overlays input:checked').click();
|
||||||
|
$(this).find('input').click();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
window.setupStyles = function() {
|
window.setupStyles = function() {
|
||||||
$('head').append('<style>' +
|
$('head').append('<style>' +
|
||||||
@ -167,13 +186,22 @@ window.setupPlayerStat = function() {
|
|||||||
|
|
||||||
$('#playerstat').html(''
|
$('#playerstat').html(''
|
||||||
+ '<h2 title="'+t+'">'+level+' '
|
+ '<h2 title="'+t+'">'+level+' '
|
||||||
|
+ '<div id="name">'
|
||||||
+ '<span class="'+cls+'">'+PLAYER.nickname+'</span>'
|
+ '<span class="'+cls+'">'+PLAYER.nickname+'</span>'
|
||||||
+ '<div>'
|
+ '<a href="https://www.ingress.com/_ah/logout?continue=https://www.google.com/accounts/Logout%3Fcontinue%3Dhttps://appengine.google.com/_ah/logout%253Fcontinue%253Dhttps://www.ingress.com/intel%26service%3Dah" id="signout">sign out</a>'
|
||||||
|
+ '</div>'
|
||||||
|
+ '<div id="stats">'
|
||||||
+ '<sup>XM: '+xmRatio+'%</sup>'
|
+ '<sup>XM: '+xmRatio+'%</sup>'
|
||||||
+ '<sub>' + (level < 8 ? 'level: '+lvlApProg+'%' : 'max level') + '</sub>'
|
+ '<sub>' + (level < 8 ? 'level: '+lvlApProg+'%' : 'max level') + '</sub>'
|
||||||
+ '</div>'
|
+ '</div>'
|
||||||
+ '</h2>'
|
+ '</h2>'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$('#name').mouseenter(function() {
|
||||||
|
$('#signout').show();
|
||||||
|
}).mouseleave(function() {
|
||||||
|
$('#signout').hide();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
window.setupSidebarToggle = function() {
|
window.setupSidebarToggle = function() {
|
||||||
@ -264,6 +292,7 @@ function boot() {
|
|||||||
window.setupTooltips();
|
window.setupTooltips();
|
||||||
window.chat.setup();
|
window.chat.setup();
|
||||||
window.setupQRLoadLib();
|
window.setupQRLoadLib();
|
||||||
|
window.setupLayerChooserSelectOne();
|
||||||
// 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');
|
||||||
|
12
code/chat.js
12
code/chat.js
@ -279,8 +279,14 @@ window.chat.writeDataToHash = function(newData, storageHash, skipSecureMsgs) {
|
|||||||
|
|
||||||
case 'PORTAL':
|
case 'PORTAL':
|
||||||
var latlng = [markup[1].latE6/1E6, markup[1].lngE6/1E6];
|
var latlng = [markup[1].latE6/1E6, markup[1].lngE6/1E6];
|
||||||
var js = 'window.zoomToAndShowPortal(\''+markup[1].guid+'\', ['+latlng[0]+', '+latlng[1]+'])';
|
var perma = 'https://ingress.com/intel?latE6='+markup[1].latE6+'&lngE6='+markup[1].lngE6+'&z=17&pguid='+markup[1].guid;
|
||||||
msg += '<a onclick="'+js+'" title="'+markup[1].address+'" class="help">'+markup[1].name+'</a>';
|
var js = 'window.zoomToAndShowPortal(\''+markup[1].guid+'\', ['+latlng[0]+', '+latlng[1]+']);return false';
|
||||||
|
|
||||||
|
msg += '<a onclick="'+js+'"'
|
||||||
|
+ ' title="'+markup[1].address+'"'
|
||||||
|
+ ' href="'+perma+'" class="help">'
|
||||||
|
+ markup[1].name
|
||||||
|
+ '</a>';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'SECURE':
|
case 'SECURE':
|
||||||
@ -341,7 +347,7 @@ window.chat.renderMsg = function(msg, nick, time, team) {
|
|||||||
var s = 'style="color:'+COLORS[team]+'"';
|
var s = 'style="color:'+COLORS[team]+'"';
|
||||||
var title = nick.length >= 8 ? 'title="'+nick+'" class="help"' : '';
|
var title = nick.length >= 8 ? 'title="'+nick+'" class="help"' : '';
|
||||||
var i = ['<span class="invisep"><</span>', '<span class="invisep">></span>'];
|
var i = ['<span class="invisep"><</span>', '<span class="invisep">></span>'];
|
||||||
return '<tr><td>'+t+'</td><td>'+i[0]+'<mark '+s+'>'+nick+'</mark>'+i[1]+'</td><td>'+msg+'</td></tr>';
|
return '<tr><td>'+t+'</td><td>'+i[0]+'<mark class="nickname" '+s+'>'+nick+'</mark>'+i[1]+'</td><td>'+msg+'</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -43,25 +43,34 @@ window.requestData = function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reset previous result of Portal Render Limit handler
|
||||||
|
portalRenderLimit.init();
|
||||||
// finally send ajax requests
|
// finally send ajax requests
|
||||||
$.each(tiles, function(ind, tls) {
|
$.each(tiles, function(ind, tls) {
|
||||||
data = { minLevelOfDetail: -1 };
|
data = { minLevelOfDetail: -1 };
|
||||||
data.boundsParamsList = tls;
|
data.boundsParamsList = tls;
|
||||||
window.requests.add(window.postAjax('getThinnedEntitiesV2', data, window.handleDataResponse));
|
window.requests.add(window.postAjax('getThinnedEntitiesV2', data, window.handleDataResponse, window.handleFailedRequest));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Handle failed map data request
|
||||||
|
window.handleFailedRequest = function() {
|
||||||
|
if(requests.isLastRequest('getThinnedEntitiesV2')) {
|
||||||
|
var leftOverPortals = portalRenderLimit.mergeLowLevelPortals(null);
|
||||||
|
handlePortalsRender(leftOverPortals);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// works on map data response and ensures entities are drawn/updated.
|
// works on map data response and ensures entities are drawn/updated.
|
||||||
window.handleDataResponse = function(data, textStatus, jqXHR) {
|
window.handleDataResponse = function(data, textStatus, jqXHR) {
|
||||||
// remove from active ajax queries list
|
// remove from active ajax queries list
|
||||||
if(!data || !data.result) {
|
if(!data || !data.result) {
|
||||||
window.failedRequestCount++;
|
window.failedRequestCount++;
|
||||||
console.warn(data);
|
console.warn(data);
|
||||||
|
handleFailedRequest();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var portalUpdateAvailable = false;
|
|
||||||
var portalInUrlAvailable = false;
|
|
||||||
var m = data.result.map;
|
var m = data.result.map;
|
||||||
// defer rendering of portals because there is no z-index in SVG.
|
// defer rendering of portals because there is no z-index in SVG.
|
||||||
// this means that what’s rendered last ends up on top. While the
|
// this means that what’s rendered last ends up on top. While the
|
||||||
@ -88,8 +97,6 @@ window.handleDataResponse = function(data, textStatus, jqXHR) {
|
|||||||
// format for portals: { controllingTeam, turret }
|
// format for portals: { controllingTeam, turret }
|
||||||
|
|
||||||
if(ent[2].turret !== undefined) {
|
if(ent[2].turret !== undefined) {
|
||||||
if(selectedPortal === ent[0]) portalUpdateAvailable = true;
|
|
||||||
if(urlPortal && ent[0] == urlPortal) portalInUrlAvailable = true;
|
|
||||||
|
|
||||||
var latlng = [ent[2].locationE6.latE6/1E6, ent[2].locationE6.lngE6/1E6];
|
var latlng = [ent[2].locationE6.latE6/1E6, ent[2].locationE6.lngE6/1E6];
|
||||||
if(!window.getPaddedBounds().contains(latlng)
|
if(!window.getPaddedBounds().contains(latlng)
|
||||||
@ -114,7 +121,7 @@ window.handleDataResponse = function(data, textStatus, jqXHR) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$.each(ppp, function(ind, portal) {
|
$.each(ppp, function(ind, portal) {
|
||||||
if(portal[2].portalV2['linkedFields'] === undefined) {
|
if(portal[2].portalV2['linkedFields'] === undefined) {
|
||||||
portal[2].portalV2['linkedFields'] = [];
|
portal[2].portalV2['linkedFields'] = [];
|
||||||
@ -124,12 +131,29 @@ window.handleDataResponse = function(data, textStatus, jqXHR) {
|
|||||||
portal[2].portalV2['linkedFields'] = uniqueArray(p2f[portal[0]]);
|
portal[2].portalV2['linkedFields'] = uniqueArray(p2f[portal[0]]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Process the portals with portal render limit handler first
|
||||||
|
// Low level portal will hold until last request
|
||||||
|
var newPpp = portalRenderLimit.splitOrMergeLowLevelPortals(ppp);
|
||||||
|
handlePortalsRender(newPpp);
|
||||||
|
|
||||||
|
resolvePlayerNames();
|
||||||
|
renderUpdateStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
window.handlePortalsRender = function(portals) {
|
||||||
|
var portalUpdateAvailable = false;
|
||||||
|
var portalInUrlAvailable = false;
|
||||||
|
|
||||||
// Preserve and restore "selectedPortal" between portal re-render
|
// Preserve and restore "selectedPortal" between portal re-render
|
||||||
if(portalUpdateAvailable) var oldSelectedPortal = selectedPortal;
|
if(portalUpdateAvailable) var oldSelectedPortal = selectedPortal;
|
||||||
|
|
||||||
runHooks('portalDataLoaded', {portals : ppp});
|
runHooks('portalDataLoaded', {portals : portals});
|
||||||
$.each(ppp, function(ind, portal) { renderPortal(portal); });
|
$.each(portals, function(ind, portal) {
|
||||||
|
if(selectedPortal === portal[0]) portalUpdateAvailable = true;
|
||||||
|
if(urlPortal && portal[0] == urlPortal) portalInUrlAvailable = true;
|
||||||
|
renderPortal(portal);
|
||||||
|
});
|
||||||
|
|
||||||
var selectedPortalLayer = portals[oldSelectedPortal];
|
var selectedPortalLayer = portals[oldSelectedPortal];
|
||||||
if(portalUpdateAvailable && selectedPortalLayer) selectedPortal = oldSelectedPortal;
|
if(portalUpdateAvailable && selectedPortalLayer) selectedPortal = oldSelectedPortal;
|
||||||
@ -146,7 +170,6 @@ window.handleDataResponse = function(data, textStatus, jqXHR) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(portalUpdateAvailable) renderPortalDetails(selectedPortal);
|
if(portalUpdateAvailable) renderPortalDetails(selectedPortal);
|
||||||
resolvePlayerNames();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// removes entities that are still handled by Leaflet, although they
|
// removes entities that are still handled by Leaflet, although they
|
||||||
|
@ -24,6 +24,7 @@ window.renderPortalDetails = function(guid) {
|
|||||||
var player = d.captured && d.captured.capturingPlayerId
|
var player = d.captured && d.captured.capturingPlayerId
|
||||||
? getPlayerName(d.captured.capturingPlayerId)
|
? getPlayerName(d.captured.capturingPlayerId)
|
||||||
: null;
|
: null;
|
||||||
|
player = '<span class="nickname">'+player+'</span>';
|
||||||
var playerText = player ? ['owner', player] : null;
|
var playerText = player ? ['owner', player] : null;
|
||||||
|
|
||||||
var time = d.captured
|
var time = d.captured
|
||||||
@ -45,12 +46,12 @@ window.renderPortalDetails = function(guid) {
|
|||||||
|
|
||||||
setPortalIndicators(d);
|
setPortalIndicators(d);
|
||||||
var img = d.imageByUrl && d.imageByUrl.imageUrl
|
var img = d.imageByUrl && d.imageByUrl.imageUrl
|
||||||
? d.imageByUrl.imageUrl.replace(/^http:/, 'https:')
|
? d.imageByUrl.imageUrl
|
||||||
: DEFAULT_PORTAL_IMG;
|
: 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 = 'https://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 poslinks = 'window.showPortalPosLinks('+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';
|
||||||
|
@ -132,6 +132,7 @@ window.renderResonatorDetails = function(slot, level, nrg, dist, nick) {
|
|||||||
|
|
||||||
var meter = '<span class="meter" title="'+inf+'">' + fill + lbar + '</span>';
|
var meter = '<span class="meter" title="'+inf+'">' + fill + lbar + '</span>';
|
||||||
}
|
}
|
||||||
|
nick = '<span class="nickname">'+nick+'</span>';
|
||||||
return [meter, nick || ''];
|
return [meter, nick || ''];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
155
code/portal_render_limit.js
Normal file
155
code/portal_render_limit.js
Normal file
@ -0,0 +1,155 @@
|
|||||||
|
|
||||||
|
// PORTAL RENDER LIMIT HANDLER ///////////////////////////////////////
|
||||||
|
// Functions to handle hiding low level portal when portal render
|
||||||
|
// limit is reached.
|
||||||
|
//
|
||||||
|
// On initialization, previous minLevel will preserve to previousMinLevel
|
||||||
|
// with zoom level difference.
|
||||||
|
//
|
||||||
|
// After initialized and reset in window.requestData(), "processPortals"
|
||||||
|
// intercept all portals data in "handleDataResponse". Put the count of
|
||||||
|
// new portals to newPortalsPerLevel[portal level]. And split portals
|
||||||
|
// into two parts base on previousMinLevel. Portals with level >=
|
||||||
|
// previousMinLevel will return as result and continue to render.
|
||||||
|
// Others will save to portalsPreviousMinLevel. If there is no more
|
||||||
|
// active request of map data, portals will not split and
|
||||||
|
// portalsPreviousMinLevel will add back to result and render base on
|
||||||
|
// current minLevel.
|
||||||
|
//
|
||||||
|
// "handleFailRequest" is added to handle the case when the last request
|
||||||
|
// failed and "processPortals" didn't get called. It will get
|
||||||
|
// portalsPreviousMinLevel base on current minLevel and render them.
|
||||||
|
//
|
||||||
|
// "getMinLevel" will be called by "getMinPortalLevel" in utils_misc.js
|
||||||
|
// to determine min portal level to draw on map.
|
||||||
|
//
|
||||||
|
// "getMinLevel" will return minLevel and call "setMinLevel" if
|
||||||
|
// minLevel hasn't set yet.
|
||||||
|
//
|
||||||
|
// In "setMinLevel", it will loop through all portal level from
|
||||||
|
// high to low, and sum total portal count (old + new) to check
|
||||||
|
// minLevel.
|
||||||
|
//
|
||||||
|
// In each call of window.handleDataResponse(), it will call
|
||||||
|
// "resetCounting" to reset previous response data. But minLevel
|
||||||
|
// is preserved and only replaced when render limit reached in
|
||||||
|
// higher level, until next window.requestData() called and reset.
|
||||||
|
//
|
||||||
|
|
||||||
|
window.portalRenderLimit = function() {}
|
||||||
|
|
||||||
|
window.portalRenderLimit.initialized = false;
|
||||||
|
window.portalRenderLimit.minLevelSet = false;
|
||||||
|
window.portalRenderLimit.minLevel = -1;
|
||||||
|
window.portalRenderLimit.previousMinLevel = -1;
|
||||||
|
window.portalRenderLimit.previousZoomLevel;
|
||||||
|
window.portalRenderLimit.newPortalsPerLevel = new Array(MAX_PORTAL_LEVEL + 1);
|
||||||
|
window.portalRenderLimit.portalsPreviousMinLevel = new Array(MAX_PORTAL_LEVEL + 1);
|
||||||
|
|
||||||
|
window.portalRenderLimit.init = function () {
|
||||||
|
var currentZoomLevel = map.getZoom();
|
||||||
|
portalRenderLimit.previousZoomLevel = portalRenderLimit.previousZoomLevel || currentZoomLevel;
|
||||||
|
|
||||||
|
// If there is a minLevel set in previous run, calculate previousMinLevel with it.
|
||||||
|
if(portalRenderLimit.minLevelSet) {
|
||||||
|
var zoomDiff = currentZoomLevel - portalRenderLimit.previousZoomLevel;
|
||||||
|
portalRenderLimit.previousMinLevel = Math.max(portalRenderLimit.minLevel - zoomDiff, -1);
|
||||||
|
portalRenderLimit.previousMinLevel = Math.min(portalRenderLimit.previousMinLevel, MAX_PORTAL_LEVEL);
|
||||||
|
}
|
||||||
|
|
||||||
|
portalRenderLimit.previousZoomLevel = currentZoomLevel;
|
||||||
|
|
||||||
|
portalRenderLimit.initialized = true;
|
||||||
|
portalRenderLimit.minLevel = -1;
|
||||||
|
portalRenderLimit.resetCounting();
|
||||||
|
portalRenderLimit.resetPortalsPreviousMinLevel();
|
||||||
|
}
|
||||||
|
|
||||||
|
window.portalRenderLimit.resetCounting = function() {
|
||||||
|
portalRenderLimit.minLevelSet = false;
|
||||||
|
for(var i = 0; i <= MAX_PORTAL_LEVEL; i++) {
|
||||||
|
portalRenderLimit.newPortalsPerLevel[i] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
window.portalRenderLimit.resetPortalsPreviousMinLevel = function() {
|
||||||
|
for(var i = 0; i <= MAX_PORTAL_LEVEL; i++) {
|
||||||
|
portalRenderLimit.portalsPreviousMinLevel[i] = new Array();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
window.portalRenderLimit.splitOrMergeLowLevelPortals = function(originPortals) {
|
||||||
|
portalRenderLimit.resetCounting();
|
||||||
|
portalRenderLimit.countingPortals(originPortals);
|
||||||
|
|
||||||
|
var resultPortals = requests.isLastRequest('getThinnedEntitiesV2')
|
||||||
|
? portalRenderLimit.mergeLowLevelPortals(originPortals)
|
||||||
|
: portalRenderLimit.splitLowLevelPortals(originPortals);
|
||||||
|
|
||||||
|
return resultPortals;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.portalRenderLimit.countingPortals = function(portals) {
|
||||||
|
$.each(portals, function(ind, portal) {
|
||||||
|
var portalGuid = portal[0];
|
||||||
|
var portalLevel = parseInt(getPortalLevel(portal[2]));
|
||||||
|
var layerGroup = portalsLayers[portalLevel];
|
||||||
|
|
||||||
|
if(findEntityInLeaflet(layerGroup, window.portals, portalGuid)) return true;
|
||||||
|
|
||||||
|
portalRenderLimit.newPortalsPerLevel[portalLevel]++;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
window.portalRenderLimit.splitLowLevelPortals = function(portals) {
|
||||||
|
var resultPortals = new Array();
|
||||||
|
$.each(portals, function(ind, portal) {
|
||||||
|
var portalLevel = parseInt(getPortalLevel(portal[2]));
|
||||||
|
if(portalLevel < portalRenderLimit.previousMinLevel) {
|
||||||
|
portalRenderLimit.portalsPreviousMinLevel[portalLevel].push(portal);
|
||||||
|
}else{
|
||||||
|
resultPortals.push(portal);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return resultPortals;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.portalRenderLimit.mergeLowLevelPortals = function(appendTo) {
|
||||||
|
var resultPortals = appendTo ? appendTo : new Array();
|
||||||
|
for(var i = portalRenderLimit.getMinLevel();
|
||||||
|
i < portalRenderLimit.previousMinLevel;
|
||||||
|
i++) {
|
||||||
|
$.merge(resultPortals, portalRenderLimit.portalsPreviousMinLevel[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reset portalsPreviousMinLevel, ensure they return only once
|
||||||
|
portalRenderLimit.resetPortalsPreviousMinLevel();
|
||||||
|
return resultPortals;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.portalRenderLimit.getMinLevel = function() {
|
||||||
|
if(!portalRenderLimit.initialized) return -1;
|
||||||
|
if(!portalRenderLimit.minLevelSet) portalRenderLimit.setMinLevel();
|
||||||
|
return portalRenderLimit.minLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.portalRenderLimit.setMinLevel = function() {
|
||||||
|
var totalPortalsCount = 0;
|
||||||
|
var newMinLevel = MAX_PORTAL_LEVEL + 1;
|
||||||
|
|
||||||
|
// Find the min portal level under render limit
|
||||||
|
while(newMinLevel > 0) {
|
||||||
|
var oldPortalCount = layerGroupLength(portalsLayers[newMinLevel - 1]);
|
||||||
|
var newPortalCount = portalRenderLimit.newPortalsPerLevel[newMinLevel - 1];
|
||||||
|
totalPortalsCount += oldPortalCount + newPortalCount;
|
||||||
|
if(totalPortalsCount >= MAX_DRAWN_PORTALS)
|
||||||
|
break;
|
||||||
|
newMinLevel--;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If render limit reached at max portal level, still let portal at max level render
|
||||||
|
newMinLevel = Math.min(newMinLevel, MAX_PORTAL_LEVEL);
|
||||||
|
|
||||||
|
portalRenderLimit.minLevel = Math.max(newMinLevel, portalRenderLimit.minLevel);
|
||||||
|
portalRenderLimit.minLevelSet = true;
|
||||||
|
}
|
@ -111,3 +111,14 @@ window.requests._callOnRefreshFunctions = function() {
|
|||||||
window.requests.addRefreshFunction = function(f) {
|
window.requests.addRefreshFunction = function(f) {
|
||||||
window.requests._onRefreshFunctions.push(f);
|
window.requests._onRefreshFunctions.push(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.requests.isLastRequest = function(action) {
|
||||||
|
var result = true;
|
||||||
|
$.each(window.activeRequests, function(ind, req) {
|
||||||
|
if(req.action === action) {
|
||||||
|
result = false;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
@ -2,6 +2,14 @@
|
|||||||
|
|
||||||
// UTILS + MISC ///////////////////////////////////////////////////////
|
// UTILS + MISC ///////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
window.layerGroupLength = function(layerGroup) {
|
||||||
|
var layersCount = 0;
|
||||||
|
var layers = layerGroup._layers;
|
||||||
|
if (layers)
|
||||||
|
layersCount = Object.keys(layers).length;
|
||||||
|
return layersCount;
|
||||||
|
}
|
||||||
|
|
||||||
// retrieves parameter from the URL?query=string.
|
// retrieves parameter from the URL?query=string.
|
||||||
window.getURLParam = function(param) {
|
window.getURLParam = function(param) {
|
||||||
var v = document.URL;
|
var v = document.URL;
|
||||||
@ -50,7 +58,7 @@ window.postAjax = function(action, data, success, error) {
|
|||||||
data = JSON.stringify($.extend({method: 'dashboard.'+action}, data));
|
data = JSON.stringify($.extend({method: 'dashboard.'+action}, data));
|
||||||
var remove = function(data, textStatus, jqXHR) { window.requests.remove(jqXHR); };
|
var remove = function(data, textStatus, jqXHR) { window.requests.remove(jqXHR); };
|
||||||
var errCnt = function(jqXHR) { window.failedRequestCount++; window.requests.remove(jqXHR); };
|
var errCnt = function(jqXHR) { window.failedRequestCount++; window.requests.remove(jqXHR); };
|
||||||
return $.ajax({
|
var result = $.ajax({
|
||||||
// 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
|
||||||
@ -65,6 +73,8 @@ window.postAjax = function(action, data, success, error) {
|
|||||||
req.setRequestHeader('X-CSRFToken', readCookie('csrftoken'));
|
req.setRequestHeader('X-CSRFToken', readCookie('csrftoken'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
result.action = action;
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// converts unix timestamps to HH:mm:ss format if it was today;
|
// converts unix timestamps to HH:mm:ss format if it was today;
|
||||||
@ -152,7 +162,11 @@ window.getMinPortalLevel = function() {
|
|||||||
var z = map.getZoom();
|
var z = map.getZoom();
|
||||||
if(z >= 16) return 0;
|
if(z >= 16) return 0;
|
||||||
var conv = ['impossible', 8,7,7,6,6,5,5,4,4,3,3,2,2,1,1];
|
var conv = ['impossible', 8,7,7,6,6,5,5,4,4,3,3,2,2,1,1];
|
||||||
return conv[z];
|
var minLevelByRenderLimit = portalRenderLimit.getMinLevel();
|
||||||
|
var result = minLevelByRenderLimit > conv[z]
|
||||||
|
? minLevelByRenderLimit
|
||||||
|
: conv[z];
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns number of pixels left to scroll down before reaching the
|
// returns number of pixels left to scroll down before reaching the
|
||||||
|
5
dist/leaflet_google.js
vendored
5
dist/leaflet_google.js
vendored
@ -92,6 +92,7 @@ L.Google = L.Class.extend({
|
|||||||
var map = new google.maps.Map(this._container, {
|
var map = new google.maps.Map(this._container, {
|
||||||
center: this._google_center,
|
center: this._google_center,
|
||||||
zoom: 0,
|
zoom: 0,
|
||||||
|
tilt: 0,
|
||||||
styles: this._styles,
|
styles: this._styles,
|
||||||
mapTypeId: this._type,
|
mapTypeId: this._type,
|
||||||
disableDefaultUI: true,
|
disableDefaultUI: true,
|
||||||
@ -138,8 +139,8 @@ L.Google = L.Class.extend({
|
|||||||
|
|
||||||
_resize: function() {
|
_resize: function() {
|
||||||
var size = this._map.getSize();
|
var size = this._map.getSize();
|
||||||
if (this._container.style.width == size.x &&
|
if (parseInt(this._container.style.width) == size.x &&
|
||||||
this._container.style.height == size.y)
|
parseInt(this._container.style.height) == size.y)
|
||||||
return;
|
return;
|
||||||
this._container.style.width = size.x + 'px';
|
this._container.style.width = size.x + 'px';
|
||||||
this._container.style.height = size.y + 'px';
|
this._container.style.height = size.y + 'px';
|
||||||
|
4
dist/style.0.7.css
vendored
4
dist/style.0.7.css
vendored
@ -401,6 +401,10 @@ input {
|
|||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.leaflet-control-layers input {
|
||||||
|
height: auto;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* portal title and image */
|
/* portal title and image */
|
||||||
h3 {
|
h3 {
|
||||||
|
25
external/leaflet_google.js
vendored
25
external/leaflet_google.js
vendored
@ -36,12 +36,11 @@ L.Google = L.Class.extend({
|
|||||||
this._initContainer();
|
this._initContainer();
|
||||||
this._initMapObject();
|
this._initMapObject();
|
||||||
|
|
||||||
// set up events
|
this._map.options.zoomAnimation = false;
|
||||||
map.on('viewreset', this._resetCallback, this);
|
|
||||||
|
|
||||||
this._limitedUpdate = L.Util.limitExecByInterval(this._update, 150, this);
|
// set up events
|
||||||
|
//~ map.on('viewreset', this._resetCallback, this);
|
||||||
map.on('move', this._update, this);
|
map.on('move', this._update, this);
|
||||||
//map.on('moveend', this._update, this);
|
|
||||||
|
|
||||||
this._reset();
|
this._reset();
|
||||||
this._update();
|
this._update();
|
||||||
@ -51,7 +50,8 @@ L.Google = L.Class.extend({
|
|||||||
this._map._container.removeChild(this._container);
|
this._map._container.removeChild(this._container);
|
||||||
//this._container = null;
|
//this._container = null;
|
||||||
|
|
||||||
this._map.off('viewreset', this._resetCallback, this);
|
//~ this._map.off('viewreset', this._resetCallback, this);
|
||||||
|
this._map.options.zoomAnimation = true;
|
||||||
|
|
||||||
this._map.off('move', this._update, this);
|
this._map.off('move', this._update, this);
|
||||||
//this._map.off('moveend', this._update, this);
|
//this._map.off('moveend', this._update, this);
|
||||||
@ -93,6 +93,7 @@ L.Google = L.Class.extend({
|
|||||||
center: this._google_center,
|
center: this._google_center,
|
||||||
zoom: 0,
|
zoom: 0,
|
||||||
styles: this._styles,
|
styles: this._styles,
|
||||||
|
tilt: 0,
|
||||||
mapTypeId: this._type,
|
mapTypeId: this._type,
|
||||||
disableDefaultUI: true,
|
disableDefaultUI: true,
|
||||||
keyboardShortcuts: false,
|
keyboardShortcuts: false,
|
||||||
@ -121,28 +122,22 @@ L.Google = L.Class.extend({
|
|||||||
_update: function() {
|
_update: function() {
|
||||||
this._resize();
|
this._resize();
|
||||||
|
|
||||||
var bounds = this._map.getBounds();
|
|
||||||
var ne = bounds.getNorthEast();
|
|
||||||
var sw = bounds.getSouthWest();
|
|
||||||
var google_bounds = new google.maps.LatLngBounds(
|
|
||||||
new google.maps.LatLng(sw.lat, sw.lng),
|
|
||||||
new google.maps.LatLng(ne.lat, ne.lng)
|
|
||||||
);
|
|
||||||
var center = this._map.getCenter();
|
var center = this._map.getCenter();
|
||||||
var _center = new google.maps.LatLng(center.lat, center.lng);
|
var _center = new google.maps.LatLng(center.lat, center.lng);
|
||||||
|
|
||||||
this._google.setCenter(_center);
|
this._google.setCenter(_center);
|
||||||
this._google.setZoom(this._map.getZoom());
|
this._google.setZoom(this._map.getZoom());
|
||||||
//this._google.fitBounds(google_bounds);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_resize: function() {
|
_resize: function() {
|
||||||
var size = this._map.getSize();
|
var size = this._map.getSize();
|
||||||
if (this._container.style.width == size.x &&
|
if (parseInt(this._container.style.width) == size.x &&
|
||||||
this._container.style.height == size.y)
|
parseInt(this._container.style.height) == size.y)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this._container.style.width = size.x + 'px';
|
this._container.style.width = size.x + 'px';
|
||||||
this._container.style.height = size.y + 'px';
|
this._container.style.height = size.y + 'px';
|
||||||
|
|
||||||
google.maps.event.trigger(this._google, "resize");
|
google.maps.event.trigger(this._google, "resize");
|
||||||
},
|
},
|
||||||
|
|
||||||
|
1
main.js
1
main.js
@ -188,6 +188,7 @@ window.DESTROY_FIELD = 750; //AP for destroying field
|
|||||||
window.CAPTURE_PORTAL = 500; //AP for capturing a portal
|
window.CAPTURE_PORTAL = 500; //AP for capturing a portal
|
||||||
window.DEPLOY_RESONATOR = 125; //AP for deploying a resonator
|
window.DEPLOY_RESONATOR = 125; //AP for deploying a resonator
|
||||||
window.COMPLETION_BONUS = 250; //AP for deploying all resonators on portal
|
window.COMPLETION_BONUS = 250; //AP for deploying all resonators on portal
|
||||||
|
window.MAX_PORTAL_LEVEL = 8;
|
||||||
|
|
||||||
// OTHER MORE-OR-LESS CONSTANTS //////////////////////////////////////
|
// OTHER MORE-OR-LESS CONSTANTS //////////////////////////////////////
|
||||||
window.TEAM_NONE = 0;
|
window.TEAM_NONE = 0;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// ==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.1
|
// @version 0.3
|
||||||
// @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
|
||||||
@ -44,6 +44,21 @@ window.plugin.compAPStats.onPositionMove = function() {
|
|||||||
+ '</table>');
|
+ '</table>');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.plugin.compAPStats.missingResonatorAP = function(portal) {
|
||||||
|
var resAP = 0;
|
||||||
|
var missing_resonators = 0;
|
||||||
|
$.each(portal.resonatorArray.resonators, function(ind, reso) {
|
||||||
|
if(reso === null) {
|
||||||
|
missing_resonators++;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if(missing_resonators > 0) {
|
||||||
|
resAP = window.DEPLOY_RESONATOR * missing_resonators;
|
||||||
|
resAP += window.COMPLETION_BONUS;
|
||||||
|
}
|
||||||
|
return(resAP);
|
||||||
|
};
|
||||||
|
|
||||||
window.plugin.compAPStats.compAPStats = function() {
|
window.plugin.compAPStats.compAPStats = function() {
|
||||||
|
|
||||||
var totalAP_RES = 0;
|
var totalAP_RES = 0;
|
||||||
@ -78,6 +93,9 @@ window.plugin.compAPStats.compAPStats = function() {
|
|||||||
if(!field) return true;
|
if(!field) return true;
|
||||||
allEnlFields.push(field);
|
allEnlFields.push(field);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
totalAP_ENL += window.plugin.compAPStats.missingResonatorAP(d);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (getTeam(d) === TEAM_RES) {
|
else if (getTeam(d) === TEAM_RES) {
|
||||||
totalAP_ENL += portalSum;
|
totalAP_ENL += portalSum;
|
||||||
@ -91,6 +109,9 @@ window.plugin.compAPStats.compAPStats = function() {
|
|||||||
if(!field) return true;
|
if(!field) return true;
|
||||||
allResFields.push(field);
|
allResFields.push(field);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
totalAP_RES += window.plugin.compAPStats.missingResonatorAP(d);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// it's a neutral portal, potential for both teams. by definition no fields or edges
|
// it's a neutral portal, potential for both teams. by definition no fields or edges
|
||||||
totalAP_ENL += portalSum;
|
totalAP_ENL += portalSum;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// ==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.3.1
|
// @version 0.5
|
||||||
// @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
|
||||||
@ -74,12 +74,25 @@ window.plugin.portalWeakness.portalAdded = function(data) {
|
|||||||
params["dashArray"] = dash;
|
params["dashArray"] = dash;
|
||||||
}
|
}
|
||||||
data.portal.setStyle(params);
|
data.portal.setStyle(params);
|
||||||
|
} else {
|
||||||
|
data.portal.setStyle({color: COLORS[getTeam(data.portal.options.details)],
|
||||||
|
fillOpacity: 0.5,
|
||||||
|
dashArray: null});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.plugin.portalWeakness.portalDataLoaded = function(data) {
|
||||||
|
$.each(data.portals, function(ind, portal) {
|
||||||
|
if(window.portals[portal[0]]) {
|
||||||
|
window.plugin.portalWeakness.portalAdded({portal: window.portals[portal[0]]});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
var setup = function() {
|
var setup = function() {
|
||||||
window.addHook('portalAdded', window.plugin.portalWeakness.portalAdded);
|
window.addHook('portalAdded', window.plugin.portalWeakness.portalAdded);
|
||||||
|
window.addHook('portalDataLoaded', window.plugin.portalWeakness.portalDataLoaded);
|
||||||
window.COLOR_SELECTED_PORTAL = '#f0f';
|
window.COLOR_SELECTED_PORTAL = '#f0f';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
22
style.css
22
style.css
@ -329,21 +329,34 @@ h2 {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 span {
|
h2 #name {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: "~";
|
text-overflow: "~";
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
width: 205px;
|
width: 205px;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 div {
|
h2 #stats {
|
||||||
float: right;
|
float: right;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h2 #signout {
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: normal;
|
||||||
|
line-height: 29px;
|
||||||
|
padding: 0 4px;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
background-color: rgba(8, 48, 78, 0.5);
|
||||||
|
display: none; /* starts hidden */
|
||||||
|
}
|
||||||
|
|
||||||
h2 sup, h2 sub {
|
h2 sup, h2 sub {
|
||||||
display: block;
|
display: block;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
@ -401,6 +414,11 @@ input {
|
|||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.leaflet-control-layers input {
|
||||||
|
height: auto;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* portal title and image */
|
/* portal title and image */
|
||||||
h3 {
|
h3 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user