User:ערן/autocomplete

A context aware autocomplete that suggest links when user typing TemplateData, and can also help to fill parameters names.

Setup
Add to Special:MyPage/common.js: User:ערן/autocomplete.js

Links

 * 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 )
 * 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

 * Similarly to links, the gadget suggest template names when user start to type {{

Templatedata

 * 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:
 * 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

 * ESC - close the suggestions
 * arrow keys - move between different suggestions.