User:DuckeyD/global.js

// LastEdited if (wgNamespaceNumber === 0 || wgNamespaceNumber === 2 || wgNamespaceNumber === 4 || wgNamespaceNumber === 14) { // Article, User, Project, Category window.lastEdited = { avatar: false, position: { element: document.getElementById('WikiaMainContent'), method: 'append' }   }; } else if (wgNamespaceNumber === 500) { // UserBlog } else { // MediaWiki, Module, File... window.lastEdited = { avatar: false }; }

// AjaxRC window.ajaxSpecialPages = [ 'Recentchanges', 'WikiActivity', 'Watchlist', 'Log', 'Newpages' ];

// Import importArticles({   type: 'script',    articles: [        'u:dev:AjaxRC/code.js',        'u:dev:MultiUpload/code.js',        'u:dev:NullEditButton/code.js',        'u:dev:PurgeButton/code.js',        'u:dev:LastEdited/code.js',        'u:dev:View Source/code.js',        'u:dev:RevealAnonIP/usercode.js',        'u:dev:LuaError/code.js',        'u:dev:ViewRemoved/code.js',        'u:dev:UserCheck/code.js',        'u:dev:SearchSuggest/code.js',        'u:dev:WhatLinksHere/code.js',        'u:dev:ConsistentNotifications.js',        'u:dev:RCStats.js',        'u:pl.duckey:User:DuckeyD/header.javascript',        'u:pl.duckey:User:DuckeyD/navi.javascript'    ] });

// Bypass Special:InfoboxBuilder // Author: Vuh if($('.template-classification-type-text').data('type') === 'infobox') { $('#ca-edit').attr('href', function { return this.href + '&useeditor=source'; }); } if(window.location.pathname.indexOf('Special:InfoboxBuilder') != -1) {var pname = window.location.pathname.split('Special:InfoboxBuilder/')[1]; location.replace(document.URL.replace(window.location.href.split('/wiki/')[1],'Template:'+pname+'?action=edit&useeditor=source'));}

// Cat redlinks // Author: Nanaki $('#catlinks .newcategory, #WikiaArticle .newcategory').addClass('new');

// Inspectable Mercury preview // Author: DuckeyD // Special thanks to: fngplg mw.hook('wikipage.content').add(function (content) {   if (content[0] && content[0].querySelector('.mobile-preview') !== null) {        content[0].querySelector('.mobile-preview > iframe').contentDocument.querySelector('.article-preview').style.setProperty('pointer-events', 'all');        content[0].querySelector('.mobile-preview > iframe').contentDocument.querySelector('.mobile-wiki').style.setProperty('background-color', '#f6f6f6');    } });

// Move RCStats mw.hook('rcstats.link').add(function (data) {   if (window.duckey__headerChanges) {        data.elem.appendTo($('.wds-dropdown-custom-tools'))    } else {        mw.hook('duckey.headerChanges').add(function  { data.elem.appendTo($('.wds-dropdown-custom-tools')) })   } })

window.monacoTheme = 'vs-dark'