Jump to content

User:Mathwizard1232/monobook.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Mathwizard1232 (talk | contribs) at 14:04, 15 February 2006. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
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.
function CongressConvert()
{
	var str = document.editform.wpTextbox1.value;
	var pos = -1;
	while (str.indexOf("Congress", pos) != -1)
	{
		var midpos = str.indexOf("Congress", pos) - 2;
		var startpos1 = str.lastIndexOf("(",midpos);
		var startpos2 = str.lastIndexOf(" ",midpos);
		var startpos;
		if (startpos1 < startpos2)
		{
			startpos = startpos2;
		}
		else
		{
			startpos = startpos1;
		}
		startpos++;
		var currpos = midpos + 8;
		window.alert("Up to found point: " + str.substring(0,currpos));
		window.alert(str.substring(startpos,currpos));
		pos = currpos;
	}
	document.editform.wpTextbox1.value = str;
}