zip_extractor.html 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <html>
  2. <head>
  3. <title>Zip Extractor</title>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0 user-scalable=no">
  6. <link rel="stylesheet" href="../../script/semantic/semantic.min.css">
  7. <script type="text/javascript" src="../../script/jquery.min.js"></script>
  8. <script type="text/javascript" src="../../script/semantic/semantic.min.js"></script>
  9. <script type="text/javascript" src="../../script/ao_module.js"></script>
  10. <style>
  11. body{
  12. background-color: rgba(255,255,255,0.7);
  13. }
  14. </style>
  15. </head>
  16. <body>
  17. <br>
  18. <div class="ui active inverted dimmer">
  19. <div class="ui text loader">Loading Archives</div>
  20. </div>
  21. <script>
  22. ao_module_setFixedWindowSize();
  23. //Load openeing file from ao_module inputs
  24. var targetFiles = ao_module_loadInputFiles();
  25. console.log("Opening Zip Archives", targetFiles);
  26. //Generate an filepath array from file objects
  27. var targetFilePaths = [];
  28. targetFiles.forEach(file => {
  29. targetFilePaths.push(file.filepath);
  30. });
  31. //Unzip and open them to tmp:/
  32. var oprConfig = {
  33. opr: "unzipAndOpen",
  34. src: targetFilePaths,
  35. dest: "tmp:/tmp_" + Date.now() + "/",
  36. overwriteMode: "overwrite",
  37. }
  38. //Render the dialog title name
  39. var configHash = encodeURIComponent(JSON.stringify(oprConfig));
  40. var title = "Unzipping " + targetFilePaths.length;
  41. if (targetFilePaths.length > 1){
  42. title += " files";
  43. }else{
  44. title += " file";
  45. }
  46. //Open the operation dialog in new floatWindow
  47. ao_module_newfw({
  48. url: "SystemAO/file_system/file_operation.html#" + configHash,
  49. width: 400,
  50. height: 220,
  51. appicon: "SystemAO/file_system/img/zip_extractor.png",
  52. title: title
  53. });
  54. //CLose this window
  55. ao_module_close();
  56. </script>
  57. </body>
  58. </html>