User:Eejit43/scripts/ajax-undo.js: Difference between revisions

Content deleted Content added
automatically focus reason input
use mw.notify()
Line 2:
/* global mw, importStylesheet */
 
mw.loader.using(['mediawiki.util', 'mediawiki.notification'], () => {
if (mw.config.get('wgAction') !== 'history') return;
 
Line 53:
})
.catch((_, data) => {
mw.notification.notify(`${data.error.info} (${data.error.code})`, { type: 'error' });
setTimeout(() => window.___location.reload(), 2000);
return false;
Line 60:
if (!success) return;
 
mw.notification.notify('Revision successfully undone, reloading...', { type: 'success' });
window.___location.reload();
}