embedded.html 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. <link rel="stylesheet" href="notepadA.css">
  10. <script src="../script/jquery.min.js"></script>
  11. <script src="../script/semantic/semantic.min.js"></script>
  12. <script src="../script/ao_module.js"></script>
  13. <style>
  14. body{
  15. background-color:#292929;
  16. color:white;
  17. }
  18. </style>
  19. </head>
  20. <body>
  21. <br>
  22. <div class="ui container" align="center">
  23. <img class="ui image" src="img/banner.png"/>
  24. <p>Loading launch information...</p>
  25. </div>
  26. <script>
  27. ao_module_setFixedWindowSize();
  28. //Check if another window already exists
  29. var openLocally = true;
  30. //Start one instance launching
  31. $(parent.window.document.body).find(".floatWindow").each(function(){
  32. var iframeURL = $(this).find("iframe").attr('src');
  33. if (iframeURL.includes("Code Studio/index.html")){
  34. //There are already one instance of Code Studio running. Send open command to that window.
  35. openLocally = false;
  36. var files = ao_module_loadInputFiles();
  37. if (files.length > 0){
  38. for (var i=0; i<files.length; i++){
  39. $(this).find("iframe")[0].contentWindow.openFile(files[i].filepath);
  40. }
  41. }
  42. //Focus the target floatWindow
  43. $(this).find("iframe")[0].contentWindow.ao_module_focus();
  44. ao_module_close();
  45. }
  46. });
  47. //Open the NotepadA with this window
  48. if (openLocally){
  49. ao_module_setWindowSize(1024,768);
  50. ao_module_setResizableWindowSize();
  51. //Update the iframe url as well
  52. hash = window.location.hash;
  53. $(parent.getFloatWindowByID(ao_module_windowID)).find("iframe").attr('src',"Code Studio/index.html" + hash);
  54. //Move the hash value as well
  55. window.location.href = "index.html" + hash;
  56. }
  57. </script>
  58. </body>
  59. </html>