Jump to content

Extension:MsWikiEditor/ja

From mediawiki.org
This page is a translated version of the page Extension:MsWikiEditor and the translation is 31% complete.
MediaWiki 拡張機能マニュアル
MsWikiEditor
リリースの状態: 安定
実装 ユーザー インターフェイス
説明 Easily add or remove buttons to the WikiEditor
作者 Martin Schwindl, Martin Keyler
メンテナー Sophivorus
最新バージョン 4.0 (2024-08-12)
MediaWiki 1.39+
PHP 7.4+
  • $wgMSWE_remove
  • $wgMSWE_add
ライセンス GNU 一般公衆利用許諾書 2.0 以降
ダウンロード
translatewiki.net で翻訳を利用できる場合は、MsWikiEditor 拡張機能の翻訳にご協力ください

The MsWikiEditor extension allows you to easily add or remove buttons from the WikiEditor toolbar via configuration.

インストール

  • ダウンロードして、ファイルをextensions/フォルダー内のMsWikiEditorという名前のディレクトリ内に配置します。
    開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MsWikiEditor
    
  • 以下のコードを LocalSettings.php ファイルの末尾に追加します:
    wfLoadExtension( 'MsWikiEditor' );
    
  • 必要に応じて設定します。
  • Yes 完了 – ウィキの「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' ];

By default, both arrays are empty.

関連項目