提交 625c971a 编写于 作者: 蔡祥熠

Merge branch 'feature/Query.view_in_compasion' into 'wrdp'

Merge of feature/Query.view_in_compasion 修复论坛图片host改变后不显示的问题 to wrdp

See merge request o2oa/o2oa!2066
......@@ -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))
}
......
......@@ -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<imgs.count(); i++ ){
var img = imgs.getItem(i);
var src = img.getAttribute("src");
if( src && src.indexOf("/x_file_assemble_control/") > -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));
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册