Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for 3rd party modules to quill editor (image drop and resize) #5622

Closed
jamjamg opened this issue Apr 24, 2018 · 5 comments
Closed
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@jamjamg
Copy link

jamjamg commented Apr 24, 2018

[ ] bug report => Search github for a similar issue or PR before submitting
[X] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

The primeng editor component currently does not allow registering 3rd party modules. Especially quill-image-resize-module and quill-image-drop-module are very useful modules.

Please add support for registering 3rd party modules (or at least image resize and drop capabilities).

The current initilization code of quill inside editor.ts would need to be enhanced similar to this:

import { ImageResize } from 'quill-image-resize-module';
Quill.register('modules/imageResize', ImageResize);
// ...
var quill = new Quill(editor, {
    modules: {
        ImageResize: {}
    }
});

current snippet from editor.ts:

this.quill = new Quill(editorElement, {
    modules: {
        toolbar: toolbarElement
    },
    placeholder: this.placeholder,
    readOnly: this.readonly,
    theme: 'snow',
    formats: this.formats
});
@vasyl-trs
Copy link

Any updates on this?

@salem017
Copy link

salem017 commented Nov 26, 2018

Any updates ?May be I can modify the editor.js to add it but it is not maintenable.

@cagataycivici cagataycivici self-assigned this Dec 20, 2018
@cagataycivici cagataycivici added the Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add label Dec 20, 2018
@cagataycivici cagataycivici added this to the 7.0.4 milestone Dec 20, 2018
@cagataycivici
Copy link
Member

cagataycivici commented Jan 3, 2019

Handled via;

#5695

It has a new modules property to define your own modules.

@Svancara
Copy link

It does not work.

I mean your

It has a new modules property to define your own modules.

This modules property of p-editor is not enough.
Modules have to be registered in Quill.
There is no "quill.register(...)" code in the PrimeNG editor code.
And - attempts to use some module fail.

@rogerex
Copy link

rogerex commented Jan 3, 2020

It does not work.

I mean your

It has a new modules property to define your own modules.

This modules property of p-editor is not enough.
Modules have to be registered in Quill.
There is no "quill.register(...)" code in the PrimeNG editor code.
And - attempts to use some module fail.

And if you try to register modules before, you can't, because editor.js is importing quill again overwriting your registered modules. [primeng version: 8.0.3]

The unique solution is import the modules in the same component:

import * as ImageResize from 'quill-image-resize-module'; ngOnInit(): void { Quill.register('modules/imageResize', (quill: any, options: any) => { new (ImageResize.default as any)(quill, options); }); }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

No branches or pull requests

6 participants