Editor.html 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  6. <title>Editor</title>
  7. <style type="text/css" media="screen">
  8. body {
  9. overflow: hidden;
  10. }
  11. #editor {
  12. margin: 0;
  13. position: absolute;
  14. top: 0;
  15. bottom: 0;
  16. left: 0;
  17. right: 0;
  18. }
  19. </style>
  20. </head>
  21. <body>
  22. <pre id="editor"></pre>
  23. <script src="./source/ace/ace.js" type="text/javascript" charset="utf-8"></script>
  24. <script src="./source/ace/ext-language_tools.js"></script>
  25. <script src="./source/systemjs/system.js" type="text/javascript" charset="utf-8"></script>
  26. <script>
  27. System.config({
  28. "baseURL": "/",
  29. "defaultJSExtensions": true,
  30. // TODO: figure out how to make this be loaded in by the extension instead of being hard-coded in the html page
  31. meta: {
  32. './source/editorCore/modules/typescript.js': {
  33. format: 'global',
  34. exports: 'ts',
  35. }
  36. }
  37. });
  38. // Functions exposed to the host editor. These
  39. // are hooked in here so that they are available immediately from the host
  40. // and when called will bring in the interop as a promise and call it once
  41. // it has been loaded
  42. function HOST_loadCode(url) {
  43. System.import('./source/editorCore/interop').then((module) => {
  44. module.default.getInstance().loadCode(url);
  45. });
  46. }
  47. function HOST_saveCode() {
  48. System.import('./source/editorCore/interop').then((module) => {
  49. module.default.getInstance().saveCode();
  50. });
  51. }
  52. function HOST_resourceRenamed(path, newPath) {
  53. System.import('./source/editorCore/interop').then((module) => {
  54. module.default.getInstance().resourceRenamed(path, newPath);
  55. });
  56. }
  57. function HOST_resourceDeleted(path) {
  58. System.import('./source/editorCore/interop').then((module) => {
  59. module.default.getInstance().resourceDeleted(path);
  60. });
  61. }
  62. function HOST_preferencesChanged() {
  63. System.import('./source/editorCore/interop').then((module) => {
  64. module.default.getInstance().preferencesChanged();
  65. });
  66. }
  67. System.import('./source/editorCore/interop').then((module) => {
  68. module.default.getInstance().editorLoaded();
  69. });
  70. </script>
  71. </body>
  72. </html>