User:Euphoria/common.js: Difference between revisions
From Test Wiki
Content deleted Content added
OOUI buttons |
fix |
||
Line 1:
//
mw.loader.using(['mediawiki.util', 'mediawiki.api', 'oojs-ui
const pagePrefix = 'User:Euphoria/Test VfD';
Line 22:
const actions = [
{ name: 'delete',
{ name: 'keep',
{ name: 'no consensus',
];
actions.forEach(function (actionObj) {
const btn = new OO.ui.ButtonWidget({
label: actionObj.name.charAt(0).toUpperCase(),
title: 'Close as ' + actionObj.name,
});
btn.on('click', function (e) {
e.preventDefault();
Line 62 ⟶ 60:
'\n{{subst:vb}}';
api.postWithToken('csrf', {
action: 'edit',
Line 85 ⟶ 82:
if (actionObj.name === 'delete') {
api.postWithToken('csrf', {
action: 'delete',
Line 101 ⟶ 97:
if (talkId !== "-1") {
api.postWithToken('csrf', {
action: 'delete',
Line 121 ⟶ 116:
);
} else {
api.get({
action: 'query',
Line 185 ⟶ 179:
});
container.appendChild(btn.$element[0]);
});
Line 193 ⟶ 186:
});
});
//
| |||