Namespace: editorConfiguration

Drupal. editorConfiguration

Editor configuration namespace.

Methods

staticDrupal.editorConfiguration.addedFeature(feature)

Must be called by a specific text editor's configuration whenever a feature is added by the user.

Triggers the drupalEditorFeatureAdded event on the document, which receives a Drupal.EditorFeature object.

Name Type Description
feature Drupal.EditorFeature

A text editor feature object.

Fires:
  • event:drupalEditorFeatureAdded

staticDrupal.editorConfiguration.featureIsAllowedByFilters(feature){bool}

May be called by a specific text editor's configuration whenever a feature is being added, to check whether it would require the filter settings to be updated.

The canonical use case is when a text editor is being enabled: preferably this would not cause the filter settings to be changed; rather, the default set of buttons (features) for the text editor should adjust itself to not cause filter setting changes.

Note: for filters to integrate with this functionality, it is necessary that they implement Drupal.filterSettingsForEditors[filterID].getRules().

Name Type Description
feature Drupal.EditorFeature

A text editor feature object.

Returns:
Type Description
bool Whether the given feature is allowed by the current filters.

staticDrupal.editorConfiguration.modifiedFeature(feature)

Must be called by a specific text editor's configuration whenever a feature is modified, i.e. has different rules.

For example when the "Bold" button is configured to use the <b> tag instead of the <strong> tag.

Triggers the drupalEditorFeatureModified event on the document, which receives a Drupal.EditorFeature object.

Name Type Description
feature Drupal.EditorFeature

A text editor feature object.

Fires:
  • event:drupalEditorFeatureModified

staticDrupal.editorConfiguration.removedFeature(feature)

Must be called by a specific text editor's configuration whenever a feature is removed by the user.

Triggers the drupalEditorFeatureRemoved event on the document, which receives a Drupal.EditorFeature object.

Name Type Description
feature Drupal.EditorFeature

A text editor feature object.

Fires:
  • event:drupalEditorFeatureRemoved