확장기능:InputBox

From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Extension:InputBox and the translation is 36% complete.

Other languages:
English • ‎français • ‎日本語 • ‎한국어 • ‎polski • ‎português do Brasil • ‎русский • ‎中文
This extension comes with MediaWiki 1.21 and above. Thus you do not have to download it again. However, you still need to follow the other instructions provided.
미디어위키 확장 기능 매뉴얼Manual:Extensions
Crystal Clear action run.svg
InputBox

출시 상태:Extension status 안정

Simple Input Form.png
구현Template:Extension#type Tag, Page action, Search
설명Template:Extension#description Allows users to add predefined HTML forms to wiki pages
만든이Template:Extension#username Erik Möller, Leonardo Pimenta, Rob Church, Trevor Parscal, Daniel Schuba (Eloquencetalk)
최신 버전Template:Extension#version Continuous updates
MediaWikiTemplate:Extension#mediawiki 1.23+
데이터베이스 변경Template:Extension#needs-updatephp 아니오
라이선스Template:Extension#license MIT License
다운로드
태그Template:Extension#tags
* <inputbox>
사용된 훅Template:Extension#hook
ParserFirstCallInitManual:Hooks/ParserFirstCallInit
MediaWikiPerformActionManual:Hooks/MediaWikiPerformAction
SpecialPageBeforeExecuteManual:Hooks/SpecialPageBeforeExecute

InputBox 확장 기능 번역 (translatewiki.net에서 가능한 경우)

사용법과 버전 매트릭스를 확인합니다.

이슈Phabricator

미해결 작업 · 버그 보고

The InputBox extension adds already created HTML forms to wiki pages. Users can “complete” a form (entering text, selecting menu items, etc.) by entering text into the box.

InputBox was originally created by Erik Möller for the purpose of adding a Create an article box to Wikinews.

설치

  • 파일을 다운로드해서, extensions/ 폴더 내의 InputBox 이라는 이름의 디렉터리 내에 설치합니다.
  • 아래의 코드를 LocalSettings.php의 말미에 추가합니다:
    wfLoadExtension( 'InputBox' );
    
  • YesY 완료 – 위키의 ‘Special:Version’에 이동해서, 확장기능이 올바르게 설치된 것을 확인합니다.

미디어위키 1.24 이하를 실행 중인 사용자에게:

위의 지시사항은 wfLoadExtension()을 사용하여 이 확장기능을 설치하는 새로운 방법을 기술합니다 wfLoadExtension( 'InputBox' ); 대신 이 초기 버전(미디어위키 1.24 이하)에 이 확장기능을 설치하려면 다음을 사용해야 합니다:

require_once "$IP/extensions/InputBox/InputBox.php";

예시

새 문서를 시작하기 위한 상자.

위키 코드

<inputbox>
type=create
break=no
</inputbox>

결과

General syntax

Input boxes are constructed like this:

<inputbox>
type=
bgcolor=
width=
default=
preload=
editintro=
buttonlabel=
hidden=
searchbuttonlabel=
break=
namespaces=
prefix=
placeholder=
preloadparams[]=
</inputbox>

The type parameter is mandatory. All other parameters are optional. preloadparams[] can appear more than once.

박스 종류

The default location of the “Submit” button(s) is below the input box. The “Submit” 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 “Submit” button to the right is useful for search boxes when search suggestions would otherwise cover up a search button below the search box.

종류 예시 설명
type=search
Creates a search box which has a default width of 50 characters. Information added in the text box is searched for.
type=create

새 문서 만들기. Information added in the text box is the name of the page which is edited.
type=comment

Adds a new section to the bottom of the page specified in the text box.
type=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. rev:42703에 추가됨.e
type=fulltext
Search only with the fulltext search button, without the “Go” button. rev:45269에 추가됨.ㅜ
type=move

다른 이름으로 이동하기. gerrit:97559에 추가됨.

For type=search2, the default location for the search button is 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=search2
 


변수

변수 설명e 목적 호환성 예시 결과
bgcolor= Sets the table background color (HTML color values). Do not use quotes. 모든 종류 ?
<inputbox>
type=search
bgcolor=#eeeeff
</inputbox>
width= Sets the width of the InputBox in characters. 모든 종류 ?
<inputbox>
type=create
width=24
</inputbox>

default= 기본 텍스트를 InputBox에 넣기. 모든 종류 ?
<inputbox>
type=comment
default=User talk:Eloquence
</inputbox>

preload= The page under this title will be preloaded (see Manual:Creating pages with preloaded textManual:Creating pages with preloaded text) into the blank editbox when a new page is created. create, comment, commentitle ?
<inputbox>
type=create
preload=Log
</inputbox>

ㅓㅓ
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. 모든 종류 ?
<inputbox>
type=comment
buttonlabel=Add new rumor
</inputbox>

hidden= This specifies that there is no InputBox.

It is used with parameter "default", now not being a default, but the fixed value of the name of the page.

create, comment ?
<inputbox>
type=comment
editintro=Extension:InputBox/editintro comment
preload=Extension:InputBox/preload
hidden=yes
default=Extension talk:InputBox
buttonlabel=토론 문서에 의견 달기
</inputbox>

searchbuttonlabel= This label will be used for the "Search full text" button of the search form. search, fulltext ?
<inputbox>
type=search
searchbuttonlabel=Dig deeperee
</inputbox>
fulltextbutton= Show the full text search button on search2 form search2 ?
<inputbox>
type=search2
searchbuttonlabel=Dig deeper
fulltextbutton=true
</inputbox>
labeltext= Text to print 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). 모든 종류 ?
<inputbox>
type=create
width=24
break=no
</inputbox>
namespaces= Support for namespace checkboxes in fulltext search.

일반, "Main**" 이름 공간에는 기본적으로 확인됩니다.

search, fulltext ?
<inputbox>
type=search
namespaces=Main**,Help
</inputbox>
prefix=
  • Narrow down search to pages beginning with certain prefix. Note this only works with certain search back-ends, currently only latest Extension:lucene-searchExtension:lucene-search. Defaults to empty string (search all pages).
  • Create new page beginning with a certain prefix.
  • In type=move, the prefix is prepended to the default parameter.

Remark: underscores aren't recognized as spaces.

search, fulltext, create ?
<inputbox>
type=search
prefix={{FULLPAGENAME}}/Archive
</inputbox>

The button below prefixes the name with Special:Mypage/.


placeholder= Define placeholder text that will display in the input box when it is empty. 모든 종류 1.19+
<inputbox>
type=search
placeholder=이 위키를 둘러보기
</inputbox>
page= Page to posts comment to, or page to move. comment, move
<inputbox>
type=comment
page=Project:Sandbox
</inputbox>

minor= 사소한 편집. comment, create
<inputbox>
type=comment
page=Project:Sandbox
minor=true
</inputbox>

nosummary= Edit summary (headline) not required for new comment. comment
<inputbox>
type=comment
page=Project:Sandbox
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>. 모든 종류 1.23 for some 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). 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. 모든 종류
<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, commentitle 1.25+
<inputbox>
type=create
preload=Log
preloadparams[]=param1
preloadparams[]=param2
</inputbox>

searchfilter= Specify parameters to append to the search search 1.30+
<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. Bug remains to be fixed to be able to include the prefix parameter in the string of the page to be created. If the whole path of the page is typed, VE creates it correctly in all spaces. 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:{{dir|{{pagelang}}|left|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=새로 만들기 {{{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}}

같이 보기