User:UnboxingHan/global.js

//Code links script with a little adjustments from on Gamepedia $( function { 'use strict';

var interwikiTable; var interwikiRequest = $.Deferred; mw.hook( 'wikipage.content' ).add( function( $content ) {   const codeWrap = ['#theme-solarized-light', '.de1'];    const commentElement = ['.coMULTI', '.co1'];    var t, len;    var tmp = [];    var $code;        for (t = 0, len = codeWrap.length; t < len; t++) {            $code = $content.find(codeWrap[t]);        }	if ( window.mcw && mcw.onlyLinkComment ) {	    for (t = 0, len = commentElement.length; t < len; t++) {	        tmp.join($code.find(commentElement[t]));	    }        $code = tmp;	}	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 u:dev:PseudoMonobook 'Modern Polls= 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',        'u:dev:MediaWiki:EditBio/code.js',    ] });

$(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("+"); });