From 0f0dcfc7a01c4b3a8b15b12b5257f08797fd0926 Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Fri, 3 Jun 2022 16:04:40 +0200 Subject: refactor(connector): move MS-Connector from new directory 'connector' to 'ms_specific_connector' --- connector/src/main/webapp/js/js_country.js | 42 ------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 connector/src/main/webapp/js/js_country.js (limited to 'connector/src/main/webapp/js/js_country.js') diff --git a/connector/src/main/webapp/js/js_country.js b/connector/src/main/webapp/js/js_country.js deleted file mode 100644 index 5dcea90e..00000000 --- a/connector/src/main/webapp/js/js_country.js +++ /dev/null @@ -1,42 +0,0 @@ -function clickCountryFlag(element) { - if (!element) return false; - - var form = element.target.closest("form"); - - if (!form) 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