Merge branch 'upstream' into plugin

This commit is contained in:
boombuler 2013-02-24 15:33:39 +01:00
commit 37314522b0
7 changed files with 41 additions and 15 deletions

View File

@ -68,7 +68,7 @@ How do I report bugs?
- press `SHIFT+F5` (or shift-click the reload button). Wait for the page to load.
- press `CTRL+F5`, same as above.
If your issue persists, continue. Provide **all** of the information below, even if you dont think this is necessary.
If your issue persists, continue. The next step is to look for existing issues, maybe someone else has a similar problem. You can look [through the existing issues](https://github.com/breunigs/ingress-intel-total-conversion/issues?sort=updated&state=open) or use the search function on the top right. If your issue persists, open a new issue and provide **all** of the information below, even if you dont think this is necessary.
- a descriptive title
- your browser and its version

View File

@ -1,5 +1,7 @@
CHANGES IN 0.7
==============
CHANGES IN 0.7 / 0.7.1
======================
- 0.7.1 fixes an oversight that prevented some portals from showing (by saithis)
### General
- from now on there will be [nightly builds](https://www.dropbox.com/sh/lt9p0s40kt3cs6m/3xzpyiVBnF) available. You need to manually update them if you want to stay on nightly. You should be offered to update to the next release version, though. Be sure to [have read the guide on how to report bugs](https://github.com/breunigs/ingress-intel-total-conversion/blob/gh-pages/HACKING.md#how-do-i-report-bugs) before using a nightly version.
@ -33,7 +35,7 @@ CHANGES IN 0.7
- show portal address in sidebar (by vita10gy)
**Updated:**
- the guess players plugin now groups and sorts by level. It also remembers the players now, so zooming in wont make a player “lower level”.
- the guess player level plugin now groups and sorts by level. It also remembers the players now, so zooming in wont make a player “lower level”.
[You can obtain them in the plugins directory](https://github.com/breunigs/ingress-intel-total-conversion/tree/gh-pages/plugins#readme).

View File

@ -19,7 +19,7 @@ IITC can be [extended with the use of plugins](https://github.com/breunigs/ingre
Install
-------
Current version is 0.7. [See NEWS.md for details](https://github.com/breunigs/ingress-intel-total-conversion/blob/gh-pages/NEWS.md).
Current version is 0.7.1. [See NEWS.md for details](https://github.com/breunigs/ingress-intel-total-conversion/blob/gh-pages/NEWS.md).
[**INSTALL**](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/dist/total-conversion-build.user.js)

View File

@ -49,7 +49,7 @@
window._hooks = {}
window.VALID_HOOKS = ['portalAdded', 'portalDetailsUpdated',
'publicChatDataAvailable', 'portalDataLoaded'];
'publicChatDataAvailable', 'portalDataLoaded', 'beforePortalReRender'];
window.runHooks = function(event, data) {
if(VALID_HOOKS.indexOf(event) === -1) throw('Unknown event type: ' + event);

View File

@ -261,8 +261,11 @@ window.renderPortal = function(ent) {
// pre-loads player names for high zoom levels
loadPlayerNamesForPortal(ent[2]);
var lvWeight = Math.max(2, portalLevel / 1.5);
var lvRadius = Math.max(portalLevel + 3, 5);
var lvWeight = Math.max(2, Math.floor(portalLevel) / 1.5);
var lvRadius = Math.floor(portalLevel) + 4;
if(team === window.TEAM_NONE) {
lvRadius = 7;
}
var p = L.circleMarker(latlng, {
radius: lvRadius + (L.Browser.mobile ? PORTAL_RADIUS_ENLARGE_MOBILE : 0),
@ -481,9 +484,19 @@ window.renderLink = function(ent) {
weight:2,
clickable: false,
guid: ent[0],
smoothFactor: 10
smoothFactor: 0 // doesnt work for two points anyway, so disable
});
// determine which links are very short and dont render them at all.
// in most cases this will go unnoticed, but improve rendering speed.
poly._map = window.map;
poly.projectLatlngs();
var op = poly._originalPoints;
var dist = Math.abs(op[0].x - op[1].x) + Math.abs(op[0].y - op[1].y);
if(dist <= 10) {
return;
}
if(!getPaddedBounds().intersects(poly.getBounds())) return;
poly.on('remove', function() { delete window.links[this.options.guid]; });
@ -512,16 +525,27 @@ window.renderField = function(ent) {
[reg.vertexB.location.latE6/1E6, reg.vertexB.location.lngE6/1E6],
[reg.vertexC.location.latE6/1E6, reg.vertexC.location.lngE6/1E6]
];
var poly = L.polygon(latlngs, {
fillColor: COLORS[team],
fillOpacity: 0.25,
stroke: false,
clickable: false,
smoothFactor: 10,
vertices: ent[2].capturedRegion,
smoothFactor: 0, // hiding small fields will be handled below
vertices: reg,
lastUpdate: ent[1],
guid: ent[0]});
// determine which fields are too small to be rendered and dont
// render them, so they dont count towards the maximum fields limit.
// This saves some DOM operations as well, but given the relatively
// low amount of fields there isnt much to gain.
// The algorithm is the same as used by Leaflet.
poly._map = window.map;
poly.projectLatlngs();
var count = L.LineUtil.simplify(poly._originalPoints, 6).length;
if(count <= 2) return;
if(!getPaddedBounds().intersects(poly.getBounds())) return;
poly.on('remove', function() { delete window.fields[this.options.guid]; });

View File

@ -1,7 +1,7 @@
// ==UserScript==
// @id ingress-intel-total-conversion@breunigs
// @name intel map total conversion
// @version 0.7-2013-02-23-141531
// @version 0.7.1-2013-02-23-235612
// @namespace https://github.com/breunigs/ingress-intel-total-conversion
// @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/dist/total-conversion-build.user.js
// @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/dist/total-conversion-build.user.js
@ -15,7 +15,7 @@
if(document.getElementsByTagName('html')[0].getAttribute('itemscope') != null)
throw('Ingress Intel Website is down, not a userscript issue.');
window.iitcBuildDate = '2013-02-23-141531';
window.iitcBuildDate = '2013-02-23-235612';
// disable vanilla JS
window.onload = function() {};
@ -294,7 +294,7 @@ if(typeof window.plugin !== 'function') window.plugin = function() {};
window._hooks = {}
window.VALID_HOOKS = ['portalAdded', 'portalDetailsUpdated',
'publicChatDataAvailable', 'portalDataLoaded'];
'publicChatDataAvailable', 'portalDataLoaded', 'beforePortalReRender'];
window.runHooks = function(event, data) {
if(VALID_HOOKS.indexOf(event) === -1) throw('Unknown event type: ' + event);

View File

@ -158,7 +158,7 @@ window.MAX_DRAWN_FIELDS = 200;
window.RESONATOR_DISPLAY_ZOOM_LEVEL = 17;
window.COLOR_SELECTED_PORTAL = '#f00';
window.COLORS = ['#FFCE00', '#0088FF', '#03FE03']; // none, res, enl
window.COLORS = ['#FFCE00', '#0088FF', '#03DC03']; // none, res, enl
window.COLORS_LVL = ['#000', '#FECE5A', '#FFA630', '#FF7315', '#E40000', '#FD2992', '#EB26CD', '#C124E0', '#9627F4'];
window.COLORS_MOD = {VERY_RARE: '#F78AF6', RARE: '#AD8AFF', COMMON: '#84FBBD'};