User:PerfektesChaos/js/menuSwitcher

JavaScript gadget – provide multiplane toolset for large number of single tool triggers.

Major field is insertion of special characters into edited text.

  • However, the purpose is not limited to text editing, and any task my be triggered.
  • Text insertion is built-in capability.
  • So-called “edit tools” have been used on many wikis in the first decades of source text editing. This gadget provides a framework to create smart user interfaces.

A panel selection widget will be presented.

Functionality edit

Well known actions are:

  • Insertion of text fragments at cursor position, or embedding a text selection into a pair of delimiters.

The following issues are quite new:

  • Support VisualEditor.
    • Users may work with long term known special character sets, configured by the project, and use the identical collection on both source text editing and “visual” editing.
  • Positioning at arbitrary positions in page.
  • Hiding and displaying of the entire interface.
  • Panels depending on “content model” will be limited to appropriate pages (wikitext, CSS, JavaScript, Lua etc.).
  • Multiple copies may be placed within the page, e.g. close to several text input fields spread over the page.
  • “Overwrite mode” of text insertion when [Ctrl] is pressed simultaneously.

Some wikis already supported some of the following features:

  • User defined group of items to serve individual needs.
    • Any number of panels may be added to a basic project collection.
  • Memorize recent panel selection on this page, e.g. after preview or diff refreshing.
  • The most recent text input field will receive text insertion.
  • Support of <charinsert> panels.
  • Decoration capabilities.

Usage edit

Please see separate page for configuration and launching.

Default behaviour edit

Nothing visible.

Just listening for configuration events.

The wiki project is supposed to provide some general purpose collections, and users may add their own panels.

Internationalization edit

Not required for gadget itself.

A translation of this page may be offered.

Codes edit

Source code
ResourceLoader
  • ext.gadget.menuSwitcher for mw:Extension:Gadgets
  • Dependencies:
    • None required (self-completing)
    • jquery.textSelection
Namespaces Every. Includes forms on special pages.
Cookies sessionStorage memorizes recent panel selection on this page.
mw.libs menuSwitcher
mw.hook
  • menuSwitcher.ready
    When gadget is prepared for presentation.
  • menuSwitcher.created
    When page has been equipped with basic elements.
  • menuSwitcher.config
    Specify individual configuration.
MediaWiki 1.27

A test page tells how to check for proper functionality.

See also edit

  • editToolStrIns – similar gadget as of 2011, but with some different approaches.