
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),.

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.

