我想创建相同类型的函数tumblr用于上传图像,然后将它们直接插入到WYSIWYG编辑器中 .
我打算使用uploadify上传图像,然后我不确定插入CKEditor的方法 .
有没有人做过任何相似或知道的插件可以做到这一点?理想情况下,我希望在最后放置文本光标的位置插入图像 .
Upload an image and directly insert it into a text area http://www.freeimagehosting.net/uploads/06217dcebb.png
提前致谢,
蒂姆
CKEDITOR.instances['instanceName'].insertHtml('<img src="your image">');
正确的是:
CKEDITOR.instances['instanceName'].insertHtml('<img src="your image"/>');
我正在使用dropzone作为图像上传器 . 我在每个图像下方添加了一个按钮,当单击它时,在CKEditor中的光标位置插入一个图像 . 请看下面的例子:
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); }; });
我正在为CKeditor使用漂亮的插件http://www.ckuploader.com
4 回答
正确的是:
我正在使用dropzone作为图像上传器 . 我在每个图像下方添加了一个按钮,当单击它时,在CKEditor中的光标位置插入一个图像 . 请看下面的例子:
我正在为CKeditor使用漂亮的插件http://www.ckuploader.com