User:Documentalist/StyleGuard.js

/*Ruler--- 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890

/***************************************************************************************** Style Guard var Id = document.createAttribute("id"); Id.value = "StyleGuard";

var Title = document.createElement("H2"); Title.appendChild(document.createTextNode("Style Guard"));

var Version = document.createElement("P"); Version.appendChild(document.createTextNode("version 0.1"));

var StyleGuard = document.createElement("DIV"); StyleGuard.style.position = "fixed"; StyleGuard.style.left = "86%"; StyleGuard.style.top= "57px"; StyleGuard.style.width = "14%"; StyleGuard.style.height = "auto"; StyleGuard.style.minHeight = "50px"; StyleGuard.style.backgroundColor = "black"; StyleGuard.setAttributeNode(Id); StyleGuard.appendChild(Title); StyleGuard.appendChild(Version);

var StyleGuardSpaceReservation = document.createElement("DIV"); StyleGuardSpaceReservation .style.position = "relative"; StyleGuardSpaceReservation .style.cssFloat = "right"; StyleGuardSpaceReservation .style.width = "15%"; StyleGuardSpaceReservation .style.height = "50px"; StyleGuardSpaceReservation .style.backgroundColor = "black";

var WikiaPage = document.getElementById("WikiaPage"); WikiaPage.style.marginLeft = "0px"; WikiaPage.style.width = "85%"; WikiaPage.style.maxWidth = "1600px"; WikiaPage.parentNode.insertBefore(StyleGuardSpaceReservation, WikiaPage); WikiaPage.parentNode.insertBefore(StyleGuard, WikiaPage); /* Rule: Every WikiaPage shall have a category. function CheckRule { var Categories = document.getElementById("WikiaArticleCategories"); var Success = (Categories != null); var Message= document.createElement("DIV"); Message.style.position = "relative"; Message.style.width = "100%"; if (Success) { Message.appendChild(document.createTextNode("This page has at least one category.")); Message.style.color = "green"; } else { Message.appendChild(document.createTextNode("This page has no category.")); Message.style.color = "red"; } StyleGuard.appendChild(Message); return Success; } /*--*/ var Success = CheckRule;