User:Gracenotes/studybreak.js

if (document.cookie.indexOf("wikibreak=true") != -1 && (wgNamespaceNumber != 0 || wgAction != "view")) { addOnloadHook(function {       document.getElementById("bodyContent").style.visibility = "hidden";    }); }

$(function {   addPortletLink("p-tb", "javascript:toggleBreak;", "Toggle wikibreak"); });

function toggleBreak { var shouldEnable = document.cookie.indexOf("wikibreak=true") == -1; var now = new Date; if (shouldEnable) now.setTime(now.getTime + 7*24*60*60*1000); document.cookie = "wikibreak=" + shouldEnable + "; expires=" + now.toGMTString; alert("Enforced wikibreak = " + shouldEnable); };