“MediaWiki:Common.js”的版本间的差异
(创建页面,内容为“→共享站相关: "use strict"; $(function() { if (["ViewAvatar", "Listfiles", "ListDuplicatedFiles", "Unusedimages", "Uncategorizedimages", "MediaStatistics…”) |
(// Edit via Wikiplus) |
||
(未显示2个用户的4个中间版本) | |||
第2行: | 第2行: | ||
"use strict"; | "use strict"; | ||
$(function() { | $(function() { | ||
− | if (["ViewAvatar", "Listfiles", "ListDuplicatedFiles", "Unusedimages", "Uncategorizedimages", "MediaStatistics", "TimedMediaHandler"].includes(mw.config.get("wgCanonicalSpecialPageName"))) { | + | if (["ViewAvatar", "UploadAvatar", "Listfiles", "ListDuplicatedFiles", "Unusedimages", "Uncategorizedimages", "MediaStatistics", "TimedMediaHandler"].includes(mw.config.get("wgCanonicalSpecialPageName"))) { |
− | + | var url = new mw.Uri(); | |
+ | url.host = url.host.replace(/^[^\.]+/g, "commons"); | ||
+ | url.path = mw.config.get("wgScript"); | ||
+ | url.query.title = mw.config.get("wgCanonicalNamespace") + ":" + mw.config.get("wgCanonicalSpecialPageName"); | ||
+ | location.replace(url); | ||
} | } | ||
− | } | + | }) |
2022年6月5日 (日) 15:27的最新版本
/* 共享站相关 */ "use strict"; $(function() { if (["ViewAvatar", "UploadAvatar", "Listfiles", "ListDuplicatedFiles", "Unusedimages", "Uncategorizedimages", "MediaStatistics", "TimedMediaHandler"].includes(mw.config.get("wgCanonicalSpecialPageName"))) { var url = new mw.Uri(); url.host = url.host.replace(/^[^\.]+/g, "commons"); url.path = mw.config.get("wgScript"); url.query.title = mw.config.get("wgCanonicalNamespace") + ":" + mw.config.get("wgCanonicalSpecialPageName"); location.replace(url); } })