How do I capture the thumbnail image links from Zemanta?

131 Views Asked by At

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-images, 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

There are 0 best solutions below