User:BZPN/RfD.js: Difference between revisions
From Test Wiki
Content deleted Content added
No edit summary Tags: Mobile edit Mobile web edit |
No edit summary Tags: Mobile edit Mobile web edit |
||
| Line 17: | Line 17: | ||
openDeletionPopup(); |
openDeletionPopup(); |
||
}; |
}; |
||
| ⚫ | |||
} |
|||
| ⚫ | |||
// |
// Dodanie zakładki Quick Delete do popupu |
||
function addQuickDeleteTab(popup) { |
function addQuickDeleteTab(popup) { |
||
const quickDeleteTab = $('<div>').attr('id', 'quick-delete-tab').css({ |
const quickDeleteTab = $('<div>').attr('id', 'quick-delete-tab').css({ |
||
| Line 89: | Line 88: | ||
} |
} |
||
| ⚫ | |||
// Funkcja do oznaczania strony do szybkiego usunięcia |
|||
function tagPageForQuickDeletion(reason) { |
|||
const tag = `{{qd|${reason}}}`; |
|||
const editSummary = 'Nominating for quick deletion ([[User :BZPN/RfD.js|QD]])'; |
|||
new mw.Api().postWithToken('csrf', { |
|||
action: 'edit', |
|||
title: mw.config.get('wgPageName'), |
|||
prependtext: tag + '\n', |
|||
summary: editSummary, |
|||
watchlist: 'watch', |
|||
}).done(function() { |
|||
alert('Page tagged for quick deletion.'); |
|||
closeDeletionPopup(); // Zamknij popup po pomyślnym oznaczeniu |
|||
}).fail(function() { |
|||
alert('Failed to tag the page for quick deletion. Please try again.'); |
|||
}); |
|||
} |
|||
| ⚫ | |||
// Tworzenie i otwarcie okna popup dla nominacji do usunięcia |
// Tworzenie i otwarcie okna popup dla nominacji do usunięcia |
||
function openDeletionPopup() { |
function openDeletionPopup() { |
||