aboutsummaryrefslogtreecommitdiffstats
path: root/templates/web/base/common_scripts.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/web/base/common_scripts.html')
-rw-r--r--templates/web/base/common_scripts.html41
1 files changed, 28 insertions, 13 deletions
diff --git a/templates/web/base/common_scripts.html b/templates/web/base/common_scripts.html
index 82f33569d..cecf9da5b 100644
--- a/templates/web/base/common_scripts.html
+++ b/templates/web/base/common_scripts.html
@@ -8,13 +8,21 @@ 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/validation_rules.js'),
- version('/vendor/jquery.validate.min.js'),
- version('/vendor/dropzone.min.js'),
version('/js/jquery.multi-select.js'),
version('/cobrands/fixmystreet/fixmystreet.js'),
);
+IF NOT bodyclass.match('frontpage');
+ scripts.push(
+ version('/js/validation_rules.js'),
+ version('/vendor/jquery.validate.min.js'),
+ );
+END;
+
+FOR script IN extra_js;
+ scripts.push(script);
+END;
+
IF c.user_exists AND (c.user.from_body OR c.user.is_superuser);
scripts.push(
version('/cobrands/fixmystreet/staff.js')
@@ -26,14 +34,25 @@ IF c.user_exists AND (c.user.from_body OR c.user.is_superuser);
END;
END;
-FOR script IN map_js;
- scripts.push(script);
+IF bodyclass.match('mappage');
+ FOR script IN map_js;
+ IF script.match('^/');
+ scripts.push(version(script));
+ ELSE;
+ scripts.push(script);
+ END;
+ END;
+ scripts.push(
+ version('/cobrands/fixmystreet/map.js'),
+ version('/vendor/dropzone.min.js'),
+ version('/vendor/fancybox/jquery.fancybox-1.3.4.pack.js'),
+ );
+ELSE;
+ scripts.push(
+ version('/cobrands/fixmystreet/prefetch-polyfill.js'),
+ );
END;
-scripts.push(
- version('/cobrands/fixmystreet/map.js'),
-);
-
IF admin;
scripts.push(
version('/vendor/jquery-ui/js/jquery-ui-1.10.3.custom.min.js'),
@@ -41,10 +60,6 @@ IF admin;
);
END;
-FOR script IN extra_js;
- scripts.push(script);
-END;
-
TRY;
PROCESS 'footer_extra_js.html';
CATCH file;