Jump to content

User:Steven Crossin/restrictor.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Fox (talk | contribs) at 15:06, 21 June 2011 (create (credit goes to User:Nick)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
Array.prototype.in_array = function (term)
{
	var i = this.length;
	if (i > 0)
	{
		do
		{
			if (this[i] === term)
			{
				return true;
			}
		}
		while (i--);
	}
	return false;
}
allowed = [2, 3];
if (!allowed.in_array(wgNamespaceNumber) && document.location.toString().indexOf('action=edit') != -1)
{
	alert('Reminder: You are likely to be blocked if you continue. For the user talk namespace, you are allowed to edit your own talkpage, and as for others, only essential posts are allowed.');
}