0 results found

tinymce.EditorCommands

Contribute to this page
Namespacetinymce
ClassEditorCommands

This class enables you to add custom editor commands and it contains overrides for native browser commands to address various bugs and issues.

Public Methods

MethodDefined By
addCommands(command_list:Object, type:String):void : Adds commands to the command collection.EditorCommands
execCommand(command:String, ui:Boolean, value:Object):Boolean : Executes the specified command.EditorCommands
queryCommandState(command:String):Boolean/Number : Queries the current state for a command for example if the current selection is "bold".EditorCommands
queryCommandValue(command:String):Object : Queries the command value for example the current fontsize.EditorCommands

Method details

addCommands

public function addCommands(command_list:Object, type:String):void
Adds commands to the command collection.

Parameters

ParamDetail
command_list:ObjectName/value collection with commands to add, the names can also be comma separated.
type:StringOptional type to add, defaults to exec. Can be value or state as well.

execCommand

public function execCommand(command:String, ui:Boolean, value:Object):Boolean
Executes the specified command.

Parameters

ParamDetail
command:StringCommand to execute.
ui:BooleanOptional user interface state.
value:ObjectOptional value for command.

Returns
Boolean - true/false if the command was found or not.

queryCommandState

public function queryCommandState(command:String):Boolean/Number
Queries the current state for a command for example if the current selection is "bold".

Parameters

ParamDetail
command:StringCommand to check the state of.

Returns
Boolean/Number - true/false if the selected contents is bold or not, -1 if it's not found.

queryCommandValue

public function queryCommandValue(command:String):Object
Queries the command value for example the current fontsize.

Parameters

ParamDetail
command:StringCommand to check the value of.

Returns
Object - Command value of false if it's not found.

Except as otherwise noted, the content of this page is licensed under the Creative Commons BY-NC-SA 3.0 License, and code samples are licensed under the Apache 2.0 License.