代码快捷链接将创建一个新的侧栏模块,其中包含指向用户本地JavaScript和CSS文件的快捷链接,用户在英文社区中心的全域JS和CSS文件,单个wiki的MediaWiki页面和JS页面。
Installation
Configuration
用户可以合并自己的链接集,或将其它链接添加到默认集,而不是使用默认链接集。在脚本导入之前放置到window.customCodeQuickLinks对象。
布尔值 replaceAllDefaultLinks 字段默认设置为 false ,允许用户仅显示其自定义链接选择,如果设置为 true 则不显示任何默认值。
showIcon布尔值默认地设置为 true ,允许在模块标题旁边显示WDS样式的图标,类似于现代化铁路模块的设计。
linkSet对象包含要包含的格式正确的链接。
示例如下所示:
window.customCodeQuickLinks= {
replaceAllDefaultLinks: true,
showIcon: false,
linkSet: {
siteFiles: [
{
name: "JSPages",
href: mw.util.getUrl("Special:JSPages")
},
{
name: "ImportJS",
href: mw.util.getUrl("MediaWiki:ImportJS")
}
],
userFiles: [
{
name: "Global.js",
href: "//c.fandom.com/wiki/Special:MyPage/global.js"
},
{
name: "Global.css",
href: "//c.fandom.com/wiki/Special:MyPage/global.css"
}
]
}
};
本地化说明
您无法在本地更改首选语言,这是因为它取决于wiki的内容语言。例如,德语社区中心的语言是德语,英语社区中心的语言是英语。
更新日志
| Date | Description |
|---|---|
| November 17, 2016 | Initial revision. |
| December 23, 2016 | Multiple instances check |
| March 5, 2017 | General rewrite; addition of ImportJS. |
| October 10, 2017 | Rewrite, addition of MonoBook support. |
| October 19, 2017 | CSS adjustments, removal of .module class, compatibility with ConsistentModules.
|
| April 18, 2018 | Addition of custom links option. |
| April 20, 2018 | Addition of extra add-on links option. |
| June 20, 2018 | Code streamline, CSS ported to separate stylesheet at MediaWiki:CodeQuickLinks.css |
| July 12, 2020 | Addition of UCP support, rewrite of rail module construction functionality, general cleanup. |
| July 14, 2020 | Addition of optional WDS-style icon, using code provided by Ursuul in a thread over two years prior. |
| October 7, 2021 | Final UCP update; removal of legacy MW 1.19 code, refactoring of external dependency loader |