Content deleted Content added
(bot/CD) |
(bot/CD) |
||
Line 3,663:
var version = "0.4.2";
var gitAbbrevHash = "
var gitBranch = "main";
var gitDate = "Wed, 16 Aug 2023
var gitVersion = "0.4.2+
/**
Line 6,690:
* in the list will be used.
*/
static
pivot = pivot !== null && pivot !== void 0 ? pivot : templateList[0];
while (templateList.length > 0) {
const template = templateList[0];
if (template !== pivot) {
if (template.node.getTarget().href !== pivot.node.getTarget().href) {
throw new Error("Attempted to merge incompatible templates.");
pivot.merge(template, { delete: true });
}
Line 6,755 ⟶ 6,758:
if (confirmed) {
// Recursively merge all templates
TemplateMerger.
mergeTarget.setValue(null);
mergePanel.toggle(false);
Line 10,642 ⟶ 10,645:
array.splice(0, 0, el);
return array;
}
function organize(objects, keyer) {
const finalObj = {};
for (const obj of objects) {
if (!finalObj[key]) {
finalObj[key] = [];
}
finalObj[key].push(obj);
}
return finalObj;
}
Line 10,714 ⟶ 10,729:
}
return notices;
}
findRowedNoticesByHref() {
return organize(this.findNotices().filter(v => v instanceof RowedAttributionNotice), (v) => v.node.getTarget().href);
}
/**
Line 11,100 ⟶ 11,118:
label: mw.msg('deputy.ante.mergeAll'),
title: mw.msg('deputy.ante.mergeAll'),
disabled: true▼
});
this.mergeButton.on('click', () => {
const notices = this.parsoid.
.reduce((p, n) => p + n.length, 0);
OO.ui.confirm(mw.message('deputy.ante.mergeAll.confirm', `${noticeCount}`).text()).done((confirmed) => {
if (!confirmed) {
return;
}
}
▲ }
});
const resetButton = new OO.ui.ButtonWidget({
Line 11,171 ⟶ 11,189:
}));
this.layout.on('remove', () => {
// this.mergeButton.setDisabled( notices.length < 2 );▼
});
this.parsoid.addEventListener('templateInsert', () => {
});
this.$overlay.append(new AttributionNoticeAddMenu(this.parsoid, addButton).render());
Line 11,258 ⟶ 11,272:
*/
getReadyProcess() {
▲ var _a;
const process = super.getReadyProcess();
// Recheck state of merge button
this.mergeButton.setDisabled(!Object.values(
process.next(() => {
for (const page of getObjectValues(this.layout.pages)) {
Line 11,376 ⟶ 11,390:
"deputy.ante.add": "Add a notice",
"deputy.ante.mergeAll": "Merge all notices",
"deputy.ante.mergeAll.confirm": "You are about to merge $1 {{PLURAL:$1|notice|notices}} which support rows. Continue?",
"deputy.ante.reset": "Reset all changes",
"deputy.ante.reset.confirm": "This will reset all changes. Proceed?",
|