User:Tyilo/quicksave.js

if (wgAction == 'edit' || wgAction == 'submit') { $(document).ready(function {		(function($) {			$.fn.ajaxSubmit = function(callback) {				$.ajax(				{					type: this.attr('method'),					url: this.attr('action'),					contentType: this.attr('entype'),					data: this.serialize,					complete: callback				}); };		})(jQuery);		var attrs = {			id: 'dlQuickSave',			title: 'Saves the page without leaving'		};		var $button = $(' ').val('Quick save').attr(attrs).click(function { $(this).val('Saving').attr('disabled', 'disabled'); var f = document.editform; $(f).ajaxSubmit(function			{				$('#dlQuickSave').val('Quick save').removeAttr('disabled');			}); });		$('#wpSave').after($button);		}); }