Sfoglia il codice sorgente

Merge pull request #629 from herby/simpler-loading

Simpler loading
Nicolas Petton 11 anni fa
parent
commit
dc985ae6df
7 ha cambiato i file con 25 aggiunte e 23 eliminazioni
  1. 2 8
      helios.html
  2. 2 8
      index.html
  3. 1 1
      support/amber.js
  4. 12 0
      support/deploy.js
  5. 2 1
      support/devel.js
  6. 2 1
      support/helios.js
  7. 4 4
      support/smalltalk.js

+ 2 - 8
helios.html

@@ -13,20 +13,14 @@
       <script type='text/javascript' src='support/amber.js'></script>
       <script type='text/javascript' src='support/requirejs/require.min.js'></script>
       <script type='text/javascript'>
-          require.config({
-              config: {
-                  'amber_vm/smalltalk': {
-                      defaultNamespace: 'amber_core'
-                  }
-              }
-          });
           require(
-                  ["amber_vm/smalltalk", "amber_set/full-devel-helios"],
+                  ["amber/helios"],
                   function (smalltalk) {
                       window.onbeforeunload = function() {
                           return 'Do you want to close Amber? All uncommitted changes will be lost.';
                       };
 
+                      smalltalk.defaultAMDNamespace = "amber_core";
                       smalltalk.initialize();
                   }
           );

+ 2 - 8
index.html

@@ -11,16 +11,10 @@
 
 <body>
 <script type='text/javascript'>
-    require.config({
-        config: {
-            'amber_vm/smalltalk': {
-                defaultNamespace: 'amber_core'
-            }
-        }
-    });
     require(
-        ["amber_vm/smalltalk", "amber_set/full-devel"],
+        ["amber/devel"],
         function (smalltalk) {
+            smalltalk.defaultAMDNamespace = "amber_core";
             smalltalk.initialize();
 
             smalltalk.Browser._open()

+ 1 - 1
support/amber.js

@@ -19,7 +19,7 @@ require = function (require) {
     var config = {
         baseUrl: home,
         paths: {
-            'amber_set': '.',
+            'amber': '.',
             'amber_vm': '.',
             'amber_css': '../css',
             'amber_core': '../js',

+ 12 - 0
support/deploy.js

@@ -0,0 +1,12 @@
+define([
+    'amber_vm/smalltalk',
+    'amber_core/Kernel-Objects',
+    'amber_core/Kernel-Classes',
+    'amber_core/Kernel-Methods',
+    'amber_core/Kernel-Collections',
+    'amber_core/Kernel-Infrastructure',
+    'amber_core/Kernel-Exceptions',
+    'amber_core/Kernel-Transcript',
+    'amber_core/Kernel-Announcements',
+    'amber_core/Canvas'
+], function (smalltalk) { return smalltalk; });

+ 2 - 1
support/full-devel.js → support/devel.js

@@ -1,4 +1,5 @@
 define([
+    'amber_vm/smalltalk',
     'jquery',
     'jquery-ui',
     'jQuery/jquery.textarea',
@@ -34,4 +35,4 @@ define([
     'amber_core/Benchfib',
     'amber_core/Kernel-Tests',
     'amber_core/SUnit-Tests'
-], {});
+], function (smalltalk) { return smalltalk; });

+ 2 - 1
support/full-devel-helios.js → support/helios.js

@@ -1,4 +1,5 @@
 define([
+    'amber_vm/smalltalk',
     'jquery',
     'jquery-ui',
     'jQuery/jquery.textarea',
@@ -52,4 +53,4 @@ define([
     'amber_core/Helios-References',
     'amber_core/Helios-Announcements',
     'amber_core/Helios-Workspace-Tests'
-], {});
+], function (smalltalk) { return smalltalk; });

+ 4 - 4
support/smalltalk.js

@@ -1,10 +1,10 @@
 define("amber_vm/smalltalk", ["require", "module", "./boot"], function (require, module, boot) {
     var smalltalk = boot.smalltalk;
 	smalltalk.amdRequire = require;
-    var config = module.config && module.config();
-    if (config) {
-		smalltalk.defaultAMDNamespace = config.defaultNamespace;
-    }
+//    var config = module.config && module.config();
+//    if (config) {
+//		smalltalk.defaultAMDNamespace = config.defaultNamespace;
+//    }
     return  smalltalk;
 });