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="ZipFolderCreate">
  48. <label for="ZipFolderCreate">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. $( "#ZipFolderCreate" ).change(function() {
  69. updatePath();
  70. }).change();
  71. function f_close(){
  72. if(ao_module_virtualDesktop){
  73. ao_module_close();
  74. }else{
  75. ts('#modal').modal('hide');
  76. }
  77. }
  78. function f_ok(){
  79. var href = "ProgressUI.php?method=" + f_method + "&rand=" + f_rand + "&file=" + f_file + "&dir=" + f_dir + "&destdir=" + f_extractTo + "&CreateNewFoler=" + $("#ZipFolderCreate").is( ":checked" );
  80. if(ao_module_virtualDesktop){
  81. ao_module_newfw('7-Zip File Manager/' + href,'7-Zip','file outline','7-ZipProgressUI' + Math.floor(Math.random()*100),720,250);
  82. ao_module_close();
  83. }else{
  84. $.get( href, function( data ) {
  85. $( "#modaldata" ).html( data );
  86. ts('#modal').modal("show");
  87. });
  88. }
  89. }
  90. $( "#path" ).keyup(function() {
  91. updatePath();
  92. });
  93. function updatePath(){
  94. var SelectedPath = $("#path").val();
  95. var ZipPath = "";
  96. console.log(f_file);
  97. var ZipNameAsPath = ao_module_codec.decodeUmFilename(f_file.replace(/^.*[\\\/]/, '')).split(".")[0] + "/";
  98. var RootDir = "/AOR/";
  99. if(f_dir == ""){
  100. ZipPath = "...";
  101. }else{
  102. if(f_method == "e"){
  103. ZipPath = f_dir.replace(/^.*[\\\/]/, '');
  104. }else{
  105. ZipPath = f_dir;
  106. }
  107. }
  108. if(SelectedPath.slice(-1) !== "/"){
  109. SelectedPath = SelectedPath + "/";
  110. }
  111. if(SelectedPath.includes("/media/") || (!SelectedPath.includes("C:\\") && SelectedPath.includes("/media/"))){
  112. RootDir = "";
  113. }
  114. if($("#ZipFolderCreate").is( ":checked" )){
  115. ZipNameAsPath = "";
  116. }
  117. console.log(SelectedPath);
  118. console.log(ZipNameAsPath);
  119. console.log(ZipPath);
  120. $("#filesshow").text("Target: " + RootDir + SelectedPath + ZipNameAsPath + ZipPath);
  121. f_extractTo = "../" + SelectedPath;
  122. }
  123. function selectFolder(){
  124. if (ao_module_virtualDesktop){
  125. ao_module_openFileSelector(getUUID(),"setPathBySelector",undefined,undefined,false,"folder");
  126. }else{
  127. ao_module_openFileSelectorTab(getUUID(),"../",false,"folder","setPathBySelector");
  128. }
  129. }
  130. function setPathBySelector(object){
  131. var files = JSON.parse(object);
  132. console.log(files);
  133. $("#path").val(files[0].filepath);
  134. updatePath();
  135. }
  136. function getUUID(){
  137. return new Date().getTime();
  138. }
  139. /* depreacted
  140. $( "#path" ).keypress(function() {
  141. $.get( "opr.php?method=ListAORDir&dir=" + $( "#path" ).val(), function( data ) {
  142. $( "#path" ).autocomplete({
  143. source: JSON.parse(data)
  144. });
  145. });
  146. });
  147. */
  148. </script>
  149. </html>