From e528b42b7528450780482d9eaa8b37a06f68b204 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Thu, 29 Aug 2013 20:30:52 +0100 Subject: [PATCH 1/3] remove plugin - it relied on data that niantic no longer send --- plugins/players-portal-pictures.user.js | 99 +------------------------ 1 file changed, 2 insertions(+), 97 deletions(-) diff --git a/plugins/players-portal-pictures.user.js b/plugins/players-portal-pictures.user.js index ffb6d414..55cac29d 100644 --- a/plugins/players-portal-pictures.user.js +++ b/plugins/players-portal-pictures.user.js @@ -2,10 +2,11 @@ // @id iitc-plugin-players-portal-pictures // @name IITC plugin: Player's Portal Pictures // @version 0.1.0.@@DATETIMEVERSION@@ +// @category Deleted // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ // @downloadURL @@DOWNLOADURL@@ -// @description [@@BUILDNAME@@-@@BUILDDATE@@] This plugin finds portal pictures submitted by a given player. The input is in the sidebar. +// @description [@@BUILDNAME@@-@@BUILDDATE@@] Niantic removed the data this plugin needed. It is no longer possible to search for photo submitter. // @include https://www.ingress.com/intel* // @include http://www.ingress.com/intel* // @match https://www.ingress.com/intel* @@ -13,99 +14,3 @@ // @grant none // ==/UserScript== -@@PLUGINSTART@@ - -// PLUGIN START //////////////////////////////////////////////////////// - -/********************************************************************************************************* -* Changelog: -* -* 0.1.0 First public release, supports only cover photos for now. -*********************************************************************************************************/ - -// use own namespace for plugin -window.plugin.playersPortalPictures = function() {}; - -window.plugin.playersPortalPictures.findPictures = function(playername) { - var s = ''; - var portalSet = {}; - var effectiveNick = ''; - var team = ''; - var portalCounter = 0; - var pictureCounter = 0; - var totalVoteCounter = 0; - // Assuming there can be no agents with same nick with different lower/uppercase - var nickToFind = playername.toLowerCase(); - $.each(window.portals, function(ind, portal){ - var coverPhotoAttribution = ''; - var attributionMarkup = new Object(); - if(portal.options.details.photoStreamInfo.hasOwnProperty('coverPhoto') && portal.options.details.photoStreamInfo.coverPhoto.hasOwnProperty('attributionMarkup')) { - attributionMarkup = portal.options.details.photoStreamInfo.coverPhoto.attributionMarkup; - if(attributionMarkup.length === 2 && attributionMarkup[0] === 'PLAYER') { - coverPhotoAttribution = attributionMarkup[1].plain; - } else { - return true; - } - } else { - return true; - } - - if(coverPhotoAttribution.toLowerCase() === nickToFind) { - pictureCounter += 1; - if(!effectiveNick) { - effectiveNick = coverPhotoAttribution; - } - if(!team) { - team = attributionMarkup[1].team; - } - var votes = 0; - votes = portal.options.details.photoStreamInfo.coverPhoto.voteCount; - totalVoteCounter += votes; - if(!portalSet.hasOwnProperty(portal.options.guid)) { - portalSet[portal.options.guid] = true; - var latlng = [portal.options.details.locationE6.latE6/1E6, portal.options.details.locationE6.lngE6/1E6].join(); - var guid = portal.options.guid; - var zoomPortal = 'window.zoomToAndShowPortal(\''+guid+'\', ['+latlng+']);return false'; - var perma = '/intel?latE6='+portal.options.details.locationE6.latE6+'&lngE6='+portal.options.details.locationE6.lngE6+'&z=17&pguid='+guid; - var a = $('',{ - 'class': 'help', - text: portal.options.details.portalV2.descriptiveText.TITLE, - title: portal.options.details.portalV2.descriptiveText.ADDRESS, - href: perma, - onClick: zoomPortal - })[0].outerHTML; - portalCounter += 1; - s += a + ': '; - } - s += votes + ' votes
'; - } - }); - if (s) { - // Showing the playername as a "fake" link to avoid the auto-mouseover effect on the first portal - fakeLinkPlayer = '
' + effectiveNick + ''; - s = fakeLinkPlayer + ' has pictures on ' + portalCounter + ' portals with ' + totalVoteCounter + ' total votes:

