|
@@ -0,0 +1,144 @@
|
|
|
+define("amber-helloapp/HelloApp", ["amber/boot", "amber_core/Kernel-Objects"], function($boot){
|
|
|
+var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
|
|
|
+var smalltalk=$core,_st=$recv,globals=$globals;
|
|
|
+$core.addPackage('HelloApp');
|
|
|
+$core.packages["HelloApp"].transport = {"type":"amd","amdNamespace":"amber-helloapp"};
|
|
|
+
|
|
|
+$core.addClass('HelloApp', $globals.Object, [], 'HelloApp');
|
|
|
+$core.addMethod(
|
|
|
+$core.method({
|
|
|
+selector: "augmentPage",
|
|
|
+protocol: 'starting',
|
|
|
+fn: function (){
|
|
|
+var self=this;
|
|
|
+
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
+
|
|
|
+var $1;
|
|
|
+$1="#amber-with"._asJQuery();
|
|
|
+
|
|
|
+$ctx1.sendIdx["asJQuery"]=1;
|
|
|
+
|
|
|
+$recv($1)._click_((function(){
|
|
|
+
|
|
|
+return $core.withContext(function($ctx2) {
|
|
|
+
|
|
|
+return self._doAmberWith();
|
|
|
+
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
|
|
|
+
|
|
|
+}));
|
|
|
+
|
|
|
+$ctx1.sendIdx["click:"]=1;
|
|
|
+
|
|
|
+$recv("#jquery-append"._asJQuery())._click_((function(){
|
|
|
+
|
|
|
+return $core.withContext(function($ctx2) {
|
|
|
+
|
|
|
+return self._doJQueryAppend();
|
|
|
+
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
|
|
|
+
|
|
|
+}));
|
|
|
+return self;
|
|
|
+
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"augmentPage",{},$globals.HelloApp)});
|
|
|
+
|
|
|
+},
|
|
|
+
|
|
|
+args: [],
|
|
|
+source: "augmentPage\x0a\x09'#amber-with' asJQuery click: [ self doAmberWith ].\x0a\x09'#jquery-append' asJQuery click: [ self doJQueryAppend ]",
|
|
|
+referencedClasses: [],
|
|
|
+
|
|
|
+messageSends: ["click:", "asJQuery", "doAmberWith", "doJQueryAppend"]
|
|
|
+}),
|
|
|
+$globals.HelloApp);
|
|
|
+
|
|
|
+$core.addMethod(
|
|
|
+$core.method({
|
|
|
+selector: "doAmberWith",
|
|
|
+protocol: 'action',
|
|
|
+fn: function (){
|
|
|
+var self=this;
|
|
|
+var tag;
|
|
|
+function $HTMLCanvas(){return $globals.HTMLCanvas||(typeof HTMLCanvas=="undefined"?nil:HTMLCanvas)}
|
|
|
+
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
+
|
|
|
+tag=$recv($recv($HTMLCanvas())._onJQuery_("#output-list"._asJQuery()))._root();
|
|
|
+$recv(tag)._with_((function(html){
|
|
|
+
|
|
|
+return $core.withContext(function($ctx2) {
|
|
|
+
|
|
|
+return $recv($recv(html)._li())._with_("Amber Web #with: added me!");
|
|
|
+
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)});
|
|
|
+
|
|
|
+}));
|
|
|
+
|
|
|
+$ctx1.sendIdx["with:"]=1;
|
|
|
+
|
|
|
+return self;
|
|
|
+
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"doAmberWith",{tag:tag},$globals.HelloApp)});
|
|
|
+
|
|
|
+},
|
|
|
+
|
|
|
+args: [],
|
|
|
+source: "doAmberWith\x0a\x09| tag |\x0a\x09tag := (HTMLCanvas onJQuery: '#output-list' asJQuery) root.\x0a\x09tag with: [ :html | html li with: 'Amber Web #with: added me!' ]",
|
|
|
+referencedClasses: ["HTMLCanvas"],
|
|
|
+
|
|
|
+messageSends: ["root", "onJQuery:", "asJQuery", "with:", "li"]
|
|
|
+}),
|
|
|
+$globals.HelloApp);
|
|
|
+
|
|
|
+$core.addMethod(
|
|
|
+$core.method({
|
|
|
+selector: "doJQueryAppend",
|
|
|
+protocol: 'action',
|
|
|
+fn: function (){
|
|
|
+var self=this;
|
|
|
+
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
+
|
|
|
+$recv("#output-list"._asJQuery())._append_("<li>jQuery append added me!</li>");
|
|
|
+return self;
|
|
|
+
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"doJQueryAppend",{},$globals.HelloApp)});
|
|
|
+
|
|
|
+},
|
|
|
+
|
|
|
+args: [],
|
|
|
+source: "doJQueryAppend\x0a\x09'#output-list' asJQuery append: '<li>jQuery append added me!</li>'",
|
|
|
+referencedClasses: [],
|
|
|
+
|
|
|
+messageSends: ["append:", "asJQuery"]
|
|
|
+}),
|
|
|
+$globals.HelloApp);
|
|
|
+
|
|
|
+
|
|
|
+$core.addMethod(
|
|
|
+$core.method({
|
|
|
+selector: "start",
|
|
|
+protocol: 'starting',
|
|
|
+fn: function (){
|
|
|
+var self=this;
|
|
|
+
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
+
|
|
|
+$recv(self._new())._augmentPage();
|
|
|
+return self;
|
|
|
+
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"start",{},$globals.HelloApp.klass)});
|
|
|
+
|
|
|
+},
|
|
|
+
|
|
|
+args: [],
|
|
|
+source: "start\x0a\x09self new augmentPage",
|
|
|
+referencedClasses: [],
|
|
|
+
|
|
|
+messageSends: ["augmentPage", "new"]
|
|
|
+}),
|
|
|
+$globals.HelloApp.klass);
|
|
|
+
|
|
|
+});
|