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

Content deleted Content added
(bot/CD)
(bot/CD)
Line 351:
 
var version = "0.6.0";
var gitAbbrevHash = "13fa403e4c177b";
var gitBranch = "main";
var gitDate = "ThuFri, 2223 Feb 2024 1308:0257:1114 +0800";
var gitVersion = "0.6.0+g13fa403ge4c177b";
 
/**
Line 6,264:
*/
function performHacks () {
var _a;
const HtmlEmitter = (_a = mw.jqueryMsg.HtmlEmitter) !== null && _a !== void 0 ? _a : {
prototype: Object.getPrototypeOf(new mw.jqueryMsg.Parser().emitter)
};
// This applies the {{int:message}} parser function with "MediaWiki:". This
// is due to VisualEditor using "MediaWiki:" in message values instead of "int:"
mw.jqueryMsg.HtmlEmitter.prototype.mediawiki =
mw.jqueryMsg.HtmlEmitter.prototype.int;
/**
* Performs a simple if check. Works just like the Extension:ParserFunctions
Line 6,280 ⟶ 6,284:
* @return see function description
*/
mw.jqueryMsg.HtmlEmitter.prototype.if = function (nodes) {
var _a, _b;
return (nodes[0].trim() ? ((_a = nodes[1]) !== null && _a !== void 0 ? _a : '') : ((_b = nodes[2]) !== null && _b !== void 0 ? _b : ''));
Line 6,290 ⟶ 6,294:
*
* @param nodes
* @return `{{text}}`
*/
mw.jqueryMsg.HtmlEmitter.prototype.template = function (nodes) {
return `{{${nodes.join('|')}}}`;
};
Line 6,299 ⟶ 6,303:
*
* @param nodes
* @return `{{text}}`
*/
mw.jqueryMsg.HtmlEmitter.prototype.subst = function (nodes) {
return `{{subst:${nodes.map((v) => typeof v === 'string' ? v : v.text()).join('|')}}}`;
};
Line 6,310 ⟶ 6,314:
* @see https://www.mediawiki.org/wiki/Help:Magic_words#URL_data
* @param nodes
* @return `/wiki/{page}?{query}`
*/
mw.jqueryMsg.HtmlEmitter.prototype.localurl = function (nodes) {
return mw.util.getUrl(nodes[0]) + '?' + nodes[1];
};