User:UnboxingHan/global.js

//Code links script with a little adjustments from a admin on Gamepedia... Special:MyPage $( function { 'use strict';

var interwikiTable; var interwikiRequest = $.Deferred; mw.hook( 'wikipage.content' ).add( function( $content ) {	var $code = $content.find( '#theme-solarized-light' );	if ( window.mcw && mcw.onlyLinkComment ) {		$code = $code.find( '.coMULTI' );	}	if ( !$code.length ) {		return;	}	if ( !interwikiTable ) {		mw.loader.using( 'mediawiki.api', function { new mw.Api.get( {				action:'query',				meta:'siteinfo',				siprop:'interwikimap'			} ).done( function( data ) {				interwikiTable = data.query.interwikimap.reduce( function( obj, val ) { obj[val.prefix] = val.url; return obj; }, {} );				interwikiRequest.resolve;			} ); } );	}	interwikiRequest.done( function { $code.html( function( _, html ) {			return html.replace( /(?:\[\[([^\[\]#<>\|{}\n]*?)\]\]|((\w*?:)?(mailto:|MAILTO:|\/\/)[\w\-\._~@&]+\.[\w\-\._~@&]+(:\d+)?(\/[\w\-\._~\/&:]*)?(\?[\w\-\._~=&:\/;]*)?(#[\w\-\._~&:]*)?))/g, function( m, wiki, ext ) { if ( wiki ) { var parts = wiki.split( ':' ), url = '/' + wiki; parts[1] = parts.slice( 1 ).join( ':' ); if ( interwikiTable[parts[0].toLowerCase] ) { url = interwikiTable[parts[0].toLowerCase].replace( /\$1/, parts[1] ); }						return '' + mw.html.escape( wiki ) + ''; } else if ( ext ) { return '' + ext + ''; }			} );		} );	} ); } );

} );

window.SS = { skins: [ //'PseudoMonobook = u:dev:MediaWiki:PseudoMonobook.css', unused 'Modernization = u:dev:MediaWiki:FandomizedActivityFeed.css|u:dev:MediaWiki:ModernPolls.css' ] };

window.AdvancedOasisUI = { activity2RC: true };

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:SkinSwitch.js',        'u:dev:MediaWiki:AdvancedOasisUI/code.js'    ] });

/*document.getElementsByClassName('wds-community-header__wiki-buttons')[0].getElementsByClassName('wds-dropdown__content')[0].firstChild.getElementsByTagName('a')[2] = { href: '/wiki/Special:WikiActivity', innerHTML: ' Wiki Activity', }; $(function{   $('a[data-tracking="more-recent-changes"]').attr('href','/wiki/Special:WikiActivity');    $('a[data-tracking="more-recent-changes"]').text('Wiki Activity');    $('a[data-tracking-label="start-a-wiki"]').text("+"); });