User:Maralia/monobook.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.
var magicURL = "http://www.amazon.com/gp/search?ie=UTF8&field-isbn=MAGICNUMBER&tag=wikipedia08-20"; //sets ISBN lookup

importScript('User:Dr pda/articlehistory.js');		//adds link to look up oldids 				[[User:Dr pda/articlehistory.js]]
importScript('User:Dr pda/editrefs.js');		//adds link to edit all refs 				[[User:Dr pda/editrefs.js]]
importScript('User:Lunchboxhero/externISBN.js'); 	//external search on ISbN 				[[User:Lunchboxhero/externISBN.js]]
importScript('User:Alex Smotrov/histcomb.js');		//combines consecutive edits in history 		[[User:Alex Smotrov/histcomb.js]]
importScript('User:Gary King/nominations viewer.js');	//collapse subpages at WP:FAC/WP:FAR/WP:PR		[[User:Gary King/nominations viewer.js]]
importScript('User:Dr_pda/prosesize.js');		//adds link to check prose size 			[[User:Dr pda/prosesize.js]]
importScript('User:Splarka/dabfinder.js'); 		//adds link to check for redirects 			[[User:Splarka/dabfinder.js]]
importScript('User:PleaseStand/segregate-refs.js'); 	//adds button to segregate refs                	        [[User:PleaseStand/segregate-refs.js]]
importScript('User:Anomie/ajaxpreview.js');             //adds button to preview w/ refs                        [[User:Anomie/ajaxpreview.js]]
importScript('User:Dr pda/generatestats.js');           //stats generator for long FAs etc                      [[User:Dr pda/generatestats.js]]

// Add view subpages link to toolbox
if (wgNamespaceNumber > 0){
$(function(){
mw.util.addPortletLink('p-tb', mw.config.get('wgServer')+mw.config.get('wgScript')+'?title=Special:Prefixindex/'+wgPageName+'&limit=100',
'All subpages', 't-prefix', 'View subpages of this page', '', document.getElementById('t-upload'))
})}

/* Add custom US ship changes link links to the interaction bar
*addOnloadHook(function () {
*addPortletLink('p-interaction', 'http://en.wikipedia.org/wiki' + 
*'/Special:RecentChangesLinked/Wikipedia:WikiProject Ships/Articles US','US ship changes')
*});
*/

// rename some other sidebar links
$(function(){ if(document.getElementById("pt-mytalk")){document.getElementById("pt-mytalk").firstChild.innerHTML = "Talk";}});
$(function(){ if(document.getElementById("pt-preferences")){document.getElementById("pt-preferences").firstChild.innerHTML = "Preferences";}});
$(function(){ if(document.getElementById("pt-watchlist")){document.getElementById("pt-watchlist").firstChild.innerHTML = "Watchlist";}});
$(function(){ if(document.getElementById("pt-mycontris")){document.getElementById("pt-mycontris").firstChild.innerHTML = "Contributions";}});

/*wikEd debugging
*var wikEdConfig = { 'debugging': true };
*/

//wikEd avoid duplicating edit notices
var wikEdConfig = { 'doCloneWarnings': false };

// Get section links easier, from User:Zhaofeng Li/common.js
function displaySectionLink( e ) {
	var pagename = mw.config.get( "wgPageName" ).replace( /\_/g, " " );
	var section = $( e ).text();
	$( e ).text( "[[" + pagename + "#" + section + "]]" )
	      .css( "font-family", "monospace" );
}
$( ".mwgadget-headline-anchor" ).remove();
$( ".mw-headline" ).each( function( i, e ) {
	var anchor = $( "<a>" ).text( "¶" )
	                       .addClass( "mwgadget-headline-anchor" )
	                       .css( { "color": "#ccc", "margin-right": "5px" } )
	                       .attr( "href", "#" + $( e ).attr( "id" ) )
	                       .click( function() { displaySectionLink( e ); } );
	$( e ).before( anchor );
} );