User:Euphoria/common.js: Difference between revisions

From Test Wiki
Content deleted Content added
fix
fix
Line 81:
const link = $(heading).find('a').first();
if (!link.length) {
mw.notify('Cannot find target page link!', {title: 'VfDcloser', type: 'error', timeout: 15002000});
setTimeout(() => location.reload(), 15002000);
return;
}
Line 88:
const targetPage = link.attr('title') || link.text().trim();
if (!targetPage) {
mw.notify('Cannot determine target page title!', {title: 'VfDcloser', type: 'error', timeout: 15002000});
setTimeout(() => location.reload(), 15002000);
return;
}
Line 107:
api.postWithToken('csrf', {action: 'delete', title: talkPage, reason: 'Parent page deleted via VfD'})
.done(() => {
mw.notify('Discussion closed. Page and talk page deleted.', {title: 'VfDcloser', type: 'success', timeout: 15002000});
setTimeout(() => location.reload(), 15002000);
}).fail(err => mw.notify('Error deleting talk page: ' + JSON.stringify(err), {title: 'VfDcloser', type: 'error', timeout: 5000}));
} else {
mw.notify('Discussion closed. Page deleted.', {title: 'VfDcloser', type: 'success', timeout: 15002000});
setTimeout(() => location.reload(), 15002000);
}
});
Line 164:
minor: true
}).done(() => {
mw.notify('Discussion closed. Page and talk page updated.', {title: 'VfDcloser', type: 'success', timeout: 15002000});
setTimeout(() => location.reload(), 15002000);
}).fail(err => mw.notify('Error editing talk page: ' + JSON.stringify(err), {title: 'VfDcloser', type: 'error', timeout: 5000}));
});