הרחבה:InputBox

This page is a translated version of the page Extension:InputBox and the translation is 66% complete.
Outdated translations are marked like this.
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.
MediaWiki extensions manual
InputBox
Release status: stable
Implementation Tag , Page action , Search
Description מאפשרת למשתמשים להוסיף טפסי HTML מוגדרים מראש לדפי ויקי
Author(s)
  • Erik Möller
  • Leonardo Pimenta
  • Rob Church
  • Trevor Parscal
  • Daniel Schuba
Latest version Continuous updates
MediaWiki >= 1.42
Database changes No
License MIT License
Download
  • <inputbox>
Quarterly downloads 291 (Ranked 23rd)
Public wikis using 10,897 (Ranked 10th)
Translate the InputBox extension if it is available at translatewiki.net
Issues Open tasks · Report a bug

הרחבת InputBox (בעברית: "תיבת־קלט") מוסיפה טפסי HTML שנוצרו מראש לדפי ויקי. משתמשים יכולים "להשלים" טופס (להזין טקסט, לבחור פריטי תפריט וכו') על ידי הקלדת טקסט לתוך תיבה.

InputBox נוצרה במקור על ידי Erik Möller במטרה להוסיף תיבת יצירת ערך לוויקיחדשות.

התקנה

  • Download and move the extracted InputBox folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/InputBox
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'InputBox' );
    
  •   Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

דוגמה

תיבה להתחלת ערך חדש.

קוד ויקי

<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.

Having the “שליחה” button to the right is useful for search boxes when search suggestions would otherwise cover up a search button below the search box.

סוג דוגמה תיאור
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>. (introduced in rev:47203)
fulltext
חיפוש רק עם הכפתור לחיפוש טקסט־מלא, ללא כפתור ה־"הצגה". (introduced in rev:45269)
move

העברת דף לשם אחר. This also doesn't work when creating it by invoking a tag. (introduced in gerrit:97559)

עבור type=search2, מיקום ברירת המחדל של כפתור החיפוש הוא מימין לתיבה. נכון לעכשיו לא נראה אפשרי להוסיף פרמטרים אחרים לסוג זה של תיבת טקסט. תיבת הטקסט הזאת מחפשת בכל אתר הוויקי שבו היא ממוקמת.

סוג דוגמה
search2
 

פרמטרים

פרמטר תיאור Scope תאימות דוגמה תוצאה
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>
type=create
width=24
</inputbox>

default= טקסט ברירת מחדל שיוכנס לתיבת הקלט. כל הסוגים ?
<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>

יש להכניס את כותרת הדף (דף שעדיין לא קיים) בדוגמה הבאה לתוך תיבת הקלט, וללחוץ על "יצירת הדף" או על "פרק חדש" בהתאמה על מנת לנסות את האפקט.
editintro= הדף שהוגדר בפרמטר הזה יוצג, בתור תיבת הנחיות, "מעל" לחלון העריכה. create, comment ?
<inputbox>
type=comment
editintro=MediaWiki:Missingcommenttext
</inputbox>

buttonlabel= תווית זאת תופיע בכפתור הראשי בטופס. כל הסוגים ?
<inputbox>
type=comment
buttonlabel=Add new rumor
</inputbox>

hidden= פרמטר זה קובע שלא תהיה תיבת קלט.

אם עושים בו שימוש יחד עם הפרמטר "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= הצגת כפתור החיפוש אחר טקסט־מלא בטופס החיפוש השני (search2) search2 ?
<inputbox>
type=search2
searchbuttonlabel=לחפור לעומק
fulltextbutton=true
</inputbox>
labeltext= טקסט להדפסה לפני הכפתור search2 ?
<inputbox>
type=search2
searchbuttonlabel=לחפור לעומק
labeltext=לחפש אחר: 
</inputbox>
 
break= Whether or not to insert a line break between the input box and the button(s). ברירת המחדל היא yes (להשתמש בשבירת שורה). כל הסוגים ?
<inputbox>
type=create
width=24
break=no
</inputbox>
namespaces= Support for namespace checkboxes in fulltext search.

With "Main**", main article namespace is checked by default.

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= הדף שאליו רוצים לפרסם תגובות, או הדף שרוצים להעביר. 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= מאפיין id עבור <form>. כל הסוגים
1.23
for some types
<inputbox>
type=comment
page=Project:Sandbox
summary=Foo
id=bar
</inputbox>

inline= הפיכת תיבת הקלט לאלמנט שמוכנס לאותה השורה (ללא שבירת שורה בהתחלה). 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[]= ציון פרמטרים לטקסט מוגדר מראש. ר' יצירת דפים עם טקסט מוגדר מראש. 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>

הגדרת create כשהוכנס שם של דף קיים פשוט תביא את דף העריכה. במקרה כזה אין התייחסות ל־preload. הגדרת comment עבור דף חדש תעבוד.

הטקסטים שנלקחו ממרחב MediaWiki: הם רק דוגמאות, כל דף קיים יכול להיות משומש ב־"editintro" או ב־"preload". לרוע המזל preload עדיין לא עובד בתקציר העלאת קובץ.

יישור

אם ברצונכם ליצור תיבת קלט עם יישור לימין הדף, עשו משהו כמו:

<div style="float:left; width:42em">
<inputbox>
type=create
</inputbox>
</div>

Gives:


פונקציית מפענח

שימוש בתיבת קלט בתוך תבנית

כדי ליצור מספר תיבות קלט דומות, ניתן להשתמש ב־InputBox בתבנית. However, passing template parameters to InputBox parameters only works if the ‎<inputbox>...‎</inputbox> tag is written as {{#tag:inputbox | ...}} inside the 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}}

ראו גם