Index

CommandTool

MMO.editor · 1 symbol · generated 30 Sep 2026

class

CommandTool

Tool.js:190

A tool that runs one of the browser's editing commands (document.execCommand).

class MMO.editor.CommandTool extends MMO.editor.Tool
Namespace
MMO.editor
Extends
Tool
The browser does these well -- splitting and merging blocks, lists, the typing style of a collapsed caret -- so the editor relies on it for them rather than rewriting them.
MMO.editor.CommandTool.Register('bold', {command: 'bold', icon: 'editor-bold', shortcut: 'Mod+b', inline: true});

Methods3

constructor(name, options)

Tool.js:200
constructor(name, options = {})
namestring
options = {}ObjectMMO.editor.Tool, plus: - command {string} the execCommand name - value {?string} its argument - state {boolean} false when the browser's queryCommandState does not say whether it is applied - tags {?string} a selector: the tool is applied when the selection is in one of these tags (the browser says a link is underlined, but the text has no <u>)