User:Akodone/global.js

/* All scripts here are from Dev and/or written by Rail */ /* Opis przy usuwaniu */ if (mw.config.get('wgAction') === 'delete' && !!document.getElementById('wpReason')) { document.getElementById('wpReason').value = ''; }

// Add RecentChanges to nav tools dropdown mw.loader.using( 'mediawiki.util', function {   if ( mw.config.get( 'skin' ) !== 'fandomdesktop' ) {        return;    }    const toolsDropdown = document.querySelector( '.fandom-community-header .wiki-tools .wds-list' );    const rcElement = document.createElement( 'li' );    const rcLink = document.createElement( 'a' );    rcLink.setAttribute( 'href', mw.util.getUrl( mw.config.get( 'wgFormattedNamespaces' )[-1]  + ':RecentChanges' ) );    rcLink.innerText = 'Ostatnie zmiany';    rcElement.appendChild( rcLink );    toolsDropdown.prepend( rcElement ); } );

// Quick theme changer mw.loader.using( ['mediawiki.api', 'mediawiki.util'], function {	if ( mw.config.get( 'skin' ) !== 'fandomdesktop' ) {		return;	}	function themeSwitch( theme ) {		new mw.Api.saveOption( 'theme', theme ).done( function( d ) { if ( d.options === 'success' ) { location.reload; }		} );	}	$( '.fandom-community-header__community-name-wrapper' ).append( $( ' ', { class: 'quick-theme-switcher' } ).append(			$( '', { text: '(light)', href: '#', click: function { themeSwitch( 'light' ); }			} ), ' ',			$( '', { text: '(dark)', href: '#', click: function { themeSwitch( 'dark' ); }			} ), ' ',			$( '', { text: '(wiki)', href: '#', click: function { themeSwitch( 'wiki' ); }			} )		)	); } );

/* Skrypty z Dev */ window.fdButtons = [ {       summary: 'Nieużywany plik', label: 'NU' },   {        summary: 'Brak licencji', label: 'BL' },   {        summary: 'Niedziałający film', label: 'F'   }, {       summary: 'Niepotrzebna strona', label: 'NP' },   {        summary: 'Niepotrzebny szablon', label: 'NS' },   {        summary: 'Zbędne przekierowanie', label: 'ZP' },   {        summary: 'Wandalizm', label: 'W'   }, {       summary: 'Spam', label: 'S'   }, {       summary: 'Prośba autora', label: 'PA' } ]; window.globalNavBehavior = { onScrollUp: 'show', onScrollDown: 'hide', };

/* Importy */ importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:AjaxBatchDelete/code.2.js',        'u:dev:MediaWiki:ListFiles/code.js',        'u:dev:MediaWiki:GlobalNavBehavior.js',        'u:dev:MediaWiki:FastDelete/code.js',        'u:dev:MediaWiki:MassRename/code.js',        'u:dev:MediaWiki:UserActivityLink.js',        'u:dev:MediaWiki:MassCategorization/code.js',        'u:dev:MediaWiki:SyntaxHighlight.js',        //'u:dev:ReferencePopups/code.js',        //'u:dev:MediaWiki:Deadvideo/code.js',        //'u:dev:MediaWiki:FileUsageAuto-update/code.js',        //'u:dev:MediaWiki:GlobalEditcount/code.js',        //'u:dev:MediaWiki:EditConflictAlert/code.js',    ] });