aboutsummaryrefslogtreecommitdiffstats
path: root/templates/web/base
diff options
context:
space:
mode:
Diffstat (limited to 'templates/web/base')
-rw-r--r--templates/web/base/common_header_tags.html5
-rw-r--r--templates/web/base/common_scripts.html14
2 files changed, 16 insertions, 3 deletions
diff --git a/templates/web/base/common_header_tags.html b/templates/web/base/common_header_tags.html
index 1dad1cfa0..f65f1e336 100644
--- a/templates/web/base/common_header_tags.html
+++ b/templates/web/base/common_header_tags.html
@@ -36,7 +36,12 @@
[% IF bodyclass.match('frontpage') %]
<link rel="prefetch" href="[% version('/js/validation_rules.js') %]">
+ [%~ IF NOT c.user_exists OR NOT (c.user.from_body OR c.user.is_superuser) %]
+ <link rel="prefetch" href="[% version('/jslib/jquery-1.7.2.min.js') %]">
+ [%~ END %]
+ <link rel="prefetch" href="[% version('/js/jquery.multi-select.js') %]">
<link rel="prefetch" href="[% version('/vendor/jquery.validate.min.js') %]">
+ <link rel="prefetch" href="[% version('/cobrands/fixmystreet/fixmystreet.js') %]">
[% END %]
[% IF NOT bodyclass.match('mappage') %]
[% FOR script IN map_js %]
diff --git a/templates/web/base/common_scripts.html b/templates/web/base/common_scripts.html
index b04404f06..c6225e8fa 100644
--- a/templates/web/base/common_scripts.html
+++ b/templates/web/base/common_scripts.html
@@ -7,15 +7,14 @@ scripts = [];
scripts.push(
start _ "/js/translation_strings." _ lang_code _ ".js?" _ Math.int( date.now / 3600 ),
- version('/jslib/jquery-1.7.2.min.js'),
- version('/js/jquery.multi-select.js'),
- version('/cobrands/fixmystreet/fixmystreet.js'),
);
+SET jquery_loaded = 0;
SET geolocation_loaded = 0;
IF bodyclass.match('frontpage');
SET geolocation_loaded = 1;
scripts.push(
+ version('/js/front.js'),
version('/js/geolocation.js'),
);
ELSIF bodyclass.match('alertpage');
@@ -24,9 +23,13 @@ ELSIF bodyclass.match('alertpage');
version('/js/geolocation.js'),
);
ELSE;
+ SET jquery_loaded = 1;
scripts.push(
version('/js/validation_rules.js'),
+ version('/jslib/jquery-1.7.2.min.js'),
+ version('/js/jquery.multi-select.js'),
version('/vendor/jquery.validate.min.js'),
+ version('/cobrands/fixmystreet/fixmystreet.js'),
);
END;
@@ -40,6 +43,11 @@ IF c.user_exists AND (c.user.from_body OR c.user.is_superuser);
version('/js/geolocation.js'),
);
END;
+ IF NOT jquery_loaded;
+ scripts.push(
+ version('/jslib/jquery-1.7.2.min.js'),
+ );
+ END;
scripts.push(
version('/cobrands/fixmystreet/staff.js')
);