Closed EugenMayer closed 9 years ago
I'll make a few adjustments on this tomorrow. To support contenteditable without affecting the focus behavior is a good start.
Also try to fix #3 . We don't need to create a hidden div if:
firefox and chrome are working now, IE11 not tested
Now working version for IE11, Firefox and Chrome - safari is not working and will not work, see this browser bug http://jsfiddle.net/0psu172n/13/
Hi, @EugenMayer , I'm going to close this pull-request, and instead, I've implemented the interface for contenteditable
in #5 . I have two reasons for this:
I also took your idea to make three modes of invoking the library:
I finally abstract them into three shorthand methods, to be used the way like other popular jquery plugins. E.g. when you have a contenteditable, and you want to handle the image uploading by js. you can call:
$ '#mycontenteditable'
.pastableContenteditable()
.on 'pasteImage', (data)->
# now images are already removed from contenteditable by paste.js
uploadImageByDataURL data.dataURL, (url_on_cdn)->
# uploaded, insert the image into contenteditable
$(document.createElement 'img').attr('src', url_on_cdn).appendTo('#mycontenteditable')
I hope this can solve your problem, and many thanks to the help.
by the way, here's some information I found when I firstly made this lib. There might be useful if you continue working on this lib
so you basically just dumped the merge. Whatever - then i guess our joint effort stops here.
now we should be able to handle browser specific implementation easier. Added a lot case-documentation