index.html 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 global = typeof global === "undefined" ? window : global || 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. messageBox.appendChild(done);
  55. });
  56. });
  57. });
  58. })();
  59. </script>
  60. </body>
  61. </html>