index.html 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta name="apple-mobile-web-app-capable" content="yes" />
  5. <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1"/>
  6. <meta charset="UTF-8">
  7. <meta name="theme-color" content="#4b75ff">
  8. <link rel="stylesheet" href="../script/semantic/semantic.min.css">
  9. <script src="../script/jquery.min.js"></script>
  10. <script src="../script/ao_module.js"></script>
  11. <script src="../script/semantic/semantic.min.js"></script>
  12. <title>Dummy</title>
  13. <style>
  14. body{
  15. background-color:white;
  16. }
  17. </style>
  18. </head>
  19. <body>
  20. <br><br>
  21. <div class="ui container">
  22. <h3>This is a Dummy Testing Module</h3>
  23. <p>Received drag-in filelist (if any)</p>
  24. <span id="flist"></span>
  25. <br>
  26. <button class="ui blue button" onClick="pinWindow();">Pin Window</button>
  27. <button class="ui primary button" onclick="openfileselector();">Open File Selector New Mode</button>
  28. <button class="ui negative button" onClick="ao_module_close();">Close Window</button>
  29. </div>
  30. <script>
  31. var flist = ao_module_loadInputFiles();
  32. if (flist == null){
  33. $("#flist").text("No input file");
  34. }else{
  35. for (var i =0; i < flist.length; i++){
  36. $("#flist").append(flist[i].filename + " / " + flist[i].filepath + "<br>");
  37. }
  38. }
  39. function openfileselector(){
  40. ao_module_openFileSelector(fileLoader, "user:/Desktop/",type="new",true, {
  41. defaultName: "New File.txt"
  42. })
  43. }
  44. //Test to pin this window to topmost
  45. function pinWindow(){
  46. ao_module_setTopMost();
  47. }
  48. function fileLoader(filedata){
  49. if (filedata.length == 0){
  50. $("#flist").text("No file selected");
  51. return;
  52. }
  53. $("#flist").html("");
  54. for (var i =0; i < filedata.length; i++){
  55. $("#flist").append(filedata[i].filename + " / " + filedata[i].filepath + "<br>");
  56. }
  57. }
  58. function testRunScript(){
  59. var script = "Dummy/backend/getParamters.js";
  60. $.ajax({
  61. url: "../system/ajgi/interface?script=" + script,
  62. data: {foo: "Hello", bar: "World"},
  63. method: "POST",
  64. success: function(data){
  65. console.log(data);
  66. }
  67. })
  68. }
  69. </script>
  70. </body>
  71. </html>