CopyNMoveUI.php 3.4 KB

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