From 06905a7ef296350fd03215d2ba650f4cfe710cfc Mon Sep 17 00:00:00 2001 From: leon Date: Thu, 7 Jul 2022 12:04:18 +0800 Subject: [PATCH] roojs-core.js roojs-core-debug.js roojs-ui.js roojs-ui-debug.js roojs-all.js roojs-debug.js --- roojs-all.js | 2 +- roojs-debug.js | 1 + roojs-ui-debug.js | 1 + roojs-ui.js | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/roojs-all.js b/roojs-all.js index 2aceea1a94..989a578132 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -2960,7 +2960,7 @@ i++){B.push(C.pageX,C.pageY);}var x=Math.pow(B[0]-B[2],2);var y=Math.pow(B[1]-B[ return;}this.draw();},onTouchEnd:function(e){this.pinching=false;this.dragable=false;},process:function(A,B){console.log("process");if(this.loadMask){this.maskEl.mask(this.loadingText);}this.xhr=new XMLHttpRequest();A.xhr=this.xhr;console.log("METHOD:"+this.method); console.log("URL: "+this.url);this.xhr.open(this.method,this.url,true);var C={"Accept":"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};for(var D in C){var E=C[D];if(E){this.xhr.setRequestHeader(D,E);}}var F=this;this.xhr.onload=function(){F.xhrOnLoad(F.xhr); };this.xhr.onerror=function(){F.xhrOnError(F.xhr);};var G=new FormData();G.append('returnHTML','NO');if(B){G.append('crop',B);}if(typeof(A)!='undefined'&&(typeof(A.id)=='undefined'||A.id*1<1)){G.append(this.paramName,A,A.name);}if(typeof(A.filename)!='undefined'){G.append('filename',A.filename); -}if(typeof(A.mimetype)!='undefined'){G.append('mimetype',A.mimetype);}if(this.fireEvent('arrange',this,G)!=false){this.xhr.send(G);};},xhrOnLoad:function(A){console.log("xhrOnLoad");if(this.loadMask){this.maskEl.unmask();}if(A.readyState!==4){this.fireEvent('exception',this,A); +}if(typeof(A.mimetype)!='undefined'){G.append('mimetype',A.mimetype);}if(this.fireEvent('arrange',this,G)!=false){this.xhr.send(G);};},xhrOnLoad:function(A){console.log("xhrOnLoad");console.log(A);if(this.loadMask){this.maskEl.unmask();}if(A.readyState!==4){this.fireEvent('exception',this,A); return;}console.log(B);var B=Roo.decode(A.responseText);if(!B.success){this.fireEvent('exception',this,A);return;}var B=Roo.decode(A.responseText);this.fireEvent('upload',this,B);},xhrOnError:function(){if(this.loadMask){this.maskEl.unmask();}Roo.log('xhr on error'); var A=Roo.decode(xhr.responseText);Roo.log(A);},prepare:function(A){console.log("PREPARE");console.log(A);if(this.loadMask){this.maskEl.mask(this.loadingText);}this.file=false;this.exif={};if(typeof(A)==='string'){this.loadCanvas(A);return;}if(!A||!this.urlAPI){return; }this.file=A;this.cropType=A.type;var B=this;if(this.fireEvent('prepare',this,this.file)!=false){var C=new FileReader();C.onload=function(e){if(e.target.error){Roo.log(e.target.error);return;}var D=e.target.result,E=new DataView(D),F=2,G=E.byteLength-4,H,I; diff --git a/roojs-debug.js b/roojs-debug.js index a1fa2ea222..81a482a498 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -69429,6 +69429,7 @@ Roo.extend(Roo.dialog.UploadCropbox, Roo.Component, { xhrOnLoad : function(xhr) { console.log("xhrOnLoad"); + console.log(xhr); if(this.loadMask){ this.maskEl.unmask(); } diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index f0079fcca4..b70b0d4d98 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -44937,6 +44937,7 @@ Roo.extend(Roo.dialog.UploadCropbox, Roo.Component, { xhrOnLoad : function(xhr) { console.log("xhrOnLoad"); + console.log(xhr); if(this.loadMask){ this.maskEl.unmask(); } diff --git a/roojs-ui.js b/roojs-ui.js index 34d0f4104b..7f189f9609 100644 --- a/roojs-ui.js +++ b/roojs-ui.js @@ -2014,7 +2014,7 @@ i++){B.push(C.pageX,C.pageY);}var x=Math.pow(B[0]-B[2],2);var y=Math.pow(B[1]-B[ return;}this.draw();},onTouchEnd:function(e){this.pinching=false;this.dragable=false;},process:function(A,B){console.log("process");if(this.loadMask){this.maskEl.mask(this.loadingText);}this.xhr=new XMLHttpRequest();A.xhr=this.xhr;console.log("METHOD:"+this.method); console.log("URL: "+this.url);this.xhr.open(this.method,this.url,true);var C={"Accept":"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};for(var D in C){var E=C[D];if(E){this.xhr.setRequestHeader(D,E);}}var F=this;this.xhr.onload=function(){F.xhrOnLoad(F.xhr); };this.xhr.onerror=function(){F.xhrOnError(F.xhr);};var G=new FormData();G.append('returnHTML','NO');if(B){G.append('crop',B);}if(typeof(A)!='undefined'&&(typeof(A.id)=='undefined'||A.id*1<1)){G.append(this.paramName,A,A.name);}if(typeof(A.filename)!='undefined'){G.append('filename',A.filename); -}if(typeof(A.mimetype)!='undefined'){G.append('mimetype',A.mimetype);}if(this.fireEvent('arrange',this,G)!=false){this.xhr.send(G);};},xhrOnLoad:function(A){console.log("xhrOnLoad");if(this.loadMask){this.maskEl.unmask();}if(A.readyState!==4){this.fireEvent('exception',this,A); +}if(typeof(A.mimetype)!='undefined'){G.append('mimetype',A.mimetype);}if(this.fireEvent('arrange',this,G)!=false){this.xhr.send(G);};},xhrOnLoad:function(A){console.log("xhrOnLoad");console.log(A);if(this.loadMask){this.maskEl.unmask();}if(A.readyState!==4){this.fireEvent('exception',this,A); return;}console.log(B);var B=Roo.decode(A.responseText);if(!B.success){this.fireEvent('exception',this,A);return;}var B=Roo.decode(A.responseText);this.fireEvent('upload',this,B);},xhrOnError:function(){if(this.loadMask){this.maskEl.unmask();}Roo.log('xhr on error'); var A=Roo.decode(xhr.responseText);Roo.log(A);},prepare:function(A){console.log("PREPARE");console.log(A);if(this.loadMask){this.maskEl.mask(this.loadingText);}this.file=false;this.exif={};if(typeof(A)==='string'){this.loadCanvas(A);return;}if(!A||!this.urlAPI){return; }this.file=A;this.cropType=A.type;var B=this;if(this.fireEvent('prepare',this,this.file)!=false){var C=new FileReader();C.onload=function(e){if(e.target.error){Roo.log(e.target.error);return;}var D=e.target.result,E=new DataView(D),F=2,G=E.byteLength-4,H,I; -- 2.39.2