User:User-100152098/common.js

mw.loader.localLoad = function( url ) { return mw.loader.load( '//minecraft.gamepedia.com/index.php?title=' + url + '&action=raw&ctype=text/javascript' ); };

/** Scripts **/

// User:KnightMiner/editSummaryPresets.js // Creates a dropdown menu on edit summaries with presets if (mw.config.get('wgAction') === 'edit' || mw.config.get('wgAction') === 'submit') { var customSummaries = [ 'Revert consecutive edits by {user} ([' + '[User talk:{user}|talk]])', {	label: 'Style guide', namespaces: [0], values: [ '[' + '[MCW:STYLE#Writing|Unsourced]], please provide a [' + '[Help:Official sources|valid source]]', '[' + '[MCW:STYLE#Writing|Tutorial information in non-tutorial article]]', '[' + '[MCW:STYLE#Writing|Mod info in vanilla article]]', '[' + '[MCW:UPTODATE|Outdated information]]', '[' + '[MCW:UPTODATE|History information outside of history section]]', '[' + '[MCW:FUTURE|Content not in a development version]]', '[' + '[MCW:STYLE#Grammar|This wiki uses US English]]', '[' + '[MCW:STYLE#Capitalization|Improper capitalization]]', '[' + '[MCW:IMAGES|Improper image]]', '[' + '[MCW:STYLE#Linking|Overlinking]]', '[' + '[MCW:FEATURES#Trivia|Comparative trivia]]', '[' + '[MCW:FEATURES#Trivia|Bugs are not trivia]]' ]		},		{  label: 'Wiki rules', values: [ '[' + '[MCW:RULES#1|Rule #1]]: Violates Minecraft ToU/brand guidelines', '[' + '[MCW:RULES#2|Rule #2]]: Spam', '[' + '[MCW:RULES#2|Rule #2]]: Vandalism', '[' + '[MCW:RULES#3|Rule #3]]: Harassment/insult/ad hominem', '[' + '[MCW:RULES#4|Rule #4]]: False info/hoax', '[' + '[MCW:RULES#4|Rule #4]]: Speculation', '[' + '[MCW:RULES#5|Rule #5]]: Advertising', '[' + '[MCW:RULES#6|Rule #6]]: Fan community', '[' + '[MCW:RULES#7|Rule #7]]: Plagiarism', '[' + '[MCW:RULES#8|Rule #8]]: [' + '[MCW:Wiki Rules/Video policy|Video policy]]' ]		},		{	label: 'Talk page guidelines', namespaces: [ 4, 'talk' ], values: [ '[' + '[MCW:TALK#General|Improper talk page usage]]', '[' + "[MCW:TALK#General|Don't edit other user's comments]]", '[' + "[MCW:TALK#General|Don't edit archives]]" ]		},		{	label: 'Talk page guidelines', namespaces: [ 'main' ], values: [ '[' + '[MCW:Projects/Rewrite for Style|Rewrite for Style]]', '[' + '[MCW:Projects/Rewrite for Style|Minor rewrite]]', '[' + '[MCW:Projects/Categorization|Categorize]]', '[' + '[MCW:Projects/Categorization|Change category]]', ]		},		{	label: 'Forums', values: [ '[' + '[forum:minecraft-discussion|Go to the forums]]', '[' + '[forum:minecraft-discussion/suggestions|Go to the suggestion forums]]', '[' + '[forum:mapping-and-modding/minecraft-mods|Go to the mod forums]]', '[' + '[forum:support|Go to the support forums]]' ]		},		{	label: 'General', values: [ 'Fixed typo', 'Added content', 'Corrected spelling errors', 'Fix red link (s)', 'Copyediting', 'Created redirect page', 'Grammar changes', 'Removed or added wikilink (s)', 'Cleanup, to comply with the style guide' ]		}	];	mw.loader.localLoad('User:KnightMiner/editSummaryPresets.js'); }

// User:Majr/Prism.js // Adds JavaScript, CSS and Lua syntax highlighting, see file for license // Requires a theme from http://prismjs.com to be added to usercss mw.loader.localLoad( 'User:Majr/Prism.js' );

