aboutsummaryrefslogtreecommitdiffstats
path: root/web/js.js
diff options
context:
space:
mode:
authorlouise <louise>2009-09-23 15:43:54 +0000
committerlouise <louise>2009-09-23 15:43:54 +0000
commita6e0574642c9b6aa0f4d3c43bba1f12b56bfdfa5 (patch)
tree032ff18eb49bd79884d559908d477726647bf545 /web/js.js
parent1ed78ecb294d558b91739170c8e78bd3db8360ba (diff)
Ugly way of allowing the AJAX paths to change depending on what root path the pages are being served from
Diffstat (limited to 'web/js.js')
-rw-r--r--web/js.js20
1 files changed, 13 insertions, 7 deletions
diff --git a/web/js.js b/web/js.js
index 7debab608..b3d61bdcc 100644
--- a/web/js.js
+++ b/web/js.js
@@ -42,7 +42,6 @@ YAHOO.util.Event.onContentReady('compass', function() {
YAHOO.util.Event.addListener(points[4], 'click', compass_pan, { home:1, orig_x:drag_x, orig_y:drag_y });
});
-
YAHOO.util.Event.onContentReady('map', function() {
var ua=navigator.userAgent.toLowerCase();
// if (document.getElementById('mapForm') && (/safari/.test(ua) || /Konqueror/.test(ua))) return;
@@ -295,8 +294,7 @@ function update_tiles(dx, dy, force) {
tile_x += horizontal;
fms_y -= vertical;
tile_y += vertical;
-
- var url = [ '/tilma/tileserver/10k-full/', fms_x, '-', (fms_x+5), ',', fms_y, '-', (fms_y+5), '/JSON' ].join('');
+ var url = [ root_path + '/tilma/tileserver/10k-full/', fms_x, '-', (fms_x+5), ',', fms_y, '-', (fms_y+5), '/JSON' ].join('');
YAHOO.util.Connect.asyncRequest('GET', url, {
success: urls_loaded, failure: urls_not_loaded,
argument: [tile_x, tile_y]
@@ -308,10 +306,18 @@ function update_tiles(dx, dy, force) {
function load_pins(x, y) {
if (document.getElementById('formX')) {
- url = [ '/ajax?sx=', document.getElementById('formX').value, ';sy=',
- document.getElementById('formY').value, ';x=', (x+2), ';y=', (y+2),
- ';all_pins=', document.getElementById('all_pins').value
- ].join('');
+ var ajax_params = [ 'sx=' + document.getElementById('formX').value,
+ 'sy=' + document.getElementById('formY').value,
+ 'x=' + (x+2),
+ 'y=' + (y+2),
+ 'all_pins=' + document.getElementById('all_pins').value ];
+ var separator;
+ if (window.Cobrand){
+ separator = window.Cobrand.param_separator();
+ }else{
+ separator = ';';
+ }
+ var url = [ root_path , '/ajax?', ajax_params.join(separator)].join('');
YAHOO.util.Connect.asyncRequest('GET', url, {
success: pins_loaded
});