-
Notifications
You must be signed in to change notification settings - Fork 0
/
alert-test.min.js
4 lines (4 loc) · 1.68 KB
/
alert-test.min.js
1
2
3
4
var strProto="https:"==window.location.protocol?"https://":"http://";function displayAlert(){types={"red-alert-urgent":"uwalert-red","orange-alert":"uwalert-orange","steel-alert-fyis":"uwalert-steel"};addElement("Campus Alert:","http://emergency.washington.edu/","uwalert-steel","There is no emergency. For additional information, please visit ")}
function addElement(e,g,b,a){var c=document.getElementsByTagName("body")[0];c.style.margin="0px";c.style.padding="0px";c.className+=" uw-alert";var h=document.createElement("div");h.setAttribute("id","uwalert-alertMessage");var f=document.createElement("div");f.setAttribute("id","uwalert-alertBox");f.setAttribute("class",b);b=document.createElement("div");b.setAttribute("id","uwalert-alertBoxText");var j=document.createElement("h1"),d=document.createTextNode("Campus Alert:");j.appendChild(d);var d=
document.createElement("p"),i=document.createElement("div");i.innerHTML=a;a=i.textContent||i.innerText||"";a=document.createTextNode(a.substring(0,200)+(200<=a.length?"... ":" "));d.appendChild(a);a=document.createElement("a");a.setAttribute("href",g);a.setAttribute("title",e);e=document.createTextNode("More Info");a.appendChild(e);e=document.createTextNode(" >>");g=document.createElement("div");g.setAttribute("id","uwalert-clearer");d.appendChild(a);d.appendChild(e);b.appendChild(j);b.appendChild(d);
f.appendChild(b);f.appendChild(g);h.appendChild(f);c.insertBefore(h,c.firstChild)}displayAlert();var strCSS=document.createElement("link");strCSS.setAttribute("href",strProto+"www.washington.edu/static/uwalert.css");strCSS.setAttribute("rel","stylesheet");strCSS.setAttribute("type","text/css");document.getElementsByTagName("head")[0].appendChild(strCSS);