Extension:CharInsert

From MediaWiki.org

Jump to: navigation, search

       

Manual on MediaWiki Extensions
List of MediaWiki Extensions
Crystal Clear action run.png
CharInsert

Release status: stable

Implementation  Tag, Page action
Description Create JavaScript character insert boxes.
Author(s)  Brion Vibber
License GPL
Download Download snapshot

Subversion [Help]
Browse source code

check usage (experimental)

CharInsert is an extension that creates JavaScript links that when clicked, insert predefined text into the text box.

These links are usually used in MediaWiki:Edittools system message (for an example, see Wikipedia:MediaWiki:Edittools).

Contents

[edit] Syntax

Use <charinsert> tags with a space-separated list of characters or tags for which you wish to allow insertion.

You can use + sign inside a tag to define a place to:

  • insert selected text or
  • place cursor if no text was selected.

You have to enclose templates and spaces inside <nowiki>:

<charinsert><nowiki>== + ==</nowiki> <nowiki>{{stub}}</nowiki></charinsert>

[edit] Sample output

Note that clicking the links will have no effect since there is no text box.

Á á Ć ć É é Í í Ĺ ĺ Ń ń Ó ó Ŕ ŕ Ś ś Ú ú Ý ý Ź ź

[edit] Notes

  • Generated JavaScript links also work in other areas around edit window, e.g. in MediaWiki:Copyrightwarning or MediaWiki:Newarticletext, on the page preloaded with Inputbox, and even from the text preview.
  • They can also be used in MediaWiki:Uploadtext to insert image description templates.
  • Generated JavaScript links use insertTags() from wikibits.js.
  • Unlike toolbar buttons on top, this extension doesn't provide a way to specify inserted "sample text".

[edit] Installation


This extension is being used on one or more of Wikimedia's wikis. It means that the extension is stable and works well enough to be used by such high traffic websites. A full list of the extensions installed on a particular wiki is produced by Special:Version on that wiki.