Changes between Initial Version and Version 1 of Ticket #11461, comment 6


Ignore:
Timestamp:
Aug 31, 2014, 11:24:12 AM (10 years ago)
Author:
Piotrek Koszuliński
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11461, comment 6

    initial v1  
    11== Problems: ==
    22
    3 There are some problems related to image upload.
     3There are some problems related to ~~image upload~~ [[Reinmar: files upload in general]].
    44
    5 In generals (ex. drop file from the file system) we need to handle 2 asynchronous operations:
     5In general (e.g. drop file from the file system) we need to handle 2 asynchronous operations:
    66 - get file from disc,
    77 - upload files.
    88
    9 In some cases (ex. paste from Word, paste from Paint) image is already given as Base64 data in the source of a `img` element so we need to handle only upload.
     9In some cases (e.g. 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.
    1010
    11 During this asynchronous operation (ex. file is uploading) user can modify the content of the editor. Lets focus on 4 critical cases:
    12 1. undo/redo
     11During this asynchronous operation (e.g. file is uploading) user can modify the content of the editor. Let's focus on 4 critical cases:
     12
     131. undo/redo,
    13142. getData/switch to the source mode,
    14153. image modification/dialogs,
     
    1718== Expected behavior: ==
    1819
    19 1. Undo/Redo should works fine, in every case. Scenario:
     201. Undo/Redo should work fine in every case. Scenario:
    2021     - user pastes image which should be uploaded,
    2122     - user modifies some content, creates an undo snapshot, before upload is done,
    2223     - upload is done,
    23      - user press undo.
    24    Content should be restored, but the uploading image should be replaces with the uploaded image (url instead of data in source).
     24     - user presses undo.
     25   Content should be restored, but the image that was being uploaded should be replaced with the uploaded image (url instead of data in source).
    2526
    26 2. If user call getData or switch to the source mode before image is fully uploaded, then the uploading image should be removed from the HTML content. We should not show Base64 data to user.
     272. 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. We should not show Base64 data to user.
    2728
    28293. We can not show Base64 data to the end user in the dialog too.
    29    Firstly, it would be a very bad UX, these are definitely data that end use do not care about.
     30   Firstly, it would be a very bad UX, these are definitely data that end user does not care about.
    3031   Secondly, putting such a big string in the dialog we can hang or break a browser.
    3132   `src` field in the dialog or whole dialog should be disabled.
    3233
    33 4. Drag, drop, copy, cut and paste should not break an editor or caused second upload of the same image. If user cut or delete image upload should be canceled.
     344. Drag, drop, copy, cut and paste should not break an editor or caused second upload of the same image. If user cut or delete image upload should be canceled. [[Reinmar: when user duplicates an image (e.g. copy+paste few times) every image's src should be updated]].
    3435
    3536== Solution: ==
     
    3738==== Image loading:
    3839
    39 For the first asynchronous operation best solution seems to be delay paste event until we get files from hard disc. I measured it with ~1 MB image, SSD and HHD and it takes no more then 20ms for native Ubuntu with Chorme 36 and 100-250ms for virtual machine (Windows 7 with Chrome, Firefox or IE). Keep in mind that:
    40  - 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,
     40For the first asynchronous operation best solution seems to be delay paste event until we get files from hard disc. 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). Keep in mind that:
     41 - 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,
    4142 - we are talking only about jpg/png images here, these are relatively small files.
    4243
     
    4849==== Image uploading:
    4950
    50 For the image upload I'd prefer to use a widget. Thank to the widget:
     51For the image upload I'd prefer to use a widget. Thanks to the widget system:
    5152 - problem 2 can be fixed with 1 line of code (downcast method will return an empty text node),
    5253 - problem 3 can be fixed out of the box,
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy