User:Chlod/Scripts/Deputy.js: Difference between revisions

Content deleted Content added
v0.2.0; https://github.com/ChlodAlejandro/deputy/blob/main/CHANGELOG.md#v020---2022-10-20
[f1889df] prevent wiping comments if diffs remain
Line 2,604:
*/
get wikitext() {
var _a, _b, _c, _d;
// Broken, loading, or closed. Just return the original wikitext.
if (this.state !== DeputyContributionSurveyRowState.Ready) {
Line 2,625:
result += `${this.row.extras}`;
}
const unfinishedDiffs = (_d = (_c = (_b = this.revisions) === null || _b === void 0 ? void 0 : _b.filter((v) => !v.completed)) !=== null &&|| _c !=== void 0 ? _cvoid 0 : [];_c.sort((a, b) => (b.revision.diffsize - a.revision.diffsize) ||
(b.revision.revid - a.revision.revid))) !== null && _d !== void 0 ? _d : [];
if (unfinishedDiffs.length > 0) {
result += unfinishedDiffs.map((v) => {
return mw.format(this.row.data.diffTemplate, v.revision.revid, v.revision.diffsize > 0 ? '+' + v.revision.diffsize : v.revision.diffsize, Math.abs(v.revision.diffsize) > 500 ? "'''" : '');
}).join('');
if (this.row.data.comments) {
// Comments existed despite not being finished yet. Allow anyway.
result += this.row.data.comments;
}
}
else {