123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- define("{%= namespace %}/{%= name %}", ["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('{%= name %}');
- $core.packages["{%= name %}"].transport = {"type":"amd","amdNamespace":"{%= namespace %}"};
- $core.addClass('{%= name %}', $globals.Object, [], '{%= name %}');
- $core.addMethod(
- $core.method({
- selector: "augmentPage",
- protocol: 'starting',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1="#amber-with"._asJQuery();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["asJQuery"]=1;
- //>>excludeEnd("ctx");
- $recv($1)._click_((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return self._doAmberWith();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["click:"]=1;
- //>>excludeEnd("ctx");
- $recv("#jquery-append"._asJQuery())._click_((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return self._doJQueryAppend();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
- //>>excludeEnd("ctx");
- }));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"augmentPage",{},$globals.{%= name %})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "augmentPage\x0a\x09'#amber-with' asJQuery click: [ self doAmberWith ].\x0a\x09'#jquery-append' asJQuery click: [ self doJQueryAppend ]",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["click:", "asJQuery", "doAmberWith", "doJQueryAppend"]
- }),
- $globals.{%= name %});
- $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)}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- tag=$recv($recv($HTMLCanvas())._onJQuery_("#output-list"._asJQuery()))._root();
- $recv(tag)._with_((function(html){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv($recv(html)._li())._with_("Amber Web #with added me!");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["with:"]=1;
- //>>excludeEnd("ctx");
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"doAmberWith",{tag:tag},$globals.{%= name %})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- 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"],
- //>>excludeEnd("ide");
- messageSends: ["root", "onJQuery:", "asJQuery", "with:", "li"]
- }),
- $globals.{%= name %});
- $core.addMethod(
- $core.method({
- selector: "doJQueryAppend",
- protocol: 'action',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv("#output-list"._asJQuery())._append_("<li>jQuery append added me!</li>");
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"doJQueryAppend",{},$globals.{%= name %})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "doJQueryAppend\x0a\x09'#output-list' asJQuery append: '<li>jQuery append added me!</li>'",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["append:", "asJQuery"]
- }),
- $globals.{%= name %});
- $core.addMethod(
- $core.method({
- selector: "start",
- protocol: 'starting',
- fn: function (){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv(self._new())._augmentPage();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"start",{},$globals.{%= name %}.klass)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "start\x0a\x09self new augmentPage",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["augmentPage", "new"]
- }),
- $globals.{%= name %}.klass);
- });
|