File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed
Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change 134134 if ( fileName === "" )
135135 {
136136 alert ( imageLang . uploadFileEmpty ) ;
137-
137+
138138 return false ;
139139 }
140-
140+
141141 if ( ! isImage . test ( fileName ) )
142142 {
143143 alert ( imageLang . formatNotAllowed + settings . imageFormats . join ( ", " ) ) ;
144-
144+
145145 return false ;
146146 }
147147
152152 var uploadIframe = document . getElementById ( iframeName ) ;
153153
154154 uploadIframe . onload = function ( ) {
155-
155+
156156 loading ( false ) ;
157157
158158 var body = ( uploadIframe . contentWindow ? uploadIframe . contentWindow : uploadIframe . contentDocument ) . document . body ;
159159 var json = ( body . innerText ) ? body . innerText : ( ( body . textContent ) ? body . textContent : null ) ;
160160
161161 json = ( typeof JSON . parse !== "undefined" ) ? JSON . parse ( json ) : eval ( "(" + json + ")" ) ;
162162
163- if ( json . success === 1 )
164- {
165- dialog . find ( "[data-url]" ) . val ( json . url ) ;
166- }
167- else
163+ if ( ! settings . crossDomainUpload )
168164 {
169- alert ( json . message ) ;
165+ if ( json . success === 1 )
166+ {
167+ dialog . find ( "[data-url]" ) . val ( json . url ) ;
168+ }
169+ else
170+ {
171+ alert ( json . message ) ;
172+ }
170173 }
171174
172175 return false ;
You can’t perform that action at this time.
0 commit comments