Skip to content

Commit

Permalink
utils_misc.js: mark setPermaLink and androidPermalink as deprecated
Browse files Browse the repository at this point in the history
too specific actions to have public api functions for them
(main.js need to be refactored before we can get rid of them)
  • Loading branch information
johndoe committed Jul 4, 2019
1 parent d296449 commit 3b06d75
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions code/utils_misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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

0 comments on commit 3b06d75

Please sign in to comment.