|
@@ -657,6 +657,7 @@
|
|
|
<button class="ts icon tiny button standard whiteTheme" title="New Folder" onclick="newFolder();"><i class="folder outline icon"></i></button>
|
|
|
<button class="ts icon tiny button standard whiteTheme" title="Upload" onclick="upload();"><i class="upload icon"></i></button>
|
|
|
<button class="ts icon tiny button standard whiteTheme" title="Create Zip" onclick="zipFile();"><i class="zip file icon"></i></button>
|
|
|
+ <button class="ts icon tiny button standard whiteTheme" title="Unzip Here" onclick="unzipHere();"><i class="inbox icon"></i></button>
|
|
|
|
|
|
<button class="ts icon tiny button standard whiteTheme" title="Rename" onclick="rename();"><i class="i cursor icon"></i></button>
|
|
|
<button class="ts icon tiny negative button" title="Delete" onclick="deleteFile();"><i class="trash outline icon"></i></button>
|
|
@@ -1089,6 +1090,9 @@
|
|
|
<div class="item" onclick="zipFile();">
|
|
|
<i class="zip file icon"></i> <span locale="contextmenu/zip">Create Zip</span>
|
|
|
</div>
|
|
|
+ <div class="item zipFileOnly" onclick="unzipHere();">
|
|
|
+ <i class="inbox icon"></i> <span locale="contextmenu/unzip">Unzip Here</span>
|
|
|
+ </div>
|
|
|
<div class="item" onclick="rename();">
|
|
|
<i class="i cursor icon"></i> <span locale="contextmenu/rename">Rename</span>
|
|
|
</div>
|
|
@@ -2162,6 +2166,7 @@
|
|
|
$("#contextmenu").find(".vroothide").show();
|
|
|
$("#contextmenu").find(".noSelectionOnly").hide();
|
|
|
$("#contextmenu").find(".vrootonly").hide();
|
|
|
+ $("#contextmenu").find(".zipFileOnly").hide();
|
|
|
|
|
|
//Hide backup manual
|
|
|
$("#contextmenu").find(".backuponly").hide();
|
|
@@ -2197,6 +2202,12 @@
|
|
|
$("#contextmenu").find(".mobileonly").hide();
|
|
|
}
|
|
|
|
|
|
+ $(".fileObject.selected").each(function(){
|
|
|
+ if ($(this).attr("filename").split(".").pop().toLowerCase() == "zip"){
|
|
|
+ $(".zipFileOnly").show();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
});
|
|
|
|
|
|
//Right click on empty space of the file selector
|
|
@@ -2208,6 +2219,7 @@
|
|
|
$("#contextmenu").find(".noSelectionOnly").show();
|
|
|
$("#contextmenu").find(".allowNoSelection").show();
|
|
|
$("#contextmenu").find(".vroothide").show();
|
|
|
+ $("#contextmenu").find(".zipFileOnly").hide();
|
|
|
|
|
|
//Calculate the position of the context menu
|
|
|
calculateContextMenuOffsets(e);
|
|
@@ -2494,13 +2506,74 @@
|
|
|
}else{
|
|
|
title += applocale.getString("opr/zip/file"," file");
|
|
|
}
|
|
|
- parent.newFloatWindow({
|
|
|
- url: "SystemAO/file_system/file_operation.html#" + configHash,
|
|
|
- width: 400,
|
|
|
- height: 220,
|
|
|
- appicon: "SystemAO/file_system/img/selector.png",
|
|
|
- title: title
|
|
|
+
|
|
|
+ if (!ao_module_virtualDesktop){
|
|
|
+ window.open("file_operation.html#" + configHash);
|
|
|
+ }else{
|
|
|
+ parent.newFloatWindow({
|
|
|
+ url: "SystemAO/file_system/file_operation.html#" + configHash,
|
|
|
+ width: 400,
|
|
|
+ height: 220,
|
|
|
+ appicon: "SystemAO/file_system/img/selector.png",
|
|
|
+ title: title
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ function unzipHere(){
|
|
|
+ $(".popup").fadeOut('fast');
|
|
|
+
|
|
|
+ //Get a list of zip files selected
|
|
|
+ var unzippingFiles = [];
|
|
|
+ $(".fileObject.selected").each(function(){
|
|
|
+ var filepath = $(this).attr("filepath");
|
|
|
+ if ((filepath.split(".").pop()).toLowerCase() == "zip"){
|
|
|
+ unzippingFiles.push(filepath);
|
|
|
+ }
|
|
|
});
|
|
|
+
|
|
|
+ if(unzippingFiles.length == 0){
|
|
|
+ msgbox("remove", applocale.getString("opr/zip/nozipfile", "No zip file selected"));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ //Start unzip progress
|
|
|
+ console.log(unzippingFiles);
|
|
|
+
|
|
|
+ //Unzip and open them to tmp:/
|
|
|
+ var oprConfig = {
|
|
|
+ opr: "unzip",
|
|
|
+ src: unzippingFiles,
|
|
|
+ dest: currentPath,
|
|
|
+ overwriteMode: "overwrite",
|
|
|
+ callbackWindowID: ao_module_windowID,
|
|
|
+ callbackFunction: `callRefresh("${currentPath}")`
|
|
|
+ }
|
|
|
+
|
|
|
+ //Render the dialog title name
|
|
|
+ var configHash = encodeURIComponent(JSON.stringify(oprConfig));
|
|
|
+ var title = applocale.getString("opr/zip/unzipping","Unzipping ") + unzippingFiles.length;
|
|
|
+ if (unzippingFiles.length > 1){
|
|
|
+ title += applocale.getString("opr/zip/files", " files");
|
|
|
+ }else{
|
|
|
+ title += applocale.getString("opr/zip/file"," file");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (!ao_module_virtualDesktop){
|
|
|
+ window.open("file_operation.html#" + configHash);
|
|
|
+ }else{
|
|
|
+ parent.newFloatWindow({
|
|
|
+ url: "SystemAO/file_system/file_operation.html#" + configHash,
|
|
|
+ width: 400,
|
|
|
+ height: 220,
|
|
|
+ appicon: "SystemAO/file_system/img/selector.png",
|
|
|
+ title: title,
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
let renameFileObjects = [];
|