User:BZPN/RfD.js: Difference between revisions

From Test Wiki
Content deleted Content added
BZPN (talk | contribs)
No edit summary
Tags: Mobile edit Mobile web edit
BZPN (talk | contribs)
No edit summary
Line 32: Line 32:
// Tworzenie okna popup
// Tworzenie okna popup
const popup = $('<div>').attr('id', 'deletion-popup').css({
const popup = $('<div>').attr('id', 'deletion-popup').css({
'width': '400px',
'width': '90%',
'max-width': '400px',
'margin': '10% auto',
'margin': '10% auto',
'padding': '20px',
'padding': '15px',
'background-color': '#fff',
'background-color': '#fff',
'border-radius': '8px',
'border-radius': '8px',
Line 53: Line 54:


// Tytuł okna
// Tytuł okna
$('<h3>').text('Nominate for deletion').appendTo(popup);
$('<h3>').text('Nominate for deletion').css({
'font-size': '18px',
'margin-bottom': '10px'
}).appendTo(popup);


// Informacja o zasadach RfD
// Informacja o zasadach RfD
Line 76: Line 80:
'type': 'text',
'type': 'text',
'id': 'deletion-short-reason',
'id': 'deletion-short-reason',
'placeholder': 'Enter short reason...'
'placeholder': 'Brief reason...'
}).css({
}).css({
'width': '100%',
'width': '100%',
'padding': '6px',
'padding': '6px',
'font-size': '14px',
'margin-bottom': '10px'
'margin-bottom': '10px'
}).appendTo(popup);
}).appendTo(popup);
Line 90: Line 95:
const detailedReasonInput = $('<textarea>').attr({
const detailedReasonInput = $('<textarea>').attr({
'id': 'deletion-detailed-reason',
'id': 'deletion-detailed-reason',
'placeholder': 'Enter detailed reason...'
'placeholder': 'Detailed reason...'
}).css({
}).css({
'width': '100%',
'width': '100%',
'padding': '6px',
'padding': '6px',
'font-size': '14px',
'height': '80px',
'height': '80px',
'margin-bottom': '10px'
'margin-bottom': '10px'
Line 118: Line 124:
'border': 'none',
'border': 'none',
'border-radius': '5px',
'border-radius': '5px',
'cursor': 'pointer'
'cursor': 'pointer',
'font-size': '16px'
}).on('click', function() {
}).on('click', function() {
const shortReason = shortReasonInput.val().trim();
const shortReason = shortReasonInput.val().trim();
Line 208: Line 215:
new mw.Api().postWithToken('csrf', {
new mw.Api().postWithToken('csrf', {
action: 'edit',
action: 'edit',
title: `User talk:${creator}`,
title: `User talk:${creator}`, appendtext: '\n' + notification,
appendtext: '\n' + notification,
summary: 'Notifying page creator about deletion nomination ([[User:BZPN/RfD.js|RfD]])',
summary: 'Notifying page creator about deletion nomination ([[User:BZPN/RfD.js|RfD]])',
watchlist: 'watch',
watchlist: 'watch',