3 namespace Drupal\editor_test\Plugin\Editor;
5 use Drupal\Core\Form\FormStateInterface;
6 use Drupal\editor\Entity\Editor;
7 use Drupal\editor\Plugin\EditorBase;
10 * Defines a Tyrannosaurus-Rex powered text editor for testing purposes.
14 * label = @Translation("TRex Editor"),
15 * supports_content_filtering = TRUE,
16 * supports_inline_editing = TRUE,
17 * is_xss_safe = FALSE,
18 * supported_element_types = {
23 class TRexEditor extends EditorBase {
28 public function getDefaultSettings() {
29 return ['stumpy_arms' => TRUE];
35 public function settingsForm(array $form, FormStateInterface $form_state, Editor $editor) {
36 $form['stumpy_arms'] = [
37 '#title' => t('Stumpy arms'),
38 '#type' => 'checkbox',
39 '#default_value' => TRUE,
47 public function getJSSettings(Editor $editor) {
49 $settings = $editor->getSettings();
50 if ($settings['stumpy_arms']) {
51 $js_settings['doMyArmsLookStumpy'] = TRUE;
59 public function getLibraries(Editor $editor) {