User:TRJ-VoRoN/global.js

importArticles({   type: "script",    articles: [        'u:dev:MediaWiki:RecentChangesMultiple/code.2.js',        'u:dev:MediaWiki:GlobalNavButtons.js',        'u:dev:MediaWiki:WantedPagesFilter/code.js',        'u:dev:MediaWiki:ToggleSideBar/code.js',        'u:dev:MediaWiki:AjaxDelete/code.js',        'u:dev:MediaWiki:PurgeButton/code.js',        'u:dev:MediaWiki:LastEdited/code.js'    ] });

mw.loader.using("oojs-ui").then(   function  {        var changeThemeButton = new OO.ui.ButtonWidget({ icon: "puzzle", title: "Изменить тему", id: "nkch-theme-button" });

var body = document.body;

changeThemeButton.$element[0].addEventListener("click", function (e) {           var currentTheme, themeToChange;

if (body.classList.contains("theme-fandomdesktop-light")) { currentTheme = "light"; themeToChange = "dark"; } else if (body.classList.contains("theme-fandomdesktop-dark")) { currentTheme = "dark"; themeToChange = "light"; }

body.classList.remove("theme-fandomdesktop-" + currentTheme); body.classList.add("theme-fandomdesktop-" + themeToChange);

$.ajax({               method: "GET",                url: encodeURI(mw.config.get("wgServer") + mw.config.get("wgScriptPath") + "/wikia.php"),                data: {                    controller: "ThemeApi",                    method: "themeVariables",                    variant: themeToChange                }            }).done(                function (data) {                    mw.util.addCSS(data);                }            ); }, false);

document.querySelector(".fandom-community-header__top-container .wiki-tools a").before(changeThemeButton.$element[0]); mw.util.addCSS("#nkch-theme-button .oo-ui-buttonElement-button { color: var(--theme-body-text-color); padding: 5px 6px; }") } );

window.lastEdited = { comment: false, };

/*Менюшки*/ window.globalNavButtons = [ {   text: 'Моё', url: '', isMain: true, whoIsMain: false, shortName: '0' },     {    text: 'TBOI', url: 'https://bindingofisaac.fandom.com/ru/', isMain: false, whoIsMain: '0', shortName: '' },          {    text: 'Dead Cells', url: 'https://dead-cells.fandom.com/ru/', isMain: false, whoIsMain: '0', shortName: '' },            {    text: 'Indie', url: 'http://ru.indiegames.wikia.com/ru/', isMain: false, whoIsMain: '0', shortName: '' },      {    text: 'HK', url: 'https://hollowknight.fandom.com/ru/', isMain: false, whoIsMain: '0', shortName: '' },        {    text: 'Кастла', url: 'https://castlevania.fandom.com/ru/', isMain: false, whoIsMain: '0', shortName: '' },          {    text: 'СМБ', url: 'https://supermeatboy.fandom.com/ru/', isMain: false, whoIsMain: '0', shortName: '' },

{   text: 'Слежка', url: 'https://bindingofisaac.fandom.com/ru/wiki/Участник:TRJ-VoRoN/Правки', isMain: false, whoIsMain: '0', shortName: '' },

{   text: 'Вики', url: '', isMain: true, whoIsMain: false, shortName: '1' },       {   text: 'Основная', url: 'https://community.fandom.com/ru/', isMain: false, whoIsMain: '1', shortName: '' },         {    text: 'Викии Вики', url: 'https://wikies.fandom.com/', isMain: false, whoIsMain: '1', shortName: '' },

{   text: 'Forest', url: 'https://the-forest.fandom.com/ru/', isMain: false, whoIsMain: '1', shortName: '' },

{   text: 'Etg', url: 'https://enter-the-gungeon.fandom.com/ru/', isMain: false, whoIsMain: '1', shortName: '' },             {    text: 'Messenger', url: 'http://ru.the-messenger.wikia.com/ru/', isMain: false, whoIsMain: '1', shortName: '' },

{       text: 'Ссылки', url: '', isMain: true, whoIsMain: false, shortName: '2' },         {    text: 'MultipleActivity', url: '/ru/wiki/Special:MultipleActivity', isMain: false, whoIsMain: '2', shortName: '' },    {    text: 'Изменить Нав меню', url: '/ru/wiki/MediaWiki:Wiki-navigation?action=edit', isMain: false, whoIsMain: '2', shortName: '' },   {    text: 'MediaWiki:ImportJS', url: '/ru/wiki/MediaWiki:ImportJS', isMain: false, whoIsMain: '2', shortName: '' },   {    text: 'Discord ID Custom', url: '/ru/wiki/MediaWiki:Custom-Discord-id', isMain: false, whoIsMain: '2', shortName: '' },       {    text: 'Project:Medals', url: '/ru/wiki/Project:Medals', isMain: false, whoIsMain: '2', shortName: '' },       {    text: 'MediaWiki:Edittools', url: '/ru/wiki/MediaWiki:Edittools', isMain: false, whoIsMain: '2', shortName: '' },        {    text: 'Кастом уведомления', url: '/ru/wiki/MediaWiki:Custom-WikiaNotifications', isMain: false, whoIsMain: '2', shortName: '' },          {    text: 'Править Global JS', url: 'https://community.fandom.com/wiki/User:TRJ-VoRoN/global.js?action=edit', isMain: false, whoIsMain: '2', shortName: '' }, ];

/*Менюшки окончены*/ $( '#wpTextbox1' ).on( 'wikiEditor-toolbar-doneInitialSections', function {    $( '.mw-editTools' ).appendTo( '.section-characters' ); } );

window.customToolbarLinks = [ { // Link added to "My Tools" menu action: "link", title: "Edit Dev Common CSS", placement: "myTools", address: "w:c:dev:Special:MyPage/common.css?action=edit", },   { // Single script import action: "import", title: "CQL", placement: "myTools", scripts: [ "MediaWiki:CodeQuickLinks/code.js" ]   },    { // Single stylesheet import action: "import", title: "Dark Nav", placement: "toolbar", styles: [ "DarkScrollingGlobalNav.css" ]   },    { // Import scripts and stylesheets action: "import", title: "PseudoMonobook Tools", placement: "toolbar", scripts: [ "ToggleSideBar/code.js", "SkinSwitchButton/code.js" ],       styles: [ "PseudoMonobook.css", "Highlight.css" ]   } ];

$(function{ $('.page-header__actions').prepend('');

mw.hook('dev.wds').add(function(wds) {   $('#mobilelink').append( $(' ', {           'id': 'dev-wds-icons-pages'        }) );   $('#oasislink').append( $(' ', {           'id': 'dev-wds-icons-gear-small'        }) );   wds.render('#mobilelink');    wds.render('#oasislink'); }); });