User:Sophiedp/global.js

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

/* Community Central only JS */ if (location.host === 'community.fandom.com') { /* 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) {               var pre = document.querySelector('pre');                pre.classList.forEach(function (className) { if (className.slice(0, 7) != 'source-') return; hljs.loadLanguage(className.slice(7)).then(function (hl) {                       hl.highlightBlock(pre);                    }); });           });            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'); } }

/* Indicate if I'm not admin on the wiki */ var ashtyn = document.querySelector('.ns-8:not(.wiki-dev) #ca-edit'); if (!wgUserGroups.includes('sysop') && ashtyn) { ashtyn.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' });

/* Create the my tools menu if it doesn't exist */ if (!document.getElementById('my-tools-menu')) { var star = document.createElement('ul'); star.id = 'my-tools-menu'; document.querySelector('#WikiaBar .tools').prepend(star); }