我有Zemanta的控件使用TinyMCE在我的本地CMS上运行,但我还想将图像保存到我的服务器上,这样我就可以将它们的缩略图用于文章之外的预览。我不确定如何最好地实现这一目标。
我的想法是除了内容text_area之外还有一个隐藏字段,可以捕获Zemanta的图像链接并在保存时下载它们。我不确定如何用他们的通用JavaScript实现这一点,如下所示:
我想把它扔到#editor-images
,我也只是在没有HTML标记的情况下只收到图片链接的问题。有任何想法吗?
get_editor: function () {
var elm = null, win = null, editor = {element: null, property: null, type: null, win: null};
try {
elm = $('#editor-textarea_ifr').get(0);
if (elm && elm.contentWindow) {
win = elm.contentWindow;
elm = null;
} else {
elm = $('#editor-textarea_ifr').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;
}