Jump to content

User:Slakr/twinkle-oldwarn-custom.js

From Wikipedia, the free encyclopedia
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.
// <nowiki>
// This was a prereq of the old warning system.
importScript('Wikipedia:WikiProject User scripts/Scripts/Add LI menu');

// This was also a prereq of the old warning system.
importStylesheet('Wikipedia:WikiProject User scripts/Scripts/Add LI menu/css');

// The old tabbed warning system, taken from revision id 121500851.  Credits obviously still go to AzaToth.  Cheers.

// If TwinkleConfig aint exist.
if( typeof( TwinkleConfig ) == 'undefined' ) {
	TwinkleConfig = {};
}

/**
 TwinkleConfig.showSharedIPNotice may take arguments:
  true: to show shared ip notice if an IP address
  false: to not print the notice
*/
if( typeof( TwinkleConfig.showSharedIPNotice ) == 'undefined' ) {
	TwinkleConfig.showSharedIPNotice = true;
}

/**
 TwinkleConfig.markWarningsAsMinor (boolean)
 Defines if a warning should be marked as minor, if false, default is applied as per preference.
*/
if( typeof( TwinkleConfig.markWarningsAsMinor ) == 'undefined' ) {
	TwinkleConfig.markWarningsAsMinor = true;
}

/**
TwinkleConfig.summaryAd (string)
If ad should be added or not to summary, default [[WP:TWINKLE|TWINKLE]]
*/
if( typeof( TwinkleConfig.summaryAd ) == 'undefined' ) {
	TwinkleConfig.summaryAd = " using [[WP:TWINKLE|TW]]";
}

function blockTagAdd( tag, summary ) {
	var reason = null;
	var notice = null;
	var duration = null;

	if( [ 'uw-sblock', 'uw-vblock', 'uw-dblock' ].indexOf( tag ) != -1 ) {
		duration = prompt( 'What is the duration of the block? (* for indef)' );
		if( /te?mp|^\s*$|min/.exec( duration ) ) {
			notice = '{{subst:' + tag + '}} &mdash;~~' + '~~';
		} else if( /indef|\*|max/.exec( duration ) ) {
			notice = '{{subst:' + tag + '|indef=yes}} &mdash;~~' + '~~';
		} else {
			notice = '{{subst:' + tag + '|time=' + duration + '}} &mdash;~~' + '~~';
		}
	} else {
		if( [ 'uw-block3', 'uw-ublock', 'uw-uhblock', 'spamusername', 'uw-schoolblock', 'uw-voablock' ].indexOf( tag ) == -1 ) {
			duration = prompt( 'What duration is the block for? (* for indef)' );
		}

		if( [ 'uw-voablock', 'uw-block3', 'uw-uhblock', 'spamusername', 'uw-schoolblock', 'uw-ablock' ].indexOf( tag ) == -1 ) {
			reason = prompt( 'Reason for block?' );
		}

		notice = '{{subst:' + tag + ( duration ? '|time=' + duration : '' ) + ( reason ? '|reason=' + reason : '' ) + '}} &mdash;~~' + '~~';
	}

	// BEGIN WikiEd -> wpTextbox1
	if (typeof(wikEdUseWikEd) != 'undefined') {
		if (wikEdUseWikEd == true) {
			WikEdUpdateTextarea();
		}
	}
	// END
	var textbox = document.getElementById( 'wpTextbox1' );
	textbox.value += "\n" + notice;
	// BEGIN wpTextbox1 -> WikiEd
	if (typeof(wikEdUseWikEd) != 'undefined') {
		if (wikEdUseWikEd == true) {
			WikEdUpdateFrame();
		}
	}
	// END

	if( TwinkleConfig.markWarningsAsMinor ) {
		document.getElementById( 'wpMinoredit' ).checked = true;
	}
	document.getElementById( 'wpSummary' ).value = summary + TwinkleConfig.summaryAd;
}

