var dashboardsHtml = ''; L.custom = { init: function(mapContainer, params) { var cl = document.querySelector('html').classList; cl.remove('no-js'); cl.add('has-js'); var request = new XMLHttpRequest(); request.addEventListener("load", function() { var el = document.createElement("style"); el.innerText = this.responseText; el.type = "text/css"; el.media = "all"; document.getElementsByTagName("head")[0].appendChild(el); }); request.open("GET", "https://knowledge4policy.ec.europa.eu/sites/default/files/biomon-prod-min-css.txt"); request.send(); var el = document.createElement("script"); el.type = "text/javascript"; el.src = "https://knowledge4policy.ec.europa.eu/sites/default/files/biomon-prod-lib-js.txt"; document.getElementsByTagName("head")[0].appendChild(el); var loader = setInterval(function() { if (typeof Highcharts == "undefined") return; clearInterval(loader); mapContainer.parentNode.innerHTML = dashboardsHtml; document.getElementById("frame").style.display = "block"; ECL.autoInit(); var el = document.createElement("script"); el.type = "text/javascript"; el.src = "https://knowledge4policy.ec.europa.eu/sites/default/files/biomon-prod-main-js.txt"; document.getElementsByTagName("head")[0].appendChild(el); }, 100); $wt._queue("next"); } };