Note: After saving, changes may not occur immediately. Click here to learn how to bypass your browser's cache.
  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (Cmd-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (Cmd-Shift-R on a Mac)
  • Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Clear the cache in Tools → Preferences

For details and instructions about other browsers, see Wikipedia:Bypass your cache.

mediaWiki.loader.load( '//pl.wikisource.org/w/index.php?title=MediaWiki:Gadget-preload-prp-page-image.js&action=raw&ctype=text/javascript');

$.wtypo = {
	todo: [],
	add: function(fonction) {
		$.wtypo.todo.push(fonction);
	},
	exec: function() {
		var txt = $('#wpTextbox1').val();
		for (var i = 0; i < $.wtypo.todo.length; ++i) {
			txt = $.wtypo.todo[i](txt);
		}
		$('#wpTextbox1').val(txt);
	},
};

if($.inArray(mw.config.get('wgAction'), ['edit', 'submit']) !== -1 ) {
	$(function() {
		//typo
		$.wtypo.add(function(str) {
			str = str.replace(/  /g," ");
			str = str.replace(/¬ /g,"");
			str = str.replace(/”/g,'"');
			str = str.replace(/“/g,'"');
			str = str.replace(/’/g,"'");
			str = str.replace(/‘/g,"'");
			str = str.replace(/ *— */g,"—");
			str = str.replace(/ ([:;!?]) /g,"$1 ");
			str = str.replace(/ ([a-z\-]*) , /ig," ''$1,'' ");
			str = str.replace(/\.\.\./g,"&hellip;");
			str = str.replace(/\. \. \./g,"&hellip;");
			str = str.replace(/\. \n\. \n\./g,"&hellip;");
			str = str.replace(/- \n([^A-Z\n])/g,"$1");
			str = str.replace(/([^\.!?"]) \n([^A-Z\n])/g,"$1 $2");
			str = str.replace(/([\.!?]) \n([A-Z"'])/g,"$1\n\n$2");
			str = str.replace(/: \n("[A-Z])/g,':\n\n$1');
			str = str.replace(/([\.!?]") \n([A-Z"'])/g,"$1\n\n$2");
			str = str.replace(/ \n/g,"\n");

			return $.trim(str);
		});

		$.when(
			mw.loader.using( [ 'mediawiki.toolbar' ] )
			).then(function() {
				mw.toolbar.addButton( {
				imageFile: "//upload.wikimedia.org/wikipedia/commons/9/99/Toolbaricon_templatelink.png",
				speedTip: "Typo...",
				imageId: 'wsTypo',
				onClick: $.wtypo.exec
			});
		});
	});
}