Merge pull request #307 from Merovius/qrcodes

Replace gmaps-link by popup with qrcode and links
This commit is contained in:
Stefan Breunig 2013-02-25 11:07:02 -08:00
commit a73ec67fc7
5 changed files with 18 additions and 3 deletions

View File

@ -75,6 +75,7 @@ Please do!
[j16sdiz](https://github.com/j16sdiz),
[JasonMillward](https://github.com/JasonMillward),
[jonatkins](https://github.com/jonatkins),
[Merovius](https://github.com/Merovius),
[mledoze](https://github.com/mledoze),
[OshiHidra](https://github.com/OshiHidra),
[phoenixsong6](https://github.com/phoenixsong6),

View File

@ -297,6 +297,7 @@ function asyncLoadScript(a){return function(b,c){var d=document.createElement("s
var LEAFLETGOOGLE = 'http://breunigs.github.com/ingress-intel-total-conversion/dist/leaflet_google.js';
var JQUERY = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js';
var JQUERYUI = 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js';
var JQUERYQRCODE = 'http://jeromeetienne.github.com/jquery-qrcode/jquery.qrcode.min.js';
var LEAFLET = 'http://cdn.leafletjs.com/leaflet-0.5/leaflet.js';
var AUTOLINK = 'http://breunigs.github.com/ingress-intel-total-conversion/dist/autolink.js';
var EMPTY = 'data:text/javascript;base64,';
@ -305,12 +306,13 @@ var EMPTY = 'data:text/javascript;base64,';
var ir = window && window.internalResources ? window.internalResources : [];
if(ir.indexOf('jquery') !== -1) JQUERY = EMPTY;
if(ir.indexOf('jqueryui') !== -1) JQUERYUI = EMPTY;
if(ir.indexOf('jqueryqrcode') !== -1) JQUERYQRCODE = EMPTY;
if(ir.indexOf('leaflet') !== -1) LEAFLET = EMPTY;
if(ir.indexOf('autolink') !== -1) AUTOLINK = EMPTY;
if(ir.indexOf('leafletgoogle') !== -1) LEAFLETGOOGLE = EMPTY;
// after all scripts have loaded, boot the actual app
load(JQUERY, LEAFLET, AUTOLINK).then(LEAFLETGOOGLE, JQUERYUI).onError(function (err) {
load(JQUERY, LEAFLET, AUTOLINK).then(LEAFLETGOOGLE, JQUERYUI, JQUERYQRCODE).onError(function (err) {
alert('Could not all resources, the script likely wont work.\n\nIf this happend the first time for you, its probably a temporary issue. Just wait a bit and try again.\n\nIf you installed the script for the first time and this happens:\n try disabling NoScript if you have it installed\n press CTRL+SHIFT+K in Firefox or CTRL+SHIFT+I in Chrome/Opera and reload the page. Additional info may be available in the console.\n Open an issue at https://github.com/breunigs/ingress-intel-total-conversion/issues');
}).thenRun(boot);

View File

@ -50,7 +50,7 @@ window.renderPortalDetails = function(guid) {
var lng = d.locationE6.lngE6;
var perma = 'http://ingress.com/intel?latE6='+lat+'&lngE6='+lng+'&z=17&pguid='+guid;
var imgTitle = 'title="'+getPortalDescriptionFromDetails(d)+'\n\nClick to show full image."';
var gmaps = 'https://maps.google.com/?q='+lat/1E6+','+lng/1E6;
var poslinks = 'window.showPortalPosLinks('+lat/1E6+','+lng/1E6+')';
var postcard = 'Send in a postcard. Will put it online after receiving. Address:\\n\\nStefan Breunig\\nINF 305 R045\\n69120 Heidelberg\\nGermany';
$('#portaldetails')
@ -66,7 +66,7 @@ window.renderPortalDetails = function(guid) {
+ randDetails
+ resoDetails
+ '<div class="linkdetails">'+ '<aside><a href="'+perma+'">portal link</a></aside>'
+ '<aside><a href="'+gmaps+'" target="_blank">gmaps</a></aside>'
+ '<aside><a onclick="'+poslinks+'">poslinks</a></aside>'
+ '<aside><a onclick="alert(\''+postcard+'\');">donate</a></aside>'
+ '<aside><a onclick="window.reportPortalIssue()">report issue</a></aside>'
+ '</div>'

View File

@ -96,6 +96,14 @@ window.rangeLinkClick = function() {
window.smartphone.mapButton.click();
}
window.showPortalPosLinks = function(lat, lng) {
var qrcode = '<div id="qrcode"></div>';
var script = '<script>$(\'#qrcode\').qrcode({text:\'GEO:'+lat+','+lng+'\'});</script>';
var gmaps = '<a href="https://maps.google.com/?q='+lat+','+lng+'">gmaps</a>';
var osm = '<a href="http://www.openstreetmap.org/?mlat='+lat+'&mlon='+lng+'&zoom=16">OSM</a>';
alert('<div style="text-align: center;">' + qrcode + script + gmaps + ' ' + osm + '</div>');
}
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;

View File

@ -688,6 +688,10 @@ aside {
max-width: 700px !important;
}
.ui-dialog a {
color: #0000ca;
}
.ui-dialog-buttonpane {
background: #F2F2F2;
padding: 12px;