我正在尝试使用Zemanta的小部件和Redactor HTML编辑器。我无法让Zemanta找到Redactor的iframe/content
,并能够点击其中一个小部件后发送更新。我怎样才能让Zemanta和Redactor一起工作?
Redactor创建iframe
,但保留真实textarea
幕后,我想发送更新之间,但我不知道如何一次更新。如果我使用它的ID
来更新textarea
,它可以正常工作,但除非点击code view
,否则我不会在Redactor中看到它。如果我使用iframe
类,我可以在redactor中看到它,但它不会在textarea
内进行更改,并且当我保存时,我什么也得不到。
.redactor_frame (redactor IFRAME)
#zemanta_content (textarea)
如何使用Zemanta的小部件更新两者?
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;
}
有同样的问题...编辑作者还没有回复,这是一个耻辱,因为他们的编辑几乎完美。 – holden 2012-07-16 11:12:59