|
@@ -13,12 +13,12 @@ smalltalk.send(self,"_dispatcher_",[smalltalk.send((smalltalk.TrappedDumbDispatc
|
|
obj=smalltalk.HashedCollection._fromPairs_([smalltalk.send("title","__minus_gt",["To-Do List"])]);
|
|
obj=smalltalk.HashedCollection._fromPairs_([smalltalk.send("title","__minus_gt",["To-Do List"])]);
|
|
smalltalk.send(self,"_model_",[obj]);
|
|
smalltalk.send(self,"_model_",[obj]);
|
|
smalltalk.send((function(){
|
|
smalltalk.send((function(){
|
|
-smalltalk.send(obj,"_at_put_",["items",["hello", "world"]]);
|
|
|
|
|
|
+smalltalk.send(obj,"_at_put_",["items",[[true, "hello"], [false, "world"]]]);
|
|
return smalltalk.send(smalltalk.send(self,"_dispatcher",[]),"_changed_",[[]]);
|
|
return smalltalk.send(smalltalk.send(self,"_dispatcher",[]),"_changed_",[[]]);
|
|
}),"_valueWithTimeout_",[(2000)]);
|
|
}),"_valueWithTimeout_",[(2000)]);
|
|
return self},
|
|
return self},
|
|
args: [],
|
|
args: [],
|
|
-source: "initialize\x0a\x09| obj |\x0a\x09super initialize.\x0a self dispatcher: TrappedDumbDispatcher new.\x0a obj := #{'title' -> 'To-Do List'}.\x0a self model: obj.\x0a [ obj at: 'items' put: #('hello' 'world'). self dispatcher changed: #() ] valueWithTimeout: 2000\x0a",
|
|
|
|
|
|
+source: "initialize\x0a\x09| obj |\x0a\x09super initialize.\x0a self dispatcher: TrappedDumbDispatcher new.\x0a obj := #{'title' -> 'To-Do List'}.\x0a self model: obj.\x0a [ obj at: 'items' put: #(#(true 'hello') #(false 'world')). self dispatcher changed: #() ] valueWithTimeout: 2000\x0a",
|
|
messageSends: ["initialize", "dispatcher:", "new", "->", "model:", "valueWithTimeout:", "at:put:", "changed:", "dispatcher"],
|
|
messageSends: ["initialize", "dispatcher:", "new", "->", "model:", "valueWithTimeout:", "at:put:", "changed:", "dispatcher"],
|
|
referencedClasses: ["TrappedDumbDispatcher"]
|
|
referencedClasses: ["TrappedDumbDispatcher"]
|
|
}),
|
|
}),
|
|
@@ -34,20 +34,32 @@ selector: "renderOn:",
|
|
category: 'rendering',
|
|
category: 'rendering',
|
|
fn: function (html){
|
|
fn: function (html){
|
|
var self=this;
|
|
var self=this;
|
|
-var $1,$2;
|
|
|
|
|
|
+var $1,$2,$3,$4;
|
|
smalltalk.send(smalltalk.send(html,"_h2",[]),"_trapShow_",[["title"]]);
|
|
smalltalk.send(smalltalk.send(html,"_h2",[]),"_trapShow_",[["title"]]);
|
|
smalltalk.send(smalltalk.send(html,"_div",[]),"_trap_toggle_ifNotPresent_",[["items"],(function(){
|
|
smalltalk.send(smalltalk.send(html,"_div",[]),"_trap_toggle_ifNotPresent_",[["items"],(function(){
|
|
smalltalk.send(smalltalk.send(html,"_p",[]),"_with_",[(function(){
|
|
smalltalk.send(smalltalk.send(html,"_p",[]),"_with_",[(function(){
|
|
smalltalk.send(smalltalk.send(html,"_span",[]),"_trapShow_",[[smalltalk.symbolFor("size")]]);
|
|
smalltalk.send(smalltalk.send(html,"_span",[]),"_trapShow_",[[smalltalk.symbolFor("size")]]);
|
|
return smalltalk.send(html,"_with_",[" item(s)."]);
|
|
return smalltalk.send(html,"_with_",[" item(s)."]);
|
|
})]);
|
|
})]);
|
|
-return smalltalk.send(smalltalk.send(html,"_form",[]),"_with_",[(function(){
|
|
|
|
|
|
+smalltalk.send(smalltalk.send(html,"_form",[]),"_with_",[(function(){
|
|
return smalltalk.send(smalltalk.send(html,"_ul",[]),"_trapIter_tag_do_",[[],smalltalk.symbolFor("li"),(function(each){
|
|
return smalltalk.send(smalltalk.send(html,"_ul",[]),"_trapIter_tag_do_",[[],smalltalk.symbolFor("li"),(function(each){
|
|
|
|
+smalltalk.send(smalltalk.send(html,"_root",[]),"_empty",[]);
|
|
$1=smalltalk.send(html,"_input",[]);
|
|
$1=smalltalk.send(html,"_input",[]);
|
|
smalltalk.send($1,"_type_",["checkbox"]);
|
|
smalltalk.send($1,"_type_",["checkbox"]);
|
|
-$2=smalltalk.send($1,"_at_put_",["checked",true]);
|
|
|
|
|
|
+$2=smalltalk.send($1,"_trapBind_",[[(1)]]);
|
|
$2;
|
|
$2;
|
|
-return smalltalk.send(html,"_with_",[each]);
|
|
|
|
|
|
+return smalltalk.send(smalltalk.send(html,"_span",[]),"_trapShow_",[[(2)]]);
|
|
|
|
+})]);
|
|
|
|
+})]);
|
|
|
|
+smalltalk.send(smalltalk.send(html,"_p",[]),"_with_",["... and again, to see the bidirectional binding:"]);
|
|
|
|
+return smalltalk.send(smalltalk.send(html,"_form",[]),"_with_",[(function(){
|
|
|
|
+return smalltalk.send(smalltalk.send(html,"_ul",[]),"_trapIter_tag_do_",[[],smalltalk.symbolFor("li"),(function(each){
|
|
|
|
+smalltalk.send(smalltalk.send(html,"_root",[]),"_empty",[]);
|
|
|
|
+$3=smalltalk.send(html,"_input",[]);
|
|
|
|
+smalltalk.send($3,"_type_",["checkbox"]);
|
|
|
|
+$4=smalltalk.send($3,"_trapBind_",[[(1)]]);
|
|
|
|
+$4;
|
|
|
|
+return smalltalk.send(smalltalk.send(html,"_span",[]),"_trapShow_",[[(2)]]);
|
|
})]);
|
|
})]);
|
|
})]);
|
|
})]);
|
|
}),(function(){
|
|
}),(function(){
|
|
@@ -55,8 +67,8 @@ return smalltalk.send(html,"_with_",["Loading ..."]);
|
|
})]);
|
|
})]);
|
|
return self},
|
|
return self},
|
|
args: ["html"],
|
|
args: ["html"],
|
|
-source: "renderOn: html\x0a\x09html h2 trapShow: #('title').\x0a html div trap: #('items') toggle: [\x0a html p with: [ html span trapShow: #(#size). html with: ' item(s).' ].\x0a\x09\x09html form with: [ html ul trapIter: #() tag: #li do: [ :each |\x0a html input\x0a type: 'checkbox';\x0a at: 'checked' put: true.\x0a html with: each\x0a ]]\x0a ] ifNotPresent: [ html with: 'Loading ...' ]",
|
|
|
|
-messageSends: ["trapShow:", "h2", "trap:toggle:ifNotPresent:", "with:", "span", "p", "trapIter:tag:do:", "type:", "input", "at:put:", "ul", "form", "div"],
|
|
|
|
|
|
+source: "renderOn: html\x0a\x09html h2 trapShow: #('title').\x0a html div trap: #('items') toggle: [\x0a html p with: [ html span trapShow: #(#size). html with: ' item(s).' ].\x0a\x09\x09html form with: [ html ul trapIter: #() tag: #li do: [ :each |\x0a html root empty.\x0a html input\x0a type: 'checkbox';\x0a trapBind: #(1).\x0a html span trapShow: #(2).\x0a ]].\x0a html p with: '... and again, to see the bidirectional binding:'.\x0a\x09\x09html form with: [ html ul trapIter: #() tag: #li do: [ :each |\x0a html root empty.\x0a html input\x0a type: 'checkbox';\x0a trapBind: #(1).\x0a html span trapShow: #(2).\x0a ]].\x0a ] ifNotPresent: [ html with: 'Loading ...' ]",
|
|
|
|
+messageSends: ["trapShow:", "h2", "trap:toggle:ifNotPresent:", "with:", "span", "p", "trapIter:tag:do:", "empty", "root", "type:", "input", "trapBind:", "ul", "form", "div"],
|
|
referencedClasses: []
|
|
referencedClasses: []
|
|
}),
|
|
}),
|
|
smalltalk.AppView);
|
|
smalltalk.AppView);
|