From 272138e36324a84175d0dbcc14e803c8e0d5a53e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Nov 2020 01:54:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DCKEditor=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E6=94=B9=E5=8F=98=E5=90=8E=E4=B8=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/image/dialogs/image.js | 1 + o2web/source/x_component_Template/MDomItem.js | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/o2web/source/o2_lib/htmleditor/ckeditor4114/plugins/image/dialogs/image.js b/o2web/source/o2_lib/htmleditor/ckeditor4114/plugins/image/dialogs/image.js index d645fce0ff..29cd075937 100644 --- a/o2web/source/o2_lib/htmleditor/ckeditor4114/plugins/image/dialogs/image.js +++ b/o2web/source/o2_lib/htmleditor/ckeditor4114/plugins/image/dialogs/image.js @@ -5,6 +5,7 @@ (function () { function setupCheckbox(b) { debugger; + if(!b.hasAttribute)return; var c = this instanceof CKEDITOR.ui.dialog.checkbox; b.hasAttribute(this.id) && (b = b.getAttribute(this.id), c ? this.setValue(checboxOptions[this.id]["true"] == b.toLowerCase()) : this.setValue(b)) } diff --git a/o2web/source/x_component_Template/MDomItem.js b/o2web/source/x_component_Template/MDomItem.js index dcc2952299..3c49d198de 100644 --- a/o2web/source/x_component_Template/MDomItem.js +++ b/o2web/source/x_component_Template/MDomItem.js @@ -2622,6 +2622,32 @@ MDomItem.Rtf = new Class({ } } this.editor = this.module.editor = CKEDITOR.replace(item, editorConfig); + + var imgSrc = MWF.xDesktop.getImageSrc(); + var imgHost = imgSrc.split("/x_file_assemble_control/")[0]; + debugger; + this.editor.on("instanceReady", function(e){ + debugger; + var editable = e.editor.editable && e.editor.editable(); + if(!editable)return; + var imgs = editable.find("img"); + for( var i=0; i -1 ){ + if( imgHost !== src.split("/x_file_assemble_control/")[0] ){ + var id = img.getAttribute("data-id"); + if( id ){ + var newSrc = MWF.xDesktop.getImageSrc(id); + if(newSrc){ + img.setAttribute("src" , newSrc ); + img.setAttribute("data-cke-saved-src" , newSrc ); + } + } + } + } + } + }); this.items.push( this.editor ); }.bind(this)); }, -- GitLab