function tagadd( tag , summary) {
	var article;

	if( QueryString.exists( 'vanarticle' ) ) {
		article = decodeURI(QueryString.get( 'vanarticle' )).replace( /^(Image|Category):/i, ':$1:' );
                article = article.replace(/_/g, ' ');
	} else {
		article = prompt('Which article?').replace( /^(Image|Category):/i, ':$1:' );
	}

	var date = new Date();
	var notice = "";
	var header = "";

	var headerRe = new RegExp( "^==\\s*" + date.getUTCMonthName() + "\\s+" + date.getUTCFullYear() + "\\s*==", 'm' );
	var textbox = document.getElementById( 'wpTextbox1' );

	if ( textbox.value.length > 0 ) {
		textbox.value += '\n';
	}
	if( !headerRe.exec( textbox.value ) ) {
		header += "== " + date.getUTCMonthName() + " " + date.getUTCFullYear() + " ==\n";
	}

	notice += header;
	notice += "{{subst:" + tag + ( article ? '|' + article : '' ) + "}} &mdash;~~" + "~~"; // subst=subst: hack only on article given as per MW bug :( UPDATE: removed. -- slakr
	if ( TwinkleConfig.showSharedIPNotice && isIPAddress( wgTitle ) ) {
		switch( QueryString.get( 'type' ) ) {
			case 'vand':
			notice +=  "\n:''If this is a shared [[IP address]], and you didn't make any [[Wikipedia:vandalism|unconstructive]] edits, consider [[Wikipedia:Why create an account?|creating an account]] for yourself so you can avoid further irrelevant warnings.'' ";
			break;
			default:
			notice +=  "\n:''If this is a shared [[IP address]], and you didn't make the edit, consider [[Wikipedia:Why create an account?|creating an account]] for yourself so you can avoid further irrelevant notices.'' ";
			break;
		}
	}

	// BEGIN WikiEd -> wpTextbox1
	if (typeof(wikEdUseWikEd) != 'undefined') {
		if (wikEdUseWikEd == true) {
			WikEdUpdateTextarea();
		}
	}
	// END


	textbox.value += "\n" + notice;
	// BEGIN wpTextbox1 -> WikiEd
	if (typeof(wikEdUseWikEd) != 'undefined') {
		if (wikEdUseWikEd == true) {
			WikEdUpdateFrame();
		}
	}
	// END	

	document.getElementById( 'wpSummary' ).value = summary + ( article ? ' on [[' + article + ']]'  : '' ) + '.' + TwinkleConfig.summaryAd;
	if( TwinkleConfig.markWarningsAsMinor ) {
		document.getElementById( 'wpMinoredit' ).checked = true;
	}
}

