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' ); } /** 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 **/