aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-02-24 18:21:56 +0000
committerMatthew Somerville <matthew@mysociety.org>2012-02-24 18:21:56 +0000
commit69c00d73b6e70dcbacbfcdd3c751ce56978f7731 (patch)
treeca712c011b26cd1c09ee889519f505c5574480d2
parent009454dcbde762ae2d21ad93e3fc94f49ada0f33 (diff)
On the front page, preload the map JavaScript for presumably the next page.
-rw-r--r--templates/web/fixmystreet/index.html18
1 files changed, 18 insertions, 0 deletions
diff --git a/templates/web/fixmystreet/index.html b/templates/web/fixmystreet/index.html
index 82305f376..5ffe52c6f 100644
--- a/templates/web/fixmystreet/index.html
+++ b/templates/web/fixmystreet/index.html
@@ -1,3 +1,21 @@
+[%# Assumes fixmystreet cobrand is using FMS map template - for bonus points preload all the right map elements. %]
+[% map_js = BLOCK %]
+<script>
+yepnope.addPrefix( 'preload', function ( resource ) {
+ resource.noexec = true;
+ return resource;
+});
+Modernizr.load({
+ load: [
+ "preload![% version('/js/OpenLayers.fixmystreet.js') %]",
+ "preload![% version('/js/map-OpenLayers.js') %]",
+ "preload![% version('/js/map-bing-ol.js') %]",
+ "preload![% version('/js/jquery.ba-hashchange.min.js') %]"
+ ]
+});
+</script>
+[% END %]
+
[% INCLUDE 'header.html', title => '' , bodyclass => 'frontpage fullwidthpage' %]
[% IF error %]