Browse Source

Fix hello example: Gruntfile.js/index.html namespace mismatch

Herbert Vojčík 10 years ago
parent
commit
74de7398ef
3 changed files with 7 additions and 7 deletions
  1. 1 1
      hello/Gruntfile.js
  2. 4 4
      hello/index.html
  3. 2 2
      hello/js/HelloApp.js

+ 1 - 1
hello/Gruntfile.js

@@ -16,7 +16,7 @@ module.exports = function(grunt) {
         libraries: ['Web'],
         output_dir: 'js',
         deploy: true,
-        amd_namespace: 'amber_examples_hello'
+        amd_namespace: 'com_examples_hello'
       }
     }
   });

+ 4 - 4
hello/index.html

@@ -6,11 +6,11 @@
     <script src="../bower_components/amber/support/requirejs/require.min.js"></script>
     <script type="text/javascript">
       require.config({ paths: {
-        'com_example_hello': 'js', //mapping compiled .js files
-        'com_example_hello/_source': 'st' //mapping smalltalk source files
+        'com_examples_hello': 'js', //mapping compiled .js files
+        'com_examples_hello/_source': 'st' //mapping smalltalk source files
       }});
-      require(['amber/devel','com_example_hello/HelloApp'], function (smalltalk) {
-        smalltalk.defaultAmdNamespace = "com_example_hello"; //used for all new packages in IDE
+      require(['amber/devel','com_examples_hello/HelloApp'], function (smalltalk) {
+        smalltalk.defaultAmdNamespace = "com_examples_hello"; //used for all new packages in IDE
         smalltalk.initialize();
         smalltalk.Hello._new()._begin();
       });

+ 2 - 2
hello/js/HelloApp.js

@@ -1,7 +1,7 @@
-define("amber_examples_hello/HelloApp", ["amber/boot", "amber_core/Kernel-Objects"], function($boot){
+define("com_examples_hello/HelloApp", ["amber/boot", "amber_core/Kernel-Objects"], function($boot){
 var smalltalk=$boot.vm,nil=$boot.nil,_st=$boot.asReceiver,globals=$boot.globals;
 smalltalk.addPackage('HelloApp');
-smalltalk.packages["HelloApp"].transport = {"type":"amd","amdNamespace":"amber_examples_hello"};
+smalltalk.packages["HelloApp"].transport = {"type":"amd","amdNamespace":"com_examples_hello"};
 
 smalltalk.addClass('Hello', globals.Object, [], 'HelloApp');
 smalltalk.addMethod(