User:Arhhhat/global.js

mw.loader.using('mediawiki.util').then(function { $(function{ importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:PortableCSSPad/code.js',        'u:dev:MediaWiki:QuickDiff/code.js',        'u:dev:MediaWiki:PurgeButton/code.js',        'u:dev:MediaWiki:ProtectionIcons.js',        'u:dev:MediaWiki:View_Source/code.js',        'u:dev:MediaWiki:ThemeToggler.js',    ] });

/*Выпадающее меню https://dev.fandom.com/wiki/MediaWiki:CodeLinksDropdown.js*/ $('.wds-global-navigation__user-menu .wds-dropdown__content').addClass('wds-is-not-scrollable'); mw.hook('dev.i18n').add(function (lib) {   lib.loadMessages('CodeLinksDropdown').then(function (i18n) { var config = mw.config.get([           'wgFormattedNamespaces',            'wgUserName',            'wgScriptPath'        ]); $('.wds-dropdown.wds-open-to-right.is-attached-to-bottom > .wds-dropdown__content > ul.wds-list > li:nth-child(2)').after(           ''+                '' +                    i18n.msg('codelinks').escape +                     '' +                        '' +                        ' ' +                    ' ' +                '' +                    '' + '' + ''+ 'Common.js' + '' + ''+ 'Wikia.js' + '' + ''+ 'Common.css</a>' + '</li>' + ''+ 'Wikia.css</a>' + '</li>' + ''+ 'Восьмидневник</a>' + '</li>' + '</ul>' + ' ' +           '</li>' );   }); }); importArticle({ type: 'script', article: 'u:dev:I18n-js/code.js' }); $('.wds-dropdown-level-2 .wds-dropdown-level-2__content .wds-list.wds-is-linked>li#quick-cup').remove; $('.wds-dropdown-level-2 .wds-dropdown-level-2__content .wds-list.wds-is-linked>li>a[data-id="contributions"]').remove; $('.wds-dropdown-level-2 .wds-dropdown-level-2__content .wds-list.wds-is-linked>li#MySandbox>a').remove;

mw.loader.using('mediawiki.api').then(function{	if (mw.config.get('wgWikiaEnvironment') !== "sandbox") return;	if (mw.config.get('skin') === "fandomdesktop") return;	if (mw.config.get('wgCanonicalSpecialPageName') === "ThemeDesigner") return;	new mw.Api.saveOption('skin','fandomdesktop').then(function { location.reload; }); });

mw.hook('dev.wds').add(function(wds) {	   $('.page-side-tools').append('<button class="page-side-tool view-source-toggle" data-wds-tooltip="View Source" data-wds-tooltip-position="right" data-tooltip-attached="1"> ');	    $('.view-source-toggle').append( wds.icon('link') );        wds.render('.page-side-tools');    });

importArticle({ type: 'script', article: 'u:dev:MediaWiki:WDSIcons/code.js' });

$('.view-source-toggle').not('.changed-source').click( function {			window.dev.viewSource.loadSource           $(this).addClass('changed-source')		}) }); });