User:MusikAnimal/confirmationRollback-mobile.js: Difference between revisions

Content deleted Content added
Replaced content with '// now default-enabled gadget'
Undid revision 665758109 by MusikAnimal (talk)
Line 1:
//<nowiki>
// now default-enabled gadget
//To install, add the following to your common.js: {{subst:iusc|User:MusikAnimal/confirmationRollback-mobile.js}}
(function() {
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
$(".mw-rollback-link").on('click', function(e) {
var count = e.target.innerText.match(/\d/) ? e.target.innerText.match(/\d+/)[0] : null,
message = 'Rollback ' + (count ? count + ' edits' : 'edit') + ' by ' + mw.util.getParamValue('from',e.target.href) + '?';
if(!confirm(message)) return e.preventDefault();
});
}
}());
//</nowiki>