From 7e647228ce717fd2a30a79e97bd588cc9a5846a9 Mon Sep 17 00:00:00 2001 From: Xelio Date: Tue, 26 Mar 2013 03:51:51 +0800 Subject: [PATCH 1/2] Plugin Show Linked Portals: Fix uncaught error of undefined "imageUrl" --- plugins/show-linked-portals.user.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/show-linked-portals.user.js b/plugins/show-linked-portals.user.js index e39719cd..0c0d3690 100644 --- a/plugins/show-linked-portals.user.js +++ b/plugins/show-linked-portals.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @id iitc-plugin-show-linked-portals@fstopienski // @name IITC plugin: Show linked portals -// @version 0.0.1.@@DATETIMEVERSION@@ +// @version 0.0.2.@@DATETIMEVERSION@@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ // @downloadURL @@DOWNLOADURL@@ @@ -79,7 +79,8 @@ window.plugin.showLinkedPortal.getPortalByGuid = function (guid) { portalInfoString = ''; var portalNameAdressAlt = "'" + portalDetails.portalV2.descriptiveText.TITLE + "' (" + portalDetails.portalV2.descriptiveText.ADDRESS + ")"; var portalNameAdressTitle = "'" + portalDetails.portalV2.descriptiveText.TITLE + "'
(" + portalDetails.portalV2.descriptiveText.ADDRESS + ")"; - portalInfoString = '' + portalNameAdressAlt + ''; + var imageUrl = (portalDetails.imageByUrl ? portalDetails.imageByUrl.imageUrl : ''); + portalInfoString = '' + portalNameAdressAlt + ''; } return portalInfoString; }; From c60cf76639a77e5296d79d45cf76489b719ab7ba Mon Sep 17 00:00:00 2001 From: Xelio Date: Tue, 26 Mar 2013 04:02:34 +0800 Subject: [PATCH 2/2] Plugin Show Linked Portals: Use default portal image if linked portal has no image --- plugins/show-linked-portals.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/show-linked-portals.user.js b/plugins/show-linked-portals.user.js index 0c0d3690..99b4f27d 100644 --- a/plugins/show-linked-portals.user.js +++ b/plugins/show-linked-portals.user.js @@ -79,7 +79,7 @@ window.plugin.showLinkedPortal.getPortalByGuid = function (guid) { portalInfoString = ''; var portalNameAdressAlt = "'" + portalDetails.portalV2.descriptiveText.TITLE + "' (" + portalDetails.portalV2.descriptiveText.ADDRESS + ")"; var portalNameAdressTitle = "'" + portalDetails.portalV2.descriptiveText.TITLE + "'
(" + portalDetails.portalV2.descriptiveText.ADDRESS + ")"; - var imageUrl = (portalDetails.imageByUrl ? portalDetails.imageByUrl.imageUrl : ''); + var imageUrl = (portalDetails.imageByUrl ? portalDetails.imageByUrl.imageUrl : window.DEFAULT_PORTAL_IMG); portalInfoString = '' + portalNameAdressAlt + ''; } return portalInfoString;