bizley / yii2-quill

Yii 2 implementation of Quill, modern WYSIWYG editor
Apache License 2.0
62 stars 15 forks source link

Is there a way to use the npm module "quill-image-uploader"? #54

Open gb5256 opened 1 week ago

gb5256 commented 1 week ago

Hi, love your extension. Is there a way to include an additional module like the quill-image-uploader? This is the npm source for it: https://www.npmjs.com/package/quill-image-uploader How would I do that?

Thanks for any ideas, gb5256

bizley commented 1 week ago

I'm not sure if this will work but in a theory you could add asset for this package and register it for the view and then just add a module like:

[
    'modules' => [
        'imageUploader' => new JsExpression('your JS here')
    ],
 ]

Looks like also you need to add JS to the view with:

Quill.register("modules/imageUploader", ImageUploader);

See https://www.yiiframework.com/doc/guide/2.0/en/output-client-scripts

There is a big chance it will work like that. Please let me know.