2
0

HelloApp.js 1.2 KB

1234567891011121314151617181920212223242526272829
  1. define("com_example_hello/HelloApp", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st){
  2. smalltalk.addPackage('HelloApp');
  3. smalltalk.packages["HelloApp"].transport = {"type":"amd","amdNamespace":"com_example_hello"};
  4. smalltalk.addClass('Hello', smalltalk.Object, [], 'HelloApp');
  5. smalltalk.addMethod(
  6. smalltalk.method({
  7. selector: "begin",
  8. category: 'not yet classified',
  9. fn: function (){
  10. var self=this;
  11. var msg,button;
  12. return smalltalk.withContext(function($ctx1) {
  13. msg="Hello world!";
  14. button="#sayHello"._asJQuery();
  15. _st(button)._click_((function(){
  16. return smalltalk.withContext(function($ctx2) {
  17. return _st(button)._after_(_st("<p>".__comma(msg)).__comma("</p>"));
  18. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  19. return self}, function($ctx1) {$ctx1.fill(self,"begin",{msg:msg,button:button},smalltalk.Hello)})},
  20. args: [],
  21. source: "begin\x0a\x22Makes me say hello to the user.\x22\x0a\x0a| msg button |\x0amsg := 'Hello world!'.\x0abutton := '#sayHello' asJQuery.\x0abutton click: [button after: '<p>' , msg , '</p>'].",
  22. messageSends: ["asJQuery", "click:", "after:", ","],
  23. referencedClasses: []
  24. }),
  25. smalltalk.Hello);
  26. });