InputBox
?張機能はあらかじめ作られた
HTML フォ?ム
をウィキペ?ジに追加します。
利用者はボックスにテキストを入力することによってフォ?ムを「埋める」(テキストを入力する、メニュ?項目を選?する、等)ことができます。
InputBoxは、?初は
Erik Moller
によって
Wikinews
の「
記事を作成する
」欄を追加するために作成されました。
インスト?ル
- ダウンロ?ド
して、ファイルを
extensions/
フォルダ??の
InputBox
という名前のディレクトリ?に配置します。
開?者とコ?ド寄稿者は、上記の代わりに以下を使用して
Gitから
インスト?ルします:
cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/InputBox
- 以下のコ?ドを
LocalSettings.php
ファイルの末尾に追加します:
wfLoadExtension
(
'InputBox'
);
-
完了
? ウィキの「
Special:Version
」に移動して、?張機能が正しくインスト?ルされたことを確認します。
例
新しい記事を開始するためのボックス。
ウィキコ?ド
<
inputbox
>
type=create
width=30
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=
usedt=
arialabel=
</
inputbox
>
type
パラメ?タ?は必須です。
その他のパラメ?タ?はすべて省略可能です。
preloadparams[]
は複?回使用できます。
ボックスの種類
?定では、「送信」ボタンは入力ボックスの下に配置されます。
「送信」ボタンは、break=noというパラメ?タを指定することで入力ボックスの右に配置させることも可能です。このパラメ?タ?は、ボックスとボタンの間にある改行を取り除くものです:
break=no
。
「送信」ボタンを下に配置すると入力の自動補完機能によってボタンが?れてしまうといった場合には右に配置するのが有用です。
種類
|
例
|
?明
|
search
|
|
?定の幅が50文字の?索ボックスを作成します。
テキストボックスに追加された情報が?索されます。
|
create
|
|
新しいペ?ジを作成します。
テキストボックスに追加される情報は、編集されたペ?ジの名前です。
|
comment
|
|
テキストボックスに指定のあるとおり、ペ?ジの末尾に新しく節を追加します。
|
commenttitle
|
|
テキストボックスに入力した文字例を見出しに使い、新しい節を作ります。 タイトルは、
default=
パラメ?タで指定します。ペ?ジは、
page=
パラメ?タで指定する必要があります。 For some reason this does NOT work when using the extension by invoking it with {{#tag}}, only when using
<
inputbox
>
.
(
rev:47203
で導入)
|
fulltext
|
|
表示ボタンを使わずに、全文?索ボタンのみで?索します。
(
rev:45269
で導入)
|
move
|
|
ペ?ジ名を別の名前に移動する。 This also doesn't work when creating it by invoking a tag.
(
gerrit:97559
で導入)
|
type=search2
の場合、?索ボタンの?定の位置は右側でインラインです。
現在のところ、このタイプの入力ボックスに他のパラメ?タを追加することはできないようです。
この?索ボックスは、それが置かれたWiki全?を?索します。
パラメ?タ?
パラメ?タ?
|
?明
|
通用範?
|
互換性
|
例
|
結果
|
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
と共に使用され、現在は?定ではなく、ペ?ジ名の固定値となっています。
Any value means
yes/true
.
|
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=
|
全文?索で名前空間チェックボックスに??
"
Main
**
"を指定すると、デフォルトで主記事の名前空間がチェックされます。
|
search, fulltext
|
?
|
<
inputbox
>
type=search
namespaces=Main**,Help
</
inputbox
>
|
|
prefix=
|
- 特定の接頭?で始まるペ?ジに絞り?むことができます。 これは特定の?索バックエンドでのみ動作することに注意しましょう。現在は
Extension:CirrusSearch
のみです。 デフォルトでは空文字列(全ペ?ジ?索)です。
- 特定の接頭?で始まる新しいペ?ジを作成します。
- type=moveでは、デフォルトのパラメ?タに接頭?が付きます。
注:アンダ?スコアはスペ?スとして認識されません。
|
search, fulltext, create
|
?
|
<
inputbox
>
type=search
prefix={{FULLPAGENAME}}/Archive
</
inputbox
>
|
下のボタンは、名前の前に
Special:Mypage/
を付けています。
|
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?性を指定します。
|
すべての種類
|
for some types
|
<
inputbox
>
type=comment
page=Project:Sandbox
summary=Foo
id=bar
</
inputbox
>
|
|
inline=
|
InputBoxをインライン要素にする(冒頭で改行しない)。
Any value means
yes/true
.
|
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 any value.
|
create, comment
|
|
<
inputbox
>
type=create
break=no
useve=true
</
inputbox
>
|
|
usedt=
|
When adding a new section, the input box will open the
DiscussionTools new topic tool
, if the extension is installed, and this parameter is set to any value.
|
comment, commenttitle
|
|
<
inputbox
>
type=commenttitle
page=Project:Sandbox
usedt=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
>
Gives:
パ?サ???
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}}
?連項目
| この?張機能は以下のウィキ ファ?ム/ウィキ ホスト/パッケ?ジに含まれています:
これは正式な一?ではありません。
一部のウィキ ファ?ム/ウィキ ホスト/パッケ?ジは、ここに記載されていなくてもこの?張機能を含んでいる場合があります。
必ずご利用のウィキ ファ?ム、ウィキ ホスト、バンドルで確認してください。
|