User:KnightMiner/hydra.js

mw.loader.localLoad = function( url ) { return mw.loader.load( 'http://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]])', '== Style guide', '[' + '[MCW:Style guide#Notability|Tutorial information in non-tutorial article]]', '[' + '[MCW:Style guide#Notability|Mod info in vanilla article]]', '[' + '[MCW:Style guide#Future|Content not in a development version]]', '[' + '[MCW:Style guide#Grammar|This wiki uses US English]]', '[' + '[MCW:Style guide#Capitalization|Improper capitalization]]', '[' + '[MCW:Style guide#Linking|Overlinking]]', '[' + '[MCW:Style guide/Features#Trivia|Bad trivia]]', '== Wiki rules', '[' + '[MCW:Wiki Rules#1|Rule #1]]: Violates Minecraft ToU/brand guidelines', '[' + '[MCW:Wiki Rules#2|Rule #2]]: Spam', '[' + '[MCW:Wiki Rules#2|Rule #2]]: Vandalism', '[' + '[MCW:Wiki Rules#3|Rule #3]]: Harassment/insult/ad hominem', '[' + '[MCW:Wiki Rules#4|Rule #4]]: False info/speculation', '[' + '[MCW:Wiki Rules#5|Rule #5]]: Advertising', '[' + '[MCW:Wiki Rules#6|Rule #6]]: Fan community', '[' + '[MCW:Wiki Rules#8|Rule #8]]: Plagiarism', '[' + '[MCW:Wiki Rules#9|Rule #9]]: [' + '[MCW:Wiki Rules/Video policy|Video policy]]', '[' + '[MCW:Wiki Rules#11|Rule #11]]: Legend/hoax', '== Projects', '[' + '[MCW:Projects/Rewrite for Style|Rewrite for Style]]', '[' + '[MCW:Projects/Rewrite for Style|Minor rewrite]]', '[' + '[MCW:Projects/Categorization|Minor rewrite|Categorize]]', '== Forums', '[' + '[mcf:24-|go to the forums]]', '[' + '[mcf:31-|go to the server forums]]', '[' + '[mcf:56-|go to the mod forums]]', '[' + '[mcf:155-|go to the support forums]]', '[' + '[mcf:219-|go to the Pocket Edition forums]]', '[' + '[mcf:220-|go to the Xbox 360 Edition forums]]', ];	mw.loader.localLoad('User:KnightMiner/editSummaryPresets.js'); }

// User:Majr/editcounter.js var editPage = 'Edit count'; var tableClass = ''; var tableStyle = ''; if ( mw.config.get( 'wgTitle' ) === mw.config.get( 'wgUserName' ) && mw.config.get( 'wgNamespaceNumber' ) === 2) { importScript( 'User:Majr/editcounter.js' ); }

// User:Majr/refTooltip.js importScript( 'User:Majr/refTooltip.js' );

// User:Majr/docTabs.js // Adds Doc + Doc discussion tabs to template and module pages and // changes Template/Module + Discussion tabs to always link to the original template/module + discussion page if ( 	$.inArray( mw.config.get( 'wgNamespaceNumber' ), [ 10, 11, 828, 829 ] ) > -1 ||	$.inArray( mw.config.get( 'wgNamespaceNumber' ), [ 2, 3 ] ) > -1 &&	mw.config.get( 'wgTitle' ).replace( /\/doc$/, '' ).search( /\.(js|css)$/ ) > -1 ) { importScript( 'User:Majr/docTabs.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 importScript( 'User:Majr/inputCounter.js' );

// User:Majr/codeLinks.js importScript( 'User:Majr/codeLinks.js' );

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

/** General fixes **/

// Replaces the Special:GlobalWatchlist tab with the Special:MyPage/Sandbox tab $('#pt-1 a[href$="/Special:GlobalWatchlist"]').attr({ href: '/User:' + mw.config.get( 'wgUserName' ) + '/Sandbox' }).text('Sandbox');

// Add a purge tab after the move tab $( '#p-cactions ul' ).append( $( '' ).html( $( '' ).prop( {	title: 'Purge the page',	href: '/index.php?title=' + mw.config.get( 'wgRelevantPageName' ) + '&action=purge' } ).text( 'Purge' ) ) );

/** Direct code from User:Majr/hydra.js **/ $( function { 'use strict';

// Modify the text added by the signature button. if ( $.inArray( mw.config.get( 'wgAction' ), [ 'edit', 'submit' ] ) > -1 ) { mw.loader.using( 'ext.wikiEditor.toolbar', function {		var $button = $( '#wikiEditor-section-main > .group-insert > a[rel="signature"]' )		var action = $button.data( 'action' );		action.options.pre = ' ' + ' ';		$button.data( 'action', action );	} ); }

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

} );

/** Testing stuff **/