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

Content deleted Content added
Created page with '//<nowiki> //To install, add the following to your common.js: {{subst:iusc|User:MusikAnimal/confirmationRollback-mobile.js}} (function() { if(/Android|webOS|iPh...'
 
No edit summary
Line 4:
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,
if(!confirm('Are you sure you want to perform a rollback?')) return e.preventDefault();
message = 'Rollback ' + (count ? count + ' edits' : 'edit') + ' by ' + mw.util.getParamValue('from',e.target.href) + '?';
if(!confirm('Are you sure you want to perform a rollback?'message)) return e.preventDefault();
});
}