User:Sophiedp/global.js

/* Remove autofill delete reason */ if (mw.config.get('wgAction') === 'delete') { document.getElementById('wpReason').removeAttribute('value'); }

/* Community Central only JS */ if (mw.config.get('wgCityId') === '177') { /* Use dark theme */ var eve = mw.config.get('wgCanonicalSpecialPageName'); if (       mw.config.get('wgIsEditPage') ||        $('#theme-solarized-light').exists ||        eve === 'AbuseLog' || eve === 'AbuseFilter'    ) { mw.config.set('wgIsDarkTheme', true); document.body.classList.add('oasis-dark-theme'); if ($('#theme-solarized-light').exists) { mw.hook('dev.highlight').add(function (hljs) {               hljs.loadAllLanguages.then(function (hl) { hl.highlightBlock($('pre')[0]); });           });            importArticle({                type: 'script',                article: 'u:dev:MediaWiki:Highlight-js.js'            }); }   }    /* Import script for archiving my wall */ if ($('.page-header__page-subtitle > nav > a[title="My wall"]').exists) { mw.loader.load('https://a-sina.herokuapp.com/archive.js'); } }

//testing if (   !['dev', 'communitytest'].includes(wgDBname) &&    wgCanonicalNamespace === 'MediaWiki' &&    !wgUserGroups.includes('sysop') ) { document.getElementById('ca-edit').style.opacity = '0.5'; }

/* Imports */ importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:MaximizeAce.js',        'u:dev:MediaWiki:ProtectionIcons.js'    ] }, {    type: 'style',    article: 'u:dev:MediaWiki:DarkGlobalNavDropdowns.css' });

/* Deal with the toolbar (and things that may be added to it) */ mw.loader.load('https://a-sina.herokuapp.com/toolmenu.js');