Jump to content

User:ערן/autocomplete

From Wikipedia, the free encyclopedia
Screenshot of autocomplete gadget

A context aware autocomplete that suggest links when user typing [[, and template when user type {{. The gadget takes advantage of TemplateData, and can also help to fill parameters names.

Setup

[edit]

Add to Special:MyPage/common.js:

{{subst:iusc|1=User:ערן/autocomplete.js}}

FAQ

[edit]
[edit]
  • The gadget use the same mechanism as the suggestion in the searchbox, only pages that appear in the search will be suggested.
  • The gadget suggest links when user start to type [[ and typed at least the beginning of the pagename.
  • The gadget suggest links also when a template parameter is filled is expecting page name based on template data (see #Templatedata)
  • The gadget supports links to sections (such as Wikipedia:Featured articles#Biology when user type [[Wikipedia:Featured articles#). By design this is supported only when editing pages not in main namespace.

Templates

[edit]
Autocomplete gadget can fill template names (cursor is near {{user he))
  • Similarly to links, the gadget suggest template names when user start to type {{

Templatedata

[edit]
Autocompelte gadget can fill parameters names (when the cursor is near "ima" parameter)
  • The gadget complete parameter names when user is within a template and typed | if the template has templatedata.
  • For templates expecting unnamed parameters, the gadget expect the user to first fill the unnamed parameters and doesn't suggest parameter name. For example
    • Template source: the user page is [[User:{{{1|{{{Username}}}}}}]]
    • when user typed {{template|User<span style=" it isn't possible to know whether the user typed a name of a user starting with "User" or started to type the parameter name "Username". The gadget assume the first option.
    • For parameters indicated as referring to other pages, the gadget suggest filling similar to links and templates. Supported parameters types:
    • wiki-page-name
    • wiki-file-name
    • wiki-user-name

Keyboard shortcuts

[edit]
  • ESC - close the suggestions
  • arrow keys - move between different suggestions.

See also

[edit]