User:קיפודנחש/personalEdittools

General
personalEdittools script lets the user define personal "Edit tools".

In this context, an "Edit tool" is a button-like tool, that injects its content into the edit-box when pressed, optionally enveloping the selected text in the edit box.

To use it, one has to add to Special:Mypage/common.js the following line: and define the edit tools to be used in the personal page Special:Mypage/Edit tools.

The documentation of the syntax of the "Edit tools" page can be found at mw:Extension:Charinsert.

Buttons
Buttons are enclosed within "charinsert" tags. e.g.,
 * this will create a button that looks like so:
 * this will create a button that looks like so:

note the "+" sign. this has a special meaning: it does not show on the button itself, but if there is any selected text in the edit box, the underline tag will envelope it. otherwise, after the injection of the tags to the edit page, the edit caret will be at the location of the "+".

a single pair of "charinsert" tags can be used for many buttons: whenever a space encountered, it means a new button is to be created. If you want the button to include spaces, this can be accomplished by enclosing it in a "nowiki" tag.

Namespaces
You can define some of the tools that to only be visible in specific namespaces. This is done by enclosing the buttons in a html element with specific ID and style. the ID is personal-edittools-NAMESPACE, and the style is "display:none;".

For instance, the following line in your "Edit tools" page will add a button and Smile3, but only in User talk namespace. note that the 2nd one adds ~. to prevent wikipedia from converting this to your signature when saving the "Edittools" page, we add the "+" between the first and the 2nd. You can use different html elements (e.g., "div", "p" etc), not just "span" as in the example. The element can contain any number of buttons.

The namespace names are listed below.
 * Main space: "Article" (note that this is not the "real" name of article space: the real name is an empty string, but the script uses "Article" instead)
 * Talk
 * User
 * User_talk
 * Wikipedia: "Project"
 * Wikipedia talk: Project_talk
 * File
 * File_talk
 * Mediawiki
 * Mediawiki_talk
 * Template
 * Template_talk
 * Help
 * Help_talk
 * Category
 * Category_talk

Descriptive text
Anything on the "Edit tools" page which is not enclosed within "charinsert" tags, will appear in the "Personal edit tools" box as is, without becoming a button.

Appearance
By default, the "Buttons" look like links. However, you can make them appear mode like "real" buttons by including the following segment in your Special:Mypage/common.css page: