tinymce.Annotator

This is the annotator api.

Summary

Methods

Name Summary Defined by

annotate()

Applies the annotation at the current selection using data

Annotator

annotationChanged()

Executes the specified callback when the current selection matches the annotation or not.

Annotator

getAll()

Retrieve all the annotations for a given name

Annotator

register()

Registers a specific annotator by name

Annotator

remove()

Removes any annotations from the current selection that match the name

Annotator

removeAll()

Removes all annotations that match the specified name from the entire document.

Annotator

Methods

annotate()

annotate(name: String, data: Object)

Applies the annotation at the current selection using data

Parameters

  • name (String) - the name of the annotation to apply

  • data (Object) - information to pass through to this particular annotation


annotationChanged()

annotationChanged(name: String, callback: Function)

Executes the specified callback when the current selection matches the annotation or not.

Parameters

  • name (String) - Name of annotation to listen for

  • callback (Function) - Callback with (state, name, and data) fired when the annotation at the cursor changes. If state if false, data will not be provided.


getAll()

getAll(name: String): Object

Retrieve all the annotations for a given name

Parameters

  • name (String) - the name of the annotations to retrieve

Return value

  • Object - an index of annotations from uid ⇒ DOM nodes


register()

register(name: String, settings: Object)

Registers a specific annotator by name

Parameters

  • name (String) - the name of the annotation

  • settings (Object) - settings for the annotation (e.g. decorate)


remove()

remove(name: String)

Removes any annotations from the current selection that match the name

Parameters

  • name (String) - the name of the annotation to remove


removeAll()

removeAll(name: String)

Removes all annotations that match the specified name from the entire document.

Parameters

  • name (String) - the name of the annotation to remove