//Quick warning tabs
function add_warn_tabs() 
{ 
	var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];

	if ( wgNamespaceNumber == 3 && ( QueryString.equals( 'action', 'edit' ) || QueryString.equals( 'action', 'submit' ) || QueryString.equals( 'action', 'editredlink') ) ) {

		addlimenu(tabs, '[1]', 'generalnotefunc');
		// Frequent
		mw.util.addPortletLink('generalnotefunc', 'javascript:tagadd("uw-vandalism1", "General note: Possibly nonconstructive edits")', 'Vandalism', '');
		mw.util.addPortletLink('generalnotefunc', 'javascript:tagadd("uw-delete1", "General note: Deletion of content")', 'Page blanking, removal', '');
		mw.util.addPortletLink('generalnotefunc', 'javascript:tagadd("uw-test1", "General note: Editing tests")', 'Tests', '');
		mw.util.addPortletLink('generalnotefunc', 'javascript:tagadd("uw-spam1", "General note: Possible spam")', 'Spam', '');
		mw.util.addPortletLink('generalnotefunc', 'javascript:tagadd("uw-ad1", "General note: Possible advertising or promotion")', 'Ads/Promos', '');
		mw.util.addPortletLink('generalnotefunc', 'javascript:tagadd("uw-npov1", "General note: Please maintain a neutral point of view")', 'NPOV', '');
		mw.util.addPortletLink('generalnotefunc', 'javascript:tagadd("uw-tpv1", "General note: Altering talk page comments")', 'Talkpage vandalism', '');
		mw.util.addPortletLink('generalnotefunc', 'javascript:tagadd("uw-creation1", "General note: Creation of pages")', 'Creates', '');
		mw.util.addPortletLink('generalnotefunc', 'javascript:tagadd("uw-speedy1", "General note: Please do not remove {{"+"speedy deletion}} templates")', 'CSD removal', '');
		mw.util.addPortletLink('generalnotefunc', 'javascript:tagadd("uw-afd1", "General note: Please do not remove {{"+"afd}} templates")', 'AfD removal', '');
		mw.util.addPortletLink('generalnotefunc', 'javascript:tagadd("uw-chat1", "General note: Talk page  [[WP:TALK#Behavior_that_is_unacceptable|usage]]")', 'Chat in Talk', '');

		mw.util.addPortletLink('generalnotefunc', 'javascript:void(0)', '---', '');
		// Less frequent
		mw.util.addPortletLink('generalnotefunc', 'javascript:tagadd("uw-copyright1", "General note: Copyrighted contributions")', 'Copyvio', '');
		mw.util.addPortletLink('generalnotefunc', 'javascript:tagadd("uw-upv1", "General note: Altering user pages")', 'Userpage vandalism', '');
		mw.util.addPortletLink('generalnotefunc', 'javascript:tagadd("uw-unsourced1", "General note: Unsourced information")', 'Unsourced', '');
		mw.util.addPortletLink('generalnotefunc', 'javascript:tagadd("uw-error1", "General note: Possible factual errors")', 'Factual errors', '');
		mw.util.addPortletLink('generalnotefunc', 'javascript:tagadd("uw-biog1", "General note: Possibly negative biography")', 'Biography negative', '');
		mw.util.addPortletLink('generalnotefunc', 'javascript:tagadd("uw-defamatory1", "General note: Possibly defamatory content")', 'Libel/Defamation', '');

		mw.util.addPortletLink('generalnotefunc', 'javascript:void(0)', '---', '');
		// Infrequent
		mw.util.addPortletLink('generalnotefunc', 'javascript:tagadd("uw-joke1", "General note: Possibly inappropriate humor")', 'Jokes', '');
		mw.util.addPortletLink('generalnotefunc', 'javascript:tagadd("uw-mos1", "General note: Manual of style")', 'MOS', '');
		mw.util.addPortletLink('generalnotefunc', 'javascript:tagadd("uw-notcensored1", "General note: Censorship of contributions")', 'Censor', '');
		mw.util.addPortletLink('generalnotefunc', 'javascript:tagadd("uw-npa1", "General note: Please avoid personal attacks")', 'NPA', '');
		mw.util.addPortletLink('generalnotefunc', 'javascript:tagadd("uw-agf1", "General note: Please assume good faith")', 'AGF', '');
		mw.util.addPortletLink('generalnotefunc', 'javascript:tagadd("uw-image1", "General note: Images you added")', 'img vandal', '');
		mw.util.addPortletLink('generalnotefunc', 'javascript:tagadd("uw-upload1", "General note: Images you uploaded")', 'img uploads', '');
		mw.util.addPortletLink('generalnotefunc', 'javascript:tagadd("uw-move1", "General note: Page moves")', 'Moves', '');
		mw.util.addPortletLink('generalnotefunc', 'javascript:tagadd("uw-own1", "General note: Ownership of articles")', 'Ownership', '');
		mw.util.addPortletLink('generalnotefunc', 'javascript:tagadd("uw-maintenance1", "General note: Removal of maintenance templates")', 'Template notices', '');




		addlimenu(tabs, '[2]', 'cautionfunc');
		// Frequent
		mw.util.addPortletLink('cautionfunc', 'javascript:tagadd("uw-vandalism2", "Caution: Possibly nonconstructive edits")', 'Vandalism', '');
		mw.util.addPortletLink('cautionfunc', 'javascript:tagadd("uw-delete2", "Caution: Deletion of content")', 'Page blanking, removal', '');
		mw.util.addPortletLink('cautionfunc', 'javascript:tagadd("uw-test2", "Caution: Editing tests")', 'Tests', '');
		mw.util.addPortletLink('cautionfunc', 'javascript:tagadd("uw-spam2", "Caution: Possible spam")', 'Spam', '');
		mw.util.addPortletLink('cautionfunc', 'javascript:tagadd("uw-ad2", "Caution: Possible advertising or promotion")', 'Ads/Promos', '');
		mw.util.addPortletLink('cautionfunc', 'javascript:tagadd("uw-npov2", "Caution: Please maintain a neutral point of view")', 'NPOV', '');
		mw.util.addPortletLink('cautionfunc', 'javascript:tagadd("uw-tpv2", "Caution: Altering talk page comments")', 'Talkpage vandalism', '');
		mw.util.addPortletLink('cautionfunc', 'javascript:tagadd("uw-creation2", "Caution: Creation of pages")', 'Creates', '');
		mw.util.addPortletLink('cautionfunc', 'javascript:tagadd("uw-speedy2", "Caution: Please do not remove {{"+"speedy deletion}} templates")', 'CSD removal', '');
		mw.util.addPortletLink('cautionfunc', 'javascript:tagadd("uw-afd2", "Caution: Please do not remove {{"+"afd}} templates")', 'AfD removal', '');
		mw.util.addPortletLink('cautionfunc', 'javascript:tagadd("uw-chat2", "Caution: Talk page  [[WP:TALK#Behavior_that_is_unacceptable|usage]]")', 'Chat in Talk', '');

		mw.util.addPortletLink('cautionfunc', 'javascript:void(0)', '---', '');
		// Less frequent
		mw.util.addPortletLink('cautionfunc', 'javascript:tagadd("uw-copyright2", "Caution: Copyrighted contributions")', 'Copyvio', '');
		mw.util.addPortletLink('cautionfunc', 'javascript:tagadd("uw-upv2", "Caution: Altering user pages")', 'Userpage vandalism', '');
		mw.util.addPortletLink('cautionfunc', 'javascript:tagadd("uw-unsourced2", "Caution: Unsourced information")', 'Unsourced', '');
		mw.util.addPortletLink('cautionfunc', 'javascript:tagadd("uw-error2", "Caution: Possible factual errors")', 'Factual errors', '');
		mw.util.addPortletLink('cautionfunc', 'javascript:tagadd("uw-biog2", "Caution: Possibly negative biography")', 'Biography negative', '');
		mw.util.addPortletLink('cautionfunc', 'javascript:tagadd("uw-defamatory2", "Caution: Possibly defamatory content")', 'Libel/Defamation', '');

		mw.util.addPortletLink('cautionfunc', 'javascript:void(0)', '---', '');
		// Infrequent
		mw.util.addPortletLink('cautionfunc', 'javascript:tagadd("uw-joke2", "Caution: Possibly inappropriate humor")', 'Jokes', '');
		mw.util.addPortletLink('cautionfunc', 'javascript:tagadd("uw-mos2", "Caution: Manual of style")', 'MOS', '');
		mw.util.addPortletLink('cautionfunc', 'javascript:tagadd("uw-notcensored2", "Caution: Censorship of contributions")', 'Censor', '');
		mw.util.addPortletLink('cautionfunc', 'javascript:tagadd("uw-npa2", "Caution: Please avoid personal attacks")', 'NPA', '');
		mw.util.addPortletLink('cautionfunc', 'javascript:tagadd("uw-agf2", "Caution: Please assume good faith")', 'AGF', '');
		mw.util.addPortletLink('cautionfunc', 'javascript:tagadd("uw-image2", "Caution: Images you added")', 'img vandal', '');
		mw.util.addPortletLink('cautionfunc', 'javascript:tagadd("uw-upload2", "Caution: Images you uploaded")', 'img uploads', '');
		mw.util.addPortletLink('cautionfunc', 'javascript:tagadd("uw-move2", "Caution: Page moves")', 'Moves', '');
		mw.util.addPortletLink('cautionfunc', 'javascript:tagadd("uw-own2", "Caution: Ownership of articles")', 'Ownership', '');
		mw.util.addPortletLink('cautionfunc', 'javascript:tagadd("uw-maintenance2", "Caution: Removal of maintenance templates")', 'Template notices', '');





		addlimenu(tabs, '[3]', 'warningfunc');
		// Frequent
		mw.util.addPortletLink('warningfunc', 'javascript:tagadd("uw-vandalism3", "Warning: Possibly nonconstructive edits")', 'Vandalism', '');
		mw.util.addPortletLink('warningfunc', 'javascript:tagadd("uw-delete3", "Warning: Deletion of content")', 'Page blanking, removal', '');
		mw.util.addPortletLink('warningfunc', 'javascript:tagadd("uw-test3", "Warning: Editing tests")', 'Tests', '');
		mw.util.addPortletLink('warningfunc', 'javascript:tagadd("uw-spam3", "Warning: Possible spam")', 'Spam', '');
		mw.util.addPortletLink('warningfunc', 'javascript:tagadd("uw-ad3", "Warning: Possible advertising or promotion")', 'Ads/Promos', '');
		mw.util.addPortletLink('warningfunc', 'javascript:tagadd("uw-npov3", "Warning: Please maintain a neutral point of view")', 'NPOV', '');
		mw.util.addPortletLink('warningfunc', 'javascript:tagadd("uw-tpv3", "Warning: Altering talk page comments")', 'Talkpage vandalism', '');
		mw.util.addPortletLink('warningfunc', 'javascript:tagadd("uw-creation3", "Warning: Creation of pages")', 'Creates', '');
		mw.util.addPortletLink('warningfunc', 'javascript:tagadd("uw-speedy3", "Warning: Please do not remove {{"+"speedy deletion}} templates")', 'CSD removal', '');
		mw.util.addPortletLink('warningfunc', 'javascript:tagadd("uw-afd3", "Warning: Please do not remove {{"+"afd}} templates")', 'AfD removal', '');
		mw.util.addPortletLink('warningfunc', 'javascript:tagadd("uw-chat3", "Warning: Talk page  [[WP:TALK#Behavior_that_is_unacceptable|usage]]")', 'Chat in Talk', '');

		mw.util.addPortletLink('warningfunc', 'javascript:void(0)', '---', '');
		// Less frequent
		mw.util.addPortletLink('warningfunc', 'javascript:tagadd("uw-copyright3", "Warning: Copyrighted contributions")', 'Copyvio', '');
		mw.util.addPortletLink('warningfunc', 'javascript:tagadd("uw-upv3", "Warning: Altering user pages")', 'Userpage vandalism', '');
		mw.util.addPortletLink('warningfunc', 'javascript:tagadd("uw-unsourced3", "Warning: Unsourced information")', 'Unsourced', '');
		mw.util.addPortletLink('warningfunc', 'javascript:tagadd("uw-error3", "Warning: Possible factual errors")', 'Factual errors', '');
		mw.util.addPortletLink('warningfunc', 'javascript:tagadd("uw-biog3", "Warning: Possibly negative biography")', 'Biography negative', '');
		mw.util.addPortletLink('warningfunc', 'javascript:tagadd("uw-defamatory3", "Warning: Possibly defamatory content")', 'Libel/Defamation', '');

		mw.util.addPortletLink('warningfunc', 'javascript:void(0)', '---', '');
		// Infrequent
		mw.util.addPortletLink('warningfunc', 'javascript:tagadd("uw-joke3", "Warning: Possibly inappropriate humor")', 'Jokes', '');
		mw.util.addPortletLink('warningfunc', 'javascript:tagadd("uw-mos3", "Warning: Manual of style")', 'MOS', '');
		mw.util.addPortletLink('warningfunc', 'javascript:tagadd("uw-notcensored3", "Warning: Censorship of contributions")', 'Censor', '');
		mw.util.addPortletLink('warningfunc', 'javascript:tagadd("uw-npa3", "Warning: Please avoid personal attacks")', 'NPA', '');
		mw.util.addPortletLink('warningfunc', 'javascript:tagadd("uw-agf3", "Warning: Please assume good faith")', 'AGF', '');
		mw.util.addPortletLink('warningfunc', 'javascript:tagadd("uw-image3", "Warning: Images you added")', 'img vandal', '');
		mw.util.addPortletLink('warningfunc', 'javascript:tagadd("uw-upload3", "Warning: Images you uploaded")', 'img uploads', '');
		mw.util.addPortletLink('warningfunc', 'javascript:tagadd("uw-move3", "Warning: Page moves")', 'Moves', '');
		mw.util.addPortletLink('warningfunc', 'javascript:tagadd("uw-own3", "Warning: Ownership of articles")', 'Ownership', '');
		mw.util.addPortletLink('warningfunc', 'javascript:tagadd("uw-maintenance3", "Warning: Removal of maintenance templates")', 'Template notices', '');




		addlimenu(tabs, '[4]', 'finalfunc');
		// Frequent
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-vandalism4", "Final warning: Possibly nonconstructive edits")', 'Vandalism', '');
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-vandalism4im", "Only warning: Possibly nonconstructive edits")', 'Vandalism (im)', '');
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-delete4", "Final warning: Deletion of content")', 'Page blanking, removal', '');
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-delete4im", "Only warning: Deletion of content")', 'Page blanking, removal (im)', '');
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-generic4", "Final warning: Possibly nonconstructive edits")', 'Finalwarn generic', '');
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-test4", "Final warning: Editing tests")', 'Tests', '');
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-spam4", "Final warning: Possible spam")', 'Spam', '');
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-spam4im", "Only warning: Possible spam")', 'Spam (im)', '');
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-ad4", "Final warning: Possible advertising or promotion")', 'Ads/Promos', '');
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-npov4", "Final warning: Please maintain a neutral point of view")', 'NPOV', '');
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-creation4", "Final warning: Creation of pages")', 'Creates', '');
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-creation4im", "Only warning: Creation of pages")', 'Creates (im)', '');
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-speedy4", "Final warning: Please do not remove {{"+"speedy deletion}} templates")', 'CSD removal', '');
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-afd4", "Final warning: Please do not remove {{"+"afd}} templates")', 'AfD removal', '');
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-chat4", "Final warning: Talk page  [[WP:TALK#Behavior_that_is_unacceptable|usage]]")', 'Chat in Talk', '');

		mw.util.addPortletLink('finalfunc', 'javascript:void(0)', '---', '');
		// Less frequent
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-copyright4", "Final warning: Copyrighted contributions")', 'Copyvio', '');
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-upv4", "Final warning: Altering user pages")', 'Userpage vandalism', '');
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-unsourced4", "Final warning: Unsourced information")', 'Unsourced', '');
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-error4", "Final warning: Possible factual errors")', 'Factual errors', '');
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-biog4", "Final warning: Possibly negative biography")', 'Biography negative', '');
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-defamatory4", "Final warning: Possibly defamatory content")', 'Libel/Defamation', '');

		mw.util.addPortletLink('finalfunc', 'javascript:void(0)', '---', '');
		// Infrequent
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-joke4", "Final warning: Possibly inappropriate humor")', 'Jokes', '');
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-notcensored4", "Final warning: Censorship of contributions")', 'Censor', '');
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-npa4", "Final warning: Please avoid personal attacks")', 'NPA', '');
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-image4", "Final warning: Images you added")', 'img vandal', '');
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-image4im", "Only warning: Images you added")', 'img vandal (im)', '');
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-upload4", "Final warning: Images you uploaded")', 'img uploads', '');
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-upload4im", "Only warning: Images you uploaded")', 'img uploads (im)', '');
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-move4", "Final warning: Page moves")', 'Moves', '');
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-move4im", "Only warning: Page moves")', 'Moves (im)', '');
		mw.util.addPortletLink('finalfunc', 'javascript:tagadd("uw-maintenance4", "Final warning: Removal of maintenance templates")', 'Template notices', '');




		addlimenu(tabs, '[!]', 'singlefunc');

		// Frequent
		mw.util.addPortletLink('singlefunc', 'javascript:tagadd("uw-selfrevert", "Note: Reverting self tests")', 'Test add and remove', '');
		mw.util.addPortletLink('singlefunc', 'javascript:tagadd("uw-talkinarticle", "Note: Talk in articles")', 'Talk in article', '');
		mw.util.addPortletLink('singlefunc', 'javascript:tagadd("uw-autobiography", "Note: Creating autobiographies.")', 'Autobiography', '');
		mw.util.addPortletLink('singlefunc', 'javascript:tagadd("uw-coi", "Caution: Conflicts of interest")', 'COI', '');
		mw.util.addPortletLink('singlefunc', 'javascript:tagadd("uw-wrongsummary", "Caution: Using inaccurate or inappropriate edit summaries")', 'Edit summary wrong', '');
		mw.util.addPortletLink('singlefunc', 'javascript:tagadd("HangonUse", "Note: Hangon tag use without a speedy deletion tag")', 'Hangon no speedy', '');
		mw.util.addPortletLink('singlefunc', 'javascript:tagadd("uw-autobiography", "Note: You added a hangon tag but did not say why on talk page")', 'Hangon no talk', '');
		mw.util.addPortletLink('singlefunc', 'javascript:tagadd("nn-userfy", "Quick note: Userfied your article")', 'Userfied', '');


		// Important
		mw.util.addPortletLink('singlefunc', 'javascript:void(0)', '---', '');
		mw.util.addPortletLink('singlefunc', 'javascript:tagadd("uw-3rr", "Only warning: Violating the [[WP:3RR|three-revert rule]]")', '3RR (w)', '');
		mw.util.addPortletLink('singlefunc', 'javascript:tagadd("uw-legal", "Only warning: Using multiple IP addresses")', 'IP hopping (im)', '');
		mw.util.addPortletLink('singlefunc', 'javascript:tagadd("uw-bv", "Only warning: Blatant vandalism")', 'Blatant vandal (im)', '');
		mw.util.addPortletLink('singlefunc', 'javascript:tagadd("uw-longterm", "Only warning: Long term pattern of abuse")', 'Longterm (im)', '');
		mw.util.addPortletLink('singlefunc', 'javascript:tagadd("uw-pinfo", "Only warning: Posting parsonal info about others is prohibited")', 'Personal info (im)', '');
		mw.util.addPortletLink('singlefunc', 'javascript:tagadd("uw-redirect", "Warning: Creating malicious redirects")', 'Redirects (im)', '');
		mw.util.addPortletLink('singlefunc', 'javascript:tagadd("uw-hoax", "Warning: Please do not create hoaxes")', 'Hoaxes (w)', '');
		mw.util.addPortletLink('singlefunc', 'javascript:tagadd("uw-legal", "Legal threats are not tolerated")', 'Legal threats (im)', '');
		mw.util.addPortletLink('singlefunc', 'javascript:tagadd("uw-copyright-link", "Warning: Linking to copyrighted works")', 'Copyvio linking (w)', '');


		// Misc
		mw.util.addPortletLink('singlefunc', 'javascript:void(0)', '---', '');
		mw.util.addPortletLink('singlefunc', 'javascript:tagadd("uw-notaiv", "Quick note: Complex abuse should not be reported to AIV")', 'AIV go2AN/I', '');
		mw.util.addPortletLink('singlefunc', 'javascript:tagadd("uw-aiv", "Quick note: Vandals should have a final warning before being blocked")', 'AIV nofinal', '');
		mw.util.addPortletLink('singlefunc', 'javascript:tagadd("uw-uaa", "Quick note: Your recent report to UAA")', 'UAA reject', '');
		mw.util.addPortletLink('singlefunc', 'javascript:tagadd("uw-warn", "Please warn vandals after reverting their edits")', 'Warn vandals pls', '');
		mw.util.addPortletLink('singlefunc', 'javascript:tagadd("uw-english", "Please communicate only in English")', 'English pls', '');
		mw.util.addPortletLink('singlefunc', 'javascript:tagadd("uw-articlesig", "Adding signatures to article space")', 'Sigs in articles', '');





		addlimenu(tabs, '[W]', 'welcomefunc');
		mw.util.addPortletLink('welcomefunc', 'javascript:tagadd("welcome2", "Welcome! :)")', 'welcome2', '');
		mw.util.addPortletLink('welcomefunc', 'javascript:tagadd("welcome-anon", "Welcome! :)")', 'welcomeIP', '');




		addlimenu(tabs, '[B]', 'blockfunc');
		mw.util.addPortletLink('blockfunc', 'javascript:blockTagAdd("uw-vblock", "You have been blocked for persistent vandalism")', 'Vandalism', '');
		mw.util.addPortletLink('blockfunc', 'javascript:blockTagAdd("uw-voablock", "You have been indefinitely blocked")', 'Vandal-only', '');
		mw.util.addPortletLink('blockfunc', 'javascript:blockTagAdd("uw-3block", "You have been blocked due to [[WP:EDITWAR|edit warring]]")', '3RR/Editwar', '');
		mw.util.addPortletLink('blockfunc', 'javascript:blockTagAdd("uw-ablock", "Anonymous editors from this address have been blocked")', 'Anonblock', '');
		mw.util.addPortletLink('blockfunc', 'javascript:blockTagAdd("schoolblock", "Editing from this school has been blocked")', 'School (long)', '');
		mw.util.addPortletLink('blockfunc', 'javascript:blockTagAdd("Test5article", "You have been blocked for repeatedly creating inappropriate pages")', 'Creates', '');
		mw.util.addPortletLink('blockfunc', 'javascript:blockTagAdd("uw-hblock", "You have been blocked for attempting to harass other users")', 'Harassment', '');

		mw.util.addPortletLink('blockfunc', 'javascript:void(0)', '---', '');

		mw.util.addPortletLink('blockfunc', 'javascript:blockTagAdd("uw-ublock", "This username violates our [[WP:U|username policy]]. Please choose another.")', 'Username soft', '');
		mw.util.addPortletLink('blockfunc', 'javascript:blockTagAdd("spamusername", "This username violates our [[WP:U|username policy]]. Please choose another.")', 'Username spam', '');
		mw.util.addPortletLink('blockfunc', 'javascript:blockTagAdd("uw-uhblock", "This username has been blocked.")', 'Username hard', '');

		mw.util.addPortletLink('blockfunc', 'javascript:void(0)', '---', '');

		mw.util.addPortletLink('blockfunc', 'javascript:blockTagAdd("uw-dblock", "You have been blocked for continued deletion of material")', 'Page blanking/removal', '');
		mw.util.addPortletLink('blockfunc', 'javascript:blockTagAdd("Tpv5", "You have been blocked for repeated user page vandalism")', 'User page vandal', '');
		mw.util.addPortletLink('blockfunc', 'javascript:blockTagAdd("uw-sblock", "You have been blocked for spam")', 'Spamming', '');
		mw.util.addPortletLink('blockfunc', 'javascript:blockTagAdd("Drmspeedy5", "You have been blocked for continued removal of CSD templates")', 'Speedy removal', '');

		mw.util.addPortletLink('blockfunc', 'javascript:void(0)', '---', '');

		mw.util.addPortletLink('blockfunc', 'javascript:blockTagAdd("uw-block1", "You have been blocked")', 'Level 1', '');
		mw.util.addPortletLink('blockfunc', 'javascript:blockTagAdd("uw-block2", "You have been blocked")', 'Level 2', '');
		mw.util.addPortletLink('blockfunc', 'javascript:blockTagAdd("uw-block3", "You have been indefinitely blocked")', 'Level 3i', '');
		mw.util.addPortletLink('blockfunc', 'javascript:blockTagAdd("uw-tblock", "You have been blocked for making death threats")', 'Death threats (tmp)', '');
		mw.util.addPortletLink('blockfunc', 'javascript:blockTagAdd("uw-lblock", "You have been blocked for making legal threats")', 'Legal threats (i)', '');

	}
}
addOnloadHook(add_warn_tabs);

function add_user_info() 
{ 
	var insertpoint = document.getElementById('contentSub');

	if ( wgNamespaceNumber == 3 ) {

		newDiv = document.createElement('div');

		thisBox = document.createElement('iframe');
		thisBox.setAttribute('src', 'http://wikitools.annoyed.org/le.php?user=' + wgTitle + '&quick=1');
		thisBox.setAttribute('width', '100%');
		thisBox.setAttribute('height', 75);
		thisBox.setAttribute('frameborder', 0);
                thisBox.setAttribute('style', 'border-bottom: 1px dotted black; padding:0px; margin:0px;');

		exLink = document.createElement('a');
		txtNode = document.createTextNode('toggle');
		uinfoState = 0;
		exLink.appendChild(txtNode);
		exLink.setAttribute('href', 'javascript:void();');
		exLink.addEventListener('click', function() {
			if (!uinfoState)
			{
				thisBox.style.height = '300px';
				uinfoState = 1;
			} else {
				thisBox.style.height = '75px';
				uinfoState = 0;
			}
		}, true);

		newDiv.appendChild(exLink);
		newDiv.appendChild(document.createElement('br'));
		newDiv.appendChild(thisBox);

		insertpoint.parentNode.insertBefore(newDiv, insertpoint);

	}
}
addOnloadHook(add_user_info);

// Top submit button
function add_top_submit() 
{ 
	var insertpoint = document.getElementById('wpTextbox1');

	if ( wgNamespaceNumber == 3 && ( QueryString.equals( 'action', 'edit' ) || QueryString.equals( 'action', 'submit' ) || QueryString.equals('action', 'editredlink') ) ) {
		newDiv = document.createElement('div');
		newDiv.setAttribute('align', 'right');

		btn = document.createElement('input');
		btn.setAttribute('name', 'wpSave');
		btn.setAttribute('type', 'submit');
		btn.setAttribute('value', 'Save page');

		newDiv.appendChild(btn);
		insertpoint.parentNode.insertBefore(newDiv, insertpoint);
	}
}
addOnloadHook(add_top_submit);
// </nowiki>