Editor configuration namespace.
Methods
(static) 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.
Parameters:
Name | Type | Description |
---|---|---|
feature |
Drupal.EditorFeature | A text editor feature object. |
Fires:
- event:drupalEditorFeatureAdded
(static) 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()
.
Parameters:
Name | Type | Description |
---|---|---|
feature |
Drupal.EditorFeature | A text editor feature object. |
Returns:
Whether the given feature is allowed by the current filters.
- Type
- bool
(static) 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.
Parameters:
Name | Type | Description |
---|---|---|
feature |
Drupal.EditorFeature | A text editor feature object. |
Fires:
- event:drupalEditorFeatureModified
(static) 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.
Parameters:
Name | Type | Description |
---|---|---|
feature |
Drupal.EditorFeature | A text editor feature object. |
Fires:
- event:drupalEditorFeatureRemoved