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