Extension:CharInsert/ja

CharInsertはJavaScriptリンクの作成を有効にする拡張機能です. クリックされたときに、あらかじめ定義されたテキストがtext boxに挿入されます.

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

構文
CharInsertは :

使用法とサンプル出力
→

テキストボックスが存在しないため、リンクをクリックしても効果がないことにご注意ください.

注記

 * 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.
 * Unlike toolbar buttons on top, this extension doesn't provide a way to specify inserted "sample text".
 * Use  to add new lines (\n).
 * Add tags into Mediawiki:Edittools.

高度なインストール
重要: You must have Extension:Gadgets for this to work.

スタイル


To give the charinsert lists additional styling, wrap the contents of your Edittools between  and   and add styling for them to your. This site (www.mediawiki.org) does that to make the links appear like buttons (as shown in the screenshot to the side). The below stylesheet was used for that, copy it to your to apply the same styling.

スクリプト
If you have many CharInsert links, one could use Javascript to put them in separate groups and allow dynamic switching with a dropdown menu. For example to separate diacritical characters from wikisyntax etc. Several sites (such as mediawiki.org, de.wikipedia.org and en.wikipedia.org) have done this. They all implemented it in different ways though. Documented below is the way it is done on mediawiki.org:

1. Wrap the all the charinsert tags on MediaWiki:Edittools into a container and give it a descriptive, unique, ID (for example "mw-edittools-charinsert"):  ...
 * 2. Wrap each individual block of charinserts into p tags like this:

 ...
 * Note:
 * Don't change the word 'mw-edittools-section'
 * The text behind "data-section-title=" will identify this group in the dropdown menu.
 * Make sure there is one group without the ' ' 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 contents of MediaWiki:Gadget-Edittools.js to an equally named page on your own wiki
 * 4. Add the following code to your :


 * Edittools[ResourceLoader|default]|Edittools.js