Skip to content

Commit

Permalink
NEW Make default TinyMCE settings configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Apr 18, 2024
1 parent 2bdc24c commit 72692f9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/Forms/HTMLEditor/TinyMCEConfig.php
Expand Up @@ -250,13 +250,11 @@ class TinyMCEConfig extends HTMLEditorConfig implements i18nEntityProvider
private static $image_size_presets = [ ];

/**
* TinyMCE JS settings
* Default TinyMCE JS options which apply to all new configurations.
*
* @link https://www.tiny.cloud/docs/tinymce/6/tinydrive-getting-started/#configure-the-required-tinymce-options
*
* @var array
*/
protected $settings = [
private static array $default_options = [
'fix_list_elements' => true, // https://www.tiny.cloud/docs/tinymce/6/content-filtering/#fix_list_elements
'formats' => [
'alignleft' => [
Expand Down Expand Up @@ -327,6 +325,8 @@ class TinyMCEConfig extends HTMLEditorConfig implements i18nEntityProvider
. "dd[id|class|title|dir],dl[id|class|title|dir],dt[id|class|title|dir],"
];

protected $settings = [];

/**
* Holder list of enabled plugins
*
Expand All @@ -351,6 +351,11 @@ class TinyMCEConfig extends HTMLEditorConfig implements i18nEntityProvider
*/
protected $theme = 'silver';

public function __construct()
{
$this->settings = static::config()->get('default_options');
}

/**
* Get the theme
*
Expand Down

0 comments on commit 72692f9

Please sign in to comment.