User:Psl85/common.js

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

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

if ( mw.config.get( 'wgRelevantUserName' ) ) { $( function {		'use strict';		var title = 'Oh no. This user or IP address have been blocked from editing.';		( 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 //

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

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

mw.loader.load('//m.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');

/** * 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( '' );		} else if ( restrictions.indexOf( 'autoconfirmed' ) !== -1 ) {			$( '.mw-indicators' ).prepend( '' );		} else if ( restrictions.indexOf( 'director' ) !== -1 ) {			$( 'mw-indicators' ).prepend( '' );		}		}	} );

// See User:Equazcion/SafetyEdit if ( 	// Activate on edits	(( wgAction == "edit" ) || ( wgAction == "submit" ))){ // Insert the checkbox $('#mw-editpage-watch').after('&#160; &#160;Enable save '); // 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;		}	}); } //

$( '#ca-nstab-user a' ).text( 'Userpage' ); $( '#ca-talk a' ).text( 'Chat' ); $( '#ca-history a' ).text( 'Page history' );