amidesfahani / filament-tinyeditor

a TineMce editor for Laravel Filament Forms
MIT License
52 stars 17 forks source link

Adding custom buttons #24

Closed marco-silvestri closed 8 months ago

marco-silvestri commented 9 months ago

Hi! It does not seem possible to add custom button to the editor. Is there any way to do so?

amidesfahani commented 8 months ago

update to last version then publish the view file. in view file find 'setup' variable and add your function here is an example:

setup: function(editor) { editor.ui.registry.addButton('custom-upload', { icon: 'upload', onAction: function () { editor.windowManager.open(upload_config) } }); },

don't forgot to add your custom button to config toolbars: 'profiles' => [ 'default' => [ 'plugins' => 'accordion autoresize codesample directionality advlist link image lists preview pagebreak searchreplace wordcount code fullscreen insertdatetime media table emoticons', 'toolbar' => 'custom-upload undo redo removeformat | styles | bold italic | rtl ltr | alignjustify alignleft aligncenter alignright | numlist bullist outdent indent | forecolor backcolor | blockquote table toc hr | image link media codesample emoticons | wordcount fullscreen', 'upload_directory' => null, ],

marco-silvestri commented 8 months ago

In the published view file there is no setup variable

amidesfahani commented 8 months ago

@marco-silvestri in line 67 setup: null,

amidesfahani commented 8 months ago

update to the latest version v1.1.3