提交 cd7842f1 编写于 作者: J Jinqn

优化上传功能提示,当后端配置项没正常加载,禁用上传功能

上级 e2ba271b
......@@ -1540,7 +1540,7 @@
}
if(serverUrl) {
serverUrl = serverUrl + (serverUrl.indexOf('?') == -1 ? '?':'&') + 'action=' + actionName;
serverUrl = serverUrl + (serverUrl.indexOf('?') == -1 ? '?':'&') + 'action=' + (actionName || '');
return utils.formatUrl(serverUrl);
} else {
return '';
......
......@@ -13,6 +13,7 @@
9. 修复图片拉伸工具和编辑拉伸长高器的样式冲突
10. 修复文字的unicode编码会被错误再次解析问题
11. 优化错误提示方式,上传错误使用冒泡提示错误信息
12. 优化上传功能提示,当后端配置项没正常加载,禁用上传功能
##1.4.2
###重构前后端交互功能
......
......@@ -145,11 +145,14 @@
uploader,
actionUrl = editor.getActionUrl(editor.getOpt('fileActionName')),
fileMaxSize = editor.getOpt('fileMaxSize'),
acceptExtensions = editor.getOpt('fileAllowFiles').join('').replace(/\./g, ',').replace(/^[,]/, '');;
acceptExtensions = (editor.getOpt('fileAllowFiles') || []).join('').replace(/\./g, ',').replace(/^[,]/, '');;
if (!WebUploader.Uploader.support()) {
$('#filePickerReady').after($('<div>').html(lang.errorNotSupport)).hide();
return;
} else if (!editor.getOpt('fileActionName')) {
$('#filePickerReady').after($('<div>').html(lang.errorLoadConfig)).hide();
return;
}
uploader = _this.uploader = WebUploader.create({
......
......@@ -354,6 +354,9 @@
if (!WebUploader.Uploader.support()) {
$('#filePickerReady').after($('<div>').html(lang.errorNotSupport)).hide();
return;
} else if (!editor.getOpt('imageActionName')) {
$('#filePickerReady').after($('<div>').html(lang.errorLoadConfig)).hide();
return;
}
uploader = _this.uploader = WebUploader.create({
......
......@@ -374,11 +374,14 @@
uploader,
actionUrl = editor.getActionUrl(editor.getOpt('videoActionName')),
fileMaxSize = editor.getOpt('videoMaxSize'),
acceptExtensions = editor.getOpt('videoAllowFiles').join('').replace(/\./g, ',').replace(/^[,]/, '');;
acceptExtensions = (editor.getOpt('videoAllowFiles') || []).join('').replace(/\./g, ',').replace(/^[,]/, '');;
if (!WebUploader.Uploader.support()) {
$('#filePickerReady').after($('<div>').html(lang.errorNotSupport)).hide();
return;
} else if (!editor.getOpt('videoActionName')) {
$('#filePickerReady').after($('<div>').html(lang.errorLoadConfig)).hide();
return;
}
uploader = _this.uploader = WebUploader.create({
......
......@@ -293,6 +293,7 @@ UE.I18N['en'] = {
'updateStatusFinish': 'Total _ pictures (_KB), _ uploaded successfully',
'updateStatusError': ' and _ upload failed',
'errorNotSupport': 'WebUploader does not support the browser you are using. Please upgrade your browser or flash player',
'errorLoadConfig': 'Server config not loaded, upload can not work.',
'errorExceedSize':'File Size Exceed',
'errorFileType':'File Type Not Allow',
'errorInterrupt':'File Upload Interrupted',
......@@ -329,6 +330,7 @@ UE.I18N['en'] = {
'updateStatusFinish': 'Total _ files (_KB), _ uploaded successfully',
'updateStatusError': ' and _ upload failed',
'errorNotSupport': 'WebUploader does not support the browser you are using. Please upgrade your browser or flash player',
'errorLoadConfig': 'Server config not loaded, upload can not work.',
'errorExceedSize':'File Size Exceed',
'errorFileType':'File Type Not Allow',
'errorInterrupt':'File Upload Interrupted',
......@@ -414,6 +416,7 @@ UE.I18N['en'] = {
'updateStatusFinish': 'Total _ files (_KB), _ uploaded successfully',
'updateStatusError': ' and _ upload failed',
'errorNotSupport': 'WebUploader does not support the browser you are using. Please upgrade your browser or flash player',
'errorLoadConfig': 'Server config not loaded, upload can not work.',
'errorExceedSize':'File Size Exceed',
'errorFileType':'File Type Not Allow',
'errorInterrupt':'File Upload Interrupted',
......
......@@ -90,9 +90,9 @@ UE.I18N['zh-cn'] = {
'closeDialog':"关闭对话框",
'tableDrag':"表格拖动必须引入uiUtils.js文件!",
'autofloatMsg':"工具栏浮动依赖编辑器UI,您首先需要引入UI文件!",
'loadconfigError': '获取后台配置项请求出错!',
'loadconfigFormatError': '后台配置项返回格式出错!',
'loadconfigHttpError': '请求后台配置项http错误!',
'loadconfigError': '获取后台配置项请求出错,上传功能将不能正常使用!',
'loadconfigFormatError': '后台配置项返回格式出错,上传功能将不能正常使用!',
'loadconfigHttpError': '请求后台配置项http错误,上传功能将不能正常使用!',
'snapScreen_plugin':{
'browserMsg':"仅支持IE浏览器!",
'callBackErrorMsg':"服务器返回数据有误,请检查配置项之后重试。",
......@@ -293,6 +293,7 @@ UE.I18N['zh-cn'] = {
'updateStatusFinish': '共_张(_KB),_张上传成功',
'updateStatusError': ',_张上传失败。',
'errorNotSupport': 'WebUploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器。',
'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!',
'errorExceedSize':'文件大小超出',
'errorFileType':'文件格式不允许',
'errorInterrupt':'文件传输中断',
......@@ -329,6 +330,7 @@ UE.I18N['zh-cn'] = {
'updateStatusFinish': '共_个(_KB),_个上传成功',
'updateStatusError': ',_张上传失败。',
'errorNotSupport': 'WebUploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器。',
'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!',
'errorExceedSize':'文件大小超出',
'errorFileType':'文件格式不允许',
'errorInterrupt':'文件传输中断',
......@@ -414,6 +416,7 @@ UE.I18N['zh-cn'] = {
'updateStatusFinish': '共_个(_KB),_个成功上传',
'updateStatusError': ',_张上传失败。',
'errorNotSupport': 'WebUploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器。',
'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!',
'errorExceedSize':'文件大小超出',
'errorFileType':'文件格式不允许',
'errorInterrupt':'文件传输中断',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册