User:Euphoria/common.js: Difference between revisions

From Test Wiki
Content deleted Content added
fix
Tag: Reverted
Line 48:
e.preventDefault();
if (!confirm('Are you sure you want to close as ' + actionObj.name + '?')) return;
 
// Disable the button and show hourglass while processing
btn.disabled = true;
btn.textContent = '⏳';
 
const api = new mw.Api();
Line 76 ⟶ 80:
minor: true
}).done(function() {
// Extract target article from heading DOM (first wikilink)
const link = $(heading).find('a').first();
if (!link.length) {
Line 92 ⟶ 95:
reason: '[[' + mw.config.get('wgPageName') + ']]'
}).done(() => {
// Also delete talk page
const talkPage = 'Talk:' + targetPage;
api.postWithToken('csrf', {
Line 104 ⟶ 106:
}).fail(err => alert('Error deleting page: ' + err));
} else {
// Keep / No consensus: remove {{vfd-new}} from article
api.get({
action: 'query',
Line 126 ⟶ 128:
minor: true
}).done(() => {
// Talk page update
const talkPage = 'Talk:' + targetPage;
api.get({