var dmledueqWrapperElement = document.getElementById("dml_edueq_wrapper"); dmledueqWrapperElement.style.transition = "all 0.5s;"; var edueqCSSid = 'edueqStyleSheet'; let sessionTimeString = (new Date()).getTime(); var edueqFlLgPp = false; var edueq_pagelink = document.createElement('link'); edueq_pagelink.id = edueqCSSid; edueq_pagelink.rel = 'stylesheet'; edueq_pagelink.type = 'text/css'; edueq_pagelink.href = '/stylesheets/style.min.css?'+sessionTimeString; edueq_pagelink.media = 'all'; dmledueqWrapperElement.appendChild(edueq_pagelink); window.edueq_maxwidth = typeof window.edueq_maxwidth != "undefined" ? window.edueq_maxwidth : "100%"; window.edueq_maxheight = typeof window.edueq_maxheight != "undefined" ? window.edueq_maxheight : window.innerHeight +"px"; window.edueq_bannerwidth= typeof window.edueq_bannerwidth != "undefined" ? window.edueq_bannerwidth : "100%"; window.edueq_isEmbed = typeof window.edueq_isEmbed != "undefined" ? window.edueq_isEmbed: true; window.edueq_forcedLanguageCode = typeof window.edueq_forcedLanguageCode != "undefined" ? window.edueq_forcedLanguageCode: ""; window.edueq_banner_cta = typeof window.edueq_banner_cta != "undefined" ? window.edueq_banner_cta: "customize your masque"; dmledueqWrapperElement.style.width = window.edueq_maxwidth; function logOnLocalHostFrontEnd(inStringBefore,inVariable){ inStringBefore = (inStringBefore === undefined) ? '' : inStringBefore; if (/localhost/g.test("") || /192\.168\.0\./g.test("") || edueqFlLgPp){ if (inVariable == undefined){ console.log(inStringBefore) }else{ console.log(inStringBefore, inVariable) } } } // GA - START window.edueqGAsetup = false; function edueqSendGA(eventName,eventParameters = {}){ const enrichedEventParams = {... eventParameters}; enrichedEventParams.send_to = "G-RY34E132SX"; var parametersAsString; try{ parametersAsString = JSON.stringify(enrichedEventParams); }catch(err){ console.warn("Error in GA event parameters - ",err); eventParameters={}; } window.gtag('event', eventName, enrichedEventParams); } function edueqSetupGA(){ if (window.gtag) { logOnLocalHostFrontEnd("setting up GA with 'gtag'"); window.gtag('config', "G-RY34E132SX"); edueqGAsetup = true; } } // GA - END function getEmbedHtmlData(url, callback){ let request = new XMLHttpRequest(); request.open('GET', url, true); request.onload = function() { if (request.status >= 200 && request.status < 400) { callback({"status": "success","status_code":request.status, "data" : request.responseText}); } else { callback({"status": "success","status_code":request.status, "data" : "We reached our target server, but it returned an error"}); } }; request.onerror = function() { callback({"error": "success","status_code":request.status, "data" : "Error occured in getting html data"}); }; request.send(); } function dml_getScript(source, callback) { var script = document.createElement('script'); script.async = 1; script.onload = function(evt) { callback({"status":"success","message":"done"}); }; script.onerror = function(err){ console.log(err) callback({"status":"error", "message":"error in getting script " + source}); } script.setAttribute('type','text/javascript'); script.src = source; dmledueqWrapperElement.appendChild(script); } function dml_getScript_withAttributes(source, attributeObj, callback) { var script = document.createElement('script'); script.async = 1; script.onload = function(evt) { callback({"status":"success","message":"done"}); }; script.onerror = function(err){ console.log(err) callback({"status":"error", "message":"error in getting script " + source}); } script.setAttribute('type','text/javascript'); try{ Object.keys(attributeObj).forEach( function(attrKey){ script.setAttribute(attrKey,attributeObj[attrKey]); }); }catch(err){ console.log(err); } script.src = source; dmledueqWrapperElement.appendChild(script); } function edueqOpenApp(){ console.log('in open app') var gaTimer = 100; var checkForWindowGA = true; var gacheckinterval = setInterval(function(){ if (window.gtag){ logOnLocalHostFrontEnd("GA AVAILABLE - "+ gaTimer/1000 + "s",""); clearInterval(gacheckinterval); edueqSetupGA(); }else{ if (checkForWindowGA){ if (window.ga){ checkForWindowGA = false; console.log("found ga but not gtag - adding gtag library"); dml_getScript("https://www.googletagmanager.com/gtag/js?id=G-RY34E132SX",function(res){ window.dataLayer = window.dataLayer || []; window.gtag = function(){dataLayer.push(arguments);} gtag('js', new Date()); }); } } if (gaTimer > 20000){ logOnLocalHostFrontEnd("GA NOT AVAILABLE - "+ gaTimer/1000 + "s"); clearInterval(gacheckinterval); } gaTimer += 100; } },100) if (navigator.appName == 'Microsoft Internet Explorer' || !!(navigator.userAgent.match(/Trident/) || navigator.userAgent.match(/rv:11/))){ setTimeout(function(){edueqSendGA("user_flow",{"user_flow": "showing browser not supported screen", page_title: "landing_page", page_location: window.location.hostname, page_path: window.location.pathname});},2000); //alert("We don't currently support this browser. Please reopen this page in a different browser.") if (!window.edueq_isEmbed){ dmledueqWrapperElement.style.height = "100vh"; } if (document.getElementById("edueq_banner_container")){ document.getElementById("edueq_banner_container").style.display="none" } dmledueqWrapperElement.innerHTML = '
We don\'t currently support this browser. Please reopen this page in a different browser, such as Chrome.