index.html 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. <div class="ui divider"></div>
  26. <p>Try open an IME and type something</p>
  27. <input class="ui fluid input" val="Test"></input>
  28. <br>
  29. <textarea></textarea>
  30. <br>
  31. <button class="ui blue button" onClick="pinWindow();">Pin Window</button>
  32. <button class="ui blue button" onClick="unpinWindow();">Unpin Window</button>
  33. <button class="ui primary button" onclick="openfileselector();">Open File Selector New Mode</button>
  34. <button class="ui negative button" onClick="ao_module_close();">Close Window</button>
  35. </div>
  36. <script>
  37. var flist = ao_module_loadInputFiles();
  38. if (flist == null){
  39. $("#flist").text("No input file");
  40. }else{
  41. for (var i =0; i < flist.length; i++){
  42. $("#flist").append(flist[i].filename + " / " + flist[i].filepath + "<br>");
  43. }
  44. }
  45. function openfileselector(){
  46. ao_module_openFileSelector(fileLoader, "user:/Desktop/",type="new",true, {
  47. defaultName: "New File.txt"
  48. })
  49. }
  50. //Test to pin this window to topmost
  51. function pinWindow(){
  52. ao_module_setTopMost();
  53. }
  54. function unpinWindow(){
  55. ao_module_unsetTopMost();
  56. }
  57. function fileLoader(filedata){
  58. if (filedata.length == 0){
  59. $("#flist").text("No file selected");
  60. return;
  61. }
  62. $("#flist").html("");
  63. for (var i =0; i < filedata.length; i++){
  64. $("#flist").append(filedata[i].filename + " / " + filedata[i].filepath + "<br>");
  65. }
  66. }
  67. function testRunScript(){
  68. var script = "Dummy/backend/getParamters.js";
  69. $.ajax({
  70. url: "../system/ajgi/interface?script=" + script,
  71. data: {foo: "Hello", bar: "World"},
  72. method: "POST",
  73. success: function(data){
  74. console.log(data);
  75. }
  76. })
  77. }
  78. </script>
  79. </body>
  80. </html>