Skip to content

Commit

Permalink
tinyMce new methods
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-to committed Dec 16, 2022
1 parent 71b7398 commit 3f9f7c4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions resources/views/fields/tinymce.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
path_absolute : "/",
selector: 'textarea#ckeditor_{{ $field->id() }}',
relative_urls: false,
plugins: '{{ $field->plugins }}',
toolbar: '{{ $field->toolbar }}',
plugins: '{{ trim($field->plugins . ' ' . $field->addedPlugins) }}',
toolbar: '{{ trim($field->toolbar . ' ' . $field->addedToolbar) }}',
tinycomments_mode: 'embedded',
tinycomments_author: '{{ $field->commentAuthor }}',
mergetags_list: @json($field->mergeTags),
Expand Down
18 changes: 18 additions & 0 deletions src/Fields/TinyMce.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ final class TinyMce extends Field

public string $plugins = 'anchor autolink charmap codesample emoticons image link lists media searchreplace table visualblocks wordcount checklist mediaembed casechange export formatpainter pageembed linkchecker a11ychecker tinymcespellchecker permanentpen powerpaste advtable advcode editimage tinycomments tableofcontents footnotes mergetags autocorrect typography inlinecss';

public string $addedPlugins = '';

public string $toolbar = 'undo redo | blocks fontfamily fontsize | bold italic underline strikethrough | link image media table mergetags | addcomment showcomments | spellcheckdialog a11ycheck typography | align lineheight | checklist numlist bullist indent outdent | emoticons charmap | removeformat';

public string $addedToolbar = '';

public array $mergeTags = [];

public string $commentAuthor = 'Author name';
Expand Down Expand Up @@ -51,6 +55,20 @@ public function toolbar(string $toolbar): self
return $this;
}

public function addPlugins(string $plugins): self
{
$this->addedPlugins = $plugins;

return $this;
}

public function addToolbar(string $toolbar): self
{
$this->addedToolbar = $toolbar;

return $this;
}

protected function token(): string
{
return config('moonshine.tinymce.token', '');
Expand Down

0 comments on commit 3f9f7c4

Please sign in to comment.