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',        'u:dev:MediaWiki:NullEditButton/code.js',    ] });

var config = mw.config.get([   'wgFormattedNamespaces',    'wgUserName',    'wgScriptPath' ]);

$('.global-navigation .global-navigation__links').html(' DEV    DOM    JS  <span class="global-navigation__icon has-background"><svg class="wds-icon wds-icon-small"><use xlink:href="#wds-icons-gear">  <span class="global-navigation__label">CSS  <div href="' + config.wgScriptPath + '/wiki/' + config.wgFormattedNamespaces[2] +':' + config.wgUserName + '/Восьмидневник" class="global-navigation__link"><span class="global-navigation__icon has-background"><svg class="wds-icon wds-icon-small"><use xlink:href="#wds-icons-bold">  <span class="global-navigation__label">DRAFT  <div href="' + config.wgScriptPath + '/wiki/Special:AllPages?from=&to=&namespace=8" class="global-navigation__link"><span class="global-navigation__icon has-background"><svg class="wds-icon wds-icon-small"><use xlink:href="#wds-icons-pages">  <span class="global-navigation__label">MW  ')

$('.global-navigation .global-navigation__links div').on('click', function {       var href = $(this).attr('href')        window.open(href, '_blank'); });

$(function{ $('a').each(function{ var href = $(this).attr('href') $(this).click(function {   if(event.ctrlKey == true){        $(this).attr('href', href + "?action=edit")    } });});});

var config = mw.config.get(['wgScriptPath']); $('.wiki-tools').prepend('<a href="' + config.wgScriptPath + '/wiki/Special:SocialActivity" class="wds-button wds-is-secondary " title="Соц. активность"><svg class="wds-icon wds-icon-small"><use xlink:href="#wds-icons-bullet-list-small"> </a>'); $('.global-navigation__icon .wds-avatar .wds-avatar__image').wrap('<a href="' + config.wgScriptPath + '/wiki/Special:MyPage"></a>'); }); });