User:JJMC89/common.js

/*** Local Scripts ***/

importScript('MediaWiki:Gadget-protectionNotices.js');

importScript('MediaWiki:Gadget-SysopTools.js');

importScript('MediaWiki:Gadget-codeBacklinks.js');

importScript('User:JJMC89/AjaxPatrolLinks.js');

importScript('User:JJMC89/ajaxRollback.js');

/*** /Local Scripts ***/

/*** External Scripts ***/

importScriptURI('//en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js' + '&action=raw&ctype=text/javascript');//en:w:User:Cacycle/wikEd

autoEdClick = false;//disables the diff page from opening automatically (required for wikEd compatability) mw.loader.load('//en.wikipedia.org/w/index.php?title=Wikipedia:AutoEd/complete.js&action=raw&ctype=text/javascript');//en:w:Wikipedia:AutoEd

mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Lenore/autolink.js&action=raw&ctype=text/javascript');//en:w:User:Lenore/autolink

/* * Add custom delete reasons * Author: Krinkle * File:Krinkle_addDeleteReasons.js * http://meta.wikimedia.org/wiki/User:Krinkle/Scripts/addDeleteReasons * http://meta.wikimedia.org/wiki/User:Krinkle/Scripts/addDeleteReasons.js */ $.getScript('http://meta.wikimedia.org/w/index.php?title=User:Krinkle/Scripts/addDeleteReasons.js&action=raw&ctype=text/javascript', function{ krAddDeleteReasons.File('Image of an item that never existed');  krAddDeleteReasons.File('Invalid file extension per Naming policy');  krAddDeleteReasons.File('Name corrected per Naming policy'); });

/*** /External Scripts ***/

/** * Make [rollback] and "blocklink" disappear on Watchlist, RecentChanges, and Contributions. * From User:Technical 13 */ if (wgPageName == "Special:Watchlist" || wgPageName == "Special:RecentChanges" || wgCanonicalSpecialPageName == "Contributions") { $('span.mw-rollback-link').remove; $('span.mw-usertoollinks').each(function {		$(this).children('a:last').replaceWith("-");		$(this).html($(this).html.replace(" | -", ""));	}); }

/** * Modify Sidebar * https://www.mediawiki.org/wiki/Manual:Interface/Sidebar#Add_or_remove_toolbox_sections_.28JavaScript.29 */ function ModifySidebar( action, section, name, link ) { try { switch ( section ) { //			case 'languages': //				var target = 'p-lang'; //				break; case 'toolbox': var target = 'p-tb'; break; //			case 'navigation': //				var target = 'p-navigation'; //				break; case 'navigation': var target = 'p-Site_navigation'; break; case 'forums': var target = 'p-Forums'; break; default: var target = 'p-' + section; break; }		if ( action == 'add' ) { var node = document.getElementById( target ) .getElementsByTagName( 'div' )[0] .getElementsByTagName( 'ul' )[0]; var aNode = document.createElement( 'a' ); var liNode = document.createElement( 'li' ); aNode.appendChild( document.createTextNode( name ) ); aNode.setAttribute( 'href', link ); liNode.appendChild( aNode ); liNode.className = 'plainlinks'; node.appendChild( liNode ); }		if ( action == 'remove' ) { var list = document.getElementById( target ) .getElementsByTagName( 'div' )[0] .getElementsByTagName( 'ul' )[0]; var listelements = list.getElementsByTagName( 'li' ); for ( var i = 0; i < listelements.length; i++ ) { if (					listelements[i].getElementsByTagName( 'a' )[0].innerHTML == name ||					listelements[i].getElementsByTagName( 'a' )[0].href == link				) {					list.removeChild( listelements[i] ); }			}		}	} catch( e ) { // let's just ignore what's happened return; } } function CustomizeModificationsOfSidebar { // adds User:JJMC89/Links to navigation ModifySidebar( 'add', 'navigation', 'My links', 'http://ddowiki.com/page/User:JJMC89/Links' ); // removes Related changes from toolbox ModifySidebar( 'remove', 'toolbox', 'Related changes' ); // removes Related changes from toolbox ModifySidebar( 'remove', 'toolbox', 'Printable version' ); } addOnloadHook( CustomizeModificationsOfSidebar );