' + s; - } else { - s = playername + ' has no portal pictures in this range
'; - } - window.dialog({ - title: playername + '\'s portal pictures', - html: s, - id: 'playerPortalPictures', - width: 500 - }); -} - -var setup = function() { - var content = ''; - $('#sidebar').append(content); - $('#toolbox').append(' Player\'s Portal Pictures'); - $('#playerPortalPicture').keypress(function(e) { - if((e.keyCode ? e.keyCode : e.which) !== 13) return; - var data = $(this).val(); - window.plugin.playersPortalPictures.findPictures(data); - }); -} - -// PLUGIN END ////////////////////////////////////////////////////////// - -@@PLUGINEND@@ From 375a32e8bdb833590917595a95c8b55fbe8048e7 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Thu, 29 Aug 2013 20:47:56 +0100 Subject: [PATCH 2/3] fix infrastructure highlighter to work with changes to portal data for #514 --- .../portal-highlighter-infrastructure.user.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/plugins/portal-highlighter-infrastructure.user.js b/plugins/portal-highlighter-infrastructure.user.js index 222ee0b8..2b102244 100644 --- a/plugins/portal-highlighter-infrastructure.user.js +++ b/plugins/portal-highlighter-infrastructure.user.js @@ -2,11 +2,11 @@ // @id iitc-plugin-highlight-portal-infrastructure@vita10gy // @name IITC plugin: highlight portals with infrastructure problems // @category Highlighter -// @version 0.1.0.@@DATETIMEVERSION@@ +// @version 0.2.0.@@DATETIMEVERSION@@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ // @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 http://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 color = ''; var opa = .75; - - if(d.photoStreamInfo.photoCount === 0) { + + if(!(d.imageByUrl && d.imageByUrl.imageUrl)) { color = 'red'; } - else if(d.photoStreamInfo.photoCount > 1) { - color = 'orange'; - } - else if((new RegExp(window.plugin.portalInfrastructure.badTitles.join("|"),'i')).test(d.portalV2.descriptiveText.TITLE)) { - color = 'yellow'; + + if((new RegExp(window.plugin.portalInfrastructure.badTitles.join("|"),'i')).test(d.portalV2.descriptiveText.TITLE)) { + color = color == 'red' ? 'orange' : 'yellow'; opa = .9; } if(color !== '') { var params = {fillColor: color, fillOpacity: opa}; data.portal.setStyle(params); - window.COLOR_SELECTED_PORTAL = '#f0f'; } } From 9e1cc629476871a3769f75361c2adefe5bfa0937 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Thu, 29 Aug 2013 20:49:47 +0100 Subject: [PATCH 3/3] add the mobile-test-{setup,revert} scripts to master - was done in the new-map-data branch before --- mobile-test-revert | 8 ++++++++ mobile-test-setup | 15 +++++++++++++++ 2 files changed, 23 insertions(+) create mode 100755 mobile-test-revert create mode 100755 mobile-test-setup diff --git a/mobile-test-revert b/mobile-test-revert new file mode 100755 index 00000000..91105439 --- /dev/null +++ b/mobile-test-revert @@ -0,0 +1,8 @@ +#!/bin/sh + +# reverse of mobile-test-setup - reverts the changes made to AndroidManifest.xml and any resource files + +mv mobile/AndroidManifest.xml~ mobile/AndroidManifest.xml + +mv mobile/res/values/strings.xml~ mobile/res/values/strings.xml + diff --git a/mobile-test-setup b/mobile-test-setup new file mode 100755 index 00000000..23534a18 --- /dev/null +++ b/mobile-test-setup @@ -0,0 +1,15 @@ +#!/bin/sh + +# quick-n-dirty script to rename the mobile build for tests + + +# rename the package, so it can be installed alongside the regular build +test -f mobile/AndroidManifest.xml~ || cp mobile/AndroidManifest.xml mobile/AndroidManifest.xml~ +sed -e 's/package="com.cradle.iitc_mobile"/package="com.cradle.iitc_mobile.test"/' mobile/AndroidManifest.xml~ > mobile/AndroidManifest.xml + + +# rename the app title +test -f mobile/res/values/strings.xml~ || cp mobile/res/values/strings.xml mobile/res/values/strings.xml~ +sed -e 's/IITC Mobile/IITCm Test/' mobile/res/values/strings.xml~ > mobile/res/values/strings.xml + +