확장기능:InputBox

From mediawiki.org
This page is a translated version of the page Extension:InputBox and the translation is 48% complete.
Outdated translations are marked like this.
이 확장 기능은 미디어위키 1.21 이상에서 포함됩니다. 따라서 다시 다운로드하지 않아도 됩니다. 하지만 여전히 제공되는 별개의 지침을 따라야 합니다.
미디어위키 확장 기능 설명서
InputBox
출시 상태: 안정
구현 태그 , Page action , 검색
설명 사용자가 미리 정의한 HTML 폼을 문서에 추가할 수 있게 합니다.
만든 이
  • Erik Möller
  • Leonardo Pimenta
  • Rob Church
  • Trevor Parscal
  • Daniel Schuba
최신 버전 Continuous updates
MediaWiki >= 1.42
데이터베이스 변경 아니오
라이선스 MIT 허가서
다운로드
  • <inputbox>
Quarterly downloads 288 (Ranked 23rd)
Public wikis using 10,897 (Ranked 10th)
InputBox 확장 기능 번역 (translatewiki.net에서 가능한 경우)
이슈 미해결 작업 · 버그 보고

InputBox 확장 기능은 미리 만들어둔 HTML 폼을 위키 문서에 추가합니다. 사용자들은 이 폼을 “채워서” (글자를 적거나 메뉴를 고르거나 하는 등) 글자를 상자 안으로 넣을 수 있습니다.

InputBox는 처음에는 Wikinews새 문서 만들기 상자를 추가하기 위해 Erik Möller에 의해 제작되었습니다.

설치

  • 파일을 다운로드하고 InputBox 폴더를 extensions/ 디렉토리에 넣어 주세요.
    개발자와 코딩 기여자는 Git을 이용해 확장기능을 다운받는 것이 좋습니다.cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/InputBox
  • 아래의 코드를 LocalSettings.php 코드의 마지막에 추가합니다.
    wfLoadExtension( 'InputBox' );
    
  • Yes 완료 – 위키의 ‘Special:Version’에 이동해서, 확장기능이 올바르게 설치된 것을 확인합니다.

예시

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

위키 코드

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

결과

일반적인 구문

Input box는 다음과 같은 구조를 같습니다.

<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[]는 여러 번 나타날 수 있습니다.

박스 종류

제출 버튼은 기본적으로 상자 아래에 나타납니다.

“제출” 버튼은 line break 매개 변수를 다음과 같이 사용하면 상자와 버튼 사이의 줄바꿈이 제거되어 상자의 오른쪽으로 갑니다: 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의 경우 검색 버튼의 기본 위치는 오른쪽입니다. 현재 이 InputBox에 다른 매개 변수를 추가할 수 없는 것으로 보입니다. 이 검색 상자는 위치한 위키 전체를 검색합니다.

종류 예시
search2
 

변수

변수 설명 목적 호환성 예시 결과
arialabel= Supply the aria-label attribute to the inputbox to allow generated markup be accessible to screen readers All types
1.35
Gerrit change 572050
<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= 새 문서를 생성할 때 이 제목의 문서가 빈 편집 창에 preload됩니다(Manual:Creating pages with preloaded text 참조). create, comment, commenttitle ?
<inputbox>
type=create
preload=Log
</inputbox>

효과를 각각 알아보기 위해 위 혹은 아래의 InputBox에 존재하지 않는 문서 이름을 적어 넣고 Enter를 누르거나 문서 만들기 혹은 새 문단를 클릭하십시오.
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. 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= 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 display beside the button search2 ?
<inputbox>
type=search2
searchbuttonlabel=Dig deeper
labeltext=찾기: 
</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 Extension:CirrusSearch . 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=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>. 모든 종류
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). 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. 모든 종류
<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
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 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=새 {{{1|글}}} 만들기
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}}

같이 보기