MediaWiki:Gadget-morebits.js: Difference between revisions
Content deleted Content added
MusikAnimal (talk | contribs) Repo at 49207b0: Revert "morebits.date: Don't import methods that collide with PageTriage (T268513)" (#1619); fix handling of hard errors (#1651) |
MusikAnimal (talk | contribs) Repo at dff0416: stop relying on .toccolours (not available in vector-2022) (#1720); support deletetalk/undeletetalk API options; disallow nested ternaries (#1695) |
||
Line 2,645:
protectCreate: null,
protectCascade: null,
// - delete
deleteTalkPage: false,
// - undelete
undeleteTalkPage: false,
// - creation lookup
Line 3,293 ⟶ 3,299:
this.suppressProtectWarning = function() {
ctx.suppressProtectWarning = true;
};
// Delete-related setter
/** @param {boolean} flag */
this.setDeleteTalkPage = function (flag) {
ctx.deleteTalkPage = !!flag;
};
// Undelete-related setter
/** @param {boolean} flag */
this.setUndeleteTalkPage = function (flag) {
ctx.undeleteTalkPage = !!flag;
};
Line 4,439 ⟶ 4,457:
if (ctx.changeTags) {
query.tags = ctx.changeTags;
}
if (ctx.deleteTalkPage) {
query.deletetalk = 'true';
}
Line 4,504 ⟶ 4,525:
if (ctx.changeTags) {
query.tags = ctx.changeTags;
}
if (ctx.undeleteTalkPage) {
query.undeletetalk = 'true';
}
Line 5,388 ⟶ 5,412:
p.innerHTML = message;
var div = document.createElement('div');
div.className = '
div.style.marginTop = '0';
div.style.whiteSpace = 'pre-wrap';
Line 5,982 ⟶ 6,006:
value.style.display = 'none';
var button = document.createElement('button');
if (value.hasAttribute('value')) {
button.textContent = value.getAttribute('value');
} else if (value.textContent) {
button.textContent = value.textContent;
} else {
button.textContent = msg('submit', 'Submit Query');
}
button.className = value.className || 'submitButtonProxy';
// here is an instance of cheap coding, probably a memory-usage hit in using a closure here
|