Jump to content

User:Iamunknown/undo.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Iamunknown (talk | contribs) at 05:00, 10 June 2007 (Will this work? No one knows). 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.
//<source lang="javascript">
if(window.location.href.indexOf('undoafter')) {

	summaries = {
		'BLP': '[[WP:BLP|negative and contentious unsourced biographical information]]', 
		'ENC': '[[WP:WP:SANDBOX|good-faith but unencyclopedic edits]]'
	};

	var div = document.createElement('div');

	for(var i in summaries) {

		var divSub = document.createElement('div');
		var txtNode = document.createTextNode(i);
		divSub.appendChild(txtNode);
		divSub.onclick = (
			document.getElementById('wpSummary').value += summaries[i]
		);
		div.appendChild(divSub);

	}

	div.getElementById('bodyContent').appendChild(div);

}
//</source>