MediaWiki:Common.js

mw.loader.load('https://apis.google.com/js/platform.js');

if(wgPageName == 'Special:Upload' || wgPageName == 'Special:MultipleUpload') { $('#wpUploadDescription').val(''); }

// change label $('.pi-data-label:contains("Username")').replaceWith('Subscribers ');

/** * * Custom preload templates for the new Wikia editor * * @author Grunny * @version 0.0.1 * */ function customPreloadTemplates { if ( mw.config.get( 'wgAction' ) !== 'edit' || !$( 'div.module_content' ).length ) { return; }	$( 'div.module_content:first' ).append( ' Standard preloads: ' ); $.get( mw.config.get( 'wgScript' ), { title: 'Template:Stdpreloads', action: 'raw', ctype: 'text/plain' } ).done( function( data ) {		var	$preloadOptionsList,			lines = data.split( '\n' );		$preloadOptionsList = $( ' ' ).attr( 'id', 'stdSummaries' ).change( function { var templateName = $( this ).val; if ( templateName !== '' ) { templateName = 'Template:' + templateName + '/preload'; templateName = templateName.replace( ' ', '_' ); $.get( mw.config.get( 'wgScript' ), { title: templateName, action: 'raw', ctype: 'text/plain' } ).done( function( data ) {					var editTextBox = document.getElementById( 'cke_wpTextbox1' ) ? document.getElementsByClassName( 'cke_source' )[0] : document.getElementById( 'wpTextbox1' );					if ( editTextBox ) {						insertAtCursor( editTextBox, data );					}				} ); }		} );		for ( var i = 0; i < lines.length; i++ ) {			var templateText = ( lines[i].indexOf( '-- ' ) === 0 ) ? lines[i].substring(3) : '';			$preloadOptionsList.append( $( ' ' ).val( templateText ).text( lines[i] ) );		}		$( 'div#lf-preload' ).append( $preloadOptionsList );	} ); } $( customPreloadTemplates ); function doCustomPreloadOasis { var value = $( '#lf-preload-pagename-w > input' ).val; value = value.replace( ' ', '_' ); $.get( mw.config.get( 'wgScript' ), { title: value, action: 'raw', ctype: 'text/plain' } ).done( function( data ) {		insertAtCursor( document.getElementById( 'wpTextbox1' ), data );	} ); } function insertAtCursor(myField, myValue) { //IE support if (document.selection) {		myField.focus; sel = document.selection.createRange; sel.text = myValue; }	//MOZILLA/NETSCAPE support else if(myField.selectionStart || myField.selectionStart == '0') {		var startPos = myField.selectionStart; var endPos = myField.selectionEnd; myField.value = myField.value.substring(0, startPos) + myValue + myField.value.substring(endPos, myField.value.length); }	else {		myField.value += myValue; } }

window.UserTagsJS = { modules: {}, tags: { discordowner: { u:'Discord Owner' }, discorddev: { u:'Discord Dev' }, discordadmin: { u:'Discord Admin' }, discordmod: { u:'Discord Moderator' } } };

UserTagsJS.modules.custom = { 'HanselElGato': ['discordowner'], 'FkeBld': ['discorddev'], 'BoaDaSnakeMan': ['discorddev'], 'Davidjl123': ['discordadmin'], 'JustLeafy': ['discordmod'] };

window.UserTagsJS = { modules: {}, tags: { bureaucrat: { link:'Project:Administration#Bureaucrats and Administrators' }, sysop: { link:'Project:Administration#Bureaucrats and Administrators' }, rollback: { link:'Project:Administration#Rollbacks and Chat Moderators' }, chatmoderator: { link:'Project:Administration#Rollbacks and Chat Moderators' } } }; UserTagsJS.modules.inactive = 30; UserTagsJS.modules.mwGroups = ['bureaucrat', 'sysop', 'rollback', 'chatmoderator', 'bot']; UserTagsJS.modules.metafilter = { 'notautoconfirmed': ['newuser'] }; UserTagsJS.modules.newuser = { days: 5, edits: 0 }; // LastEdited settings window.lastEdited = { position: 'bottom', size: false, comment: false, time: true };