From 74d50a97205066625d04d9c7c7a6e92128cb7ba4 Mon Sep 17 00:00:00 2001 From: Alan Date: Thu, 7 Jul 2022 10:29:45 +0800 Subject: [PATCH] roojs-ui.js roojs-ui-debug.js roojs-bootstrap.js roojs-bootstrap-debug.js roojs-all.js roojs-debug.js --- roojs-all.js | 2 +- roojs-bootstrap-debug.js | 2 +- roojs-bootstrap.js | 2 +- roojs-debug.js | 2 +- roojs-ui-debug.js | 2 +- roojs-ui.js | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/roojs-all.js b/roojs-all.js index ae0e01ef89..93d708c671 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -2088,7 +2088,7 @@ A.bgProperties='fixed';A.setAttribute("translate","no");Roo.EventManager.on(this this.pushValue();},onPasteEvent:function(e,v){var cd=(e.browserEvent.clipboardData||window.clipboardData);if(cd.files&&cd.files.length>0){var A=(window.createObjectURL&&window)||(window.URL&&URL.revokeObjectURL&&URL)||(window.webkitURL&&webkitURL);var B=A.createObjectURL(cd.files[0]); this.insertAtCursor('');return false;}if(cd.types.indexOf('text/html')<0){return false;}var C=[];var D=cd.getData('text/html');if(cd.types.indexOf('text/rtf')>-1){var E=new Roo.rtf.Parser(cd.getData('text/rtf'));C=E.doc?E.doc.getElementsByType('pict'):[]; }C=C.filter(function(g){return !g.path.match(/^rtf\/(head|pgdsctbl|listtable|footerf)/);}).map(function(g){return g.toDataURL();}).filter(function(g){return g!='about:blank';});D=this.cleanWordChars(D);var d=(new DOMParser().parseFromString(D,'text/html')).body; -var sn=this.getParentElement();if(d.getElementsByTagName('table').length&&sn&&sn.closest('table')){e.preventDefault();this.insertAtCursor("You can not nest tables");return false;}if(C.length>0){Roo.each(document.getElementsByTagName('v:imagedata'),function(F){F.parentNode.insertBefore(F,d.createElement('img')); +var sn=this.getParentElement();if(d.getElementsByTagName('table').length&&sn&&sn.closest('table')){e.preventDefault();this.insertAtCursor("You can not nest tables");return false;}if(C.length>0){Roo.each(d.getElementsByTagName('v:imagedata'),function(F){F.parentNode.insertBefore(F,d.createElement('img')); F.parentNode.removeChild(F);});Roo.each(d.getElementsByTagName('img'),function(F,i){F.setAttribute('src',C[i]);});}if(this.autoClean){new Roo.htmleditor.FilterWord({node:d});new Roo.htmleditor.FilterStyleToTag({node:d});new Roo.htmleditor.FilterAttributes({node:d,attrib_white:['href','src','name','align','colspan','rowspan','data-display','data-width'],attrib_clean:['href','src']} );new Roo.htmleditor.FilterBlack({node:d,tag:this.black});new Roo.htmleditor.FilterKeepChildren({node:d,tag:['FONT',':']});new Roo.htmleditor.FilterParagraph({node:d});new Roo.htmleditor.FilterSpan({node:d});new Roo.htmleditor.FilterLongBr({node:d});new Roo.htmleditor.FilterComment({node:d} );}if(this.enableBlocks){Array.from(d.getElementsByTagName('img')).forEach(function(F){if(F.closest('figure')){return;}var G=new Roo.htmleditor.BlockFigure({image_src:F.src});G.updateElement(F);});}this.insertAtCursor(d.innerHTML.replace(/ /g,' '));if(this.enableBlocks){Roo.htmleditor.Block.initAll(this.doc.body); diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 6ab7468c1f..9c3a77becd 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -29519,7 +29519,7 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { if (images.length > 0) { // replace all v:imagedata - with img. - Roo.each(document.getElementsByTagName('v:imagedata'), function(node) { + Roo.each(d.getElementsByTagName('v:imagedata'), function(node) { node.parentNode.insertBefore(node, d.createElement('img')); node.parentNode.removeChild(node); }); diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 594c077495..683e85b3a4 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -1276,7 +1276,7 @@ A.bgProperties='fixed';A.setAttribute("translate","no");Roo.EventManager.on(this this.pushValue();},onPasteEvent:function(e,v){var cd=(e.browserEvent.clipboardData||window.clipboardData);if(cd.files&&cd.files.length>0){var A=(window.createObjectURL&&window)||(window.URL&&URL.revokeObjectURL&&URL)||(window.webkitURL&&webkitURL);var B=A.createObjectURL(cd.files[0]); this.insertAtCursor('');return false;}if(cd.types.indexOf('text/html')<0){return false;}var C=[];var D=cd.getData('text/html');if(cd.types.indexOf('text/rtf')>-1){var E=new Roo.rtf.Parser(cd.getData('text/rtf'));C=E.doc?E.doc.getElementsByType('pict'):[]; }C=C.filter(function(g){return !g.path.match(/^rtf\/(head|pgdsctbl|listtable|footerf)/);}).map(function(g){return g.toDataURL();}).filter(function(g){return g!='about:blank';});D=this.cleanWordChars(D);var d=(new DOMParser().parseFromString(D,'text/html')).body; -var sn=this.getParentElement();if(d.getElementsByTagName('table').length&&sn&&sn.closest('table')){e.preventDefault();this.insertAtCursor("You can not nest tables");return false;}if(C.length>0){Roo.each(document.getElementsByTagName('v:imagedata'),function(F){F.parentNode.insertBefore(F,d.createElement('img')); +var sn=this.getParentElement();if(d.getElementsByTagName('table').length&&sn&&sn.closest('table')){e.preventDefault();this.insertAtCursor("You can not nest tables");return false;}if(C.length>0){Roo.each(d.getElementsByTagName('v:imagedata'),function(F){F.parentNode.insertBefore(F,d.createElement('img')); F.parentNode.removeChild(F);});Roo.each(d.getElementsByTagName('img'),function(F,i){F.setAttribute('src',C[i]);});}if(this.autoClean){new Roo.htmleditor.FilterWord({node:d});new Roo.htmleditor.FilterStyleToTag({node:d});new Roo.htmleditor.FilterAttributes({node:d,attrib_white:['href','src','name','align','colspan','rowspan','data-display','data-width'],attrib_clean:['href','src']} );new Roo.htmleditor.FilterBlack({node:d,tag:this.black});new Roo.htmleditor.FilterKeepChildren({node:d,tag:['FONT',':']});new Roo.htmleditor.FilterParagraph({node:d});new Roo.htmleditor.FilterSpan({node:d});new Roo.htmleditor.FilterLongBr({node:d});new Roo.htmleditor.FilterComment({node:d} );}if(this.enableBlocks){Array.from(d.getElementsByTagName('img')).forEach(function(F){if(F.closest('figure')){return;}var G=new Roo.htmleditor.BlockFigure({image_src:F.src});G.updateElement(F);});}this.insertAtCursor(d.innerHTML.replace(/ /g,' '));if(this.enableBlocks){Roo.htmleditor.Block.initAll(this.doc.body); diff --git a/roojs-debug.js b/roojs-debug.js index 9a67378539..7f65fd3e20 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -50400,7 +50400,7 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { if (images.length > 0) { // replace all v:imagedata - with img. - Roo.each(document.getElementsByTagName('v:imagedata'), function(node) { + Roo.each(d.getElementsByTagName('v:imagedata'), function(node) { node.parentNode.insertBefore(node, d.createElement('img')); node.parentNode.removeChild(node); }); diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index db68be2d3e..371d070dba 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -25908,7 +25908,7 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { if (images.length > 0) { // replace all v:imagedata - with img. - Roo.each(document.getElementsByTagName('v:imagedata'), function(node) { + Roo.each(d.getElementsByTagName('v:imagedata'), function(node) { node.parentNode.insertBefore(node, d.createElement('img')); node.parentNode.removeChild(node); }); diff --git a/roojs-ui.js b/roojs-ui.js index 4ad9cc8e22..3fefa0ccdf 100644 --- a/roojs-ui.js +++ b/roojs-ui.js @@ -1142,7 +1142,7 @@ A.bgProperties='fixed';A.setAttribute("translate","no");Roo.EventManager.on(this this.pushValue();},onPasteEvent:function(e,v){var cd=(e.browserEvent.clipboardData||window.clipboardData);if(cd.files&&cd.files.length>0){var A=(window.createObjectURL&&window)||(window.URL&&URL.revokeObjectURL&&URL)||(window.webkitURL&&webkitURL);var B=A.createObjectURL(cd.files[0]); this.insertAtCursor('');return false;}if(cd.types.indexOf('text/html')<0){return false;}var C=[];var D=cd.getData('text/html');if(cd.types.indexOf('text/rtf')>-1){var E=new Roo.rtf.Parser(cd.getData('text/rtf'));C=E.doc?E.doc.getElementsByType('pict'):[]; }C=C.filter(function(g){return !g.path.match(/^rtf\/(head|pgdsctbl|listtable|footerf)/);}).map(function(g){return g.toDataURL();}).filter(function(g){return g!='about:blank';});D=this.cleanWordChars(D);var d=(new DOMParser().parseFromString(D,'text/html')).body; -var sn=this.getParentElement();if(d.getElementsByTagName('table').length&&sn&&sn.closest('table')){e.preventDefault();this.insertAtCursor("You can not nest tables");return false;}if(C.length>0){Roo.each(document.getElementsByTagName('v:imagedata'),function(F){F.parentNode.insertBefore(F,d.createElement('img')); +var sn=this.getParentElement();if(d.getElementsByTagName('table').length&&sn&&sn.closest('table')){e.preventDefault();this.insertAtCursor("You can not nest tables");return false;}if(C.length>0){Roo.each(d.getElementsByTagName('v:imagedata'),function(F){F.parentNode.insertBefore(F,d.createElement('img')); F.parentNode.removeChild(F);});Roo.each(d.getElementsByTagName('img'),function(F,i){F.setAttribute('src',C[i]);});}if(this.autoClean){new Roo.htmleditor.FilterWord({node:d});new Roo.htmleditor.FilterStyleToTag({node:d});new Roo.htmleditor.FilterAttributes({node:d,attrib_white:['href','src','name','align','colspan','rowspan','data-display','data-width'],attrib_clean:['href','src']} );new Roo.htmleditor.FilterBlack({node:d,tag:this.black});new Roo.htmleditor.FilterKeepChildren({node:d,tag:['FONT',':']});new Roo.htmleditor.FilterParagraph({node:d});new Roo.htmleditor.FilterSpan({node:d});new Roo.htmleditor.FilterLongBr({node:d});new Roo.htmleditor.FilterComment({node:d} );}if(this.enableBlocks){Array.from(d.getElementsByTagName('img')).forEach(function(F){if(F.closest('figure')){return;}var G=new Roo.htmleditor.BlockFigure({image_src:F.src});G.updateElement(F);});}this.insertAtCursor(d.innerHTML.replace(/ /g,' '));if(this.enableBlocks){Roo.htmleditor.Block.initAll(this.doc.body); -- 2.39.2