Extension:InputBox
![]() リリースの状態: 安定 |
|
---|---|
![]() |
|
実装 | タグ , ページの操作 , 検索 |
説明 | あらかじめ定義された HTML フォームを利用者がウィキページに追加できるようにする |
作者 |
|
最新バージョン | Continuous updates |
MediaWiki | 1.30+ |
データベースの変更 | いいえ |
ライセンス | MIT ライセンス |
ダウンロード | |
|
|
Quarterly downloads | 487 (Ranked 17th) |
Public wikis using | 7,250 (Ranked 8th) |
translatewiki.net で翻訳を利用できる場合は、InputBox 拡張機能の翻訳にご協力ください | |
問題点 | 未解決のタスク · バグを報告 |
InputBox 拡張機能はあらかじめ作られた HTML フォームをウィキページに追加します。 利用者はボックスにテキストを入力することによってフォームを「埋める」(テキストを入力する、メニュー項目を選択する、等)ことができます。
InputBoxは、当初は Erik Möller によって Wikinews の「記事を作成する」欄を追加するために作成されました。
インストール
- ダウンロードして、ファイルを
extensions/
フォルダー内のInputBox
という名前のディレクトリ内に配置します。 - 以下のコードを
LocalSettings.php
の末尾に追加します:wfLoadExtension( 'InputBox' );
- 完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。
例
新しい記事を開始するためのボックス。
ウィキコード
<inputbox>
type=create
break=no
</inputbox>
結果
一般的な構文
入力ボックスは以下のように構築されます:
<inputbox>
type=
bgcolor=
width=
page=
default=
preload=
editintro=
buttonlabel=
hidden=
searchbuttonlabel=
fulltextbutton=
labeltext=
break=
namespaces=
prefix=
placeholder=
minor=
nosummary=
summary=
id=
inline=
dir=
preloadparams[]=
searchfilter=
useve=
arialabel=
</inputbox>
|
type パラメーターは必須です。 その他のパラメーターはすべて省略可能です。 preloadparams[]は複数回現れます。
ボックスの種類
既定では、「送信」ボタンは入力ボックスの下に配置されます。
「送信」ボタンは、break=noというパラメータを指定することで入力ボックスの右に配置させることも可能です。このパラメーターは、ボックスとボタンの間にある改行を取り除くものです: break=no
。
「送信」ボタンを下に配置すると入力の自動補完機能によってボタンが隠れてしまうといった場合には右に配置するのが有用です。
種類 | 例 | 説明 |
---|---|---|
type=search | 既定の幅が50文字の検索ボックスを作成します。 テキストボックスに追加された情報が検索されます。 | |
type=create | 新しいページを作成します。 テキストボックスに追加される情報は、編集されたページの名前です。 | |
type=comment | テキストボックスに指定のあるとおり、ページの末尾に新しく節を追加します。 | |
type=commenttitle | テキストボックスに入力した文字例を見出しに使い、新しい節を作ります。 タイトルは、default= パラメータで指定します。ページは、page= パラメータで指定する必要があります。 (rev:47203 で導入)
| |
type=fulltext | 表示ボタンを使わずに、全文検索ボタンのみで検索します。 (rev:45269 で導入) | |
type=move | ページ名を別の名前に移動する。 (gerrit:97559 で導入) |
type=search2
の場合、検索ボタンのデフォルトの位置は右側です。
現在のところ、このタイプの入力ボックスに他のパラメータを追加することはできないようです。
この検索ボックスは、それが置かれたWiki全体を検索します。
種類 | 例 |
---|---|
type=search2 |
パラメーター
パラメーター | 説明 | 通用範囲 | 互換性 | 例 | 結果 | |
---|---|---|---|---|---|---|
arialabel= | Supply the aria-label attribute to the inputbox to allow generated markup be accessible to screen readers | すべての種類 |
|
<inputbox>
type=search
arialabel=Search the Wiki
</inputbox>
|
||
bgcolor= | テーブルの背景色を設定します(HTMLカラー値)。 引用符は使用しないでください。 | すべての種類 | ? | <inputbox>
type=search
bgcolor=#eeeeff
</inputbox>
|
||
width= | InputBoxの幅を文字数で設定します。 | すべての種類 | ? | <inputbox>
type=create
width=24
</inputbox>
|
||
default= | InputBoxに入れるデフォルトのテキスト。 | すべての種類 | ? | <inputbox>
type=comment
default=User talk:Eloquence
</inputbox>
|
||
preload= | 新しいページを作成すると、このタイトルのページが空白の編集ボックスにあらかじめ読み込まれます(Manual:テキストをプリロードしてページを作る 参照)。 | create, comment, commenttitle | ? | <inputbox>
type=create
preload=Log
</inputbox>
|
||
上または下の例のInputBoxに存在しないページのタイトルを入力し、それぞれ「項目を作成」または「新しい節」をクリックして、この効果を試してみてください。 | ||||||
editintro= | このパラメータで指定されたページは、編集ウィンドウの上に指示として表示されます。 | create, comment | ? | <inputbox>
type=comment
editintro=MediaWiki:Missingcommenttext
</inputbox>
|
||
buttonlabel= | このラベルは、フォームのメインボタンに使用されます。 | すべての種類 | ? | <inputbox>
type=comment
buttonlabel=新しいリソースを追加
</inputbox>
|
||
hidden= | InputBoxが存在しないことを指定します。
パラメータ"default"と共に使用され、現在はデフォルトではなく、ページ名の固定値となっています。 |
create, comment | ? | <inputbox>
type=comment
editintro=Extension:InputBox/editintro comment
preload=Extension:InputBox/preload
hidden=yes
default=Extension talk:InputBox
buttonlabel=トークページ上にコメントを投稿する
</inputbox>
|
||
searchbuttonlabel= | このラベルは、フォームのメインボタンに使用されます。 | search, fulltext | ? | <inputbox>
type=search
searchbuttonlabel=深堀りする
</inputbox>
|
||
fulltextbutton= | Show the full text search button on search2 form | search2 | ? | <inputbox>
type=search2
searchbuttonlabel=深堀りする
fulltextbutton=true
</inputbox>
|
||
labeltext= | ボタンの横に印刷するテキスト | search2 | ? | <inputbox>
type=search2
searchbuttonlabel=深堀りする
labeltext=検索
</inputbox>
|
||
break= | 入力ボックスとボタン(複数可)の間に改行を挿入するかどうか。 デフォルトはyes(改行を使用)。 | すべての種類 | ? | <inputbox>
type=create
width=24
break=no
</inputbox>
|
||
namespaces= | 全文検索で名前空間チェックボックスに対応
" |
search, fulltext | ? | <inputbox>
type=search
namespaces=Main**,Help
</inputbox>
|
||
prefix= |
注:アンダースコアはスペースとして認識されません。 |
search, fulltext, create | ? | <inputbox>
type=search
prefix={{FULLPAGENAME}}/Archive
</inputbox>
|
下のボタンは、名前の前に | |
placeholder= | 入力ボックスが空のときに表示されるプレースホルダーテキストを定義します。 | すべての種類 |
|
<inputbox>
type=search
placeholder=このウィキ内を検索
</inputbox>
|
||
page= | コメントを投稿するページ、または移動するページ。 | comment, move | <inputbox>
type=comment
page=Project:Sandbox
</inputbox>
|
|||
minor= | 細部の編集。 | comment, create | <inputbox>
type=comment
page=Project:Sandbox
minor=true
</inputbox>
|
|||
nosummary= | 新しいコメントには、編集の概要(見出し)は必要ありません。 | comment | <inputbox>
type=commenttitle
page=Special:Mypage/inputbox test
nosummary=true
</inputbox>
|
|||
summary= | 要約か移動理由 | create, move | <inputbox>
type=create
default=Special:Mypage/inputbox test
summary=Foo
</inputbox>
|
|||
id= | <form>のためにID属性を指定します。 | すべての種類 |
|
<inputbox>
type=comment
page=Project:Sandbox
summary=Foo
id=bar
</inputbox>
|
||
inline= | InputBoxをインライン要素にする(冒頭で改行しない)。 | search2 | 文字を入力: <inputbox>
type=search2
inline=true
width=10
</inputbox>
|
文字を入力: | ||
dir= | 右から左(rtl)または左から右(ltr)。 デフォルトは、ページの言語の方向性。 | すべての種類 | <inputbox>
dir=rtl
type=comment
page=Project:Sandbox
summary=Foo
</inputbox>
|
|||
preloadparams[]= | プリロードテキストへのパラメータを指定する。 プリロードされたテキストでページを作成を参照してください。 | create, comment, commenttitle |
|
<inputbox>
type=create
preload=Log
preloadparams[]=param1
preloadparams[]=param2
</inputbox>
|
||
searchfilter= | 検索に付加するパラメータを指定する | search |
|
<inputbox>
type=search
searchfilter=insource:foo
</inputbox>
|
||
useve= | When creating a page the input box will use the new visual editor, if the extension is installed, and this parameter is set to true. | create, comment | <inputbox>
type=create
break=no
useve=true
</inputbox>
|
Applying create to an existing page simply gives the edit page.
In that case preload
is ignored.
Applying comment for a new page works.
The texts taken from the MediaWiki:
namespace are of course only examples, any existing page can be used for editintro
or preload
.
Unfortunately preload
does not yet work for the Upload summary.
配置
If you want to create an inputbox on the right side of the page, do something like:
<div style="float:right; width:42em">
<inputbox>
type=create
</inputbox>
</div>
パーサー関数
Using InputBox in a template
In order to create many similar input boxes, InputBox can be used in a template.
However, passing template parameters to InputBox parameters only works if the <inputbox>...</inputbox>
tag is written as {{#tag:inputbox | ...}}
inside the template.
The following example is a template to create a new wiki page from a named template:
{{#tag:inputbox |
type=create
buttonlabel=Create new {{{1|article}}}
preload={{{2|Template:Article}}} }}
When instantiating the template, the first parameter gives the item that is created (default: article
) as spelled out in the button, the second parameter gives the name of the template used to create the item (default: Template:Article
).
E.g., the code for an input box to create a new project from a project template might look like this:
{{Template:CreateNew|project|Template:Project}}
関連項目
この拡張機能は 1 つ以上のウィキメディアのプロジェクトで使用されています。 これはおそらく、この拡張機能が安定していて高いトラフィックのウェブサイトでも十分に動作することを意味します。 この拡張機能がインストールされている場所を確認するには、ウィキメディアの設定ファイル CommonSettings.php および InitialiseSettings.php 内で、この拡張機能の名前を探してください。 特定のウィキにインストールされている拡張機能の完全な一覧は、そのウィキの Special:Version ページにあります。 |
この拡張機能は以下のパッケージ/ウィキファームに含まれています: This is not an authoritative list. Some wiki farms/hosts may contain this extension even if they are not listed here. Always check with your wiki farms/hosts or bundle to confirm. |