menuoreo.blogg.se

Ckeditor filetools image upload
Ckeditor filetools image upload





  1. CKEDITOR FILETOOLS IMAGE UPLOAD UPDATE
  2. CKEDITOR FILETOOLS IMAGE UPLOAD CODE

CKEDITOR FILETOOLS IMAGE UPLOAD UPDATE

To handle undo/redo we need an upload manager which will keep id's and progress of uploads so when user executes undo command manager will update paths. In general uploading image is not just an image, it should be treated differently as a special part of the document so widget seems to be logically a good solution.Īlso, with the widgets and with the expected behavior described above we can easily show additional information like upload progress.

CKEDITOR FILETOOLS IMAGE UPLOAD CODE

we can encapsulate code related to image uploading: paste event just mark images as "to upload" and widget.upcast method will handle it.problem 4 will be partially fixed, because uploading image will be in non-contenteditable so it won't be uploaded for the second time ].problem 2 can be fixed with 1 line of code (downcast method will return an empty text node),.

ckeditor filetools image upload

Of course for file upload we can not use such delay, but for file upload we have none of these problems.įor the image upload I'd prefer to use a widget. we do not have a problem with mocking image with no data and dimensions.we can handle dropped image and pasted images the same way,.we are talking only about jpg/png images here, these are relatively small files.īy 'delay' I mean we cancel editor.paste event and fire it when files are loaded.the only case when we get files for the hard disc is when dataVaule is empty so there should be no conflicts with other plugins,.I measured it with ~1 MB image, SSD and HDD and it takes no more than 20ms for native Ubuntu with Chrome 36 and 100-250ms for virtual machine (Windows 7 with Chrome, Firefox or IE). ].įor the first asynchronous operation best solution seems to be delay paste event until we get files from hard disc. If user cut or delete image upload should be canceled. Drag, drop, copy, cut and paste should not break an editor or caused second upload of the same image.Src field in the dialog or whole dialog should be disabled. Secondly, putting such a big string in the dialog we can hang or break a browser. We can not show Base64 data to the end user in the dialog too.įirstly, it would be a very bad UX, these are definitely data that end user does not care about.

ckeditor filetools image upload

  • If user calls getData or switches to the source mode before image is fully uploaded, then the image being uploaded should be removed from the HTML content.
  • user modifies some content, creates an undo snapshot, before upload is done,Ĭontent should be restored, but the image that was being uploaded should be replaced with the uploaded image (url instead of data in source).
  • user pastes image which should be uploaded,.
  • Undo/Redo should work fine in every case.
  • drag, drop, cut, copy and paste uploading image.
  • file is uploading) user can modify the content of the editor. paste from Word, paste from Paint) image is already given as Base64 data in the source of an img element so we need to handle only upload.ĭuring this asynchronous operation (e.g. drop file from the file system) we need to handle 2 asynchronous operations: There are some problems related to image upload ].







    Ckeditor filetools image upload