diff options
author | Matthew Somerville <matthew@mysociety.org> | 2016-09-23 17:32:50 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2016-09-23 17:34:13 +0100 |
commit | 781078aeb52ad838c682ebb061ccc2a28d3e53b1 (patch) | |
tree | 0e791ab7fc73ba25ec952b9e037ac5a5456e1d20 | |
parent | 2163df6b5160480aad51ee8be432d47550a14535 (diff) |
[UK] A few small JavaScript fixes.
Cope better if things aren't defined.
-rw-r--r-- | templates/web/bristol/footer_extra_js.html | 1 | ||||
-rw-r--r-- | templates/web/bristol/maps/bristol.html | 1 | ||||
-rw-r--r-- | templates/web/fixmystreet.com/header_extra.html | 2 | ||||
-rw-r--r-- | web/js/OpenLayers.Projection.OrdnanceSurvey.js | 4 |
4 files changed, 5 insertions, 3 deletions
diff --git a/templates/web/bristol/footer_extra_js.html b/templates/web/bristol/footer_extra_js.html deleted file mode 100644 index cf8fa7301..000000000 --- a/templates/web/bristol/footer_extra_js.html +++ /dev/null @@ -1 +0,0 @@ -<script src="[% version('/cobrands/fixmystreet-uk-councils/js.js') %]"></script> diff --git a/templates/web/bristol/maps/bristol.html b/templates/web/bristol/maps/bristol.html index 42cb86bf2..7a4a5fbcf 100644 --- a/templates/web/bristol/maps/bristol.html +++ b/templates/web/bristol/maps/bristol.html @@ -1,6 +1,5 @@ [% map_js = BLOCK %] <script type="text/javascript" src="[% version('/js/OpenLayers.2.11.zurich.js') %]"></script> -<script type="text/javascript" src="[% version('/js/OpenLayers.Projection.OrdnanceSurvey.js') %]"></script> <script type="text/javascript" src="[% version('/js/map-OpenLayers.js') %]"></script> <script type="text/javascript" src="[% version('/js/map-wmts-base.js') %]"></script> <script type="text/javascript" src="[% version('/js/map-wmts-bristol.js') %]"></script> diff --git a/templates/web/fixmystreet.com/header_extra.html b/templates/web/fixmystreet.com/header_extra.html index 1bccf08d1..4ea87a5e1 100644 --- a/templates/web/fixmystreet.com/header_extra.html +++ b/templates/web/fixmystreet.com/header_extra.html @@ -20,7 +20,7 @@ [% IF c.config.BASE_URL == "https://www.fixmystreet.com" AND not admin AND NOT c.req.header('User-Agent').match('Google Page Speed') %] <script src="//www.google-analytics.com/cx/api.js?experiment=ZwMlZkAhSbK_tP_QG64QrQ"></script> <script nonce="[% csp_nonce %]"> -var variation = cxApi.chooseVariation(), +var variation = typeof cxApi !== "undefined" ? cxApi.chooseVariation() : 0, docElement = document.documentElement, className = docElement.className; if (!/about\/council/.test(location.pathname)) { diff --git a/web/js/OpenLayers.Projection.OrdnanceSurvey.js b/web/js/OpenLayers.Projection.OrdnanceSurvey.js index bb596d3bf..85574d8e0 100644 --- a/web/js/OpenLayers.Projection.OrdnanceSurvey.js +++ b/web/js/OpenLayers.Projection.OrdnanceSurvey.js @@ -39,6 +39,8 @@ * */ +if (typeof OpenLayers !== "undefined") { + OpenLayers.Projection.OS = { /** @@ -487,3 +489,5 @@ OpenLayers.Projection.addTransform("EPSG:900913", "EPSG:27700", OpenLayers.Projection.OS.goog2osgb); OpenLayers.Projection.addTransform("EPSG:27700", "EPSG:900913", OpenLayers.Projection.OS.osgb2goog); + +} |