|
@@ -0,0 +1,233 @@
|
|
|
|
+define("amber-ambertextinputexample/AmberTextInputExample", ["amber/boot", "amber_core/Kernel-Objects", "amber_core/Web"], function($boot){
|
|
|
|
+var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
|
|
|
|
+$core.addPackage('AmberTextInputExample');
|
|
|
|
+$core.packages["AmberTextInputExample"].innerEval = function (expr) { return eval(expr); };
|
|
|
|
+$core.packages["AmberTextInputExample"].transport = {"type":"amd","amdNamespace":"amber-ambertextinputexample"};
|
|
|
|
+
|
|
|
|
+$core.addClass('AmberTextInputExample', $globals.Object, [], 'AmberTextInputExample');
|
|
|
|
+$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");
|
|
|
|
+}));
|
|
|
|
+self._doTextFieldExampleAppend();
|
|
|
|
+return self;
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"augmentPage",{},$globals.AmberTextInputExample)});
|
|
|
|
+//>>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 ].\x0a\x09self doTextFieldExampleAppend",
|
|
|
|
+referencedClasses: [],
|
|
|
|
+//>>excludeEnd("ide");
|
|
|
|
+messageSends: ["click:", "asJQuery", "doAmberWith", "doJQueryAppend", "doTextFieldExampleAppend"]
|
|
|
|
+}),
|
|
|
|
+$globals.AmberTextInputExample);
|
|
|
|
+
|
|
|
|
+$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.AmberTextInputExample)});
|
|
|
|
+//>>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.AmberTextInputExample);
|
|
|
|
+
|
|
|
|
+$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.AmberTextInputExample)});
|
|
|
|
+//>>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.AmberTextInputExample);
|
|
|
|
+
|
|
|
|
+$core.addMethod(
|
|
|
|
+$core.method({
|
|
|
|
+selector: "doTextFieldExampleAppend",
|
|
|
|
+protocol: 'action',
|
|
|
|
+fn: function (){
|
|
|
|
+var self=this;
|
|
|
|
+function $TextInputExample(){return $globals.TextInputExample||(typeof TextInputExample=="undefined"?nil:TextInputExample)}
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+$recv($recv($TextInputExample())._new())._appendToJQuery_("body"._asJQuery());
|
|
|
|
+return self;
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"doTextFieldExampleAppend",{},$globals.AmberTextInputExample)});
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+},
|
|
|
|
+//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
|
+args: [],
|
|
|
|
+source: "doTextFieldExampleAppend\x0a\x0a TextInputExample new appendToJQuery: 'body' asJQuery",
|
|
|
|
+referencedClasses: ["TextInputExample"],
|
|
|
|
+//>>excludeEnd("ide");
|
|
|
|
+messageSends: ["appendToJQuery:", "new", "asJQuery"]
|
|
|
|
+}),
|
|
|
|
+$globals.AmberTextInputExample);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+$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.AmberTextInputExample.klass)});
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+},
|
|
|
|
+//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
|
+args: [],
|
|
|
|
+source: "start\x0a\x09self new augmentPage",
|
|
|
|
+referencedClasses: [],
|
|
|
|
+//>>excludeEnd("ide");
|
|
|
|
+messageSends: ["augmentPage", "new"]
|
|
|
|
+}),
|
|
|
|
+$globals.AmberTextInputExample.klass);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+$core.addClass('TextInputExample', $globals.Widget, ['myInputField'], 'AmberTextInputExample');
|
|
|
|
+$core.addMethod(
|
|
|
|
+$core.method({
|
|
|
|
+selector: "doSomething",
|
|
|
|
+protocol: 'not yet classified',
|
|
|
|
+fn: function (){
|
|
|
|
+var self=this;
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+$recv(self["@myInputField"])._inspect();
|
|
|
|
+return self;
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"doSomething",{},$globals.TextInputExample)});
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+},
|
|
|
|
+//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
|
+args: [],
|
|
|
|
+source: "doSomething\x0a\x0a myInputField inspect",
|
|
|
|
+referencedClasses: [],
|
|
|
|
+//>>excludeEnd("ide");
|
|
|
|
+messageSends: ["inspect"]
|
|
|
|
+}),
|
|
|
|
+$globals.TextInputExample);
|
|
|
|
+
|
|
|
|
+$core.addMethod(
|
|
|
|
+$core.method({
|
|
|
|
+selector: "renderOn:",
|
|
|
|
+protocol: 'not yet classified',
|
|
|
|
+fn: function (html){
|
|
|
|
+var self=this;
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+var $1,$2;
|
|
|
|
+self["@myInputField"]=$recv(html)._input();
|
|
|
|
+$1=$recv(html)._button();
|
|
|
|
+$recv($1)._with_("Do something");
|
|
|
|
+$2=$recv($1)._onClick_((function(){
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+return $core.withContext(function($ctx2) {
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+return self._doSomething();
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+}));
|
|
|
|
+return self;
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},$globals.TextInputExample)});
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+},
|
|
|
|
+//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
|
+args: ["html"],
|
|
|
|
+source: "renderOn: html\x0a myInputField := html input.\x0a html button\x0a with: 'Do something';\x0a onClick: [ self doSomething]",
|
|
|
|
+referencedClasses: [],
|
|
|
|
+//>>excludeEnd("ide");
|
|
|
|
+messageSends: ["input", "with:", "button", "onClick:", "doSomething"]
|
|
|
|
+}),
|
|
|
|
+$globals.TextInputExample);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+});
|