tinymce.Formatter

Text formatter engine class. This class is used to apply formats like bold, italic, font size etc to the current selection or specific nodes. This engine was build to replace the browsers default formatting logic for execCommand due to it's inconsistant and buggy behavior.

Examples

tinymce.activeEditor.formatter.register('mycustomformat', {
   inline : 'span',
   styles : {color : '#ff0000'}
 });

 tinymce.activeEditor.formatter.apply('mycustomformat');

Methods

Method Defined By
Returns the format by name or all formats if no name is specified.
tinymce.Formatter
Registers a specific format by name.
tinymce.Formatter
Applies the specified format to the current selection or specified node.
tinymce.Formatter
Removes the specified format from the current selection or specified node.
tinymce.Formatter
Toggles the specified format on/off.
tinymce.Formatter
Return true/false if the specified node has the specified format.
tinymce.Formatter
Matches the current selection or specified node against the specified format name.
tinymce.Formatter
Matches the current selection against the array of formats and returns a new array with matching formats.
tinymce.Formatter
Returns true/false if the specified format can be applied to the current selection or not.
tinymce.Formatter
Executes the specified callback when the current selection matches the formats or not.
tinymce.Formatter