X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=roojs-bootstrap-debug.js;h=429b553d9ed308893e545ae2ca25815d5517d74e;hb=2292bdfe51a190fca7b40f0665e0ebdebc0df2cc;hp=0a676f7eb5518fd35a29f48abbd4555d51abb6c7;hpb=f7822491d0a7de5be266db6cef8da0cdf123babb;p=roojs1 diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 0a676f7eb5..429b553d9e 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -31373,26 +31373,34 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { var urlAPI = (window.createObjectURL && window) || (window.URL && URL.revokeObjectURL && URL) || (window.webkitURL && webkitURL); - - var url = urlAPI.createObjectURL( cd.files[0]); - var d = (new DOMParser().parseFromString('', 'text/html')).body; - // is insert asycn? - if (this.enableBlocks) { + + var r = new FileReader(); + var t = this; + r.addEventListener('load',function() + { - Array.from(d.getElementsByTagName('img')).forEach(function(img) { - if (img.closest('figure')) { // assume!! that it's aready - return; - } - var fig = new Roo.htmleditor.BlockFigure({ - image_src : img.src - }); - fig.updateElement(img); // replace it.. + var d = (new DOMParser().parseFromString('', 'text/html')).body; + // is insert asycn? + if (t.enableBlocks) { - }); - } - this.insertAtCursor(d.innerHTML.replace(/ /g,' ')); + Array.from(d.getElementsByTagName('img')).forEach(function(img) { + if (img.closest('figure')) { // assume!! that it's aready + return; + } + var fig = new Roo.htmleditor.BlockFigure({ + image_src : img.src + }); + fig.updateElement(img); // replace it.. + + }); + } + t.insertAtCursor(d.innerHTML.replace(/ /g,' ')); + t.owner.fireEvent('paste', this); + }); + r.readAsDataURL(cd.files[0]); + e.preventDefault(); - this.owner.fireEvent('paste', this); + return false; } if (cd.types.indexOf('text/html') < 0 ) {