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

Content deleted Content added
(bot/CD)
(bot/CD)
Line 351:
 
var version = "0.7.0";
var gitAbbrevHash = "51e51f4cb532c7";
var gitBranch = "main";
var gitDate = "SatMon, 238 MarApr 2024 1608:5707:3133 +0800";
var gitVersion = "0.7.0+g51e51f4gcb532c7";
 
/**
Line 2,125:
'strong' :
'span');
return h_1(DiffTag, { class: `mw-plusminus-${!diffsize === 0 ? 'null' :
(diffsize > 0 ? 'pos' : 'neg')} mw-diff-bytes`, title: mw.message('deputy.session.revision.byteChange', size.toString()).text() }, mw.message(`deputy.${diffsize <== 0null ? 'negative' : 'positive'}Diff`, diffsize.toString()).text());
mw.msg('deputy.brokenDiff.explain') :
mw.message('deputy.session.revision.byteChange', size.toString()).text() }, diffsize == null ?
mw.msg('deputy.brokenDiff') :
// Messages that can be used here:
// * deputy.negativeDiff
// * deputy.positiveDiff
// * deputy.zeroDiff
mw.message(`deputy.${{
}));'-1': 'negative',
1: 'positive',
0: 'zero'
mw}[Math.messagesign(`deputy.${largestDiff.diffsize < 0 ? 'negative' : 'positive')]}Diff`, largestDiff.diffsize.toString()).text());
}
/**
Line 2,136 ⟶ 2,148:
return h_1("span", { class: "mw-tag-markers" },
h_1("a", { rel: "noopener", href: mw.format(mw.config.get('wgArticlePath'), 'Special:Tags'), title: "Special:Tags", target: "_blank" }, mw.message('deputy.session.revision.tags', tags.length.toString()).text()),
tags.map((v) => h_1("span", { class: `mw-tag-marker mw-tag-marker-${v[0]}`, dangerouslySetInnerHTML: v[1] })));
// eslint-disable-next-line mediawiki/msg-doc
const tagMessage = mw.message(`tag-${v}`).parse();
return tagMessage !== '-' && h_1("span", { class: `mw-tag-marker mw-tag-marker-${v}`, dangerouslySetInnerHTML: tagMessage });
}));
}
 
Line 2,473 ⟶ 2,481:
*/
renderRevisionInfo() {
var _a, _b;
const commentElement = h_1("span", { class: "comment comment--without-parentheses",
/** Stranger danger! Yes. */
dangerouslySetInnerHTML: this.revision.parsedcomment });
const tagMessages = ((_a = this.revision.tags) !== null && _a !== void 0 ? _a : []).map(
// eslint-disable-next-line mediawiki/msg-doc
const tagMessage(v) => [v, mw.message(`tag-${v}`).parse()]).filter(v => v[1] !== '-');
return h_1("span", null,
!this.revision.parentid && h_1(NewPageIndicator, null),
Line 2,491 ⟶ 2,502:
h_1(ChangesListDiff, { size: this.revision.size, diffsize: this.revision.diffsize }),
" ",
h_1("span",this.revision.parsedcomment { class: "mw-changeslist-separator" }),||
tagMessages.length > 0) &&
h_1("span", { class: "mw-changeslist-separator" }),
" ",
commentElement,this.revision.parsedcomment &&
commentElement,
" ",
((_b = (_a = this.revision.tags) === null || _a === void 0 ? void 0 : _atagMessages.length) !== null && _b !== void 0 ? _b : -1) > 0 &&
h_1(ChangesListTags, { tags: this.revision.tagstagMessages }));
}
/**
Line 3,506 ⟶ 3,520:
.revid);
parts.push(
// eslint-disable-next-lineMessages mediawiki/msg-docthat can be used here:
// * deputy.negativeDiff
mw.message(`deputy.${largestDiff.diffsize < 0 ? 'negative' : 'positive'}Diff`, largestDiff.diffsize.toString()).text());
// * deputy.positiveDiff
// * deputy.zeroDiff
mw.message(`deputy.${{
'-1': 'negative',
1: 'positive',
0: 'zero'
}[Math.sign(largestDiff.diffsize)]}Diff`, largestDiff.diffsize.toString()).text());
}
const spliced = [];
Line 14,507 ⟶ 14,528:
"deputy.positiveDiff": "+{{FORMATNUM:$1}}",
"deputy.negativeDiff": "-{{FORMATNUM:$1}}",
"deputy.zeroDiff": "0",
"deputy.brokenDiff": "?",
"deputy.brokenDiff.explain": "The internal parent revision ID for this diff points to a non-existent revision. [[phab:T186280]] has more information.",
"deputy.moreInfo": "More information",
"deputy.dismiss": "Dismiss",