Jelajahi Sumber

Fixed copy bug in File operation dialog

Toby Chui 3 tahun lalu
induk
melakukan
b329650f72
1 mengubah file dengan 8 tambahan dan 8 penghapusan
  1. 8 8
      web/SystemAO/file_system/file_operation.html

+ 8 - 8
web/SystemAO/file_system/file_operation.html

@@ -123,7 +123,7 @@
                 console.log("Checking launch parameters...");
                 if (window.location.hash.length > 0){
                     //OK to proceed
-                    //try{
+                    try{
                         operationConfig = JSON.parse(decodeURIComponent(window.location.hash.substring(1)));
                         
                         //Check if there are any missing paratmers
@@ -176,12 +176,12 @@
                             //All information are defined. Process it now.
                             processOperations(operationConfig)
                         }
-                    /*
+                    
                     }catch(ex){
-                        //Failed
+                        //Failed.
                         console.log("Argument parse error", ex);
                     }
-                    */
+                    
 
                 }else{
                     alert("Invalid use of File Operation Listener.")
@@ -209,7 +209,7 @@
                 
                 }else if (operationConfig.opr == "copy"){
                     $("#opricon").attr("src","img/copy.gif");
-                    copy(operationConfig.src, operationConfig.dest, operationConfig.overwriteMode);
+                    copyopr(operationConfig.src, operationConfig.dest, operationConfig.overwriteMode);
                 
                 }else if (operationConfig.opr == "zip"){
                     $("#opricon").attr("src","img/zip.gif");
@@ -487,7 +487,7 @@
                
             }
 
-            function copy(srcList, dest, overwriteMode){
+            function copyopr(srcList, dest, overwriteMode){
                 if (legacyMode){
                     //Open operation in legacy mode
                     console.log("WebSocket not found, Running in legacy mode");
@@ -511,7 +511,7 @@
 
 
                    //Use Websocket for operation updates
-                   var endpoint = getWSEndpoint() + `?opr=copy&src=${JSON.stringify(filteredSrcList)}&dest=${encodeURIComponent(dest)}&existsresp=${overwriteMode}`
+                   var endpoint = getWSEndpoint() + `?opr=copy&src=${encodeURIComponent(JSON.stringify(filteredSrcList))}&dest=${encodeURIComponent(dest)}&existsresp=${overwriteMode}`
                     var ws = new WebSocket(endpoint);
                     ws.onopen = function() {
                         console.log("File Operation WebSocket opened")
@@ -559,7 +559,7 @@
                         console.error("WebSocket error observed:", event);
                         console.log("Falling back to Legacy Mode")
                         legacyMode = true;
-                        copy(srcList, dest, overwriteMode)
+                        copyopr(srcList, dest, overwriteMode)
                     }
 
                 }