[% USE date; USE Math; scripts = []; scripts.push( start _ "/js/translation_strings." _ lang_code _ ".js?" _ Math.int( date.now / 3600 ), ); IF bodyclass.match('frontpage'); scripts.push( version('/js/front.js'), version('/js/geolocation.js'), ); ELSIF bodyclass.match('alertpage'); scripts.push( version('/js/geolocation.js'), ); ELSIF bodyclass.match('offlinepage'); ELSE; scripts.push( version('/js/validation_rules.js'), version('/jslib/jquery-1.7.2.min.js'), version('/vendor/jquery.multi-select.min.js'), version('/vendor/jquery.validate.min.js'), version('/cobrands/fixmystreet/fixmystreet.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('/js/geolocation.js'), version('/jslib/jquery-1.7.2.min.js'), version('/cobrands/fixmystreet/staff.js') ); IF bodyclass.match('mappage') AND c.cobrand.suggest_duplicates AND NOT login_success AND NOT oauth_need_email; scripts.push( version('/js/duplicates.js') ); END; IF c.user.has_body_permission_to('planned_reports'); scripts.push( version('/cobrands/fixmystreet/offline.js'), ); END; END; IF bodyclass.match('mappage'); FOR script IN map_js.merge(c.cobrand.call_hook('map_js_extra')); 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; IF admin; scripts.push( version('/cobrands/fixmystreet/admin.js'), version('/vendor/html5sortable.min.js'), ); END; TRY; PROCESS 'footer_extra_js.html'; CATCH file; END; ~%]