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

Content deleted Content added
v0.4.2; https://github.com/ChlodAlejandro/deputy/releases/tag/v0.4.2
[44e09e9] update types-mediawiki to latest (https://github.com/ChlodAlejandro/deputy/blob/main/CHANGELOG.md#unreleased)
Line 3,292:
var _a, _b, _c, _d;
const rev = (_a = this.revisions) === null || _a === void 0 ? void 0 : _a.find((r) => r.revision.revid === event.data.revision);
if// (event.data.pageHandles ===the this.row.title.getPrefixedText()) {cases:
// * Page title and revision ID (if supplied) match
// * Page title matches
// * Page revision ID (if supplied) matches
if (event.data.page === this.row.title.getPrefixedText() ||
(rev && event.data.revision)) {
window.deputy.comms.reply(event.data, {
type: 'pageStatusResponse',
Line 3,574 ⟶ 3,579:
 
var version = "0.4.2";
var gitAbbrevHash = "49388f544e09e9";
var gitBranch = "HEADmain";
var gitDate = "ThuMon, 2315 MarMay 2023 0716:4013:3213 +0800";
var gitVersion = "0.4.2+g49388f5g44e09e9";
 
/**
Line 3,898 ⟶ 3,903:
message.push(mw.msg('deputy.content.assessed.reworked', `${reworked}`));
}
ifconst nowClosed = (!this._section.originallyClosed && this.closed) {;
if (nowClosed) // Now closed.{
message.push(mw.msg('deputy.content.assessed.sectionClosed'));
}
const m = message.join(mw.msg('deputy.content.assessed.comma'));
returnconst m[0].toUpperCase()summary += mmw.slicemsg(1);nowClosed ?
'deputy.content.summary.sectionClosed' :
(finished === 0 && assessed > 0 ?
'deputy.content.summary.partial' :
'deputy.content.summary'), this.headingName, finished);
return summary + m[0].toUpperCase() + m.slice(1);
}
else {
Line 5,166 ⟶ 5,176:
var _a;
if (this.revision == null) {
if ((_a = this.options.forceRevision) !== null && _a !== void 0 ? _a : true) {
// Show if forced, or if we're not looking at the latest revision.
mw.config.get('wgRevisionId') !== mw.config.get('wgCurRevisionId') ||
((_a = this.options.forceRevision) !== null && _a !== void 0 ? _a : true)) {
return this.renderMissingRevisionInfo();
}
Line 5,394 ⟶ 5,407:
* @param timeout Timeout for the page detail request.
*/
static getPageDetails(revision = mw.config.get('wgRevisionId'), title = window.deputy.currentPage, timeout = 500) {
return __awaiter(this, void 0, void 0, function* () {
return window.deputy.comms.sendAndWait({
Line 5,554 ⟶ 5,567:
}
else if (DeputyCasePage.isCasePage()) {
if (mw.config.get('wgCurRevisionId') !==
mw.config.get('wgRevisionId')) {
// This is an old revision. Don't show the interface.
return;
}
const casePage = yield DeputyCasePage.build();
yield DeputyRootSession.initOverwriteMessage(casePage);
}
else if (mw.config.get('wgAction') === 'view') {
yield this.normalPageInitialization();
window.deputy.comms.addEventListener('sessionStarted', () => {
Line 13,547 ⟶ 13,565:
 
var deputyCoreEnglish = {
"deputy.content.assessedsummary": "Assessed/* $1 revisions across*/ -$2) pages(",
"deputy.content.summary.partial": "/* $1 */ - partial) (",
"deputy.content.summary.sectionClosed": "/* $1 */ -$2, section done) (",
"deputy.content.assessed": "Assessed $1 {{PLURAL:$1|revision|revisions}} across $2 pages",
"deputy.content.assessed.comma": ", ",
"deputy.content.assessed.finished": "$1 finished",