|
@@ -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
|
|
@@ -153,24 +153,7 @@
|
|
|
data: {dir: operationConfig.dest},
|
|
|
success: function(filelist){
|
|
|
//Check for duplication
|
|
|
- var duplicateFound = false;
|
|
|
-
|
|
|
- /*
|
|
|
-mainloop:
|
|
|
- for (var i = 0; i < filelist.length; i++){
|
|
|
- var desktopFile = filelist[i];
|
|
|
- for (var j = 0; j < operationConfig.src.length; j++){
|
|
|
- var srcfile = operationConfig.src[j];
|
|
|
- var srcFilename = srcfile.split("/").pop();
|
|
|
- if (srcFilename == desktopFile.Filename){
|
|
|
- duplicateFound = true
|
|
|
- break mainloop;
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
- */
|
|
|
-
|
|
|
- duplicateFound = filelist.some(function(file){
|
|
|
+ var duplicateFound = filelist.some(function(file){
|
|
|
return operationConfig.src.includes(file);
|
|
|
});
|
|
|
|
|
@@ -193,11 +176,12 @@ mainloop:
|
|
|
//All information are defined. Process it now.
|
|
|
processOperations(operationConfig)
|
|
|
}
|
|
|
-
|
|
|
+ /*
|
|
|
}catch(ex){
|
|
|
//Failed
|
|
|
console.log("Argument parse error", ex);
|
|
|
}
|
|
|
+ */
|
|
|
|
|
|
}else{
|
|
|
alert("Invalid use of File Operation Listener.")
|
|
@@ -317,7 +301,7 @@ mainloop:
|
|
|
ao_module_openPath(operationConfig.dest);
|
|
|
}
|
|
|
ao_module_close();
|
|
|
- }, 1000);
|
|
|
+ }, 100);
|
|
|
}
|
|
|
};
|
|
|
|