User:Fij30jigh110/global.js

/* Imports */ importScriptPage('NoImageLightbox/code.js', 'dev'); importScriptPage('View_Source/code.js', 'dev'); importScriptPage('WHAM/code.js', 'dev'); importScriptPage('OldFilePages/code.js', 'dev'); importScriptPage('AutoEditDropdown/code.js', 'dev'); importScriptPage('AdvancedOasisUI/code.js', 'dev'); importScriptPage('PurgeButton/code.js', 'dev'); importScriptPage('VisualSpellCheck/code.js', 'dev'); importScriptPage('ListFiles/code.js', 'dev'); importScriptPage('PortableCSSPad/code.js', 'dev'); importScriptPage('FastOldImageDelete/code.js', 'dev'); importScriptPage('HideRail/code.js', 'dev'); importScriptPage('FileUsageAuto-update/code.js/min.js', 'dev'); importScriptPage('MediaWiki:Wikia.js/editCount.js', 'rhythmheaven'); importScriptPage('User:Killian_Jones/Toolbar.js', 'c'); importScriptPage('User:Monchoman45/ChatHacks.js', 'c'); importScriptPage('User:Joeytje50/ChatPMs.js', 'c'); importScriptPage('MessageBlocker/code.js', 'dev'); importScriptPage('User:Madnessfan34537/multikick.js','cod');

/* AjaxUndo */ /** * Ajax Undo links * * Adds an Ajax undo link next to the normal undo link on page histories * and on diff pages * * @author Grunny * @version 0.2 * */ jQuery(document).ready( function ( $ ) {	"use strict";	function createUndoLink( diffUndoUrl ) {		var $ajaxUndoLink = $( '' ).text( 'revert' ).attr( 'href', '#' ).click( function { var	$ajaxUndoLinkob = $( this ), undoIdRegex = /&undo=([^&]*)/, undoId = undoIdRegex.exec( diffUndoUrl )[1], editToken, etUrl = wgServer + wgScriptPath + '/api.php?action=query&prop=info|revisions&intoken=edit&titles=' + encodeURIComponent( wgPageName ) + '&format=json'; $ajaxUndoLinkob.html( ' ' ); $.getJSON( etUrl, function ( data ) {				editToken = data.query.pages[wgArticleId].edittoken;				$.ajax( { url: wgScriptPath + '/api.php?', data: 'action=edit&format=json&title=' + encodeURIComponent( wgPageName ) + '&undo=' + encodeURIComponent( undoId ) + '&bot=1&token=' + encodeURIComponent( editToken ), dataType: 'json', type: 'POST', success: function ( data ) { if ( data.edit && data.edit.result === 'Success' ) { $ajaxUndoLinkob.text( '(undone)' ); } else if ( data.error && data.error.code === 'undofailure' ) { $ajaxUndoLinkob.text( '(error)' ); alert( data.error.info ); } else { $ajaxUndoLinkob.text( '(error)' ); alert( 'Error: Unknown result from API.' ); }					},					error: function { $ajaxUndoLinkob.text( '(error)' ); }				} );			} );		} );		return $ajaxUndoLink;	}	if ( $( '.mw-history-undo > a' ).length && wgAction === 'history' ) {		$( '.mw-history-undo > a' ).each( function { var	diffUndoUrl = $( this ).attr( 'href' ), $ajaxUndoLink = createUndoLink( diffUndoUrl ); $( this ).parent.after( ' | ', $ajaxUndoLink ); } );	} else if ( $( 'table.diff' ).length && typeof $.getUrlVar( 'diff' ) !== 'undefined' ) {		var	$diffUndoLink = $( 'table.diff' ).find( '.diff-ntitle > #mw-diff-ntitle1 a:last' ),			diffUndoUrl = $diffUndoLink.attr( 'href' ),			$ajaxDiffUndoLink = createUndoLink( diffUndoUrl );		$diffUndoLink.parent.append( ' (', $ajaxDiffUndoLink, ')' );	} } ); //