aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rw-r--r--perllib/Cobrand.pm10
-rw-r--r--perllib/Page.pm6
2 files changed, 8 insertions, 8 deletions
diff --git a/perllib/Cobrand.pm b/perllib/Cobrand.pm
index 0030c2ccf..e170ec87d 100644
--- a/perllib/Cobrand.pm
+++ b/perllib/Cobrand.pm
@@ -7,7 +7,7 @@
# Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved.
# Email: louise@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: Cobrand.pm,v 1.20 2009-09-23 11:31:31 louise Exp $
+# $Id: Cobrand.pm,v 1.21 2009-09-23 15:43:54 louise Exp $
package Cobrand;
use strict;
@@ -369,16 +369,16 @@ sub header_params {
=cut
-sub root_path_pattern {
+sub root_path_js {
my ($cobrand) = @_;
my $handle;
if ($cobrand){
$handle = cobrand_handle($cobrand);
}
- if ( !$cobrand || !$handle || !$handle->can('root_path_pattern')){
- return '//g';
+ if ( !$cobrand || !$handle || !$handle->can('root_path_js')){
+ return 'var root_path = "";';
} else{
- return $handle->root_path_pattern();
+ return $handle->root_path_js();
}
}
diff --git a/perllib/Page.pm b/perllib/Page.pm
index bc3999e9b..b4ca97f3a 100644
--- a/perllib/Page.pm
+++ b/perllib/Page.pm
@@ -6,7 +6,7 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: Page.pm,v 1.182 2009-09-23 13:31:46 louise Exp $
+# $Id: Page.pm,v 1.183 2009-09-23 15:43:54 louise Exp $
#
package Page;
@@ -428,7 +428,7 @@ sub display_map {
my $out = '';
my $cobrand = Page::get_cobrand($q);
- my $root_path_pattern = Cobrand::root_path_pattern($cobrand);
+ my $root_path_js = Cobrand::root_path_js($cobrand);
my $img_type;
if ($params{type}) {
my $encoding = '';
@@ -452,7 +452,7 @@ EOF
<script type="text/javascript">
var fms_x = $x - 2; var fms_y = $y - 2;
var start_x = $px; var start_y = $py;
-var root_path = window.location.pathname.match($root_path_pattern) || '';
+$root_path_js
</script>
<div id="map_box">
$params{pre}