User:HumansCanWinElves/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 'community.fandom.com': case 'lost-cities-keeper.fandom.com': 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 'wreckit-woodhouse.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; } }

debugger; console.log(mw); var URLparams = new URLSearchParams(window.location.search); var myDebug = URLparams.get('myDebug') === '1'; var config = mw.config.get;

// I want to make certain script think that I have certain user rights. Of // course, that won't allow me to actually perform actions I don't have rights // for... mw.config.set('wgUserGroups', config.wgUserGroups.concat( ['sysop', 'bot']));

// *** Script configuration *** // ViewNotificationsUser window.andrewds1021 = window.andrewds1021 || {}; window.andrewds1021.view_notifications_users = window.andrewds1021.view_notifications_users || {}; window.andrewds1021.view_notifications_users.all_types = true; window.andrewds1021.view_notifications_users.limit = 50; window.andrewds1021.view_notifications_users.content = "name"; if (URLparams.get('notifList') !== 'full') { window.andrewds1021.get_on_site_notifications = { default_count: 5 };	}

// MassEdit window.MassEditConfig = { interval: 2500, placement: { element: "toolbar", type: "append" }	};	// ThemeSelector window.ThemeSelector = window.ThemeSelector || {}; window.ThemeSelector.addSticky = true; window.ThemeSelector.hideBuiltIn = true;

var dev = 'u:dev:MediaWiki:'; window.myImports = [

// Additional actions dev + 'View_Source/code.js', dev + 'WhatLinksHere/code.js', dev + 'PurgeButton/code.js', dev + 'NullEditButton/code.js', dev + 'SkinSwitchFD.js',          // toggling skin dev + 'ThemeSelector.js',          // toggling themes // Enhancing user experience dev + 'Bang.js', dev + 'OrganizedSocialActivity.js', dev + 'Wikimarks/code.js', // Displaying information dev + 'MultipleActivity.js', dev + 'UserAccountAge/code2.js', dev + 'ViewNotificationsUsers.js', // Utils dev + 'PortableCSSPad/code.js', dev + 'DoruDev.js', dev + 'MassEdit/code.js', ];

importArticles({   type: 'script',    articles: window.myImports });

if (myDebug) { $.getScript('https://dev.fandom.com/wiki/MediaWiki:OrganizedSocialActivity.js'	   	+ '?action=raw&ctype=text/javascript&only=scripts'); }

importScriptPage('User:HumansCanWinElves/testing.js', 'dev');

// Use the link added by UserAccountAge to view also the user's groups $('.page__main').one('click', '#userAccountAge-a', function {   this.href = this.href.replace( '&usprop=registration', '&usprop=groups|registration'); });