2
0

helpers.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. define("amber/helpers", ["amber_vm/smalltalk", "amber_vm/globals", "require"], function (vm, globals, require) {
  2. var exports = Object.create(globals);
  3. // API
  4. exports.popupHelios = function () {
  5. window.open(require.toUrl('amber_helios/html/helios.html'), "Helios", "menubar=no, status=no, scrollbars=no, menubar=no, width=1000, height=600");
  6. };
  7. Object.defineProperty(exports, "vm", {
  8. value: vm,
  9. enumerable: true, configurable: true, writable: false
  10. });
  11. Object.defineProperty(exports, "globals", {
  12. value: globals,
  13. enumerable: true, configurable: true, writable: false
  14. });
  15. exports.initialize = function (options) {
  16. options = options || {};
  17. if (exports.defaultAmdNamespace) {
  18. console.warn("`smalltalk.defaultAmdNamespace = 'foo';` is deprecated. Please use `smalltalk.initialize({defaultAmdNamespace: 'foo'});` instead.");
  19. options.defaultAmdNamespace = options.defaultAmdNamespace || exports.defaultAmdNamespace;
  20. }
  21. vm.defaultAmdNamespace = options.defaultAmdNamespace || vm.defaultAmdNamespace;
  22. console.warn("smalltalk.ClassName is deprecated. Please use smalltalk.globals.ClassName instead.");
  23. return vm.initialize();
  24. };
  25. // Backward compatibility, deprecated
  26. Object.defineProperty(exports, "smalltalk", {
  27. value: vm,
  28. enumerable: true, configurable: true, writable: false
  29. });
  30. exports.defaultAmdNamespace = null;
  31. // Exports
  32. return exports;
  33. });