1/*! Insurance Website Builder Alert Widget | (c) Insurance Technologies Corp. | getitc.com */ 2 3showAlertWidget(); 4 5function showAlertWidget(theme) { 6 7 if (!sessionStorage.getItem("iwb-widget-alert")) { 8 9 var xhr = new XMLHttpRequest(); 10 xhr.onreadystatechange = function () { 11 12 // 200 success, 404 not found 13 if (this.readyState == 4 && this.status == 200) { 14 15 var obj = new Object(); 16 obj = JSON.parse(xhr.responseText); 17 if (obj.length>0) { 18 if (!localStorage.getItem("iwb-widget-alert") || 19 localStorage.getItem("iwb-widget-alert") != obj[0].key || 20 (localStorage.getItem("iwb-widget-alert") == obj[0].key && obj[0].display == "each")) { 21 22 if (theme) { obj.theme = theme }; 23 24 localStorage.setItem("iwb-widget-alert", obj[0].key); 25 sessionStorage.setItem("iwb-widget-alert", "true"); 26 buildAlertWidget(obj[0]); 27 } 28 } 29 } 30 }; 31 xhr.open("GET", "/resources/data/website_data.ashx?r=alert", true); 32 xhr.send(); 33 } 34 35} 36 37function buildAlertWidget(resp) { 38 39 var iwbWidgetAlert = document.createElement("div"); 40 iwbWidgetAlert.id = "iwb-widget-alert"; 41 iwbWidgetAlert.classList.add("iwb-widget-alert"); 42 if (resp.theme) { iwbWidgetAlert.classList.add(resp.theme); }; 43 44 var iwbWidgetAlertClose = document.createElement("img"); 45 iwbWidgetAlertClose.src = "data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjMyOXB0IiB2aWV3Qm94PSIwIDAgMzI5LjI2OTMzIDMyOSIgd2lkdGg9IjMyOXB0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Im0xOTQuODAwNzgxIDE2NC43Njk1MzEgMTI4LjIxMDkzOC0xMjguMjE0ODQzYzguMzQzNzUtOC4zMzk4NDQgOC4zNDM3NS0yMS44MjQyMTkgMC0zMC4xNjQwNjMtOC4zMzk4NDQtOC4zMzk4NDQtMjEuODI0MjE5LTguMzM5ODQ0LTMwLjE2NDA2MyAwbC0xMjguMjE0ODQ0IDEyOC4yMTQ4NDQtMTI4LjI
45xMDkzNy0xMjguMjE0ODQ0Yy04LjM0Mzc1LTguMzM5ODQ0LTIxLjgyNDIxOS04LjMzOTg0NC0zMC4xNjQwNjMgMC04LjM0Mzc1IDguMzM5ODQ0LTguMzQzNzUgMjEuODI0MjE5IDAgMzAuMTY0MDYzbDEyOC4yMTA5MzggMTI4LjIxNDg0My0xMjguMjEwOTM4IDEyOC4yMTQ4NDRjLTguMzQzNzUgOC4zMzk4NDQtOC4zNDM3NSAyMS44MjQyMTkgMCAzMC4xNjQwNjMgNC4xNTYyNSA0LjE2MDE1NiA5LjYyMTA5NCA2LjI1IDE1LjA4MjAzMiA2LjI1IDUuNDYwOTM3IDAgMTAuOTIxODc1LTIuMDg5ODQ0IDE1LjA4MjAzMS02LjI1bDEyOC4yMTA5MzctMTI4LjIxNDg0NCAxMjguMjE0ODQ0IDEyOC4yMTQ4NDRjNC4xNjAxNTYgNC4xNjAxNTYgOS42MjEwOTQgNi4yNSAxNS4wODIwMzIgNi4yNSA1LjQ2MDkzNyAwIDEwLjkyMTg3NC0yLjA4OTg0NCAxNS4wODIwMzEtNi4yNSA4LjM0Mzc1LTguMzM5ODQ0IDguMzQzNzUtMjEuODI0MjE5IDAtMzAuMTY0MDYzem0wIDAiLz48L3N2Zz4="; 46 iwbWidgetAlertClose.classList.add("iwb-widget-alert-close"); 47 iwbWidgetAlertClose.alt = "Close"; 48 iwbWidgetAlertClose.addEventListener("click", closeAlertWidget); 49 iwbWidgetAlert.appendChild(iwbWidgetAlertClose); 50 51 if (resp.title) { 52 var iwbWidgetTitle = document.createElement("div"); 53 iwbWidgetTitle.classList.add("iwb-widget-alert-title"); 54 iwbWidgetTitle.innerHTML = resp.title; 55 iwbWidgetAlert.appendChild(iwbWidgetTitle); 56 } 57 if (resp.position) { 58 switch (resp.position) { 59 case "top": 60 iwbWidgetAlert.classList.add("iwb-widget-alert-top"); 61 break; 62 case "right": 63 iwbWidgetAlert.classList.add("iwb-widget-alert-right"); 64 break; 65 case "left": 66 iwbWidgetAlert.classList.add("iwb-widget-alert-left"); 67 breakl 68 case "bottom": 69 iwbWidgetAlert.classList.add("iwb-widget-alert-bottom"); 70 break; 71 break; 72 } 73 } 74 var iwbWidgetContent = document.createElement("div"); 75 iwbWidgetContent.classList.add("iwb-widget-alert-content"); 76 iwbWidgetContent.innerHTML = resp.content; 77 iwbWidgetAlert.appendChild(iwbWidgetContent); 78 79 var iwbWidgetButton = document.createElement("button"); 80 iwbWidgetButton.classList.add("iwb-widget-alert-button"); 81 if (resp.url) { 82 iwbWidgetButton.addEventListener("click", function () { 83 closeAlertWidget(); 84 window.open(resp.url,"_blank"); 85 }); 86 iwbWidgetButton.innerHTML = "Read More"; 87 iwbWidgetButton.setAttribute("aria-label", "Click here to read more."); 88 } else { 89 iwbWidgetButton.addEventListener("click", closeAlertWidget); 90 iwbWidgetButton.innerHTML = "OK"; 91 iwbWidgetButton.setAttribute("aria-label", "Click here to close the notification."); 92 } 93 iwbWidgetAlert.appendChild(iwbWidgetButton); 94 95 document.body.appendChild(iwbWidgetAlert); 96 $('head').append('<link rel="stylesheet" type="text/css" href="/style/iwb.themes.css">'); 97 $('head').append('<link rel="stylesheet" type="text/css" href="/style/iwb.widgets.css">'); 98} 99 100function closeAlertWidget() { 101 102 try { 103 document.getElementById("iwb-widget-alert").remove(); 104 } catch (err) { 105 106 } 107 108}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.