Extension:CharInsert

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

Syntax
Use  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 :

Usage and sample output
→

Note: Clicking the links will have no effect since there is no text box.

Installation

 * Download the latest snapshot and extract it to your extensions directory.
 * Put the following line near the end of your LocalSettings.php file:
 * Add tags into Mediawiki:Edittools or another appopriate system message that gets displayed on edit/create pages (like the copyright warnings), depending e.g. on where the CharInsert tools shall appear on the page.

Advanced Installation
/******* Extra buttons for 'edittools' (modified from www.mediawiki.org/MediaWiki:Common.css) ********/ .my-buttons { /* padding: 1em; */ /* margin:5px; */ } .my-buttons a { color: black; background-color: #c0d0e0 ; font-family:monospace; font-size: 115%; text-decoration: none; border: thin #069 outset; line-spacing:5pt; } .my-buttons a:hover { background-color: #d0e0f0; border-style:outset; } .my-buttons a:active { background-color: #e0f0e0; border-style: inset; }
 * You can wrap your charinsert lists into  tags and then add style sheets to Mediawiki:Common.css to influence the looks of the links that CharInsert produces. This site (www.mediawiki.org) does that to make the links appear like buttons. Another example is given below, it creates the box as shown in the screenshot.
 * Furthermore, using Javascript, a dropdown box can be added that makes several groups of CharInsert links selectable e.g. in case there are too many of them to be displayed on one screen, or if you want to separate special and diacritical characters from wiki syntax etc. This site, the english and the german Wikipedias all implement this in a different way. This describes the mediawiki.org way unmodified:
 * 1. Wrap the whole list of charinsert tags into this div (the "id=" is the important part):

 ...
 * 2. Wrap each individual block of charinserts into p tags like this:

 ...
 * Note:
 * Don't customise the word 'specialbasic'
 * The text behind "id=" will identify this group in the dropdown menu.
 * Make sure there is one group without the 'display:none' directive: That will be the default choice in the dropdown menu. On this site, it is called 'Standard' while the other groups are named by the language for which the characters are significant.
 * 3. Copy the following two pages to your wiki (you will probably have to create the pages on your wiki first): Mediawiki:Edittools.js and Mediawiki:Editpage.js
 * 4. Add the following code to your Mediawiki:Common.js:

var load_edittools = true; // extra drop down menu on editing for adding special characters importScript( 'MediaWiki:Edittools.js' ); // Editpage scripts if( wgAction == 'edit' || wgAction == 'submit' ) { importScript( 'MediaWiki:Editpage.js' ); }
 * Note:
 * The JS programs contain their own styles for "my-buttons" thus overlaying the custom styles explained above.
 * The JS programs are probably MW-version dependant. They have worked in a 1.15.3 wiki (copied from 1.16 from this site)