Skip to content

Commit 81d7b54

Browse files
jmschejmsche
authored andcommitted
Add Track changes plugin & options
1 parent 6d00c44 commit 81d7b54

File tree

5 files changed

+10
-2
lines changed

5 files changed

+10
-2
lines changed

CHANGELOG-1.x.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
1.6.0
2+
-----
3+
4+
* Add Track changes plugin & options
5+
16
1.5.0
27
-----
38

src/Form/Type/FroalaEditorType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function buildView(FormView $view, FormInterface $form, array $options):
8282

8383
$arrPlugin = $this->pluginProvider->obtainArrPluginToInclude($arrPluginEnabled, $arrPluginDisabled);
8484

85-
$view->vars['froala_arrOption']['pluginsEnabled'] = $this->pluginProvider->obtainArrPluginCamelized($arrPlugin);
85+
$view->vars['froala_arrOption']['pluginsEnabled'] = array_map(fn (string $plugin): string => 'trackChanges' === $plugin ? 'track_changes' : $plugin, $this->pluginProvider->obtainArrPluginCamelized($arrPlugin));
8686
$view->vars['froala_arrPluginJS'] = $this->pluginProvider->obtainArrPluginJS($arrPlugin);
8787
$view->vars['froala_arrPluginCSS'] = $this->pluginProvider->obtainArrPluginCSS($arrPlugin);
8888
$view->vars['froala_events'] = $arrEvent;

src/Service/PluginProvider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ final class PluginProvider
4848
'save' => [self::KEY_CSS => 0, self::KEY_FOLDER => self::VALUE_PLUGINS],
4949
'special_characters' => [self::KEY_CSS => 1, self::KEY_FOLDER => self::VALUE_PLUGINS],
5050
'table' => [self::KEY_CSS => 1, self::KEY_FOLDER => self::VALUE_PLUGINS],
51+
'track_changes' => [self::KEY_CSS => 0, self::KEY_FOLDER => self::VALUE_PLUGINS],
5152
'url' => [self::KEY_CSS => 0, self::KEY_FOLDER => self::VALUE_PLUGINS],
5253
'video' => [self::KEY_CSS => 1, self::KEY_FOLDER => self::VALUE_PLUGINS],
5354
'word_paste' => [self::KEY_CSS => 0, self::KEY_FOLDER => self::VALUE_PLUGINS],

src/Utility/UConfiguration.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ final class UConfiguration
6767
'requestWithCredentials' => null,
6868
'requestWithCORS' => null,
6969
'shortcutsHint' => null,
70+
'showChangesEnabled' => null,
7071
'spellcheck' => null,
7172
'tableCellMultipleStyles' => null,
7273
'tableInsertHelper' => null,
@@ -78,6 +79,7 @@ final class UConfiguration
7879
'toolbarSticky' => null,
7980
'toolbarVisibleWithoutSelection' => null,
8081
'tooltips' => null,
82+
'trackChangesEnabled' => null,
8183
'useClasses' => null,
8284
'videoMove' => null,
8385
'videoResize' => null,

tests/Utility/UConfigurationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function testAllOptionsAreRegistered(): void
1818
$url = 'https://froala.com/wysiwyg-editor/docs/options/';
1919
$httpClient = HttpClient::create();
2020
$crawler = new Crawler($httpClient->request('GET', $url)->getContent());
21-
$optionsFromDocs = $crawler->filter('.docs-data-list.block-box a');
21+
$optionsFromDocs = $crawler->filter('.docs-data-list a.searchable');
2222
$registeredOptions = UConfiguration::getArrOptionAll();
2323
$proxyOrIgnoredOptions = ['Key', 'editor'];
2424
$missingOptions = [];

0 commit comments

Comments
 (0)