CopyNMoveUI.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <?php
  2. include '../auth.php';
  3. ?>
  4. <!DOCTYPE html>
  5. <html>
  6. <head>
  7. <meta charset="UTF-8">
  8. <script src="../script/jquery.min.js"></script>
  9. <!-- <script src="../script/jquery-ui.min.js"></script> -->
  10. <link rel="stylesheet" href="../script/tocas/tocas.css">
  11. <script type='text/javascript' src="../script/tocas/tocas.js"></script>
  12. <script type='text/javascript' src="../script/ao_module.js"></script>
  13. <title>7z File Manager</title>
  14. <style>
  15. body{
  16. background-color:white
  17. }
  18. .ts.form .inline.field label {
  19. min-width: 50%;
  20. }
  21. .ts.basic.dropdown, .ts.form select {
  22. max-width: 50%;
  23. }
  24. </style>
  25. </head>
  26. <body>
  27. <div class="ts container">
  28. <div class="ts grid">
  29. <div class="sixteen wide column">
  30. <br>
  31. <div class="ts form">
  32. <div class="field">
  33. <label>Extract to:</label>
  34. <div class="ts labeled input" style="width:100%">
  35. <div class="ts label">
  36. /AOR/
  37. </div>
  38. <input type="text" id="path" placeholder="Select a path for unzip.">
  39. <button class="ts icon button" onClick="selectFolder();">
  40. <i class="folder open icon"></i>
  41. </button>
  42. </div>
  43. </div>
  44. </div>
  45. <br>
  46. <div class="ts checkbox">
  47. <input type="checkbox" id="ZipFolderDontCreate">
  48. <label for="ZipFolderDontCreate">Don't create new folder</label>
  49. </div>
  50. <p id="filesshow">Target: </p>
  51. </div>
  52. <div class="eight wide column"></div>
  53. <div class="eight wide column">
  54. <button class="ts basic small button" style="width:45%" onclick="f_ok()">OK</button>
  55. <button class="ts basic small button" style="width:45%" onclick="f_close()">Cancel</button>
  56. </div>
  57. </div>
  58. </div>
  59. </body>
  60. <script>
  61. var f_method = "<?php echo $_GET["method"] ?>";
  62. var f_rand = "<?php echo $_GET["rand"] ?>";
  63. var f_file = "<?php echo $_GET["file"] ?>";
  64. var f_dir = "<?php echo $_GET["dir"] ?>";
  65. var f_extractTo = "";
  66. ao_module_setFixedWindowSize();
  67. ao_module_setWindowSize(650,240);
  68. $( "#ZipFolderDontCreate" ).change(function() {
  69. updatePath();
  70. }).change();
  71. $( "#path" ).keyup(function() {
  72. updatePath();
  73. });
  74. $("#filesshow").text("Target: ");
  75. function f_close(){
  76. if(ao_module_virtualDesktop){
  77. ao_module_close();
  78. }else{
  79. ts('#modal').modal('hide');
  80. }
  81. }
  82. function f_ok(){
  83. var href = "ProgressUI.php?method=" + f_method + "&rand=" + f_rand + "&file=" + f_file + "&dir=" + f_dir + "&destdir=" + f_extractTo + "&DontCreateNewFolder=" + $("#ZipFolderDontCreate").is( ":checked" );
  84. if(ao_module_virtualDesktop){
  85. ao_module_newfw('7-Zip File Manager/' + href,'7-Zip','file outline','7-ZipProgressUI' + Math.floor(Math.random()*100),720,250);
  86. ao_module_close();
  87. }else{
  88. $.get( href, function( data ) {
  89. $( "#modaldata" ).html( data );
  90. ts('#modal').modal("show");
  91. });
  92. }
  93. }
  94. function updatePath(){
  95. var SelectedPath = $("#path").val();
  96. var ZipPath = "";
  97. console.log(f_file);
  98. var ZipNameAsPath = ao_module_codec.decodeUmFilename(f_file.replace(/^.*[\\\/]/, '')).split(".")[0] + "/";
  99. var RootDir = "/AOR/";
  100. if(f_dir == ""){
  101. ZipPath = "...";
  102. }else{
  103. if(f_method == "e"){
  104. ZipPath = f_dir.replace(/^.*[\\\/]/, '');
  105. }else{
  106. ZipPath = f_dir;
  107. }
  108. }
  109. if(SelectedPath.slice(-1) !== "/"){
  110. SelectedPath = SelectedPath + "/";
  111. }
  112. if(SelectedPath.includes("/media/") || (!SelectedPath.includes("C:\\") && SelectedPath.includes("/media/"))){
  113. RootDir = "";
  114. }
  115. if($("#ZipFolderDontCreate").is( ":checked" )){
  116. ZipNameAsPath = "";
  117. }
  118. console.log(SelectedPath);
  119. console.log(ZipNameAsPath);
  120. console.log(ZipPath);
  121. $("#filesshow").text("Target: " + RootDir + SelectedPath + ZipNameAsPath + ZipPath);
  122. f_extractTo = "../" + SelectedPath;
  123. }
  124. function selectFolder(){
  125. if (ao_module_virtualDesktop){
  126. ao_module_openFileSelector(getUUID(),"setPathBySelector",undefined,undefined,false,"folder");
  127. }else{
  128. ao_module_openFileSelectorTab(getUUID(),"../",false,"folder","setPathBySelector");
  129. }
  130. }
  131. function setPathBySelector(object){
  132. var files = JSON.parse(object);
  133. console.log(files);
  134. $("#path").val(files[0].filepath);
  135. updatePath();
  136. }
  137. function getUUID(){
  138. return new Date().getTime();
  139. }
  140. /* depreacted
  141. $( "#path" ).keypress(function() {
  142. $.get( "opr.php?method=ListAORDir&dir=" + $( "#path" ).val(), function( data ) {
  143. $( "#path" ).autocomplete({
  144. source: JSON.parse(data)
  145. });
  146. });
  147. });
  148. */
  149. </script>
  150. </html>