User:Manticore/monobook.js

From Uncyclopedia, the content-free encyclopedia
Jump to navigation Jump to search

Note: After saving, you have to bypass your browser's cache to see the changes.

  • Internet Explorer: hold down the Ctrl key and click the Refresh or Reload button, or press Ctrl+F5.
  • Firefox: hold down the Shift key while clicking Reload; alternatively press Ctrl+F5 or Ctrl-Shift-R.
  • Opera, Konqueror and Safari users can just click the Reload button.
  • Chrome: press Ctrl+F5 or Shift+F5
//<pre><nowiki>
// Editcount link for contribs
if( wgCanonicalSpecialPageName == 'Contributions' )
	addOnloadHook( editcountlink );

function editcountlink() {
	var cs = document.getElementById('contentSub');
	// poorman contribs type finder. -1 = existing user
	try {
		var ctype = cs.getElementsByTagName('a')[0].href.indexOf('User_talk');
	} catch( e ) {
		var ctype = -1;
	}

	var inputs = document.getElementsByTagName('input');
	var targ;
	for( var i = 0; i < inputs.length; i++ ) {
		if( inputs[i].name == 'target' )
			targ = inputs[i].value;
	}
	if( !targ )
		return;

	if( ctype = -1 )
		insertContentSubContribLink('/wiki/Special:Editcount/' + targ, 'Editcount');
}

function insertContentSubContribLink( link, text ) {
	var cs = document.getElementById('contentSub');
	var icssep = document.createTextNode(' | ');
	var ics = document.createElement('a');
	ics.href = link;
	ics.setAttribute('title', ics.href);
	ics.appendChild( document.createTextNode( text ) );
	try {
		cs.insertBefore( icssep, cs.childNodes[cs.childNodes.length-1] );
		cs.insertBefore( ics, cs.childNodes[cs.childNodes.length-1] );
	} catch( e ) {
		cs.appendChild( document.createTextNode( '(Error: contentSub still empty! Inserting... ' ) );
		cs.appendChild( ics );
	}
}

// *****************************************************************
// Load various external scripts
// *****************************************************************
importScriptURI('http://www.wikia.com/index.php?title=User:Splarka/fastdelete.js&action=raw&ctype=text/javascript&dontcountme=s');
importScriptURI('http://en.wikipedia.org/w/index.php?title=User:Zocky/SearchBox.js&action=raw&ctype=text/javascript&dontcountme=s');

// *****************************************************************
// Custom automatic delete buttons
// *****************************************************************
// Adds customizable one-click deletion buttons to any deletable page.
// Requires w:User:Splarka/fastdelete.js
var fdButtons = [];
fdButtons[fdButtons.length] = {
	'summary': '[[Uncyclopedia:QuickVFD|QVFD]]',
	'label': 'qvfd'
};
fdButtons[fdButtons.length] = {
	'summary': '[[Uncyclopedia:Intensive Care Unit|ICU expired]]',
	'label': 'icu'
};
fdButtons[fdButtons.length] = {
	'summary': '[[:Category:Work In Progress|Abandoned WIP]]',
	'label': 'wip'
};

//</nowiki></pre>