User:Majr/hydra.js

( function( mcw ) { 'use strict';

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

// 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 localLoad( 'User:Majr/Prism.js' );

// User:Majr/codeLinks.js // Make links work in code blocks localLoad( 'User:Majr/codeLinks.js' );

// User:Majr/docTabs.js // Adds Doc + Doc discussion tabs to template, widget, module, and user css/js // pages and changes Template/Widget/Module/User + Discussion tabs to always // link to the original template/widget/module/user + discussion pages if ( 	$.inArray( mw.config.get( 'wgNamespaceNumber' ), [ 10, 11, 274, 275, 828, 829 ] ) > -1 ||	$.inArray( mw.config.get( 'wgNamespaceNumber' ), [ 2, 3 ] ) > -1 &&	mw.config.get( 'wgTitle' ).replace( /\/doc$/, '' ).search( /\.(js|css)$/ ) > -1 ) { localLoad( 'User:Majr/docTabs.js' ); }

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

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

// User:Majr/scriptLoader.js // Allows scripts to be loaded on demand mcw.scriptLoaderUrl = '//minecraft.gamepedia.com'; mcw.scriptLoaderPages = [ 'User:Majr/galleryList.js', 'User:Majr/fileNuke.js', 'User:Majr/getOrphanTalkPages.js' ]; localLoad( 'User:Majr/scriptLoader.js' );

if ( $.inArray( mw.config.get( 'wgAction' ), [ 'edit', 'submit' ] ) > -1 ) { $.when( $.ready, mw.loader.using( 'ext.wikiEditor.toolbar' ) ).done( function {		setTimeout( 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 ' } }					}				}			} );		} );	} ); }

// 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 ) { mw.loader.using( 'mediawiki.util', function {		var $editSection = $( ' ' ).addClass( 'mw-editsection-like' ).css( { float: 'right', lineHeight: 'inherit' } ).append( $( ' ' ).addClass( 'mw-editsection-bracket' ).text( '[' ), $( '' ).prop( 'href', mw.util.getUrl( null, { action: 'edit', section: 0 } ) ).text( 'edit' ), $( ' ' ).addClass( 'mw-editsection-bracket' ).text( ']' ) );		$firstInfobox.find( '.infobox-title' ).prepend( $editSection )			.css( 'padding-left', '+=' + $editSection.outerWidth( true ) );	} ); }

}( window.mcw || {} ) );