playground-runner.html 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <!DOCTYPE html>
  2. <html style="height: 100%">
  3. <head>
  4. <link data-inline="yes-please" href="./spinner.css" rel="stylesheet" />
  5. <link
  6. data-name="vs/editor/editor.main"
  7. rel="stylesheet"
  8. href="../../release/dev/vs/editor/editor.main.css"
  9. />
  10. <style type="text/css">
  11. body {
  12. margin: 0;
  13. padding: 0;
  14. border: 0;
  15. overflow: hidden;
  16. }
  17. </style>
  18. </head>
  19. <body>
  20. <div id="loading">
  21. <div class="spinner">
  22. <div class="rect1"></div>
  23. <div class="rect2"></div>
  24. <div class="rect3"></div>
  25. <div class="rect4"></div>
  26. <div class="rect5"></div>
  27. </div>
  28. </div>
  29. <script>
  30. var require = { paths: { vs: '../../release/dev/vs' } };
  31. </script>
  32. <script src="../../release/dev/vs/loader.js"></script>
  33. <script src="../../release/dev/vs/editor/editor.main.nls.js"></script>
  34. <script src="../../release/dev/vs/editor/editor.main.js"></script>
  35. <script type="text/javascript">
  36. var receivedCall = null;
  37. window.load = function (js, html, css) {
  38. receivedCall = {
  39. js: js,
  40. html: html,
  41. css: css
  42. };
  43. };
  44. </script>
  45. <script type="text/javascript">
  46. var geval = eval;
  47. require(['require', 'vs/editor/editor.main'], function (require) {
  48. 'use strict';
  49. var loading = document.getElementById('loading');
  50. loading.parentNode.removeChild(loading);
  51. document.body.style.height = '100%';
  52. // Switch `automaticLayout` property to true by default
  53. //TODO: var config = require('vs/editor/common/config/config');
  54. //config.getActiveEditor().automaticLayout = true;
  55. window.load = function (js, html, css) {
  56. if (css) {
  57. var style = document.createElement('style');
  58. style.type = 'text/css';
  59. style.innerHTML = css;
  60. document.body.appendChild(style);
  61. }
  62. if (html) {
  63. document.body.innerHTML += html;
  64. }
  65. if (js) {
  66. try {
  67. geval(js);
  68. } catch (err) {
  69. var pre = document.createElement('pre');
  70. pre.appendChild(document.createTextNode(err));
  71. document.body.insertBefore(pre, document.body.firstChild);
  72. }
  73. }
  74. };
  75. if (receivedCall) {
  76. window.load(receivedCall.js, receivedCall.html, receivedCall.css);
  77. }
  78. });
  79. </script>
  80. </body>
  81. </html>