diff options
author | Étienne Loks <etienne.loks@peacefrogs.net> | 2010-11-16 23:28:33 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2010-11-16 23:28:33 +0100 |
commit | 98b2ff68d82090bc0ec951a499580a682e4adff3 (patch) | |
tree | 30fbf7c8465fc348a6b0f0e292a87fa481e208a7 /chimere/static/main_map.js | |
parent | 15f7f579eb1e3c9fec03cd58b83d132a275d9bb0 (diff) | |
download | Chimère-98b2ff68d82090bc0ec951a499580a682e4adff3.tar.bz2 Chimère-98b2ff68d82090bc0ec951a499580a682e4adff3.zip |
Simplify the management of tiny urls
Don't save the current window and avoid the opening of a window
considered has a popup
Diffstat (limited to 'chimere/static/main_map.js')
-rw-r--r-- | chimere/static/main_map.js | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/chimere/static/main_map.js b/chimere/static/main_map.js index 9b8b4c6..cd770ae 100644 --- a/chimere/static/main_map.js +++ b/chimere/static/main_map.js @@ -462,35 +462,6 @@ function createParams(center, zoom, layers) { return params; } -var tiny_url = ''; -var redirect_url = ''; - -function processTinyUrl(url, current_feature_id){ - redirect_url = url; - var uri = extra_url + "getTinyUrl/"; - var params = OpenLayers.Util.getParameterString(this.createParams()); - if (current_feature_id && params.indexOf('current_feature') < 0){ - uri += 'current_feature=' + current_feature_id + '&'; - } - uri += params; - OpenLayers.loadURL(uri, '', this, getTinyfiedUrl); -} - -/* get a tiny url */ -function getTinyfiedUrl(response){ - tiny_url = ''; - if (response.responseText.indexOf('no results') == -1) { - var json = new OpenLayers.Format.JSON(); - var result = json.read(response.responseText); - tiny_url = result.url; - if (!redirect_url || !tiny_url) return; - redirect_url = redirect_url.replace('URL', tiny_url); - redirect_url = redirect_url.replace('TEXT', result.text); - window.open(redirect_url); - } -} - - /* main initialisation function */ function init(){ /* set the main map */ |