User:HumansCanWinElves/global.js

debugger; console.log(mw); window.HumansCanWinElves = {};

const HCWE = window.HumansCanWinElves, URLparams = new URLSearchParams(window.location.search), config = mw.config.get;

HCWE.debug = URLparams.get('myDebug') === '1';

/* Possibly to cookbook if (HCWE.debug) { var mediaReplacer = mw.config.get('wgTimedMediaHandler'); mediaReplacer['EmbedPlayer.RewriteSelector'] = mediaReplacer['EmbedPlayer.RewriteSelector'].replace('audio,', ''); }

// I want to make certain scripts 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;

if (HCWE.debug) { // load the unreviewed revision. Only works when on test mode mw.loader.getScript('https://dev.fandom.com/wiki/MediaWiki:OrganizedSocialActivity.js'		+ '?action=raw&ctype=text/javascript&only=scripts'); }

window.myImports = [

// Additional actions 'View_Source/code', 'WhatLinksHere/code', 'PurgeButton/code', 'NullEditButton/code', 'ThemeSelector',

// Enhancing user experience 'Bang', 'OrganizedSocialActivity', 'Wikimarks/code', 'SandboxTab/code',

// Displaying information 'MultipleActivity', 'UserAccountAge/code2', // 'ViewNotificationsUsers', // currently broken on FandonDesktop

// Utils 'PortableCSSPad/code', 'DoruDev', 'MassEdit/code', ].map(function(a, b) {	return 'u:dev:MediaWiki:' + a + '.js'; });

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

mw.loader.load('https://dev.fandom.com/wiki/User:HumansCanWinElves/testing.js' +	'?action=raw&ctype=text/javascript');

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

// View page details when clicking the heading $('#firstHeading').one('click', function { importArticles({ type: 'script', articles: [ 'u:dev:MediaWiki:PageCreator/code2.js', 'u:dev:MediaWiki:LastEdited/code.js', ] }) });

// Adding target titles to redlinks mw.loader.using('mediawiki.Uri').then(function {	$('.main-container').on('mouseover', 'a.new:not([title])[href]', function { var // the part of the URL between the /wiki/ and the ? or # regExp = /(?<=\/wiki\/)[^?#]+/, match = regExp.exec($(this).attr('href'));

if (match) $(this).attr('title',			mw.Uri.decode(match[0]).replace(/_/g, ' ')); });  });

// Prevents the editor from being opened for redlinks - see // https://dev.fandom.com/f/p/4400000000000000003 $('a.new').each(function {	var href = window.atob(this.getAttribute('data-uncrawlable-url'));	if (href) {		href = href.replace('action=edit&', '');		this.setAttribute('data-uncrawlable-url', window.btoa(href));	} });