User:McGeddon/common.js

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
 /*jshint scripturl:true*/
mw.util.addPortletLink('p-tb', 'javascript:importScript("MediaWiki:VisualFileChange.js");', 'Perform batch task', 't-AjaxQuickDeleteOnDemand');
/*jshint scripturl:false*/

/*
* Will pop-up a confirmation dialog when rollback link is clicked from Watchlist.
* Hit the "cancel" button if you had clicked Rollback accidentally and the edit will not be reverted.
* To install add importScript('User:Zvn/confirmwatchlistrollback.js'); to your monobook.js.
*/

if(mw.config.get("wgCanonicalSpecialPageName")==="Watchlist") jQuery(function($){
	$(".mw-rollback-link a").click(function(event){
		if(confirm("Are you sure you want to rollback this edit?")) return;
	  event.preventDefault();
	});
});