开发者

How do I capture the thumbnail image links from Zemanta?

I have Zemanta's controls working on my local CMS with TinyMCE, but I'd like to also save the images to my server so I can make thumbnails of them for previews outside the article. I am not sure how best to accomplish this.

My idea is in addition to the content text_area to have a hidden field which can capture just the image links from Zemanta and download them on save. I'm unsure how to accomplish this with their generic JavaScript as below:

I'd like to throw it to #editor-i开发者_如何学Gomages, also is the problem I have of only receiving the image links themselves without the HTML markup. Any ideas?

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;
    }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