diff --git a/code/utils_misc.js b/code/utils_misc.js index acdf849b1..7c6d849d9 100644 --- a/code/utils_misc.js +++ b/code/utils_misc.js @@ -230,15 +230,6 @@ window.androidCopy = function(text) { return false; } -window.androidPermalink = function() { - if(typeof android === 'undefined' || !android || !android.intentPosLink) - return true; // i.e. execute other actions - - var center = map.getCenter(); - android.intentPosLink(center.lat, center.lng, map.getZoom(), "Selected map view", false); - return false; -} - window.getCurrentZoomTileParameters = function() { var zoom = getDataZoomForMapZoom( map.getZoom() ); var tileParams = getMapZoomTileParameters(zoom); @@ -312,10 +303,6 @@ window.prettyEnergy = function(nrg) { return nrg> 1000 ? Math.round(nrg/1000) + ' k': nrg; } -window.setPermaLink = function(elm) { - $(elm).attr('href', window.makePermalink(null,true)); -} - window.uniqueArray = function(arr) { return $.grep(arr, function(v, i) { return $.inArray(v, arr) === i; @@ -458,3 +445,18 @@ window.makePermalink = function(latlng, mapView) { } return '/intel?' + args.join('&'); }; + +window.setPermaLink = function(elm) { // deprecated + $(elm).attr('href', window.makePermalink(null,true)); +} + +window.androidPermalink = function() { // deprecated + if(typeof android === 'undefined' || !android || !android.intentPosLink) + return true; // i.e. execute other actions + + var center = map.getCenter(); + android.intentPosLink(center.lat, center.lng, map.getZoom(), "Selected map view", false); + return false; +} + +// todo refactor main.js to get rid of setPermaLink and androidPermalink