fix infrastructure highlighter to work with changes to portal data
for #514
This commit is contained in:
parent
e528b42b75
commit
375a32e8bd
@ -2,11 +2,11 @@
|
|||||||
// @id iitc-plugin-highlight-portal-infrastructure@vita10gy
|
// @id iitc-plugin-highlight-portal-infrastructure@vita10gy
|
||||||
// @name IITC plugin: highlight portals with infrastructure problems
|
// @name IITC plugin: highlight portals with infrastructure problems
|
||||||
// @category Highlighter
|
// @category Highlighter
|
||||||
// @version 0.1.0.@@DATETIMEVERSION@@
|
// @version 0.2.0.@@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@@
|
||||||
// @description [@@BUILDNAME@@-@@BUILDDATE@@] Red - No Picture, Orange - More than one picture (probably means the original was bad, upvote new), Yellow - Potential title issue
|
// @description [@@BUILDNAME@@-@@BUILDDATE@@] Red - No Picture, Yellow - Potential title issue, Orange - both of these
|
||||||
// @include https://www.ingress.com/intel*
|
// @include https://www.ingress.com/intel*
|
||||||
// @include http://www.ingress.com/intel*
|
// @include http://www.ingress.com/intel*
|
||||||
// @match https://www.ingress.com/intel*
|
// @match https://www.ingress.com/intel*
|
||||||
@ -32,22 +32,19 @@ window.plugin.portalInfrastructure.highlight = function(data) {
|
|||||||
var d = data.portal.options.details;
|
var d = data.portal.options.details;
|
||||||
var color = '';
|
var color = '';
|
||||||
var opa = .75;
|
var opa = .75;
|
||||||
|
|
||||||
if(d.photoStreamInfo.photoCount === 0) {
|
if(!(d.imageByUrl && d.imageByUrl.imageUrl)) {
|
||||||
color = 'red';
|
color = 'red';
|
||||||
}
|
}
|
||||||
else if(d.photoStreamInfo.photoCount > 1) {
|
|
||||||
color = 'orange';
|
if((new RegExp(window.plugin.portalInfrastructure.badTitles.join("|"),'i')).test(d.portalV2.descriptiveText.TITLE)) {
|
||||||
}
|
color = color == 'red' ? 'orange' : 'yellow';
|
||||||
else if((new RegExp(window.plugin.portalInfrastructure.badTitles.join("|"),'i')).test(d.portalV2.descriptiveText.TITLE)) {
|
|
||||||
color = 'yellow';
|
|
||||||
opa = .9;
|
opa = .9;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(color !== '') {
|
if(color !== '') {
|
||||||
var params = {fillColor: color, fillOpacity: opa};
|
var params = {fillColor: color, fillOpacity: opa};
|
||||||
data.portal.setStyle(params);
|
data.portal.setStyle(params);
|
||||||
window.COLOR_SELECTED_PORTAL = '#f0f';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user