User:Swedmann/Consermon.js

(function {   /* with http://consermon.appspot.com/ */    var display = function(enabled) {	var id = 'pt-consermon';	var s = document.getElementById(id);	if (!s) {	    s = addPortletLink('p-personal', 'http://www.conservapedia.com', 'internal error', id, 'Go to Conservapedia');	}	if (!s) {	   document.onload = function { display(enabled) };	    return;	}	if (enabled) {	    s.firstChild.innerHTML = 'account creation enabled';	    s.firstChild.style.color = '#00ff00';	} else {	    s.firstChild.innerHTML = 'account creation disabled';	    s.firstChild.style.color = '#ff0000';	}    }    consermonCallback = function(cur) {	display(cur);    }    var check = function {	var script = document.createElement('script');	script.src = 'http://consermon.appspot.com/get';	document.head.appendChild(script);    }    check;    setInterval(check, 2 * 60 * 60 * 1000); });