提交 79139241 编写于 作者: 蔡祥熠

Merge branch 'fix/Preview_name' into 'wrdp'

Merge of fix/Preview_name ckeditor上传图片的时候设置文件名 to wrdp

See merge request o2oa/o2oa!5007
......@@ -651,6 +651,10 @@
}).inject(document.body);
fileNode.addEvent("change", function(event){
var file= fileNode.files[0];
var txtAltElement = CKEDITOR.currentImageDialog.getContentElement("info", "txtAlt");
if(file.name)txtAltElement.setValue(file.name);
if(!/image\/\w+/.test(file.type)){ //判断获取的是否为图片文件
MWF.xDesktop.notice(editor.lang.o2image.selectLocalImageNote,"error");
return false;
......@@ -678,7 +682,11 @@
"action": action,
"method": "uploadImageByScale",
"accept": "image/*",
"onEvery": function(json){
"onEvery": function(json, index, count, file){
var txtAltElement = CKEDITOR.currentImageDialog.getContentElement("info", "txtAlt");
if(file.name)txtAltElement.setValue(file.name);
var id = json.data ? json.data.id : json.id;
var orgid = json.data ? json.data.origId : json.origId;
var src = MWF.xDesktop.getImageSrc( id );
......
......@@ -1850,6 +1850,7 @@
var onViewed = function onViewed() {
var imageData = _this.imageData;
debugger;
var render = Array.isArray(options.title) ? options.title[1] : options.title;
title.innerHTML = escapeHTMLEntities(isFunction(render) ? render.call(_this, image, imageData) : "".concat(alt, " (").concat(imageData.naturalWidth, " \xD7 ").concat(imageData.naturalHeight, ")"));
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册