index.html 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>Amber Smalltalk</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
  6. <meta name="author" content="Nicolas Petton"/>
  7. <script type='text/javascript' src='node_modules/requirejs/require.js'></script>
  8. <script type='text/javascript' src='config.js'></script>
  9. </head>
  10. <body>
  11. <div>
  12. <button id="startlegacy" disabled type="button"
  13. onclick="a$gl$ifReady(function (amber) {amber.globals.Browser._open();});">
  14. Start legacy in-page IDE
  15. </button>
  16. <button id="starthelios" disabled type="button"
  17. onclick="a$gl$ifReady(function (amber) {amber.popupHelios();});">
  18. Popup Helios IDE
  19. </button>
  20. </div>
  21. <div>
  22. <span id="loadingKernel">Loading Amber kernel ... </span>
  23. <span id="initializingKernel">initializing Amber kernel ... </span>
  24. <span id="loadingTheRest">loading rest of development image ... </span>
  25. <span id="done">done.</span>
  26. </div>
  27. <script type='text/javascript'>
  28. "use strict";
  29. var global = typeof global === "undefined" ? window : global || window;
  30. var a$gl$ifReady = (function () {
  31. var startLegacy = document.getElementById("startlegacy");
  32. var startHelios = document.getElementById("starthelios");
  33. var messageBox = document.getElementById("loadingKernel").parentNode;
  34. var initializingKernel = messageBox.removeChild(document.getElementById("initializingKernel"));
  35. var loadingTheRest = messageBox.removeChild(document.getElementById("loadingTheRest"));
  36. var done = messageBox.removeChild(document.getElementById("done"));
  37. var loadAll;
  38. require(["require", "amber/es6-promise"], function (require, promiseLib) {
  39. promiseLib.polyfill();
  40. require(["amber/boot", "amber/deploy", "amber_core/Platform-Browser"], function (_, amber) {
  41. messageBox.appendChild(initializingKernel);
  42. loadAll = amber.initialize({'transport.defaultAmdNamespace': "amber_core"})
  43. .then(function () {
  44. messageBox.appendChild(loadingTheRest);
  45. return new Promise(function (resolve, reject) {
  46. require(["amber/devel", "amber/legacy/IDE", "amber/web/Web", "amber/legacy/Benchfib", "helios/all", "amber_cli/AmberCli"], resolve, reject);
  47. });
  48. })
  49. .then(function () {
  50. amber.globals.Smalltalk._postLoad();
  51. messageBox.appendChild(done);
  52. return amber;
  53. });
  54. startLegacy.disabled = startHelios.disabled = false;
  55. });
  56. });
  57. return function (action) {
  58. startLegacy.disabled = startHelios.disabled = true;
  59. loadAll.then(function (amber) {
  60. startLegacy.disabled = startHelios.disabled = false;
  61. action(amber);
  62. });
  63. };
  64. })();
  65. </script>
  66. </body>
  67. </html>