Extension:MsWikiEditor/zh
![]() Category:Stable extensions/zh |
|
---|---|
Category:User interface extensions/zh | |
描述 | 简单的对WikiEditor增加或删除按钮 |
作者 | Martin Schwindl, Martin Keyler |
Sophivorus | |
最新版本 | 4.0 (2024-08-12) |
MediaWiki | 1.39+Category:Extensions with manual MediaWiki version/zh |
PHP | 7.4+ |
GNU通用公眾授權條款2.0或更新版本 | |
下載 | Category:Extensions in Wikimedia version control/zh |
|
|
前往translatewiki.net翻譯MsWikiEditor |
The MsWikiEditor extension allows you to easily add or remove buttons from the WikiEditor toolbar via configuration.
安裝
- 下载,并将解压后的
MsWikiEditor
移动到extensions/
目录中。
开发者和代码贡献人员应从Git安装扩展,输入:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MsWikiEditor
- 将下列放置在您的LocalSettings.php 的底部:
wfLoadExtension( 'MsWikiEditor' );
- 按需求。
完成 – 在您的wiki上至Special:Version,以验证已成功安装。
To add a button, add its definition to the $wgMSWE_add
array in your LocalSettings.php
file using the following format:
$wgMSWE_add['button-key'] = [ 'Name of the button', 'Default content', 'Left wrapper', 'Right wrapper', 'URL or path to the image', 'toolbar-section', 'section-group' ];
If the toolbar section and section group are not specified, the button will be added to the "insert" group of the "main" section. Here are a few working examples:
$wgMSWE_add['date'] = [ 'Current date', date( 'Y-m-d' ), '', '', '/w/extensions/MsWikiEditor/images/date.png' ];
$wgMSWE_add['gallery'] = [ 'Gallery', "<gallery>\n", "File:Example1.jpg|Caption1\nFile:Example2.png|Caption2", "\n</gallery>", '/w/extensions/MsWikiEditor/images/gallery.png' ];
$wgMSWE_add['strike'] = [ 'Strike', '<strike>', 'Text', '</strike>', '/w/extensions/MsWikiEditor/images/strike.png' ];
$wgMSWE_add['email'] = [ 'Email', '[mailto:', 'address@example.com', ']', '/w/extensions/MsWikiEditor/images/email.png' ];
$wgMSWE_add['mslink'] = [ 'MsLink', '{{#l:', 'Filename.ext', '}}', '/w/extensions/MsWikiEditor/images/link.png' ];
$wgMSWE_add['template'] = [ 'Your template', '{{Your template|', 'Parameters', '}}', '/w/extensions/MsWikiEditor/images/template.png' ];
$wgMSWE_add['signature'] = [ 'Signature', '--~~~~', '', '', '/w/extensions/MsWikiEditor/images/signature.png' ];
$wgMSWE_add['attention'] = [ 'Attention', '{{Attention|', 'Text', '}}', '/w/extensions/MsWikiEditor/images/attention.png' ];
To remove a button, include its key (the 'rel' attribute) in the $wgMSWE_remove
array. For example:
$wgMSWE_remove = [ 'advanced', 'characters', 'help', 'file', 'reference', 'ilink', 'xlink' ];
默认情况下,两个数组均为空。
参见
Category:All extensions/zh
Category:EditPage::showEditForm:initial extensions/zh
Category:Extensions in Wikimedia version control/zh
Category:Extensions with manual MediaWiki version/zh
Category:GPL licensed extensions/zh
Category:ResourceLoaderGetConfigVars extensions/zh
Category:Stable extensions/zh
Category:User interface extensions/zh