From 63bdff0eb9f28c4e642f8002bb952a11d00f3d41 Mon Sep 17 00:00:00 2001 From: Stefan Breunig Date: Sun, 10 Feb 2013 14:08:35 +0100 Subject: [PATCH] fix 'report issue' for places with single or double quotes in their names. Fixes #68 --- code/portal_detail_display.js | 2 +- code/portal_detail_display_tools.js | 8 -------- code/utils_misc.js | 7 +++++++ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/code/portal_detail_display.js b/code/portal_detail_display.js index 0a7fd8a5..30a24f83 100644 --- a/code/portal_detail_display.js +++ b/code/portal_detail_display.js @@ -70,7 +70,7 @@ window.renderPortalDetails = function(guid) { + '
'+getResonatorDetails(d)+'
' + '
' + '' - + '' + + '' + '
' ); } diff --git a/code/portal_detail_display_tools.js b/code/portal_detail_display_tools.js index 71e38332..21fe3b91 100644 --- a/code/portal_detail_display_tools.js +++ b/code/portal_detail_display_tools.js @@ -78,14 +78,6 @@ window.getAvgResoDistText = function(d) { return '⌀ res dist: ' + avgDist + ' m'; } -window.getReportIssueInfoText = function(d) { - return ('Your Nick: '+PLAYER.nickname+' ' - + 'Portal: '+d.portalV2.descriptiveText.TITLE+' ' - + 'Location: '+d.portalV2.descriptiveText.ADDRESS - +' (lat '+(d.locationE6.latE6/1E6)+'; lng '+(d.locationE6.lngE6/1E6)+')' - ).replace(/['"]/, ''); -} - window.getResonatorDetails = function(d) { console.log('rendering reso details'); var resoDetails = ''; diff --git a/code/utils_misc.js b/code/utils_misc.js index 02a202b8..4959c40a 100644 --- a/code/utils_misc.js +++ b/code/utils_misc.js @@ -93,6 +93,13 @@ window.rangeLinkClick = function() { window.reportPortalIssue = function(info) { var t = 'Redirecting you to a Google Help Page. Once there, click on “Contact Us” in the upper right corner.\n\nThe text box contains all necessary information. Press CTRL+C to copy it.'; + var d = window.portals[window.selectedPortal].options.details; + + var info = 'Your Nick: ' + PLAYER.nickname + ' ' + + 'Portal: ' + d.portalV2.descriptiveText.TITLE + ' ' + + 'Location: ' + d.portalV2.descriptiveText.ADDRESS + +' (lat ' + (d.locationE6.latE6/1E6) + '; lng ' + (d.locationE6.lngE6/1E6) + ')'; + //codename, approx addr, portalname if(prompt(t, info) !== null) location.href = 'https://support.google.com/ingress?hl=en';