From 57e41498bc48898703cdc261669d2e64c665dd3f Mon Sep 17 00:00:00 2001 From: projectSylas Date: Tue, 6 Jul 2021 06:26:40 +0000 Subject: [PATCH] =?UTF-8?q?=EC=97=90=EB=94=94=ED=84=B0=20=EB=B3=84=20?= =?UTF-8?q?=EC=9D=B5=EC=8A=A4=ED=94=8C=EB=A1=9C=EB=9F=AC=20=EC=95=88?= =?UTF-8?q?=EB=82=B4=EB=AC=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../editor/cheditor5/popup/js/image.html5.js | 6 ++--- .../cheditor5/popup/js/image.html5.m.js | 6 ++--- .../ckeditor4/plugins/uploadimage/plugin.js | 25 +++++++++++++------ .../photo_uploader/popup/js/basic.js | 5 +++- 4 files changed, 28 insertions(+), 14 deletions(-) diff --git a/plugin/editor/cheditor5/popup/js/image.html5.js b/plugin/editor/cheditor5/popup/js/image.html5.js index 35624ae8f..c3e3f46c4 100644 --- a/plugin/editor/cheditor5/popup/js/image.html5.js +++ b/plugin/editor/cheditor5/popup/js/image.html5.js @@ -439,7 +439,7 @@ function fileFilterError(file) { function explorerFileFilterError(file) { alert("선택하신 '" + file + "' 파일은 전송할 수 없습니다.\n" + - "익스플로러 10 이하의 환경에서는 gif, png, jpg 사진 파일만 \n전송할 수 있습니다."); + "익스플로러 환경에서는 gif, png, jpg 사진 파일만 \n전송할 수 있습니다."); } function imgComplete(img, imgSize, boxId) { @@ -967,9 +967,9 @@ DoUpload.prototype = { file = files[i]; if (!file.type.match(fileTypeRe)) { - // 엣지(ie 11)를 제외한 ie브라우저인지 체크 + // 엣지를 제외한 ie브라우저인지 체크 var agent = navigator.userAgent.toLowerCase(); - if ( !(navigator.appName == 'Netscape' && navigator.userAgent.search('Trident') != -1) && (agent.indexOf("msie") != -1) ) { + if (agent.indexOf('trident') != -1 || agent.indexOf("msie") != -1) { explorerFileFilterError(file.name); } else { FileFilterError(file.name); diff --git a/plugin/editor/cheditor5/popup/js/image.html5.m.js b/plugin/editor/cheditor5/popup/js/image.html5.m.js index b79a1b37c..e50c3389f 100644 --- a/plugin/editor/cheditor5/popup/js/image.html5.m.js +++ b/plugin/editor/cheditor5/popup/js/image.html5.m.js @@ -439,7 +439,7 @@ function fileFilterError(file) { function explorerFileFilterError(file) { alert("선택하신 '" + file + "' 파일은 전송할 수 없습니다.\n" + - "익스플로러 10 이하의 환경에서는 gif, png, jpg 사진 파일만 전송할 수 있습니다."); + "익스플로러 환경에서는 gif, png, jpg 사진 파일만 \n전송할 수 있습니다."); } function imgComplete(img, imgSize, boxId) { @@ -967,9 +967,9 @@ DoUpload.prototype = { file = files[i]; if (!file.type.match(fileTypeRe)) { - // 엣지(ie 11)를 제외한 ie브라우저인지 체크 + // 엣지를 제외한 ie브라우저인지 체크 var agent = navigator.userAgent.toLowerCase(); - if ( !(navigator.appName == 'Netscape' && navigator.userAgent.search('Trident') != -1) && (agent.indexOf("msie") != -1) ) { + if (agent.indexOf('trident') != -1 || agent.indexOf("msie") != -1) { explorerFileFilterError(file.name); } else { FileFilterError(file.name); diff --git a/plugin/editor/ckeditor4/plugins/uploadimage/plugin.js b/plugin/editor/ckeditor4/plugins/uploadimage/plugin.js index 3d855547a..d506d2166 100644 --- a/plugin/editor/ckeditor4/plugins/uploadimage/plugin.js +++ b/plugin/editor/ckeditor4/plugins/uploadimage/plugin.js @@ -69,10 +69,16 @@ if ( !uploadUrl ) { return; } - - // Handle images which are available in the dataTransfer. - fileTools.addUploadWidget( editor, 'uploadimage', { - supportedTypes: /image\/(jpeg|png|gif|bmp|webp)/, + var supportedType = ''; + var agent = navigator.userAgent.toLowerCase(); + if (agent.indexOf('trident') != -1 || agent.indexOf("msie") != -1) { + supportedType = ''; + } else { + supportedType = /image\/(jpeg|png|gif|bmp|webp)/; + } + // Handle images which are available in the dataTransfer. + fileTools.addUploadWidget( editor, 'uploadimage', { + supportedTypes: supportedType, uploadUrl: uploadUrl, fileDialog: fileDialog, @@ -107,8 +113,14 @@ editor.on("fileUploadRequest", function( evt ) { // 이미지 업로드 시작 체크 - if(typeof(editor_chk_upload) != "undefined") { - editor_chk_upload = false; + var fileLoader = evt.data.fileLoader; + if(fileLoader.file.type.match(/image\/(jpeg|png|gif|bmp|webp)/) == null){ + this.showNotification('익스플로러 환경에서는 jpg / gif / png 파일만 업로드 가능합니다.','warning'); + return false; + }else { + if(typeof(editor_chk_upload) != "undefined") { + editor_chk_upload = false; + } } }); @@ -124,7 +136,6 @@ img.setAttribute( 'src', res.url ); if(typeof(res.width) != 'undefined') img.setAttribute( 'width', res.width ); if(typeof(res.height) != 'undefined') img.setAttribute( 'height', res.height ); - editor.insertElement(img); uploadType = ''; // 구분값 초기화 diff --git a/plugin/editor/smarteditor2/photo_uploader/popup/js/basic.js b/plugin/editor/smarteditor2/photo_uploader/popup/js/basic.js index 96c7c0edd..87e5941cf 100644 --- a/plugin/editor/smarteditor2/photo_uploader/popup/js/basic.js +++ b/plugin/editor/smarteditor2/photo_uploader/popup/js/basic.js @@ -85,8 +85,11 @@ jQuery(function ($) { data.context = $('
  • ').addClass("sort_list").appendTo(this.dreg_area_list); $.each(data.files, function (index, file) { if (!preload && !othis.filter.test(file.type)) { + var agent = navigator.userAgent.toLowerCase(); + var msg = ''; + msg = (agent.indexOf('trident') != -1 || agent.indexOf("msie") != -1)? "익스플로러 환경에서는 gif, png, jpg 파일만 \n전송할 수 있습니다.":"이미지만 허용합니다."; data.context.remove(); - alert('이미지만 허용합니다.'); + alert(msg); return true; } var node = $('
    ')