User:GettingMemoriesPerson/global.js

if (mw.config.get('skin') === 'fandomdesktop') { var themeSheet1 = document.createElement('link'), themeURL1 = '/wikia.php?controller=ThemeApi&method=themeVariables&variant=', themeSheet2 = document.createElement('link'), themeURL2 = '/load.php?fandomdesktop=1&lang=en&modules=' + 'ext.fandom.DesignSystem.GlobalNavigation.brand.$1.css%7C' + 'ext.fandom.DesignSystem.brand.$1.css' + '&only=styles&skin=fandomdesktop'; switch (mw.config.get('wgServerName')) { // Wikis to switch to dark mode case 'dystopian-fiction.fandom.com': case 'math.wikia.org': themeSheet1.rel = "stylesheet"; themeSheet1.href = themeURL1 + 'dark'; document.head.appendChild(themeSheet1);

themeSheet2.rel = "stylesheet"; themeSheet2.href = themeURL2.replace(/\$1/g, 'dark'); document.head.appendChild(themeSheet2);

document.body.classList.remove('theme-fandomdesktop-light'); document.body.classList.add('theme-fandomdesktop-dark'); mw.config.set('isDarkTheme', true); break;

// Wikis to switch to light mode case 'community.fandom.com': themeSheet1.rel = "stylesheet"; themeSheet1.href = themeURL1 + 'light'; document.head.appendChild(themeSheet1);

themeSheet2.rel = "stylesheet"; themeSheet2.href = themeURL2.replace(/\$1/g, 'light'); document.head.appendChild(themeSheet2);

document.body.classList.remove('theme-fandomdesktop-dark'); document.body.classList.add('theme-fandomdesktop-light'); mw.config.set('isDarkTheme', false); break; } } $('.wiki-tools .wds-button[data-tracking="recent-changes"][href]').each(function {   var clone = this.cloneNode(true);    clone.href = mw.config.get('wgArticlePath').replace('$1', 'Special:NewFiles');    clone.title = 'Image Activity';    clone.setAttribute('data-tracking', 'new-files');    clone.removeAttribute('accesskey');    clone.innerHTML = '' +        '  ';    this.insertAdjacentElement('afterend', clone); });

if (!$('.wiki-tools .wds-button.wiki-tools__add-new-page').length) { $('.wiki-tools .wds-button[data-tracking="recent-changes"][href]').each(function {       var clone = this.cloneNode(true);        clone.href = '#';        clone.title = 'Add new page';        clone.setAttribute('data-tracking', 'add-new-page');        clone.removeAttribute('accesskey');        clone.classList.add('wiki-tools__add-new-page');        clone.innerHTML = '' +            '  ';        this.insertAdjacentElement('afterend', clone);    }); } importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:UCXSearchBar.js',    ] });

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:CodeQuickLinks/code.js',    ] });

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:ThemeToggler.js',    ] });

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:MobilePreview.js',    ] });

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:QuickBarPageTools.js',    ] }); importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:CollapseGlobalNavButton.js',    ] });