I'm trying to use Zemanta's widgets and the Redactor HTML editor together. I can't get Zemanta to find Redactor's iframe/content
and be able to send updates to it after clicking one of the widgets.
Redactor creates an iframe
, but keeps the real textarea
hidden behind the scenes, I suppose sending updates between, but I can't figure out how to update both at once. If I update the textarea
using it's ID
, it works, but I don't see it in Redactor unless I click code view
. If I use the iframe
class, I see it in redactor, but it doesn't make the changes inside the textarea
, and when I save I get nothing.
.redactor_frame (redactor IFRAME)
#zemanta_content (textarea)
How can I update both using Zemanta's widget?
get_editor: function () {
var elm = null, win = null, editor = {element: null, property: null, type: null, win: null};
try {
elm = $('.redactor_frame').get(0);
if (elm && elm.contentWindow) {
win = elm.contentWindow;
elm = null;
} else {
elm = $('#zemanta_content').get(0);
}
editor = win && {element: win.document.body, property: 'innerHTML', type: 'RTE', win: win} ||
elm && {element: elm, property: 'value', type: elm.tagName.toLowerCase(), win: null} ||
editor;
} catch (er) {
$.zemanta.log(er);
}
return editor;
}
Andraz from Zemanta here.
I am not sure this is going to be an easy thing to fix, but we'll engage our front end developers to take a look at this.
Since Redactor editor is behaving in slightly non-standard way, maybe the best thing would be to turn to their support.