From c825df68a923c84dfe83457c3c718f99de5f4dc2 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 23 Jun 2020 15:07:39 +0200 Subject: [PATCH] Fix infinite spinner in sheets with image copy/paste --- www/common/onlyoffice/v2a/sdkjs/cell/sdk-all-min.js | 8 ++++---- www/common/onlyoffice/v2a/sdkjs/cell/sdk-all.js | 10 +++++----- www/common/onlyoffice/v2a/sdkjs/slide/sdk-all-min.js | 8 ++++---- www/common/onlyoffice/v2a/sdkjs/word/sdk-all-min.js | 8 ++++---- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/www/common/onlyoffice/v2a/sdkjs/cell/sdk-all-min.js b/www/common/onlyoffice/v2a/sdkjs/cell/sdk-all-min.js index 895f49624..32aeb5823 100644 --- a/www/common/onlyoffice/v2a/sdkjs/cell/sdk-all-min.js +++ b/www/common/onlyoffice/v2a/sdkjs/cell/sdk-all-min.js @@ -624,10 +624,10 @@ url+'" method="POST" enctype="multipart/form-data">0&&indexHtml>0&&index0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);var file=aFiles.pop();var aResultUrls= -[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push(urls[i]);break}if(aFiles.length===0)callback(Asc.c_oAscError.ID.No,aResultUrls);else{file=aFiles.pop();var xhr=new XMLHttpRequest;url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt); -xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}}else callback(Asc.c_oAscError.ID.UplImageFileCount)};var xhr=new XMLHttpRequest;xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}else callback(Asc.c_oAscError.ID.UplImageFileCount)}function UploadImageUrls(files,documentId,documentUserId, -jwt,callback){if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);var file=aFiles.pop();var aResultUrls=[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push({path:i, +return}}catch(err$12){}}callback(mapAscServerErrorToAscError(nError),files)}}}function UploadImageFiles(files,documentId,documentUserId,jwt,callback){window.parent.APP.UploadImageFiles(files,documentId,documentUserId,jwt,function(err,urls){callback(err||Asc.c_oAscError.ID.No,urls)});return;if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]); +var file=aFiles.pop();var aResultUrls=[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push(urls[i]);break}if(aFiles.length===0)callback(Asc.c_oAscError.ID.No,aResultUrls);else{file=aFiles.pop();var xhr=new XMLHttpRequest;url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+= +"?token="+encodeURIComponent(jwt);xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}}else callback(Asc.c_oAscError.ID.UplImageFileCount)};var xhr=new XMLHttpRequest;xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}else callback(Asc.c_oAscError.ID.UplImageFileCount)}function UploadImageUrls(files, +documentId,documentUserId,jwt,callback){if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);var file=aFiles.pop();var aResultUrls=[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push({path:i, url:urls[i]});break}if(aFiles.length===0)callback(aResultUrls);else{file=aFiles.pop();var xhr=new XMLHttpRequest;url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}}else callback([])};var xhr=new XMLHttpRequest;xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type", file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}else callback(Asc.c_oAscError.ID.UplImageFileCount)}function ValidateUploadImage(files){var nRes=c_oAscServerError.NoError;if(files.length>0)for(var i=0,length=files.length;i-1)base64=cL[i].split("xslData;")[1];else if(cL[i].indexOf("docData;")>-1)base64FromWord=cL[i].split("docData;")[1];else if(cL[i].indexOf("pptData;")>-1)base64FromPresentation=cL[i].split("pptData;")[1]}return{base64:base64,base64FromWord:base64FromWord, -base64FromPresentation:base64FromPresentation}},_getImageFromHtml:function(html,isGetUrlsArray){var res=null;if(html){var allImages=html.getElementsByTagName("img");if(allImages&&allImages.length)if(isGetUrlsArray){var arrayImages=[];for(var i=0;i-1)base64=cL[i].split("xslData;")[1];else if(cL[i].indexOf("docData;")>-1)base64FromWord=cL[i].split("docData;")[1];else if(cL[i].indexOf("pptData;")>-1)base64FromPresentation=cL[i].split("pptData;")[1]}return{base64:base64, +base64FromWord:base64FromWord,base64FromPresentation:base64FromPresentation}},_getImageFromHtml:function(html,isGetUrlsArray){var res=null;if(html){var allImages=html.getElementsByTagName("img");if(allImages&&allImages.length)if(isGetUrlsArray){var arrayImages=[];for(var i=0;ic_oAscMaxCellOrCommentLength){isChange=true;var text=currentCellData[i].text;var format=currentCellData[i].format;var lengthOfText=text.length;var iterCount=Math.ceil(lengthOfText/c_oAscMaxCellOrCommentLength);var splitText; for(var j=0;j0&&indexHtml>0&&index0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);var file=aFiles.pop();var aResultUrls= -[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push(urls[i]);break}if(aFiles.length===0)callback(Asc.c_oAscError.ID.No,aResultUrls);else{file=aFiles.pop();var xhr=new XMLHttpRequest;url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt); -xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}}else callback(Asc.c_oAscError.ID.UplImageFileCount)};var xhr=new XMLHttpRequest;xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}else callback(Asc.c_oAscError.ID.UplImageFileCount)}function UploadImageUrls(files,documentId,documentUserId, -jwt,callback){if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);var file=aFiles.pop();var aResultUrls=[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push({path:i, +return}}catch(err$17){}}callback(mapAscServerErrorToAscError(nError),files)}}}function UploadImageFiles(files,documentId,documentUserId,jwt,callback){window.parent.APP.UploadImageFiles(files,documentId,documentUserId,jwt,function(err,urls){callback(err||Asc.c_oAscError.ID.No,urls)});return;if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]); +var file=aFiles.pop();var aResultUrls=[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push(urls[i]);break}if(aFiles.length===0)callback(Asc.c_oAscError.ID.No,aResultUrls);else{file=aFiles.pop();var xhr=new XMLHttpRequest;url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+= +"?token="+encodeURIComponent(jwt);xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}}else callback(Asc.c_oAscError.ID.UplImageFileCount)};var xhr=new XMLHttpRequest;xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}else callback(Asc.c_oAscError.ID.UplImageFileCount)}function UploadImageUrls(files, +documentId,documentUserId,jwt,callback){if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);var file=aFiles.pop();var aResultUrls=[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push({path:i, url:urls[i]});break}if(aFiles.length===0)callback(aResultUrls);else{file=aFiles.pop();var xhr=new XMLHttpRequest;url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}}else callback([])};var xhr=new XMLHttpRequest;xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type", file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}else callback(Asc.c_oAscError.ID.UplImageFileCount)}function ValidateUploadImage(files){var nRes=c_oAscServerError.NoError;if(files.length>0)for(var i=0,length=files.length;i0&&indexHtml>0&&index0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);var file=aFiles.pop();var aResultUrls= -[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push(urls[i]);break}if(aFiles.length===0)callback(Asc.c_oAscError.ID.No,aResultUrls);else{file=aFiles.pop();var xhr=new XMLHttpRequest;url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt); -xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}}else callback(Asc.c_oAscError.ID.UplImageFileCount)};var xhr=new XMLHttpRequest;xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}else callback(Asc.c_oAscError.ID.UplImageFileCount)}function UploadImageUrls(files,documentId,documentUserId, -jwt,callback){if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);var file=aFiles.pop();var aResultUrls=[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push({path:i, +return}}catch(err$2){}}callback(mapAscServerErrorToAscError(nError),files)}}}function UploadImageFiles(files,documentId,documentUserId,jwt,callback){window.parent.APP.UploadImageFiles(files,documentId,documentUserId,jwt,function(err,urls){callback(err||Asc.c_oAscError.ID.No,urls)});return;if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]); +var file=aFiles.pop();var aResultUrls=[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push(urls[i]);break}if(aFiles.length===0)callback(Asc.c_oAscError.ID.No,aResultUrls);else{file=aFiles.pop();var xhr=new XMLHttpRequest;url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+= +"?token="+encodeURIComponent(jwt);xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}}else callback(Asc.c_oAscError.ID.UplImageFileCount)};var xhr=new XMLHttpRequest;xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}else callback(Asc.c_oAscError.ID.UplImageFileCount)}function UploadImageUrls(files, +documentId,documentUserId,jwt,callback){if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);var file=aFiles.pop();var aResultUrls=[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push({path:i, url:urls[i]});break}if(aFiles.length===0)callback(aResultUrls);else{file=aFiles.pop();var xhr=new XMLHttpRequest;url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}}else callback([])};var xhr=new XMLHttpRequest;xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type", file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}else callback(Asc.c_oAscError.ID.UplImageFileCount)}function ValidateUploadImage(files){var nRes=c_oAscServerError.NoError;if(files.length>0)for(var i=0,length=files.length;i