aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@balti.ukcod.org.uk>2010-11-24 19:32:17 +0000
committerMatthew Somerville <matthew@balti.ukcod.org.uk>2010-11-24 19:32:17 +0000
commita821c15c33c59bb8ff3bb5f5722a15f2ca527b6c (patch)
treed31a8d6b7d15b6fe9704c14536e506b944176c3e /perllib
parentb63492a28b56cb05396bc41e66e312eacf3ad62a (diff)
Have FixMyStreet::Map return the JS it needs.
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/Map.pm6
-rw-r--r--perllib/Page.pm7
2 files changed, 8 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/Map.pm b/perllib/FixMyStreet/Map.pm
index 0aae808b9..315de0958 100644
--- a/perllib/FixMyStreet/Map.pm
+++ b/perllib/FixMyStreet/Map.pm
@@ -24,6 +24,12 @@ use constant TIF_SIZE_M => mySociety::Config::get('TILES_TIFF_SIZE_METRES');
use constant TIF_SIZE_PX => mySociety::Config::get('TILES_TIFF_SIZE_PIXELS');
use constant SCALE_FACTOR => TIF_SIZE_M / (TIF_SIZE_PX / TILE_WIDTH);
+sub header_js {
+ return '
+<script type="text/javascript" src="/js/map-tilma.js"></script>
+';
+}
+
# display_map Q PARAMS
# PARAMS include:
# EASTING, NORTHING for the centre point of the map
diff --git a/perllib/Page.pm b/perllib/Page.pm
index b3ab35b33..16ce1befd 100644
--- a/perllib/Page.pm
+++ b/perllib/Page.pm
@@ -194,6 +194,7 @@ sub template_vars ($%) {
'lang_url' => $lang_url,
'title' => $params{title},
'rss' => '',
+ map_js => FixMyStreet::Map::header_js(),
);
if ($params{rss}) {
@@ -274,7 +275,7 @@ sub header ($%) {
my $default_params = Cobrand::header_params(get_cobrand($q), $q, %params);
my %default_params = %{$default_params};
%params = (%default_params, %params);
- my %permitted_params = map { $_ => 1 } qw(title rss js expires lastmodified template cachecontrol context status_code);
+ my %permitted_params = map { $_ => 1 } qw(title rss expires lastmodified template cachecontrol context status_code);
foreach (keys %params) {
croak "bad parameter '$_'" if (!exists($permitted_params{$_}));
}
@@ -307,8 +308,6 @@ sub header ($%) {
sub footer {
my ($q, %params) = @_;
my $extra = $params{extra};
- my $js = $params{js} || '';
- $js = ''; # Don't use fileupload JS at the moment
if ($q->{site} ne 'fixmystreet') {
my $template = template($q, %params) . '-footer';
@@ -370,8 +369,6 @@ $orglogo
$track
-$js
-
$piwik
</body>