I am trying to use Zemanta widgets and Redactor HTML together. I can not get Zemanta to find Redactor iframe/content and be able to send updates to it after clicking on one of the widgets.
Redactor creates an iframe , but keeps the real textarea hidden behind the curtains, I assume that you are sending updates between them, but I cannot figure out how to update both at once. If I update textarea using its ID , it works, but I do not see it in Redactor, if I do not click code view . If I use the iframe class, I see it in the editor, but it does not make changes inside textarea , and when I save, I get nothing.
.redactor_frame (redactor IFRAME) #zemanta_content (textarea)
How can I update both Zemanta widgets?
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; }
source share