Extension talk:InputBox

Jump to navigation Jump to search

About this board

For the page history, see also here. / previous talk on this page

Calebfergie (talkcontribs)

Hi there,

I'm a grad student making a game built on MediaWiki that uses InputBox. Thanks so much for it, I'm new to wiki software and it's exactly what the project needs - especially the 'create' type.

I was wondering if there was a way to make an InputBox that's 'fake'. What I mean is that it automatically navigates to another (existing) page, regardless of what is typed in the box.

I'm having trouble with inputs/forms in MediaWiki and was hoping there was a way to just use InputBox for this purpose.

I'm new to PHP so I'm not confident about modifying the existing extension - so if that's not possible, could you point me to another solution? All the field needs to do is behave like an input (with a button), but route to a page I can specify in the form.

Thanks again for the tool and in advance for any feedback.

Ciencia Al Poder (talkcontribs)

You can use JavaScript for that, which is more flexible.

You can use the type=commenttitle of inputbox to specify a page title, and then with JavaScript, remove the hidden input with name section.

Calebfergie (talkcontribs)

Thanks for getting back to me. This makes sense to me, could you clarify what you mean by "remove the hidden input with name section"?

I see a few hidden inputs within the commentttle form:

  1. <input type="hidden" value="edit" name="action">
  2. <input type="hidden" value="new" name="section">
  3. <input type="hidden" value="Priming Complete" name="title">

Do you mean remove #2?

To clarify, I want the user to go to the view version of the page, not the edit version/action. Is there something else I should change to do this as well?

Calebfergie (talkcontribs)


I was able to create the intended effect by adding the following JS:

$(function () {$("input[name=action]").remove();}());


RonnieV (talkcontribs)

Is there also a way to tell InputBox to not create a new section (== Section ==), but a subsection (=== Subsection ===)? Thanks in advance, ~~~~

Ciencia Al Poder (talkcontribs)

No, that's currently not possible

Reply to "Creating subsection"
RonnieV (talkcontribs)

I'd like to give a user an option by using an inputbox to start a new section on (the same) page. Using type=commenttitle, the input of the InputBox is available in the URL and will be used as the name for the section. I'm also using a prefill to offer the user a structure to enter (one) more thing. Is there an option to use the content of the Infobox in the prefill-page or in the resulting section?

If not, is it possible to combine two Inputboxes, so that the content of both is available to create a section with, one for the sectionname and one for the content? Thanks in advance, RonnieV (talk) 16:27, 25 February 2019 (UTC)

Reply to "Combining boxes or using input"

Mobile compatibility of preload

Summary by Ciencia Al Poder
Trizek (talkcontribs)

While editing a form that uses InputBox, I realized that the form I've created is not preloading anything on the default skin for mobile. The page briefly displays some code and is then replaced by a blank page.

I've tried to see if it was due to my form, but that's not the case.

Ciencia Al Poder (talkcontribs)
Reply to "Mobile compatibility of preload"

How to select single namespace to search in

Erutuon (talkcontribs)

In Category:Wiktionary-namespace discussion pages on the English Wiktionary, I want to have the inputbox search only in the Wiktionary (Project) namespace, to override user preferences (because I didn't have the Wiktionary namespace selected and saw no results!) and maybe save server resources.

Adding searchfilter=Wiktionary: ... doesn't work, because the filter is placed at the end of the search query (that is, if you enter blah in the box, you get the query blah Wiktionary: ...) and then the namespace filter doesn't work. Adding namespaces=Wiktionary works, but it adds whitespace (a <br> tag) between the textbox and the button; maybe the extension tries to create checkboxes and fails because there's only one namespace.

Any non-buggy way to choose one namespace to search in?

Quiddity (WMF) (talkcontribs)

I believe the prefix=Wiktionary: parameter will give the same result as the namespaces=Wiktionary parameter.

Erutuon (talkcontribs)

Oh yes, that works. Thanks!

Reply to "How to select single namespace to search in" (talkcontribs)

Is autocompletion possible in search type InputBox?

Quiddity (WMF) (talkcontribs)
Reply to "Autocomplete possible?"

%5B0%5D inserted into URL in stead of %5B%5D

Evolution and evolvability (talkcontribs)

There seems to be an issue with the preloadparams[] = parameter, where instead of including %5B%5D the text %5B0%5D is included, where the extra "0" prevevnts it from functioning.

see example: wikiversity.org/wiki/WikiJournal_Preprints

Any ideas for fixing this?

Ciencia Al Poder (talkcontribs)
Reply to "%5B0%5D inserted into URL in stead of %5B%5D"

Customise Button and Text Field colour, drop-shadow, border, etc?

2 (talkcontribs)

Hi, is it possible to modify the button colours, borders etc? And maybe the search box also?

Domtron vox (talkcontribs)

Haven't tried this for the input box, but you can make custom changes to the mediawiki CSS via the MediaWiki:Common.css page. Giving it a quick look the CSS classes your interested in is "mw-ui-button", "mw-ui-input", "mw-ui-input-inline", and possibly "mw-inputbox-centered" for the whole form area. (I just pulled these from the browser via the JS dev tools)

A bit late, but maybe it is useful to you or someone else.

Reply to "Customise Button and Text Field colour, drop-shadow, border, etc?" (talkcontribs)

Is there a way to look for/create pages with suffixes, as in prefix? If not, I don't suppose it would be a viable implementation? It'd be hella useful in some case.

Reply to "Suffix search/creation?"

Entering Content of New Section?

Johnywhy (talkcontribs)

I'd like an input box setup to create a new section to an existing page.

  • The user would enter the content of the new section
  • The section title would be hardcoded into the inputbox.
  • The page name would be hardcoded into the inputbox.
  • On submitting, the user would not be redirected to the target-page-- they'd remain on the current page.

Reading the extension manual, it seems none of this would be possible. Hope someone can prove me wrong.

Ciencia Al Poder (talkcontribs)

It's not possible. You'll need to

  • search for another extension (if one exists)
  • code your own one
  • use JavaScript for that and use the api to create the section on submit.
Johnywhy (talkcontribs)
This post was hidden by Ciencia Al Poder (history)
Johnywhy (talkcontribs)
Ciencia Al Poder (talkcontribs)

If the edit is going to be done on the same wiki where the JavaScript is being executed, JavaScript will be sending the same cookies that use the browser. Then, you don't need to login with JavaScript.

Johnywhy (talkcontribs)

You mean cookies for the user-login?

I thought bot-login is separate from user-login.

Ciencia Al Poder (talkcontribs)

I'd guess you want your users edit under their main account and not under their bot account. If not, disregard my previous comment.

Johnywhy (talkcontribs)

We need our bot to perform write-actions as logged-in user.

But also need to perform reads. i guess the reads could be under bot account, or user account-- doesn't matter cuz there's no write being logged.

So, since we're doing writes as logged-in user, then will keep things simple to perform reads with same cred.

Good idea!

Now i have to figure out how a bot can use the logged-user's cred.

Ciencia Al Poder (talkcontribs)

I don't see any relation between the original question (being able to create a new section from an input box) and bot edits.

Johnywhy (talkcontribs)
Reply to "Entering Content of New Section?"