|
@@ -245,79 +245,77 @@ var $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$12,$13,$14,$15,$11;
|
|
|
return smalltalk.withContext(function($ctx2) {
|
|
|
_st(_st(html)._h2())._trap_([["title"]]);
|
|
|
$ctx2.sendIdx["trap:"]=1;
|
|
|
-return _st(_st(html)._div())._trap_toggle_ifNotPresent_([["todos"]],(function(){
|
|
|
+_st(_st(html)._div())._guard_trap_contents_([["todos"], ["notNil"]],[],(function(){
|
|
|
return smalltalk.withContext(function($ctx3) {
|
|
|
-return _st(snap)._do_((function(){
|
|
|
-return smalltalk.withContext(function($ctx4) {
|
|
|
$1=_st(html)._span();
|
|
|
-$ctx4.sendIdx["span"]=1;
|
|
|
+$ctx3.sendIdx["span"]=1;
|
|
|
_st($1)._trap_([["remaining"]]);
|
|
|
-$ctx4.sendIdx["trap:"]=2;
|
|
|
+$ctx3.sendIdx["trap:"]=2;
|
|
|
_st(html)._with_(" of ");
|
|
|
-$ctx4.sendIdx["with:"]=1;
|
|
|
+$ctx3.sendIdx["with:"]=1;
|
|
|
$2=_st(html)._span();
|
|
|
-$ctx4.sendIdx["span"]=2;
|
|
|
+$ctx3.sendIdx["span"]=2;
|
|
|
_st($2)._trap_([["todos"], ["size"]]);
|
|
|
-$ctx4.sendIdx["trap:"]=3;
|
|
|
+$ctx3.sendIdx["trap:"]=3;
|
|
|
_st(html)._with_(" remaining [ ");
|
|
|
-$ctx4.sendIdx["with:"]=2;
|
|
|
+$ctx3.sendIdx["with:"]=2;
|
|
|
$3=_st(html)._a();
|
|
|
_st($3)._href_("");
|
|
|
_st($3)._onClick_((function(){
|
|
|
-return smalltalk.withContext(function($ctx5) {
|
|
|
+return smalltalk.withContext(function($ctx4) {
|
|
|
_st(snap)._modify_((function(model){
|
|
|
-return smalltalk.withContext(function($ctx6) {
|
|
|
+return smalltalk.withContext(function($ctx5) {
|
|
|
return _st(model)._archive();
|
|
|
-}, function($ctx6) {$ctx6.fillBlock({model:model},$ctx5,5)})}));
|
|
|
-$ctx5.sendIdx["modify:"]=1;
|
|
|
+}, function($ctx5) {$ctx5.fillBlock({model:model},$ctx4,4)})}));
|
|
|
+$ctx4.sendIdx["modify:"]=1;
|
|
|
return false;
|
|
|
-}, function($ctx5) {$ctx5.fillBlock({},$ctx4,4)})}));
|
|
|
+}, function($ctx4) {$ctx4.fillBlock({},$ctx3,3)})}));
|
|
|
$4=_st($3)._with_("archive");
|
|
|
-$ctx4.sendIdx["with:"]=3;
|
|
|
+$ctx3.sendIdx["with:"]=3;
|
|
|
$4;
|
|
|
_st(html)._with_(" ]");
|
|
|
-$ctx4.sendIdx["with:"]=4;
|
|
|
+$ctx3.sendIdx["with:"]=4;
|
|
|
_st(_st(html)._ul())._with_((function(){
|
|
|
-return smalltalk.withContext(function($ctx5) {
|
|
|
+return smalltalk.withContext(function($ctx4) {
|
|
|
return _st(html)._trapIter_tag_do_([["todos"]],"li",(function(each){
|
|
|
-return smalltalk.withContext(function($ctx6) {
|
|
|
+return smalltalk.withContext(function($ctx5) {
|
|
|
$5=_st(html)._root();
|
|
|
-$ctx6.sendIdx["root"]=1;
|
|
|
+$ctx5.sendIdx["root"]=1;
|
|
|
_st($5)._empty();
|
|
|
$6=_st(html)._input();
|
|
|
-$ctx6.sendIdx["input"]=1;
|
|
|
+$ctx5.sendIdx["input"]=1;
|
|
|
_st($6)._type_("checkbox");
|
|
|
-$ctx6.sendIdx["type:"]=1;
|
|
|
+$ctx5.sendIdx["type:"]=1;
|
|
|
$7=_st($6)._trap_(["done"]);
|
|
|
-$ctx6.sendIdx["trap:"]=4;
|
|
|
+$ctx5.sendIdx["trap:"]=4;
|
|
|
$7;
|
|
|
$8=_st(html)._span();
|
|
|
_st($8)._trap_read_(["done"],(function(model){
|
|
|
-return smalltalk.withContext(function($ctx7) {
|
|
|
+return smalltalk.withContext(function($ctx6) {
|
|
|
return _st(_st(html)._root())._class_("done-".__comma(model));
|
|
|
-$ctx7.sendIdx["class:"]=1;
|
|
|
-}, function($ctx7) {$ctx7.fillBlock({model:model},$ctx6,8)})}));
|
|
|
+$ctx6.sendIdx["class:"]=1;
|
|
|
+}, function($ctx6) {$ctx6.fillBlock({model:model},$ctx5,7)})}));
|
|
|
$9=_st($8)._trap_(["text"]);
|
|
|
-$ctx6.sendIdx["trap:"]=5;
|
|
|
+$ctx5.sendIdx["trap:"]=5;
|
|
|
return $9;
|
|
|
-}, function($ctx6) {$ctx6.fillBlock({each:each},$ctx5,7)})}));
|
|
|
-}, function($ctx5) {$ctx5.fillBlock({},$ctx4,6)})}));
|
|
|
-$ctx4.sendIdx["with:"]=5;
|
|
|
+}, function($ctx5) {$ctx5.fillBlock({each:each},$ctx4,6)})}));
|
|
|
+}, function($ctx4) {$ctx4.fillBlock({},$ctx3,5)})}));
|
|
|
+$ctx3.sendIdx["with:"]=5;
|
|
|
$10=_st(html)._form();
|
|
|
_st($10)._onSubmit_((function(){
|
|
|
-return smalltalk.withContext(function($ctx5) {
|
|
|
+return smalltalk.withContext(function($ctx4) {
|
|
|
_st(snap)._modify_((function(model){
|
|
|
-return smalltalk.withContext(function($ctx6) {
|
|
|
+return smalltalk.withContext(function($ctx5) {
|
|
|
return _st(model)._addTodo();
|
|
|
-}, function($ctx6) {$ctx6.fillBlock({model:model},$ctx5,10)})}));
|
|
|
+}, function($ctx5) {$ctx5.fillBlock({model:model},$ctx4,9)})}));
|
|
|
return false;
|
|
|
-}, function($ctx5) {$ctx5.fillBlock({},$ctx4,9)})}));
|
|
|
+}, function($ctx4) {$ctx4.fillBlock({},$ctx3,8)})}));
|
|
|
$11=_st($10)._with_((function(){
|
|
|
-return smalltalk.withContext(function($ctx5) {
|
|
|
+return smalltalk.withContext(function($ctx4) {
|
|
|
$12=_st(html)._input();
|
|
|
-$ctx5.sendIdx["input"]=2;
|
|
|
+$ctx4.sendIdx["input"]=2;
|
|
|
_st($12)._type_("text");
|
|
|
-$ctx5.sendIdx["type:"]=2;
|
|
|
+$ctx4.sendIdx["type:"]=2;
|
|
|
_st($12)._trap_([["todoText"]]);
|
|
|
_st($12)._at_put_("size",(30));
|
|
|
$13=_st($12)._placeholder_("add new todo here");
|
|
@@ -327,19 +325,16 @@ _st($14)._class_("btn-primary");
|
|
|
_st($14)._type_("submit");
|
|
|
$15=_st($14)._value_("add");
|
|
|
return $15;
|
|
|
-}, function($ctx5) {$ctx5.fillBlock({},$ctx4,11)})}));
|
|
|
-$ctx4.sendIdx["with:"]=6;
|
|
|
+}, function($ctx4) {$ctx4.fillBlock({},$ctx3,10)})}));
|
|
|
return $11;
|
|
|
-}, function($ctx4) {$ctx4.fillBlock({},$ctx3,3)})}));
|
|
|
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}),(function(){
|
|
|
-return smalltalk.withContext(function($ctx3) {
|
|
|
-return _st(html)._with_("Loading ...");
|
|
|
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2,12)})}));
|
|
|
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
|
|
|
+$ctx2.sendIdx["guard:trap:contents:"]=1;
|
|
|
+return _st(_st(html)._p())._guard_trap_contents_([["todos"], ["isNil"]],[],"Loading ...");
|
|
|
}, function($ctx2) {$ctx2.fillBlock({snap:snap},$ctx1,1)})}));
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.AppView)})},
|
|
|
args: ["html"],
|
|
|
-source: "renderOn: html\x0a #() trapDescend: [ :snap |\x0a\x09html h2 trap: #((title)).\x0a html div trap: #((todos)) toggle: [ snap do: [\x0a html span trap:#((remaining)).\x0a html with: ' of '.\x0a html span trap: #((todos) (size)).\x0a html with: ' remaining [ '.\x0a html a href:''; onClick: [\x0a snap modify: [ :model | model archive ].\x0a false\x0a ]; with: 'archive'.\x0a html with: ' ]'.\x0a html ul with: [ html trapIter: #((todos)) tag: #li do: [ :each |\x0a html root empty.\x0a html input type: 'checkbox'; trap: #('done').\x0a html span trap: #('done') read: [ :model | html root class: 'done-', model ]; trap: #('text').\x0a ]].\x0a html form onSubmit: [\x0a snap modify: [ :model | model addTodo ].\x0a false\x0a ]; with: [\x0a html input type: 'text'; trap: #((todoText)); at: 'size' put: 30; placeholder: 'add new todo here'.\x0a html input class: 'btn-primary'; type: 'submit'; value: 'add'.\x0a ].\x0a ]] ifNotPresent: [ html with: 'Loading ...' ]]",
|
|
|
-messageSends: ["trapDescend:", "trap:", "h2", "trap:toggle:ifNotPresent:", "div", "do:", "span", "with:", "href:", "a", "onClick:", "modify:", "archive", "ul", "trapIter:tag:do:", "empty", "root", "type:", "input", "trap:read:", "class:", ",", "onSubmit:", "form", "addTodo", "at:put:", "placeholder:", "value:"],
|
|
|
+source: "renderOn: html\x0a #() trapDescend: [ :snap |\x0a\x09html h2 trap: #((title)).\x0a html div guard: #((todos) (notNil)) trap: #() contents: [\x0a html span trap:#((remaining)).\x0a html with: ' of '.\x0a html span trap: #((todos) (size)).\x0a html with: ' remaining [ '.\x0a html a href:''; onClick: [\x0a snap modify: [ :model | model archive ].\x0a false\x0a ]; with: 'archive'.\x0a html with: ' ]'.\x0a html ul with: [ html trapIter: #((todos)) tag: #li do: [ :each |\x0a html root empty.\x0a html input type: 'checkbox'; trap: #('done').\x0a html span trap: #('done') read: [ :model | html root class: 'done-', model ]; trap: #('text').\x0a ]].\x0a html form onSubmit: [\x0a snap modify: [ :model | model addTodo ].\x0a false\x0a ]; with: [\x0a html input type: 'text'; trap: #((todoText)); at: 'size' put: 30; placeholder: 'add new todo here'.\x0a html input class: 'btn-primary'; type: 'submit'; value: 'add'.\x0a ].\x0a ].\x0a\x09html p guard: #((todos) (isNil)) trap: #() contents: 'Loading ...'.\x0a\x09]",
|
|
|
+messageSends: ["trapDescend:", "trap:", "h2", "guard:trap:contents:", "div", "span", "with:", "href:", "a", "onClick:", "modify:", "archive", "ul", "trapIter:tag:do:", "empty", "root", "type:", "input", "trap:read:", "class:", ",", "onSubmit:", "form", "addTodo", "at:put:", "placeholder:", "value:", "p"],
|
|
|
referencedClasses: []
|
|
|
}),
|
|
|
smalltalk.AppView);
|