Rozšíření:InputBox
InputBox Stav rozšíření: stabilní |
|
---|---|
Zavádění | Značka , Akce stránky , Hledání |
Popis | Umožňuje uživatelům přidat předdefinované HTML formuláře do wiki stránek |
Napsal(i) |
|
Nejnovější verze | Continuous updates |
MediaWiki | >= 1.43 |
Změny v databázi | Ne |
Licence | Licence MIT |
Zdrojový kód | |
Příklad | |
|
|
Čtvrtletní stahování | 258 (Ranked 20th) |
Používání veřejných wikin | 10,897 (Ranked 10th) |
Přeložte rozšíření InputBox, používá-li lokalizaci z translatewiki.net | |
Problémy | Otevřené úkoly · Nahlásit chybu |
Rozšíření InputBox přidává již vytvořené formuláře HTML do wiki stránek. Uživatelé mohou "doplnit" formulář (vkládání textu, vybírání položek z menu atd.) vložením textu do políčka.
InputBox byl původně vytvořen uživatelem Erik Möller z důvodu přidání pole Vytvořit článek do Wikinews.
Instalace
- Stáhněte soubor/y a vložte je do adresáře pojmenovaného
InputBox
ve vaší složceextensions/
.
Vývojáři a přispěvatelé kódu by si místo toho měli nainstalovat rozšíření from Git pomocí:cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/InputBox - Na konec vašeho souboru LocalSettings.php přidejte následující kód:
wfLoadExtension( 'InputBox' );
- Dokončeno – Přejděte na stránku Special:Version vaší wiki a zkontrolujte, zda bylo rozšíření úspěšně nainstalováno.
Příklad
Formulář pro založení nového článku.
Wiki kód
<inputbox>
type=create
width=30
break=no
</inputbox>
Výsledek
Obecná skladba
Input boxy jsou konstruovány třeba takto:
<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>
Parametr type
je povinný.
Všechny ostatní parametry jsou nepovinné.
preloadparams[]
se mohou objevit více než jednou.
Typy boxů
Výchozí umístění tlačítek "Odeslat" je pod vstupním polem.
The “Odeslat” button can be moved to the right by using the line break parameter to eliminate the line break between the box and the button: break=no
.
Having the “Odeslat” button to the right is useful for search boxes when search suggestions would otherwise cover up a search button below the search box.
type | Example | Description |
---|---|---|
search | Creates a search box which has a default width of 50 characters. Information added in the text box is searched for exact page title (first button) or text in articles (second button). | |
create | Creates a new page. Information added in the text box is the name of the page to be created (or page to edit if it already exists). | |
comment | Adds a new section to the bottom of the page specified in the text box (creates the page if new). | |
commenttitle | Adds a new section with the section header typed into the text box. The title can be specified with default= parameter. The page has to be specified with page= parameter. For some reason this does NOT work when using the extension by invoking it with {{#tag}}, only when using <inputbox> . (zavedeno od rev:47203)
| |
fulltext | Search only with the fulltext search button, without the exact match button (“Jít na” button). (zavedeno od rev:45269) | |
move | Move a page to a different name. This also doesn't work when creating it by invoking a tag. (zavedeno od gerrit:97559) |
For type=search2
, the default location for the search button is inline to the right.
Currently, it does not seem to be possible to add other parameters to this type of input box.
This search box searches the entire wiki that it is placed on.
type | Example |
---|---|
search2 |
Parameters
Parameter | Description | Scope | Compatibility | Example | Result | |
---|---|---|---|---|---|---|
arialabel= | Supply the aria-label attribute to the inputbox to allow generated markup be accessible to screen readers | All types |
|
<inputbox>
type=search
arialabel=Search the Wiki
</inputbox>
|
||
bgcolor= | Sets the table background color (HTML color values). Do not use quotes. | All types | ? | <inputbox>
type=search
bgcolor=#eeeeff
</inputbox>
|
||
width= | Sets the width of the InputBox in characters. | All types | ? | <inputbox>
type=create
width=24
</inputbox>
|
||
default= | Default text to put in the InputBox. | All types | ? | <inputbox>
type=comment
default=User talk:Eloquence
</inputbox>
|
||
preload= | The page under this title will be preloaded (see Manual:Creating pages with preloaded text ) into the blank editbox when a new page is created. | create, comment, commenttitle | ? | <inputbox>
type=create
preload=Log
</inputbox>
|
||
Enter the title of a non-existent page in the example InputBox above or below, and click "Vytvořit článek" or "Nová sekce" respectively to test this effect. | ||||||
editintro= | The page which is given under this parameter will be shown, as instructions, above the editing window. | create, comment | ? | <inputbox>
type=comment
editintro=MediaWiki:Missingcommenttext
</inputbox>
|
||
buttonlabel= | This label will be used for the main button of the form. | All types | ? | <inputbox>
type=comment
buttonlabel=Add new rumor
</inputbox>
|
||
hidden= | This specifies that there is no InputBox.
It is used with parameter |
create, comment | ? | <inputbox>
type=comment
editintro=Extension:InputBox/editintro comment
preload=Extension:InputBox/preload
hidden=yes
default=Extension talk:InputBox
buttonlabel=Post a comment on the talk page
</inputbox>
|
||
searchbuttonlabel= | This label will be used for the "Search full text" button of the search form. | search, fulltext | ? | <inputbox>
type=search
searchbuttonlabel=Dig deeper
</inputbox>
|
||
fulltextbutton= | Show the full text search button on search2 form | search2 | ? | <inputbox>
type=search2
searchbuttonlabel=Dig deeper
fulltextbutton=true
</inputbox>
|
||
labeltext= | Text to display beside the button | search2 | ? | <inputbox>
type=search2
searchbuttonlabel=Dig deeper
labeltext=Look for:
</inputbox>
|
||
break= | Whether or not to insert a line break between the input box and the button(s). Defaults to yes (use a line break). | All types | ? | <inputbox>
type=create
width=24
break=no
</inputbox>
|
||
namespaces= | Support for namespace checkboxes in fulltext search.
With " |
search, fulltext | ? | <inputbox>
type=search
namespaces=Main**,Help
</inputbox>
|
||
prefix= |
Remark: underscores aren't recognized as spaces. |
search, fulltext, create | ? | <inputbox>
type=search
prefix={{FULLPAGENAME}}/Archive
</inputbox>
|
The button below prefixes the name with | |
placeholder= | Define placeholder text that will display in the input box when it is empty. | All types |
|
<inputbox>
type=search
placeholder=Search this Wiki
</inputbox>
|
||
page= | Page to posts comment to, or page to move. | comment, move | <inputbox>
type=comment
page=Project:Sandbox
</inputbox>
|
|||
minor= | Minor edit. | comment, create | <inputbox>
type=comment
page=Project:Sandbox
minor=true
</inputbox>
|
|||
nosummary= | Edit summary (headline) not required for new comment. | comment | <inputbox>
type=commenttitle
page=Special:Mypage/inputbox test
nosummary=true
</inputbox>
|
|||
summary= | Edit summary or move reason. | create, move | <inputbox>
type=create
default=Special:Mypage/inputbox test
summary=Foo
</inputbox>
|
|||
id= | id attribute for <form>. | All types |
|
<inputbox>
type=comment
page=Project:Sandbox
summary=Foo
id=bar
</inputbox>
|
||
inline= | Make the InputBox be an inline element (no line break at beginning). Any value means yes/true. | search2 | Text here: <inputbox>
type=search2
inline=true
width=10
</inputbox>
|
Text here: | ||
dir= | Right to left (rtl) or left to right (ltr). Defaults to directionality of the page's language. | All types | <inputbox>
dir=rtl
type=comment
page=Project:Sandbox
summary=Foo
</inputbox>
|
|||
preloadparams[]= | Specify parameters to the preload text. See Creating pages with preloaded text. | create, comment, commenttitle |
|
<inputbox>
type=create
preload=Log
preloadparams[]=param1
preloadparams[]=param2
</inputbox>
|
||
searchfilter= | Specify parameters to append to the search | search, fulltext |
|
<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.
Alignment
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:
Parser function
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}}
See also
Toto rozšíření se používá na jednom nebo více projektech Wikimedie. Pravděpodobně to znamená, že rozšíření je stabilní a funguje dostatečně dobře, aby jej mohly používat weby s tak vysokou návštěvností. Vyhledejte tento název rozšíření v konfiguračních souborech CommonSettings.php a InitialiseSettings.php Wikimedie, abyste viděli, kde je nainstalováno. Úplný seznam rozšíření nainstalovaných na konkrétní wiki lze vidět na stránce wiki Special:Version. |
Toto rozšíření je zahrnuto v následujících wiki farmách/hostitelích a/nebo balíčcích: Toto není autoritativní seznam. Některé wiki farmy/hostitelé a/nebo balíčky mohou toto rozšíření obsahovat, i když zde nejsou uvedeny. Pro potvrzení se vždy obraťte na své wiki farmy/hostitele nebo balíček. |
- Extensions bundled with MediaWiki 1.21/cs
- Stable extensions/cs
- Tag extensions/cs
- Page action extensions/cs
- Search extensions/cs
- MIT licensed extensions/cs
- Extensions in Wikimedia version control/cs
- MediaWikiPerformAction extensions/cs
- ParserFirstCallInit extensions/cs
- SpecialPageBeforeExecute extensions/cs
- All extensions/cs
- Extensions used on Wikimedia/cs
- Extensions included in BlueSpice/cs
- Extensions included in Canasta/cs
- Extensions available as Debian packages/cs
- Extensions included in Fandom/cs
- Extensions included in Miraheze/cs
- Extensions included in MyWikis/cs
- Extensions included in ProWiki/cs
- Extensions included in semantic::core/cs
- Extensions included in ShoutWiki/cs
- Extensions included in Telepedia/cs
- Extensions included in wiki.gg/cs
- Extensions included in WikiForge/cs
- Form extensions/cs
- Page creation extensions/cs
- Search widget extensions/cs
- Edit box extensions/cs