User:Joritochip/common.js

window.UserTagsJS = { modules: { custom: {'Joritochip': ['a', 'b', 'c'], 'Robuxboy2005': ['d'], 'Karasuneth': ['b']}, nonuser: true, isblocked: true },	tags: { a: { u: 'Test A', order: 1 }, b: { u: 'Test B', order: 2 }, c: { u: 'Test C', order: 3 }, d: { u: 'Tag D', order: 1 }, } };

Date.parseISO8601 = function(text) { return new Date(text); };

/*jshint smarttabs:true jquery:true browser:true bitwise:false laxbreak:true */ /*global mediaWiki */

/** * UserTags Loader script * * This mini-script determines whether or not the current page should load * UserTags and then loads the full script to reduce overhead. */ mw.loader.using('mediawiki.util').then(function {	"use strict";	// Double-load protection	if (window.UserTagsJSInit) return;	window.UserTagsJSInit = true;	var loaderData = (function { var skin = mw.config.get('skin'), username = mw.config.get('profileUserName'); // Don't run if skin is unsupported if (skin !== 'fandomdesktop') { if (window.console) { window.console.log('USERTAGS(Loader): Unsupported skin:', skin); }			return; }		skin = 'oasis'; // remove this // Don't run if there is no relevant user for page, or they are anon if (!username || mw.util.isIPAddress(username)) return; return { skin: skin, user: username };	});	// Make sure config exists and is usable	var config;	window.UserTagsJS = config = $.extend({ modules: {}, extensions: {} }, window.UserTagsJS);	console.log(config);	console.log(window.UserTagsJS);	// If it's a user page then we need to expose our data to the core	if (loaderData) {		config.loader = loaderData;		// Debugging hook for debugging arbitrary Wikis without having to modify		// MediaWiki:Common.js to enable debug mode.		if ((/(?:^\?|&)debugusertags=1(?:&|$)/i).test(window.location.search)) {			config.debug = true;		}		// Default module configuration		if ($.isEmptyObject(config.modules)) {			config.modules = {				inactive: true,				newuser: true,				autoconfirmed: true,				mwGroups: true,				metafilter: {					sysop: ['bureaucrat','founder'],					bureaucrat: ['founder']				}			};		}		// Force load the blocking modules unless they are explicitly disabled		config.modules.stopblocked = config.modules.stopblocked			|| config.modules.stopblocked === void 0;		// Force the i18n module to load		config.modules.i18n = true; }	// Dependency computations for loading modules var importList = (function(config, alwaysOnly) {		// These are core modules that have irregular features so need special handling		// Most modules fit the "module.NAME.js" pattern		var moduleMap = {			explode: { s: 'u:dev:MediaWiki:UserTags/module.implode.js' }		};		// Check all the modules for matches in the above list.		// Hash ensures that each one will only be imported once.		/*jshint forin:true */		var list = [], 			hash = {}, 			exts = config.extensions || {}, 			script, data, module;		for (module in config.modules) {			// Skip already loaded			if (exts[module] !== void 0) { continue; }			if (moduleMap.hasOwnProperty(module)) {				data = moduleMap[module];				if (alwaysOnly && !data.always) {					continue;				}				script = data.s;			} else if (!alwaysOnly) {				// Attempt to load the module by name from the Dev page				script = 'u:dev:MediaWiki:UserTags/module.' + module + '.js';			} else { continue; }			if (hash[script] !== 1) { hash[script] = 1; list[list.length] = script; }		}		/*jshint forin:false */ // Improve caching by ensuring list always has the same order list.sort; // Core script (must always be last, obviously) if (!alwaysOnly) { //list[list.length] = 'u:dev:MediaWiki:UserTags/core.js'; }		return list; })(config, !loaderData);	// If we aren't going to load anything then we're done.	if (!importList.length) {		// Tidy up to reduce memory usage		delete window.UserTagsJS;		return;	}	var interval = setInterval(function { if (!$('#userProfileApp').length) { return; }		clearInterval(interval); if (config.debug !== 'noload') { console.log('Loading', window.UserTagsJS); window.importArticles({ type: 'script', articles: importList }) .then(function {				importScriptPage('User:Joritochip/core.js', 'developer');				}); } else { config.imports = importList; }	}, 100); });