HelloApp.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. define("com_examples_hello/HelloApp", ["amber/boot", "amber_core/Kernel-Objects"], function($boot){
  2. var smalltalk=$boot.vm,nil=$boot.nil,_st=$boot.asReceiver,globals=$boot.globals;
  3. smalltalk.addPackage('HelloApp');
  4. smalltalk.packages["HelloApp"].transport = {"type":"amd","amdNamespace":"com_examples_hello"};
  5. smalltalk.addClass('Hello', globals.Object, [], 'HelloApp');
  6. smalltalk.addMethod(
  7. smalltalk.method({
  8. selector: "begin",
  9. protocol: 'not yet classified',
  10. fn: function (){
  11. var self=this;
  12. var msg,button;
  13. return smalltalk.withContext(function($ctx1) {
  14. var $1,$2;
  15. msg="Hello world!";
  16. button="#sayHello"._asJQuery();
  17. _st(button)._click_((function(){
  18. return smalltalk.withContext(function($ctx2) {
  19. $1=button;
  20. $2=_st("<p>".__comma(msg)).__comma("</p>");
  21. $ctx2.sendIdx[","]=1;
  22. return _st($1)._after_($2);
  23. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  24. return self}, function($ctx1) {$ctx1.fill(self,"begin",{msg:msg,button:button},globals.Hello)})},
  25. args: [],
  26. 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>'].",
  27. messageSends: ["asJQuery", "click:", "after:", ","],
  28. referencedClasses: []
  29. }),
  30. globals.Hello);
  31. });