Closed (fixed)
Project:
widgEditor - A WYSIWYG editor
Version:
6.x-1.0
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
19 Aug 2007 at 18:12 UTC
Updated:
18 Dec 2008 at 06:11 UTC
I want to integrate IMCE with widgeditor. Since widgeditor changes the textarea to an iframe and a hidden input field, IMCE throws an exception when it tries to add an img tag to the existing content.
I'm not sure of the best way to insert a bit of content to the existing widgeditor document via javascript. Anyone have any thoughts?
Thanks!
Comments
Comment #1
jeb-1 commentedi hacked something together that works. I'd like get thoughts on TheRightWay to do this.
in widgEditor.js I needed to create a global - so IMCE can access the widgEditor instance(s).
-
setTimeout("new widgEditor('" + theTextarea.id + "')", 500 * (i));
+
setTimeout("var mywidgEditor = new widgEditor('" + theTextarea.id + "')", 500 * (i));
so, yeah, that's ugly, since a) it's a global and b) it only works for a single instance. I assume adding a widgEditor.getInstance(textarea_id) would be a nicer way to do this.
in imce_set_inline.js, I added the following to the start of imceInsertAtCursor()
+
if (mywidgEditor) {
mywidgEditor.theIframe.contentWindow.document.getElementsByTagName("body")[0].innerHTML += txt;
return;
}
so, yeah, it just appends the image to the end of the area. so, not great, but a start.
Comment #2
David Lesieur commentedMarking http://drupal.org/node/168541 as a duplicate.
Comment #3
Gurpartap Singh commentedAdded proper integration in Drupal 6 release.