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

Support easy Trix-style image uploading #767

Closed
mchaput opened this issue Jan 10, 2018 · 1 comment
Closed

Support easy Trix-style image uploading #767

mchaput opened this issue Jan 10, 2018 · 1 comment
Labels
resolution:duplicate This issue is a duplicate of another issue and was merged into it.

Comments

@mchaput
Copy link

mchaput commented Jan 10, 2018

  • Feature request

There are several problems with the current image uploading architecture:

  • Very complex and ceremonial, involving multiple classes, adaptors, factories, etc.
  • Hard to accomplish at runtime, all but requires a custom build.
  • Not documented very well yet.

Trix has a much simpler and easier to use architecture: when the user drops an image, it immediately shows up in the document, and the editor fires an event. It's up to the user's code to listen for the event, upload the image data, and when the data is on the server, set an attribute on the image in the document indicating its server URL.

I'd love for CKEditor to consider supporting this alternative upload workflow.

@Reinmar
Copy link
Member

Reinmar commented Jan 10, 2018

CKEditor 5 introduced Easy Image. All you need to do to make it work is to set up a CKEditor Cloud Services account and configure the editor to use it:

 ClassicCreator
     .create( document.querySelector( '#editor' ), {
         cloudServices: {
             tokenUrl: 'http://url-to-retrieve-token.example.com/'
         }
     } )
     .then( ... )
     .catch( ... );

Then, it's Easy Image's service (implemented by CKEditor Cloud Services) role to support things like scaling images for different sizes, cropping, etc. You just drop the image and it works. I think that it can't be done simpler :).

The second option is writing your own upload adapter which is indeed not very well documented yet. However, it doesn't require creating a custom build and it's, in general, quite simple to start (really, not that much ceremony). The only complexity will come from actually sending the file to the server in a secure and reliable way, handle errors and so on.

The third option is enabling upload to CKFinder's server connector (see https://stackoverflow.com/questions/46765197/how-to-enable-image-upload-support-in-ckeditor-5). CKFinder's upload adapter is enabled in all editors as well, so you only need to specify one config option.

All this may look confusing now because we haven't finished CKEditor Cloud Services (soon...) and we haven't documented all this properly. The task about improving the documentation is tracked in #618.

@Reinmar Reinmar closed this as completed Jan 10, 2018
@Reinmar Reinmar added the resolution:duplicate This issue is a duplicate of another issue and was merged into it. label Jan 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution:duplicate This issue is a duplicate of another issue and was merged into it.
Projects
None yet
Development

No branches or pull requests

2 participants