From fb9859f5d41e131c9a5c1195f0b6719e0f88c289 Mon Sep 17 00:00:00 2001 From: Frank Liu Date: Wed, 6 Jan 2016 16:55:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=A8=E5=9F=9F=E4=B8=8A=E4=BC=A0=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E6=97=B6=EF=BC=8C=E4=B8=8D=E7=9B=B4=E6=8E=A5=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/image-dialog/image-dialog.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/plugins/image-dialog/image-dialog.js b/plugins/image-dialog/image-dialog.js index 0be6d69..b4eca95 100644 --- a/plugins/image-dialog/image-dialog.js +++ b/plugins/image-dialog/image-dialog.js @@ -134,14 +134,14 @@ if (fileName === "") { alert(imageLang.uploadFileEmpty); - + return false; } - + if (!isImage.test(fileName)) { alert(imageLang.formatNotAllowed + settings.imageFormats.join(", ")); - + return false; } @@ -152,7 +152,7 @@ var uploadIframe = document.getElementById(iframeName); uploadIframe.onload = function() { - + loading(false); var body = (uploadIframe.contentWindow ? uploadIframe.contentWindow : uploadIframe.contentDocument).document.body; @@ -160,13 +160,16 @@ json = (typeof JSON.parse !== "undefined") ? JSON.parse(json) : eval("(" + json + ")"); - if (json.success === 1) - { - dialog.find("[data-url]").val(json.url); - } - else + if(!settings.crossDomainUpload) { - alert(json.message); + if (json.success === 1) + { + dialog.find("[data-url]").val(json.url); + } + else + { + alert(json.message); + } } return false;