User:User-100152098/hydra.js

mw.loader.localLoad = function( url ) { return mw.loader.load( '//minecraft.gamepedia.com/index.php?title=' + url + '&action=raw&ctype=text/javascript' ); }; /* Auto-refresh button on Special:RecentChanges */ /** Scripts **/ // User:KnightMiner/editSummaryPresets.js // if (mw.config.get('wgAction') === 'edit' || mw.config.get('wgAction') === 'submit') { var customSummaries = [ 'Reply', 'Comment', 'Suggestion', 'Added info', 'Fixed typo', 'Fixed red link', 'Removing unsourced info', 'Please write in American English, not British', 'Overlinking', 'Add history in the history section', 'Do not edit other users comments', 'Reverted vandalism or test edit', 'Tagging page for deletion', 'Remove spam', 'Rewriting', 'Copyedit', 'Do that in the forums' ]; mw.loader.localLoad('User:KnightMiner/editSummaryPresets.js'); } // User:Majr/docTabs.js // Adds Doc + Doc discussion tabs to // 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' ); /** General fixes **/ // 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' ); } /* Add link to view source of the current article */

{ mw.util.addPortletLink ( 'p-tb', '/index.php?title=' + mw.config.get( 'wgRelevantPageName' ) + '&action=raw', 'View source', 't-viewsource', 'View source of the article' ); } /** Mostly direct code from User:Majr/hydra.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 ) { $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' ), ']' ) ); } } ); /** Testing stuff **/

/* Hotcat */ mw.loader.load( '//commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-HotCat.js&action=raw&ctype=text/javascript' );

/* Popups while hower over links instead of the default tooltip */ mw.loader.load('//meta.wikimedia.org/w/index.php?title=Mediawiki:Gadget-popups.js&action=raw&ctype=text/javascript');

$( '#ca-user a' ).text( 'User' ); $( '#ca-talk a' ).text( 'Talk page' ); $( '#ca-move a' ).text( 'Re Name' ); $( '#pt-preferences a' ).text( 'Options' ); $( '#pt-logout a' ).text( 'Sign Out' ); $( '#pt-mytalk a' ).text( 'My chat board' ); $( '#ca-view a' ).text( 'Read' ); $( '#ca-nstab-main a' ).text( 'Article' ); $( '#ca-edit a' ).text( 'Edit' ); $( '.mw-editsection a' ).text( 'edit' ); $( '.mw-editsection-visualeditor' ).text( 'edit' ); // keep this line after the previous line

$('#t-specialpages').before(   $('').html( $('Delete pages (?)').attr({           style: 'cursor:pointer', title: 'Click to query pending deletions'        }) ) ); $('#t-pendingdeletion').click(function pdclicked {   $.ajax({ type: "GET", url: mw.util.wikiScript('api'), data: { format: 'json', action: 'query', list: 'categorymembers', cmtitle: 'Category:Pending deletion', cmlimit: 'max' },       async: true, success: function pdresponse(catResponse) { var taggedPages = 0; for (var page in catResponse.query.categorymembers) { taggedPages += 1; }           if (taggedPages > 0) { $('#t-pendingdeletion').html(                   $('DELETE PAGES (' + taggedPages + ')').attr({ href: 'http://www.minecraftwiki.net/Category:Pending_deletion', style: 'font-weight:bold', title: 'Go to Category:Pending deletion' })               );            } else { $('#t-pendingdeletion').html(               $('Delete pages (0)').attr({ style: 'cursor:pointer', title: 'Click to query pending deletions' })           );            }        }    }); });

/* Change the tab text to "Minecraft Wiki" because I do not like the default text, code obtained from User:Majr */ document.title = 'Minecraft Wiki';