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;