index.html 2.9 KB

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