User:.jun/global.js

document.getElementsByClassName('wds-global-navigation__search-input')[0].addEventListener('blur', function(elem) {   if (!elem.srcElement.value) {        document.getElementById('globalNavigation').classList.remove('wds-search-is-active');    } });

if (mw.config.get('wgCanonicalSpecialPageName') == 'Recentchanges') { Array.prototype.forEach.call(document.getElementsByClassName('rc-conntent')[0].querySelectorAll('a'), function(elem) {       if (elem.getAttribute('href') !== '#') {            elem.setAttribute('target', '_blank');        }    }); } window.ajaxCallAgain = window.ajaxCallAgain || []; window.ajaxCallAgain.push(function {   Array.prototype.forEach.call(document.getElementsByClassName('rc-conntent')[0].querySelectorAll('a'), function(elem) { if (elem.getAttribute('href') !== '#') { elem.setAttribute('target', '_blank'); }   }); }); window.ajaxPages = ['Special:RecentChanges', 'Special:WikiActivity'], window.ajaxRefresh = 30000;

Array.prototype.forEach.call(document.querySelectorAll('a[data-canonical="wikiactivity"]'), function(elem) {   elem.href = '/wiki/Special:Recentchanges';    elem.innerHTML = 'Recent changes'; });

var links = { debug: 'debug=true', qqx: 'uselang=qqx', vector: 'useskin=vector', mercury: 'useskin=mercury', monobook: 'useskin=monobook' },       parent = document.getElementsByClassName('wds-global-navigation__links-and-search')[0]; for (var i = 0; i < parent.childNodes.length; i++) { if (parent.childNodes[i].classList && parent.childNodes[i].classList.value !== 'wds-global-navigation__search') { parent.childNodes[i].parentNode.removeChild(parent.childNodes[i]); }   }    for (i in links) { if (links.hasOwnProperty(i)) { var elem = document.createElement('a'); elem.href = mw.config.get('wgArticlePath').replace(/\$1/g, mw.config.get('wgPageName') + (!!window.location.search ? window.location.search + '&': '?') + links[i] + (!!window.location.hash ? window.location.hash : '')); elem.className = 'wds-global-navigation__link'; elem.innerHTML = i;           parent.insertBefore(elem, parent.firstChild); }   } });
 * (function {

var persistentParameterList = ['useskin', 'uselang', 'usesitecss', 'usesitejs', 'useusercss', 'useuserjs', 'usevector'];

mw.util.addCSS(   '#source-code, #source-toc {' +        'font-family: monaco, monospace !important;' +    '}' +    '#source-code > a {' +        'color: ' + window.getComputedStyle(document.getElementsByTagName('a')[0]).color + ' !important;' +        'font-weight: bold;' +    '}' );

importArticles({   type: 'script',    articles: [        'u:dev:AjaxRC/code.js',        'u:dev:PersistentParameters/code.js',        'u:dev:LastEdited/code.js',        'u:dev:QuickDiff/code.js',        'u:dev:View_Source/code.js'    ] });