question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Upload image first show preview, then show upload percentage% (insert complex structure into editor)

See original GitHub issue

What I am trying to do

(From User Perspective) When upload image, image first insert into editor. a black transparent layer cover the entire image.

on that black layer, show upload progress like “10%… 20% 30%” after image 100% upload, the black layer go away.
(This is a pretty standard experience when uploading image these day(2018) )

ALSO I want the image take entire row. text is either on top or on bottom or image. not on same row.

Example: behance

  1. Show upload progress during upload (image under black layer)

image

  1. Display image when upload done
    image

How I plan implement it

First insert base64 like <image src=“base64 string” > to preview.
and then after 100% upload, replace base64 src to url like https://example.com/a.jpg

The HTML structure I think gonna work

<div class='image-container'>
    <div class='overlay'><!-- show upload progress text here--></div>
    <img src=''> 
</div>

CSS part essentially just to make that black transparent (rgba(0,0,0,0.5)) overlay work it would go something like this:

.image-container{
   position: relative
}
.overlay{
   position: absolute:
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
}
etc..etc..

Question: how to make complex structure like these insert into Quill editor?

just use Bolt and Parchment? any example? thank you

PS: I already done my research

I spend about 1+ hour on Google and Quill issue & Quill Doc.
can’t find answer. that’s why I am asking.

Relate issue https://github.com/quilljs/parchment/issues/30 this Github issue relate to my question. but no answer in there https://github.com/quilljs/quill/issues/173 https://github.com/quilljs/quill/issues/1695 https://github.com/quilljs/quill/issues/1163

Thank you very much!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
NoelOConnellcommented, Aug 28, 2018

I wrote a plugin that does something very similar to what you are describing.

When an image is added, it inserts the Base64 version with a loading overlay. Then the image is saved to the server and then replaces the Base64 version with the saved image link.

You can view it here https://github.com/NoelOConnell/quill-image-uploader

0reactions
DvzHcommented, Apr 26, 2020

@NoelOConnell thanks for the update

Read more comments on GitHub >

github_iconTop Results From Across the Web

Plupload preview image appears upside down or sideways ...
Plupload preview image appears upside down or sideways when uploading images taken from mobile. Save this question. Show activity on this post. ...
Read more >
Custom upload adapter - CKEditor 5 Documentation
In this guide you will learn the basic concepts of the file upload architecture in CKEditor 5 WYSIWYG editor which will help you...
Read more >
Programmatically Uploading Images, Videos, and Other Files
Programmatic upload video tutorial. Watch this demo on how to quickly upload images, videos and other media files to Cloudinary for immediate ...
Read more >
10 useful HTML file upload tips for web developers
First, create a drop zone and optionally a section to show the uploaded file content. We will use an image as a file...
Read more >
How to Upload an Image to Cricut Design Space - YouTube
As of October 2021 you might have noticed that the Upload screen looks a little different in Cricut Design Space. All of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found