]> git.openstreetmap.org Git - rails.git/commitdiff
Include current non-OSM.org hostname in share URL
authorJohn Firebaugh <john.firebaugh@gmail.com>
Mon, 1 Jul 2013 19:46:10 +0000 (15:46 -0400)
committerJohn Firebaugh <john.firebaugh@gmail.com>
Thu, 18 Jul 2013 17:45:16 +0000 (10:45 -0700)
app/assets/javascripts/application.js

index 0ee6dc8806a7c94607619259352e92970668b58f..171c42783049bdc973c8a983f4975731413ae94a 100644 (file)
@@ -121,7 +121,7 @@ function minZoomAlert() {
 
 function getShortUrl(map) {
   return (window.location.hostname.match(/^www\.openstreetmap\.org/i) ?
-          'http://osm.org/go/' : '/go/') +
+          'http://osm.org/go/' : 'http://' + window.location.hostname + '/go/') +
           makeShortCode(map);
 }
 
@@ -131,7 +131,7 @@ function getUrl(map) {
       toZoom = zoomPrecision(zoom);
 
   return (window.location.hostname.match(/^www\.openstreetmap\.org/i) ?
-          'http://openstreetmap.org/?' : '/?') +
+          'http://openstreetmap.org/?' : 'http://' + window.location.hostname + '/?') +
         querystring.stringify({
             lat: toZoom(center.lat),
             lon: toZoom(center.lng),