User:MetroKaiser/global.js

//1. Imports importArticles({   type: "script",    articles: [        'u:dev:MediaWiki:FollowDropdown/code.js',        'u:dev:MediaWiki:WallGreetingButton/code.js',        'u:dev:MediaWiki:ViewRemoved/code.js',        'u:dev:MediaWiki:DiscussionsActivity.js',        'u:dev:MediaWiki:ContribsLink/code.js',        'u:dev:MediaWiki:TopicBlockLog/code.js'    ] });

//2. WAM window.railWAM = { logPage: 'Участник:MetroKaiser/WAM log', loadOnPage: 'Служебная:WikiActivity', lang: 'ru', }; importArticles({   type: 'script',    articles: [        // ...        'u:dev:MediaWiki:RailWAM/code.js'    ] });

//3. Navigation scroll (function {   setInterval(function { var oldScrollY = window.pageYOffset || document.documentElement.scrollTop; window.onscroll = function { var scrolled = window.pageYOffset || document.documentElement.scrollTop; var dY = scrolled - oldScrollY; if ( dY > 0 ){ $("#globalNavigation").slideUp(300); } else { $("#globalNavigation").slideDown(300); }       };    }, 1); });

//4. Favorite wikies in the navigation var spanWiki = document.querySelector('.wds-dropdown__toggle span'); spanWiki.innerHTML = 'Вики'; window.gnWikiLinks = ['//ru.polandball.wikia.com|Polandball Вики', '//rainbowsix.wikia.com.wikia.com|Rainbow Six Wiki', '//ru.rainbowsix.wikia.com|Rainbow Six Вики', '//ru.wikies.wikia.com|Викии Вики', '//ru.five-nights-at-freddys.wikia.com|FNaF Вики']; $(function {    var $menu = $('.wds-global-navigation__link-group .wds-list'),        links = window.gnWikiLinks || [];    if (!$menu.length || !links.length) return;    links.forEach(function (v) { var link = v.replace(/\[|\]/g, ''), $a = $('', {               href: (/(.*?)\||$/.exec(link) || {})[1] || link,                text: (/\|(.*)/.exec(link) || {})[1] || link,                title: link        }); $menu.prepend($('').append($a)); }); });