CopyNMoveUI.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. <p id="filesshow">Target: </p>
  46. </div>
  47. <div class="eight wide column"></div>
  48. <div class="eight wide column">
  49. <button class="ts basic small button" style="width:45%" onclick="f_ok()">OK</button>
  50. <button class="ts basic small button" style="width:45%" onclick="f_close()">Cancel</button>
  51. </div>
  52. </div>
  53. </div>
  54. </body>
  55. <script>
  56. var f_method = "<?php echo $_GET["method"] ?>";
  57. var f_rand = "<?php echo $_GET["rand"] ?>";
  58. var f_file = "<?php echo $_GET["file"] ?>";
  59. var f_dir = "<?php echo $_GET["dir"] ?>";
  60. var f_extractTo = "";
  61. ao_module_setFixedWindowSize();
  62. ao_module_setWindowSize(650,200);
  63. function f_close(){
  64. if(ao_module_virtualDesktop){
  65. ao_module_close();
  66. }else{
  67. ts('#modal').modal('hide');
  68. }
  69. }
  70. function f_ok(){
  71. var href = "ProgressUI.php?method=" + f_method + "&rand=" + f_rand + "&file=" + f_file + "&dir=" + f_dir + "&destdir=" + f_extractTo;
  72. if(ao_module_virtualDesktop){
  73. ao_module_newfw('7-Zip File Manager/' + href,'7-Zip','file outline','7-ZipProgressUI' + Math.floor(Math.random()*100),720,250);
  74. ao_module_close();
  75. }else{
  76. $.get( href, function( data ) {
  77. $( "#modaldata" ).html( data );
  78. ts('#modal').modal("show");
  79. });
  80. }
  81. }
  82. $( "#path" ).keyup(function() {
  83. updatePath();
  84. });
  85. function updatePath(){
  86. var path = $("#path").val();
  87. var displayPath = "";
  88. if(f_dir == ""){
  89. displayPath = "...";
  90. }else{
  91. if(f_method == "e"){
  92. displayPath = f_dir.replace(/^.*[\\\/]/, '');
  93. }else{
  94. displayPath = f_dir;
  95. }
  96. }
  97. if(path.slice(-1) !== "/"){
  98. path = path + "/";
  99. }
  100. $("#filesshow").text("Target: /AOR/" + path + f_file.replace(/^.*[\\\/]/, '').replace(".","") + "/" + displayPath);
  101. f_extractTo = "../" + path;
  102. }
  103. function selectFolder(){
  104. if (ao_module_virtualDesktop){
  105. ao_module_openFileSelector(getUUID(),"setPathBySelector",undefined,undefined,false,"folder");
  106. }else{
  107. ao_module_openFileSelectorTab(getUUID(),"../",false,"folder","setPathBySelector");
  108. }
  109. }
  110. function setPathBySelector(object){
  111. var files = JSON.parse(object);
  112. console.log(files);
  113. $("#path").val(files[0].filepath);
  114. updatePath();
  115. }
  116. function getUUID(){
  117. return new Date().getTime();
  118. }
  119. /* still in implmention
  120. $( "#path" ).keypress(function() {
  121. $.get( "opr.php?method=ListAORDir&dir=" + $( "#path" ).val(), function( data ) {
  122. $( "#path" ).autocomplete({
  123. source: JSON.parse(data)
  124. });
  125. });
  126. });
  127. */
  128. </script>
  129. </html>