// User:Majr/inputCounter.js // Adds a character counter to input fields mw.loader.localLoad( 'User:Majr/inputCounter.js' );

// User:Majr/codeLinks.js mw.loader.localLoad( 'User:Majr/codeLinks.js' );

// User:Majr/renderConsoleOutput.js // Allows the output wikitext of the lua console to be rendered if ( $( '#mw-scribunto-console' ).length ) { mw.loader.localLoad( 'User:Majr/renderConsoleOutput.js' ); }

/** General fixes **/

$( function { 'use strict';

// Replaces the Special:Achievements tab with the Special:MyPage/Sandbox tab $('#pt-achievements a').attr({ href: '/User:' + mw.config.get( 'wgUserName' ) + '/Sandbox' }).text('Sandbox');

// Makes one of the user links my profile, and the other the userwiki $('.netbar-box.right li.user a').attr({ href: '/UserProfile:' + mw.config.get( 'wgUserName' ) }).text( 'Profile' );

// Add a subpages link to pages if ( mw.config.get( 'wgArticleId' ) != 0 ) { mw.util.addPortletLink (		'p-tb',		'/Special:PrefixIndex/' + mw.config.get( 'wgRelevantPageName' ) + '/',		'Subpages',		't-subpages',		'Subpages of the article'	); }

/** Mostly direct code from User:Majr/hydra.js **/

// Modify the editing toolbar if ( $.inArray( mw.config.get( 'wgAction' ), [ 'edit', 'submit' ] ) > -1 ) { mw.loader.using( 'ext.wikiEditor.toolbar', function {

// Modify the text added by the signature button. var $button = $( '#wikiEditor-section-main > .group-insert > a[rel="signature"]' ); if ( $button.length ) { var action = $button.data( 'action' ); action.options.pre = ' ' + ' '; $button.data( 'action', action ); }

// Add an option to insert ' } }				}			}		// Add an option to insert template braces } ).wikiEditor( 'addToToolbar', { section: 'advanced', group: 'insert', tools: { sign: { label: 'Template', type: 'button', icon: '//hydra-media.cursecdn.com/minecraft.gamepedia.com/6/6d/Button_sig.png', action: { type: 'replace', options: { pre: '' } }				}			}				// Add an option to insert comment text } ).wikiEditor( 'addToToolbar', { section: 'advanced', group: 'insert', tools: { sign: { label: 'Comment (not visible while reading)', type: 'button', icon: '//hydra-media.cursecdn.com/minecraft.gamepedia.com/6/6d/Button_sig.png', action: { type: 'replace', options: { pre: '' } }				}			}				// Add an option to insert tags } ).wikiEditor( 'addToToolbar', { section: 'advanced', group: 'insert', tools: { sign: { label: 'Span-tags', type: 'button', icon: '//hydra-media.cursecdn.com/minecraft.gamepedia.com/6/6d/Button_tag.png', action: { type: 'replace', options: { pre: ' ', post: ' ' } }				}			}		// Add characters to the symbols insert page } ).on( 'wikiEditor-toolbar-buildSection-characters', function (event, section) { section.pages.symbols.characters.push( '¦', '²{', '}²' ); } );	} ); }

// Changes vector menu items into tabs $( '#p-cactions' ).addClass( 'emptyPortlet' ).find( '> .menu li' ).addClass( 'collapsible' ).find( 'a' ).wrap( ' ' ).end.appendTo( '#p-views > ul' );

// Add 0th section edit button to first infobox which is in the 0th section var $firstInfobox = $( '.notaninfobox' ).first; if ( !$firstInfobox.prevAll( 'h1, h2, h3, h4, h5, h6' ).length ) { $firstInfobox.children( '.infobox-title' ).css( 'padding-left', 50 ).prepend(		$( ' ' ).addClass( 'mw-editsection' ).css( { float: 'right', lineHeight: 'inherit' } ).append( '[',			$( '' ).prop( 'href', '/' + mw.config.get( 'wgPageName' ) + '?action=edit&section=0' ).text( 'edit' ), ']'		)	); }

} );

