MediaWiki:Gadget-ConfirmRollbackMobile.js: Difference between revisions

From the Super Mario Wiki, the Mario encyclopedia
Jump to navigationJump to search
(Created page with "//<nowiki> $(".mw-rollback-link a").click(function(event){ if(confirm("Are you sure you want to rollback this edit?")) return; event.preventDefault(); }); //</nowiki>")
 
No edit summary
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
//<nowiki>
/* Require confirmation before performing rollback on mobile */
$(".mw-rollback-link a").click(function(event){
 
if(confirm("Are you sure you want to rollback this edit?")) return;
$(function() {
  event.preventDefault();
if (/Android|BlackBerry|iPhone|iPad|iPod|Kindle|Mobile|Opera M|Silk|webOS/i.test(navigator.userAgent)) {
$('body:not(.rollback-confirm) .mw-rollback-link a').click(function(e) {
if (confirm('Are you sure you want to perform this rollback?')) return;
e.preventDefault();
});
}
});
});
//</nowiki>

Latest revision as of 09:50, February 26, 2023

/* Require confirmation before performing rollback on mobile */

$(function() {
	if (/Android|BlackBerry|iPhone|iPad|iPod|Kindle|Mobile|Opera M|Silk|webOS/i.test(navigator.userAgent)) {
		$('body:not(.rollback-confirm) .mw-rollback-link a').click(function(e) {
			if (confirm('Are you sure you want to perform this rollback?')) return;
			e.preventDefault();
		});
	}
});