User:Mainframe98/common.js

mw.loader.using( 'mediawiki.util' ); /** */ ( function ( mw, $ ) {	$( document ).ready( function { if ( typeof mw.util === 'undefined' ) { return; }		mw.util.addPortletLink(			'p-personal',			'/wiki/User:Mainframe98/Sandbox', //url			'Zandbak', //Name displayed			'pt-mysandbox',			'Ga naar de zandbak', //Tooltip			null,			'#pt-preferences'		); });
 * Adds a Sandbox button, originally from https://www.wikidata.org/wiki/MediaWiki:Gadget-mySandbox.js, but that version used a localized subpagename.
 * Tweaked to remove redundancy
 * Removed a lot of code due to issues.

// Replace Gittiles with Diffusion if ( $( 'body' ).hasClass( 'ns-102' ) || $( 'body' ).hasClass( 'ns-106' ) ) { var browseRow = $( 'table > tr > div.plainlinks > ul' ).children( 'li' ).eq( 1 ); var repoUrl = browseRow.first.attr( 'href' ); browseRow.first.attr( 'href', 'https://phabricator.wikimedia.org/r/p/' + repoUrl.replace( 'https://gerrit.wikimedia.org/g/', '' ) ); } }( mediaWiki, jQuery ) );