$(function { mw.loader.localLoad = function(url) { return mw.loader.load('/index.php?title='+url+'.js&action=raw&ctype=text/javascript') };  mw.loader.interLoad = function(url, wiki) { return mw.loader.load('//'+wiki+'.gamepedia.com/index.php?title='+url+'.js&action=raw&ctype=text/javascript') };

/* Custom CSS */

/* Custom JS */ //if(mw.config.get('wgTitle') === mw.config.get('wgUserName') && mw.config.get('wgNamespaceNumber') === 2) mw.loader.localLoad('User:ITechieGamer/test'); //mw.loader.localLoad('User:ITechieGamer/welcome'); }); mw.loader.localLoad = function (url) { return mw.loader.load('http://www.minecraftwiki.net/index.php?title=' + url + '&action=raw&ctype=text/javascript'); };

/* Counts all your edits and saves them to a page ( http://en.wikipedia.org/wiki/User:Kanegasi/editcounter ) */ if (mw.config.get('wgTitle') === mw.config.get('wgUserName') && mw.config.get('wgNamespaceNumber') === 2) { var tableCaption = 'Philip57sundfors\'s edits'; var subPages = 'true'; var topRowAttrib = 'style="background-color: blue"'; var bottomRowAttrib = 'style="font-family: Times New Roman"'; mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Kanegasi/editcounter.js&action=raw&ctype=text/javascript'); }

/* Replaces IPs with their known owner, publicly acknowledged by that user */ $('.mw-userlink[title$="82.69.54.207"]').attr({ title: 'User:Simons Mith (IP)' }).text('Simons Mith');

/* Wikipedia's HotCat gadget ( http://en.wikipedia.org/wiki/Wikipedia:HotCat ) */ if (mw.config.get('wgNamespaceNumber') >= 0) { mw.loader.localLoad('User:Kanegasi/HotCat.js'); }

// User:Majr/docTabs.js

mw.loader.load( '//minecraft.gamepedia.com/index.php?title=User:Majr/goToTop.js&action=raw&ctype=text/javascript' );

/* Welcome script from User:ITechieGamer */

$(document).ready(function { // Add a new portal before the social profiles in the toolbox  var $welcomeGroup = $(' ').append($('Welcoming users ')),      $welcomeBody = $(' '),      $goodWelcomeLink = $('Good welcome'),      $badWelcomeLink = $('Bad welcome'),      $newUserLink = $('New users');  $($welcomeGroup.append($welcomeBody.html($('').append($('').html($goodWelcomeLink)).append($('').html($badWelcomeLink)).append($('').html($newUserLink))))).insertBefore('#p-socialProfiles');

$('#t-goodwelcome').click( function {   // Notify the user for the username    var username = prompt('Who would you like to good welcome?');    if(username == '' || username == null) return;

// Welcome the user window.open('/index.php?action=edit&section=new&title=User_talk:'+username+'&preload=User:ITechieGamer/welcome/good&preloadtitle=Welcome%21&preloadparams%5b%5d='+username+'&preloadparams%5b%5d=%7e', '_blank'); });

$('#t-badwelcome').click( function {   // Notify the user for the username    var username = prompt('Who would you like to bad welcome?');    if(username == '' || username == null) return;

// Welcome the user window.open('/index.php?action=edit&section=new&title=User_talk:'+username+'&preload=User:ITechieGamer/welcome/bad&preloadtitle=Welcome&preloadparams%5b%5d=%7e', '_blank'); }); });

/* Add image at the top right corner to blocked users' userpages */

if ( mw.config.get( 'wgRelevantUserName' ) ) { $( function {		'use strict';		var title = 'Blocked user. :(.'; ( new mw.Api ).get( {			action: 'query',			format: 'json',			list: 'blocks',			formatversion: 2,			bkusers: mw.config.get( 'wgRelevantUserName' )		} ).done( function( data ) {			if ( data.query.blocks.length ) {				$( '.mw-indicators' ).prepend( '' + '' + '' );			}		} );	} ); }

// Scripts, some imported from Wiki Pedia, and modified to use on this wiki //

// if ( [ 2, 3 ].indexOf( mw.config.get( 'wgNamespaceNumber' ) ) !== -1 && ( !mw.config.get( 'wgArticleId' ) || mw.config.get( 'wgAction' ) === 'view' ) ) mw.loader.load( '//meta.wikimedia.org/w/index.php?title=User:Perhelion/userstatus.js&action=raw&ctype=text/javascript' ); mw.loader.load( '//commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-HotCat.js&action=raw&ctype=text/javascript' );

mw.loader.load('//meta.wikimedia.org/w/index.php?title=Mediawiki:Gadget-popups.js&action=raw&ctype=text/javascript');

mw.loader.load('//meta.wikimedia.org/w/index.php?title=Mediawiki:Gadget-markblocked.js&action=raw&ctype=text/javascript');

mw.loader.load('//en.wikipedia.org/w/index.php?title=Mediawiki:Gadget-edittop.js&action=raw&ctype=text/javascript');

mw.loader.load('//en.wikipedia.org/w/index.php?title=Mediawiki:Gadget-charinsert.js&action=raw&ctype=text/javascript');

mw.loader.load('//en.wikipedia.org/w/index.php?title=Mediawiki:Gadget-extlinks.js&action=raw&ctype=text/javascript');

mw.loader.load('//en.wikipedia.org/w/index.php?title=User:PrimeHunter/My_subpages.js&action=raw&ctype=text/javascript');

mw.loader.load('//en.wikipedia.org/w/index.php?title=User:The_Evil_IP_address/hdedit.js&action=raw&ctype=text/javascript');

mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Theopolisme/ajaxWatchlist.js&action=raw&ctype=text/javascript');

mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Equazcion/SafetyEdit.js&action=raw&ctype=text/javascript');

mw.loader.load('//en.wikipedia.org/w/index.php?title=MediaWiki:Gadget-ReferenceTooltips.js&action=raw&ctype=text/javascript');

mw.loader.load( '//minecraft.gamepedia.com/index.php?title=User:Psl85/smartwatchlist.js&action=raw&ctype=text/javascript' );

mw.loader.load( '//minecraft.gamepedia.com/index.php?title=User:Psl85/rc.js&action=raw&ctype=text/javascript' );

mw.loader.load( '//minecraft.gamepedia.com/index.php?title=User:Psl85/dropdownmenu.js&action=raw&ctype=text/javascript' ); /** * charinsert loader */

$( function {    var tab, tablink;

tab = document.getElementById('ca-addsection'); if ( !tab ) { return; }

tablink = tab.getElementsByTagName('a')[0]; if ( !tablink ) { return; }

tablink.firstChild.nodeValue = '+'; if ( mw.config.get( 'skin' ) === 'monobook' ) { tablink.style.paddingLeft = ".4em"; tablink.style.paddingRight = ".4em"; } });

// This only shows alerts for things after this handler is installed of course. // Because this is a gadget, error reporting can thus be inconsistent. var originalErrorHandler = window.onerror || null; // Column and error args are optional window.onerror = function ( message, url, line, colomn, error ) { var $msg = $( ' ' ); if ( url ) { $( ' ' )			.text( url + ' at line ' + line + ': ' ) .appendTo( $msg ); }	$( ' ' )		.text( message ) .appendTo( $msg );

mw.notify( $msg, {		autoHide: true,		autoHideSeconds: 10,		tag: null,		title: 'An error occured:',		type: 'error'	} ); if (originalErrorHandler) { return originalErrorHandler.apply(this, arguments); } }; // unbind on leaving the page $( window ) .on( 'unload', function {		window.onerror = originalErrorHandler;	} );

$( function {	'use strict';	var restrictions = mw.config.get( 'wgRestrictionEdit' );	if ( restrictions ) {		if ( restrictions.indexOf( 'sysop' ) !== -1 ) {			$( '.mw-indicators' ).prepend( '<img title="This page is protected." id="gadget-protectionindicators-' + restrictions[ 0 ] + '" src="//upload.wikimedia.org/wikipedia/commons/5/59/Padlock.svg" height="20" />' );		} else if ( restrictions.indexOf( 'autoconfirmed' ) !== -1 ) {			$( '.mw-indicators' ).prepend( '<img title="This page is semi-protected." id="gadget-protectionindicators-' + restrictions[ 0 ] + '" src="//upload.wikimedia.org/wikipedia/commons/f/fc/Padlock-silver.svg" height="20" />' );		} else if ( restrictions.indexOf( 'director' ) !== -1 ) {			$( 'mw-indicators' ).prepend( '<img title="This page is director-protected so only directors can edit it." id="gadget-protectionindicators-' + restrictions[ 0 ] + '" src="//upload.wikimedia.org/wikipedia/commons/4/4f/Padlock-purple.svg" height="20" />' );		}		}	} );

// See User:Equazcion/SafetyEdit if ( 	// Activate on edits	(( wgAction == "edit" ) || ( wgAction == "submit" ))){ // Insert the checkbox $('#mw-editpage-watch').after('&#160;<input title="Check to unlock the Save page button" class="ruSure" type="checkbox"> &#160;<label style="color:#62090B;" title="Unlock Save page button" for="ruSure">Enable saving '); // Disable the save button on load $('input[name="wpSave"]').prop("disabled", true); // Set summary line to disable enter key saving when it recieves focus. // Unbinding on load doesn't work since MediaWiki JS will bind after this. $('#wpSummary').focus(function{		$(this).unbind;	}); // Set the change function for the checkbox $('input.ruSure').change(function{		if ($(this).prop("checked")){			// We use the name attribute so all potential save buttons (produced by other scripts etc) are affected			$('input[name="wpSave"]').prop("disabled", false);			// If checked, undo our summary line focus event from above 			$('#wpSummary').unbind('focus');			// Make enter key on summary line save again			$('#wpSummary').keydown(function(event){ if (event.keyCode == 13) { $('form#editform').submit; return false; }			});		} else {			$('input[name="wpSave"]').prop("disabled", true);			// Here we can just unbind without a focus event, because MediaWiki JS won't supercede us again			$('#wpSummary').unbind;		}	}); }

( function( $, mw ) { $alert = ' '; $alert += ' <img style="display: block;" src="//upload.wikimedia.org/wikipedia/commons/3/36/CloseWindow.svg"/> '; $alert += ' you have<a href="#" id="mw-echo-talk-link">new unread messages</a> on your discussion page. (<a href="#" id="mw-echo-talk-diff-link">diff</a>) '; $alert += ' '; $(document).ready(function { var newMsgRevisionId = mw.config.get( 'wgUserNewMsgRevisionId' ); if ( newMsgRevisionId ) { var userName = mw.config.get( 'wgUserName' ); var talkLink = '/User_talk:' + userName + '?redirect=no'; var diffLink = '/index.php?title=User_talk:' + userName + '&oldid=' + newMsgRevisionId + '&diff=cur'; $( 'body' ).append( $alert ); $( '#mw-echo-close-box' ).click( function( e ) {			$( '#mw-echo-sliding-alert' ).hide;			e.preventDefault;		} ); $( 'a#mw-echo-talk-link' ).attr( 'href', talkLink ); $( 'a#mw-echo-talk-diff-link' ).attr( 'href', diffLink ); mw.config.set( 'echoNewMsgAlertDisplayed', true ); } } ); } )( jQuery, mediaWiki ); //

$( '#ca-user a' ).text( 'User' ); $( '#ca-talk a' ).text( 'Talk/Discussion' ); $( '#ca-history a' ).text( 'Page history' ); $( '#ca-move a' ).text( 'Rename' ); $( '#pt-preferences a' ).text( 'My Options' ); $( '#pt-logout a' ).text( 'EXIT' ); $( '#pt-mytalk a' ).text( 'My Talk' );

$( '#ca-edit a' ).text( 'Edit Code' ); $( '#ca-ve-edit a' ).text( 'Edit page' ); $( '.mw-editsection a' ).text( 'edit' ); $( '.mw-editsection-visualeditor' ).text( 'edit visually' ); // keep this line after the previous line