diff options
author | Christian Kollmann <christian.kollmann@a-sit.at> | 2021-12-07 07:51:10 +0100 |
---|---|---|
committer | Christian Kollmann <christian.kollmann@a-sit.at> | 2021-12-07 11:01:13 +0100 |
commit | 8d2aa68bc18c04c2b03cbdd01f008a89e4c8c1c6 (patch) | |
tree | 2b379387a1ac8c046b98860dd114abcd64227afb /connector/src/test/resources/config/webcontent/js | |
parent | ac56869c2a981e40d6cf4637fb8fd46c06207c9d (diff) | |
download | National_eIDAS_Gateway-8d2aa68bc18c04c2b03cbdd01f008a89e4c8c1c6.tar.gz National_eIDAS_Gateway-8d2aa68bc18c04c2b03cbdd01f008a89e4c8c1c6.tar.bz2 National_eIDAS_Gateway-8d2aa68bc18c04c2b03cbdd01f008a89e4c8c1c6.zip |
Unify HTML templates across test, main, basicConfig
Diffstat (limited to 'connector/src/test/resources/config/webcontent/js')
-rw-r--r-- | connector/src/test/resources/config/webcontent/js/js_country.js | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/connector/src/test/resources/config/webcontent/js/js_country.js b/connector/src/test/resources/config/webcontent/js/js_country.js index 5dcea90e..9baa0d0a 100644 --- a/connector/src/test/resources/config/webcontent/js/js_country.js +++ b/connector/src/test/resources/config/webcontent/js/js_country.js @@ -1,41 +1,41 @@ function clickCountryFlag(element) { - if (!element) return false; + if (!element) return false; - var form = element.target.closest("form"); + var form = element.target.closest("form"); - if (!form) return false; + if (!form) return false; - form.submit(); - return false; + form.submit(); + return false; } /* Set JS events by EventListener to prevent problems with CSP*/ -document.addEventListener("DOMContentLoaded", function(event) { - - /* Element.closest polyfill - https://developer.mozilla.org/en-US/docs/Web/API/Element/closest License: public domain*/ - if (!Element.prototype.matches) - Element.prototype.matches = Element.prototype.msMatchesSelector || - Element.prototype.webkitMatchesSelector; - - if (!Element.prototype.closest) - Element.prototype.closest = function(s) { - var el = this; - if (!document.documentElement.contains(el)) return null; - do { - if (el.matches(s)) return el; - el = el.parentElement || el.parentNode; - } while (el !== null && el.nodeType === 1); - return null; - }; - - /* set Click events by EventListener to prevent JavaScript in HTML which can be a problem with CSP*/ - var allFlags = document.getElementsByClassName("countryimage"); - for (i=0;i<allFlags.length;i++) { - if(allFlags[i].getAttribute("disabled") == null) { - allFlags[i].closest("a").addEventListener('click', clickCountryFlag, false); +document.addEventListener("DOMContentLoaded", function (event) { + + /* Element.closest polyfill - https://developer.mozilla.org/en-US/docs/Web/API/Element/closest License: public domain*/ + if (!Element.prototype.matches) + Element.prototype.matches = Element.prototype.msMatchesSelector || + Element.prototype.webkitMatchesSelector; + + if (!Element.prototype.closest) + Element.prototype.closest = function (s) { + var el = this; + if (!document.documentElement.contains(el)) return null; + do { + if (el.matches(s)) return el; + el = el.parentElement || el.parentNode; + } while (el !== null && el.nodeType === 1); + return null; + }; + + /* set Click events by EventListener to prevent JavaScript in HTML which can be a problem with CSP*/ + var allFlags = document.getElementsByClassName("countryimage"); + for (i = 0; i < allFlags.length; i++) { + if (allFlags[i].getAttribute("disabled") == null) { + allFlags[i].closest("a").addEventListener('click', clickCountryFlag, false); + } } - } }); |