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

Content deleted Content added
[6f254cc0] cci: fix CSRSB
[5ad0992a] CCI fixes
Line 1,508:
/**
* Wikitext for checking if a given row is a contribution survey row.
* $1 - Page name
* $1 is the page name. $2 is the ID of the first revision. If $2 is undefined, the
* $2 - Post-page name text (`(3 edits)`)
* page has been cleared and commented on by a user.
* $3 - ID of first revision
* $4 - Comments
*/
ContributionSurveyRow.rowWikitextRegex = /\*?(?:'''.''' )?\[\[:?(.+?)]](?: ?([^{:]*) ?(?:: ?)?)?(?:(?:\[\[Special:Diff\/(\d+)\|.+?]])+|(.+$))/gm;
/**
* A set of regular expressions that will match a specific contribution survey row
Line 2,867 ⟶ 2,869:
*/
sendStatusResponse(event) {
var _a, _b, _c, _d, _e;
if (event.data.page === this.row.title.getPrefixedText() ||
(
this.revisions.some((r) => r.revision.revid === event.data.revision)) {
// `this.revisions` may be undefined. If so, don't reply.
(_a = this.revisions) === null || _a === void 0 ? void 0 : _a.some((r) => r.revision.revid === event.data.revision))) {
window.deputy.comms.reply(event.data, {
type: 'pageStatusResponse',
Line 2,877 ⟶ 2,881:
status: this.status,
enabledStatuses: this.statusDropdown.getEnabledOptions(),
revisionStatus: event.data.revision ? (_a_b = this.revisions.find((r) => r.revision.revid === event.data.revision)) === null || _a_b === void 0 ? void 0 : _a_b.completed : undefined,
nextRevision: (_d_e = (_c_d = (_b_c = this.revisions) === null || _b_c === void 0 ? void 0 : _b_c.find((revision) => !revision.completed)) === null || _c_d === void 0 ? void 0 : _c_d.revision.revid) !== null && _d_e !== void 0 ? _d_e : null
});
}
Line 3,252 ⟶ 3,256:
final.push(obj);
}
else if (obj.modified) {
final.push(obj.wikitext);
}
else {
final.push(obj.originalWikitext);
}
}