User:PerfektesChaos/js/editToolStrIns/Coding

Notes for developers.

enableForAllFields

 * en:MediaWiki:Edittools.js as of 2009 reads:
 * insertTags from the site-wide /skins-1.5/common/edit.js just inserts in the first textarea in the document. Evidently, that's not good if we have multiple textareas.
 * This has been overcome by MW 1.18 in mediawiki.action.edit.js – mw.toolbar.insertTags provides a currentFocused reference to either #wpSummary or #wpTextbox1.

noscript
By nature the script does not provide a non-JS approach. For users who have no access to JS or did not enable JS in their browser en:MediaWiki:Edittools supports a fallback menu.

JS variables

 * JS variables on global level abandoned.
 * is used to plug in an application object.

multiple textareas
The tool is expecting the class  where gadget and menu are established. It is assumed that this class has one member only.

debug
For developing purposes a  subclass is introduced. It will log messages only when explicitly requested. Such code shall be removed from productive releases.

interface page
mw.messages.get might be used to configure and distribute pieces of code for localization.