User:ARandomCitizen/global.js

importArticles(	{   		type: 'script',		articles: [   			'u:dev:MediaWiki:VEButton.js',			'u:dev:MediaWiki:ThemeToggler.js',			'u:dev:MediaWiki:HeaderLinks/code.js', 			'u:dev:MediaWiki:OriginalImages.js',			'u:dev:MediaWiki:ListFiles/code.js',			'u:dev:MediaWiki:CatFilter/code.js',		]	} ); $( function {	$('aside.page__right-rail').prepend( $(' ', { id: 'stickyRightRailButton'} ).prepend(			$("button.right-rail-toggle").css({'position':'sticky', 'top':'58px'})		).css({'position':'absolute', 'right':'0', 'height':'100%', 'padding-bottom':'430px', 'padding-top':'15px'}) ); });

$( function {	$('#my-tools-menu.wds-list').append( $('', {'class':'overflow'}).append(   	$('', { href: mw.util.getUrl('User:ARandomCitizen/sandbox'), text: 'Sandbox' })	) ); } );

$( function {	$('.wds-dropdown.explore-menu ul.wds-list.wds-is-linked').append( $('').append(   		$('', { href: mw.util.getUrl('Special:SocialActivity') }).append( $(' ', { text: 'Social' }) )   	)    ); } );

$( function {	var allpagesbutton = '.fandom-community-header__local-navigation .explore-menu > .wds-dropdown__content > ul.wds-list > li:nth-child(3)';	$(allpagesbutton).addClass('wds-dropdown-level-nested is-calculated').after( $('').prepend(			$('', { href: '/wiki/Special:Log', text: 'Logs' })		)	).find('a').addClass('wds-dropdown-level-nested__toggle').append( $(' ') ).after( $(' ',{'class': 'wds-is-not-scrollable wds-dropdown-level-nested__content'}).append(			$('', {'class': 'wds-list wds-is-linked'}).append( $('').append(					$('',{ href: '/wiki/Special:AllPages?from=&to=&namespace=10', text: 'Templates' })				),				$('').append(					$('',{ href: '/wiki/Special:AllPages?from=&to=&namespace=8', text: 'MediaWiki' })				),				$('').append(					$('',{ href: '/wiki/Special:AllPages?from=&to=&namespace=828', text: 'Modules' })				)			)		)	); } );

$(function {	$('.action-submit .page.page-is-edit .page__main').append( $(' ', { id: 'ToggleRightRailPreview-container'}).append(			$(' ', { id:'ToggleRightRailPreview'}).append( $(' ', { text: 'Rail' }) )   	)    );    $('#ToggleRightRailPreview-container').css({'position': 'absolute', 'top': '50px', 'right': '-15px', 'height': '100%', 'padding-bottom': '430px'});    $("#ToggleRightRailPreview").css({'position': 'sticky', 'top': '75px'});    var checkRightRailPreview = 0;    $("#ToggleRightRailPreview").click(function { if (checkRightRailPreview === 0) { $('#wikiPreview .mw-parser-output').css({'width': 'calc(100% - 336px)'}); checkRightRailPreview = 1; } else { $('#wikiPreview .mw-parser-output').removeAttr('style'); checkRightRailPreview = 0; }	} ); } );

$( function {	var wikiname = mw.config.get('wgDBname');	if ((wikiname === 'wikia') || (wikiname === 'dev')) {		// stolen from dev:ThemeToggler		$.when( $.get(mw.util.wikiScript( 'wikia' ) + '?controller=ThemeApi&method=themeVariables&variant=dark&cb=' + ( new Date.getTime ) ), $.get( mw.util.wikiScript( 'load' ) + '?modules=ext.fandom.DesignSystem.GlobalNavigation.brand.dark.css%7Cext.fandom.DesignSystem.brand.dark.css&only=styles' ) )		.done( function( wikiTheme, brandTheme ) { var css = wikiTheme[0] + brandTheme[0]; var $s = $( ' ' ).attr( 'id', 'pcjThemeSwitch' ).appendTo('body'); $($s).text(css); $( 'body' ).removeClass( 'theme-fandomdesktop-light' ).addClass( 'theme-fandomdesktop-dark' ); mw.config.set( 'isDarkTheme', !mw.config.get( 'isDarkTheme' ) ); } );	} } );

$( function {	if ($('body').hasClass('is-gamepedia')) {		$('#my-tools-menu.wds-list').prepend( $('', {'class':'overflow'}).append(   		$('<a>', { href: '/wiki/Special:CargoTables/', text: 'Cargo' })			)		);	} }); /*$( function {	// visual	mw.hook( 've.activationComplete' ).add( function { if ($('#ToggleRightRailPreview-ve').length === 0) { $('.page__main').append(				$(' ', { id:'ToggleRightRailPreview-ve'}).append( $(' ', { text: 'Rail' }) )   		);		}		$("#ToggleRightRailPreview-ve").css({'position': 'absolute', 'top': '50px', 'right': '-15px'}); var checkRightRailPreview_ve = 0; $("#ToggleRightRailPreview-ve").click(function {   		if (checkRightRailPreview_ve === 0) {    			$('#content .ve-ui-surface-visual').css({'width': 'calc(100% - 286px)'});    			checkRightRailPreview_ve = 1;    		} else {    			$('#content .ve-ui-surface-visual').removeAttr('style');    			checkRightRailPreview_ve = 0;    		}		} ); } );	//visual source	mw.hook( 'wikipage.content' ).add( function { $('.ve-ui-summaryPanel-previewButton .oo-ui-buttonElement-button').click(function{			if ($('#ToggleRightRailPreview-vse').length === 0) {				$('.oo-ui-window-content').append( $(' ', { id:'ToggleRightRailPreview-vse'}).append(   					$(' ', { text: 'Rail' })     				) );			}		});	} ); } );