Upload image and paste directly into CKEditor

I would like to create the same function that tumblr has for loading images, and then pasting them directly into the WYSIWYG editor.

I planned to use uploadify to upload the image, then I am not sure about the method for embedding in CKEditor.

Has anyone done something similar or knew about a plugin that could do this? Ideally, I would like it to insert an image wherever the text cursor was placed.

Download the image and directly paste it into the text area http://www.freeimagehosting.net/uploads/06217dcebb.png

Thanks in advance,

Tim

+7
javascript jquery ckeditor wysiwyg
source share
4 answers
CKEDITOR.instances['instanceName'].insertHtml('<img src="your image">'); 
+13
source share

Correctly:

 CKEDITOR.instances['instanceName'].insertHtml('<img src="your image"/>'); 
+11
source share

I use dropzone as an image downloader. I added a button under each image so that when I click the image will be inserted at the cursor position in CKEditor. See the example below:

 myDropzone.on("addedfile", function(file) { // Hookup image insert button file.previewElement.querySelector('.insert').onclick = function() { var element = CKEDITOR.dom.element.createFromHtml('<img src="' + $SCRIPT_ROOT + '/api/files/' + file.id + '?filter=image"/>'); CKEDITOR.instances.body.insertElement(element); }; }); 
0
source share

I use a good plugin for CKeditor http://www.ckuploader.com

-one
source share

All Articles