1
0

index.html 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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">Start legacy in-page IDE</button>
  13. <button id="starthelios" disabled type="button">Popup Helios IDE</button>
  14. </div>
  15. <div>
  16. <span id="loadingKernel">Loading Amber kernel ... </span>
  17. <span id="initializingKernel">initializing Amber kernel ... </span>
  18. <span id="loadingIdeSupport">loading IDE support ... </span>
  19. <span id="loadingTheRest">loading rest of development image ... </span>
  20. <span id="done">done.</span>
  21. </div>
  22. <script type='text/javascript'>
  23. "use strict";
  24. var globalThis = typeof globalThis === "undefined" ? window : globalThis || window;
  25. (function () {
  26. var startLegacy = document.getElementById("startlegacy");
  27. var startHelios = document.getElementById("starthelios");
  28. var messageBox = document.getElementById("loadingKernel").parentNode;
  29. var initializingKernel = messageBox.removeChild(document.getElementById("initializingKernel"));
  30. var loadingIdeSupport = messageBox.removeChild(document.getElementById("loadingIdeSupport"));
  31. var loadingTheRest = messageBox.removeChild(document.getElementById("loadingTheRest"));
  32. var done = messageBox.removeChild(document.getElementById("done"));
  33. require(["require", "amber/es6-promise"], function (require, promiseLib) {
  34. promiseLib.polyfill();
  35. require(["amber/boot", "amber/deploy", "amber/core/Platform-Browser"], function (_, amber) {
  36. messageBox.appendChild(initializingKernel);
  37. amber.initialize({'transport.defaultAmdNamespace': "amber/core"})
  38. .then(function () {
  39. messageBox.appendChild(loadingIdeSupport);
  40. return amber.loadPackages(["amber/lang", "amber/legacy/IDE", "amber/core/SUnit"]);
  41. })
  42. .then(function () {
  43. startLegacy.addEventListener('click', function () {
  44. amber.globals.Browser._open();
  45. });
  46. startHelios.addEventListener('click', function () {
  47. amber.popupHelios();
  48. });
  49. startLegacy.disabled = startHelios.disabled = false;
  50. messageBox.appendChild(loadingTheRest);
  51. return amber.loadPackages(["amber/devel", "amber/legacy/Benchfib", "helios/all", "amber_cli/AmberCli"]);
  52. })
  53. .then(function () {
  54. amber.beClean();
  55. messageBox.appendChild(done);
  56. });
  57. });
  58. });
  59. })();
  60. </script>
  61. </body>
  62. </html>