|
@@ -58,23 +58,22 @@ category: 'action',
|
|
|
fn: function (){
|
|
|
var self=this;
|
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
-var $2,$4,$6,$5,$3,$1;
|
|
|
+var $2,$4,$5,$3,$1;
|
|
|
$1=(function(model){
|
|
|
return smalltalk.withContext(function($ctx2) {
|
|
|
$2=self["@brush"];
|
|
|
_st($2)._empty();
|
|
|
$4=$2;
|
|
|
-$6=model;
|
|
|
-if(($receiver = $6) == nil || $receiver == undefined){
|
|
|
+if(($receiver = model) == nil || $receiver == null){
|
|
|
$5=(function(){
|
|
|
return smalltalk.withContext(function($ctx3) {
|
|
|
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})});
|
|
|
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})});
|
|
|
} else {
|
|
|
-$5=$6;
|
|
|
+$5=model;
|
|
|
};
|
|
|
$3=_st($4)._with_($5);
|
|
|
return $3;
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({model:model},$ctx1)})});
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({model:model},$ctx1,1)})});
|
|
|
return $1;
|
|
|
}, function($ctx1) {$ctx1.fill(self,"showBlock",{},smalltalk.TrappedBinder)})},
|
|
|
args: [],
|
|
@@ -102,9 +101,9 @@ return smalltalk.withContext(function($ctx3) {
|
|
|
return _st(snap)._modify_((function(){
|
|
|
return smalltalk.withContext(function($ctx4) {
|
|
|
return _st(_st(_st(self["@brush"])._asJQuery())._attr_("checked"))._notNil();
|
|
|
-}, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
|
|
|
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({snap:snap},$ctx1)})}));
|
|
|
+}, function($ctx4) {$ctx4.fillBlock({},$ctx3,3)})}));
|
|
|
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({snap:snap},$ctx1,1)})}));
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"installFor:",{path:path},smalltalk.TrappedCheckedBinder)})},
|
|
|
args: ["path"],
|
|
|
source: "installFor: path\x0a\x09super installFor: path.\x0a path trapDescend: [ :snap |\x0a\x09 brush onChange: [ snap modify: [\x0a (brush asJQuery attr: 'checked') notNil\x0a ]]\x0a ]",
|
|
@@ -120,23 +119,22 @@ category: 'action',
|
|
|
fn: function (){
|
|
|
var self=this;
|
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
-var $2,$4,$3,$1;
|
|
|
+var $2,$3,$1;
|
|
|
$1=(function(model){
|
|
|
return smalltalk.withContext(function($ctx2) {
|
|
|
$2=_st(self["@brush"])._asJQuery();
|
|
|
-$4=model;
|
|
|
-if(($receiver = $4) == nil || $receiver == undefined){
|
|
|
+if(($receiver = model) == nil || $receiver == null){
|
|
|
$3=false;
|
|
|
} else {
|
|
|
$3=self._prim_(model);
|
|
|
};
|
|
|
return _st($2)._attr_put_("checked",$3);
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({model:model},$ctx1)})});
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({model:model},$ctx1,1)})});
|
|
|
return $1;
|
|
|
}, function($ctx1) {$ctx1.fill(self,"showBlock",{},smalltalk.TrappedCheckedBinder)})},
|
|
|
args: [],
|
|
|
source: "showBlock\x0a\x09^[ :model | brush asJQuery attr: 'checked' put: (model ifNotNil: [ self prim: model ] ifNil: [ false ]) ]",
|
|
|
-messageSends: ["attr:put:", "ifNotNil:ifNil:", "prim:", "asJQuery"],
|
|
|
+messageSends: ["attr:put:", "asJQuery", "ifNotNil:ifNil:", "prim:"],
|
|
|
referencedClasses: []
|
|
|
}),
|
|
|
smalltalk.TrappedCheckedBinder);
|
|
@@ -159,9 +157,9 @@ return smalltalk.withContext(function($ctx3) {
|
|
|
return _st(snap)._modify_((function(){
|
|
|
return smalltalk.withContext(function($ctx4) {
|
|
|
return _st(_st(self["@brush"])._asJQuery())._val();
|
|
|
-}, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
|
|
|
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({snap:snap},$ctx1)})}));
|
|
|
+}, function($ctx4) {$ctx4.fillBlock({},$ctx3,3)})}));
|
|
|
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({snap:snap},$ctx1,1)})}));
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"installFor:",{path:path},smalltalk.TrappedValBinder)})},
|
|
|
args: ["path"],
|
|
|
source: "installFor: path\x0a\x09super installFor: path.\x0a path trapDescend: [ :snap |\x0a\x09 brush onChange: [ snap modify: [\x0a brush asJQuery val\x0a ]]\x0a ]",
|
|
@@ -177,25 +175,24 @@ category: 'action',
|
|
|
fn: function (){
|
|
|
var self=this;
|
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
-var $2,$4,$3,$1;
|
|
|
+var $2,$3,$1;
|
|
|
$1=(function(model){
|
|
|
return smalltalk.withContext(function($ctx2) {
|
|
|
$2=_st(self["@brush"])._asJQuery();
|
|
|
-$4=model;
|
|
|
-if(($receiver = $4) == nil || $receiver == undefined){
|
|
|
+if(($receiver = model) == nil || $receiver == null){
|
|
|
$3=(function(){
|
|
|
return smalltalk.withContext(function($ctx3) {
|
|
|
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})});
|
|
|
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)})});
|
|
|
} else {
|
|
|
$3=self._prim_(model);
|
|
|
};
|
|
|
return _st($2)._val_($3);
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({model:model},$ctx1)})});
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({model:model},$ctx1,1)})});
|
|
|
return $1;
|
|
|
}, function($ctx1) {$ctx1.fill(self,"showBlock",{},smalltalk.TrappedValBinder)})},
|
|
|
args: [],
|
|
|
source: "showBlock\x0a\x09^[ :model | brush asJQuery val: (model ifNotNil: [self prim: model] ifNil: [[]]) ]",
|
|
|
-messageSends: ["val:", "ifNotNil:ifNil:", "prim:", "asJQuery"],
|
|
|
+messageSends: ["val:", "asJQuery", "ifNotNil:ifNil:", "prim:"],
|
|
|
referencedClasses: []
|
|
|
}),
|
|
|
smalltalk.TrappedValBinder);
|
|
@@ -252,7 +249,7 @@ var self=this;
|
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
var $2,$1;
|
|
|
$2=self["@current"];
|
|
|
-if(($receiver = $2) == nil || $receiver == undefined){
|
|
|
+if(($receiver = $2) == nil || $receiver == null){
|
|
|
self["@current"]=self._new();
|
|
|
$1=self["@current"];
|
|
|
} else {
|
|
@@ -299,23 +296,27 @@ return smalltalk.withContext(function($ctx1) {
|
|
|
var $1,$2,$3,$4,$6,$7,$5;
|
|
|
tag=_st(_st(aTagBrush)._element())._nodeName();
|
|
|
$1=_st(tag).__eq("INPUT");
|
|
|
+$ctx1.sendIdx["="]=1;
|
|
|
if(smalltalk.assert($1)){
|
|
|
var type;
|
|
|
type=_st(_st(aTagBrush)._asJQuery())._attr_("type");
|
|
|
type;
|
|
|
$2=_st(type).__eq("checkbox");
|
|
|
+$ctx1.sendIdx["="]=2;
|
|
|
if(smalltalk.assert($2)){
|
|
|
binder=_st($TrappedCheckedBinder())._new();
|
|
|
+$ctx1.sendIdx["new"]=1;
|
|
|
binder;
|
|
|
};
|
|
|
$3=_st(type).__eq("text");
|
|
|
if(smalltalk.assert($3)){
|
|
|
binder=_st($TrappedValBinder())._new();
|
|
|
+$ctx1.sendIdx["new"]=2;
|
|
|
binder;
|
|
|
};
|
|
|
};
|
|
|
$4=binder;
|
|
|
-if(($receiver = $4) == nil || $receiver == undefined){
|
|
|
+if(($receiver = $4) == nil || $receiver == null){
|
|
|
binder=_st($TrappedBinder())._new();
|
|
|
binder;
|
|
|
} else {
|
|
@@ -329,7 +330,7 @@ return $5;
|
|
|
}, function($ctx1) {$ctx1.fill(self,"binder:",{aTagBrush:aTagBrush,binder:binder,tag:tag},smalltalk.Trapped)})},
|
|
|
args: ["aTagBrush"],
|
|
|
source: "binder: aTagBrush\x0a \x22Prototype; will select based on tag etc.\x22\x0a | binder tag |\x0a tag := aTagBrush element nodeName.\x0a tag = 'INPUT' ifTrue: [\x0a | type |\x0a type := aTagBrush asJQuery attr: 'type'.\x0a type = 'checkbox' ifTrue: [ binder := TrappedCheckedBinder new ].\x0a type = 'text' ifTrue: [ binder := TrappedValBinder new ]\x0a ].\x0a binder ifNil: [ binder := TrappedBinder new ].\x0a ^ binder brush: aTagBrush; yourself",
|
|
|
-messageSends: ["nodeName", "element", "ifTrue:", "attr:", "asJQuery", "new", "=", "ifNil:", "brush:", "yourself"],
|
|
|
+messageSends: ["nodeName", "element", "ifTrue:", "=", "attr:", "asJQuery", "new", "ifNil:", "brush:", "yourself"],
|
|
|
referencedClasses: ["TrappedCheckedBinder", "TrappedValBinder", "TrappedBinder"]
|
|
|
}),
|
|
|
smalltalk.Trapped);
|
|
@@ -371,7 +372,7 @@ path;
|
|
|
model=self._byName_(_st(path)._first());
|
|
|
model;
|
|
|
return _st(aBlock)._value_(_st(_st($TrappedSnapshot())._new())._path_model_(path,model));
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({path:path,model:model},$ctx1)})}));
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({path:path,model:model},$ctx1,1)})}));
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"descend:snapshotDo:",{anArray:anArray,aBlock:aBlock,tpsc:tpsc},smalltalk.Trapped)})},
|
|
|
args: ["anArray", "aBlock"],
|
|
|
source: "descend: anArray snapshotDo: aBlock\x0a\x09| tpsc |\x0a tpsc := TrappedPathStack current.\x0a tpsc append: anArray do: [\x0a | path model |\x0a path := tpsc elements copy.\x0a \x09 model := self byName: path first.\x0a aBlock value: (TrappedSnapshot new path: path model: model)\x0a ]",
|
|
@@ -438,12 +439,14 @@ var self=this;
|
|
|
function $Trapped(){return smalltalk.Trapped||(typeof Trapped=="undefined"?nil:Trapped)}
|
|
|
function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
|
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
-var $1;
|
|
|
+var $1,$2;
|
|
|
_st(args)._do_((function(each){
|
|
|
return smalltalk.withContext(function($ctx2) {
|
|
|
return self._register_(each);
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
|
|
|
-_st("[data-trap]"._asJQuery())._each_((function(index,elem){
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
|
|
|
+$1="[data-trap]"._asJQuery();
|
|
|
+$ctx1.sendIdx["asJQuery"]=1;
|
|
|
+_st($1)._each_((function(index,elem){
|
|
|
var trap,jq,viewName,modelName,tokens,path;
|
|
|
return smalltalk.withContext(function($ctx2) {
|
|
|
jq=_st(elem)._asJQuery();
|
|
@@ -451,18 +454,21 @@ jq;
|
|
|
trap=_st(jq)._attr_("data-trap");
|
|
|
trap;
|
|
|
tokens=_st(trap)._tokenize_(":");
|
|
|
+$ctx2.sendIdx["tokenize:"]=1;
|
|
|
tokens;
|
|
|
-$1=_st(_st(tokens)._size()).__eq((1));
|
|
|
-if(smalltalk.assert($1)){
|
|
|
+$2=_st(_st(tokens)._size()).__eq((1));
|
|
|
+if(smalltalk.assert($2)){
|
|
|
tokens=_st(["TrappedDumbView"]).__comma(tokens);
|
|
|
+$ctx2.sendIdx[","]=1;
|
|
|
tokens;
|
|
|
};
|
|
|
viewName=_st(tokens)._first();
|
|
|
+$ctx2.sendIdx["first"]=1;
|
|
|
viewName;
|
|
|
tokens=_st(_st(_st(tokens)._second())._tokenize_(" "))._select_((function(each){
|
|
|
return smalltalk.withContext(function($ctx3) {
|
|
|
return _st(each)._notEmpty();
|
|
|
-}, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2)})}));
|
|
|
+}, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,4)})}));
|
|
|
tokens;
|
|
|
modelName=_st(tokens)._first();
|
|
|
modelName;
|
|
@@ -471,12 +477,12 @@ path;
|
|
|
return _st(_st([modelName]).__comma(path))._trapDescend_((function(){
|
|
|
return smalltalk.withContext(function($ctx3) {
|
|
|
return _st(_st(_st(_st($Smalltalk())._current())._at_(viewName))._new())._appendToJQuery_(jq);
|
|
|
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({index:index,elem:elem,trap:trap,jq:jq,viewName:viewName,modelName:modelName,tokens:tokens,path:path},$ctx1)})}));
|
|
|
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2,5)})}));
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({index:index,elem:elem,trap:trap,jq:jq,viewName:viewName,modelName:modelName,tokens:tokens,path:path},$ctx1,2)})}));
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"start:",{args:args},smalltalk.Trapped)})},
|
|
|
args: ["args"],
|
|
|
source: "start: args\x0a args do: [ :each | self register: each ].\x0a\x09'[data-trap]' asJQuery each: [ :index :elem |\x0a \x09| trap jq viewName modelName tokens path |\x0a jq := elem asJQuery.\x0a trap := jq attr: 'data-trap'.\x0a tokens := trap tokenize: ':'.\x0a tokens size = 1 ifTrue: [ tokens := { 'TrappedDumbView' }, tokens ].\x0a viewName := tokens first.\x0a tokens := (tokens second tokenize: ' ') select: [ :each | each notEmpty ].\x0a modelName := tokens first.\x0a path := Trapped parse: tokens allButFirst.\x0a { modelName }, path trapDescend: [(Smalltalk current at: viewName) new appendToJQuery: jq].\x0a ]",
|
|
|
-messageSends: ["do:", "register:", "each:", "asJQuery", "attr:", "tokenize:", "ifTrue:", ",", "=", "size", "first", "select:", "notEmpty", "second", "parse:", "allButFirst", "trapDescend:", "appendToJQuery:", "new", "at:", "current"],
|
|
|
+messageSends: ["do:", "register:", "each:", "asJQuery", "attr:", "tokenize:", "ifTrue:", "=", "size", ",", "first", "select:", "second", "notEmpty", "parse:", "allButFirst", "trapDescend:", "appendToJQuery:", "new", "at:", "current"],
|
|
|
referencedClasses: ["Trapped", "Smalltalk"]
|
|
|
}),
|
|
|
smalltalk.Trapped);
|
|
@@ -496,9 +502,9 @@ return smalltalk.withContext(function($ctx2) {
|
|
|
_st(envelope)._with_((function(html){
|
|
|
return smalltalk.withContext(function($ctx3) {
|
|
|
return _st(_st(html)._perform_(aSymbol))._trap_read_([i],aBlock);
|
|
|
-}, function($ctx3) {$ctx3.fillBlock({html:html},$ctx2)})}));
|
|
|
+}, function($ctx3) {$ctx3.fillBlock({html:html},$ctx2,2)})}));
|
|
|
return _st(_st(_st(envjq)._children())._detach())._insertBefore_(endjq);
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({item:item,i:i},$ctx1)})}));
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({item:item,i:i},$ctx1,1)})}));
|
|
|
_st(envjq)._remove();
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"envelope:loop:before:tag:do:",{envelope:envelope,model:model,endjq:endjq,aSymbol:aSymbol,aBlock:aBlock,envjq:envjq},smalltalk.Trapped.klass)})},
|
|
|
args: ["envelope", "model", "endjq", "aSymbol", "aBlock"],
|
|
@@ -515,21 +521,23 @@ category: 'private',
|
|
|
fn: function (model,start,end,aSymbol,aBlock){
|
|
|
var self=this;
|
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
-var $1;
|
|
|
-_st(_st(_st(start)._asJQuery())._nextUntil_(_st(end)._element()))._remove();
|
|
|
+var $2,$1;
|
|
|
+$2=_st(start)._asJQuery();
|
|
|
+$ctx1.sendIdx["asJQuery"]=1;
|
|
|
+$1=_st($2)._nextUntil_(_st(end)._element());
|
|
|
+_st($1)._remove();
|
|
|
_st(start)._with_((function(html){
|
|
|
return smalltalk.withContext(function($ctx2) {
|
|
|
-$1=model;
|
|
|
-if(($receiver = $1) == nil || $receiver == undefined){
|
|
|
-return $1;
|
|
|
+if(($receiver = model) == nil || $receiver == null){
|
|
|
+return model;
|
|
|
} else {
|
|
|
return self._envelope_loop_before_tag_do_(_st(html)._div(),model,_st(end)._asJQuery(),aSymbol,aBlock);
|
|
|
};
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"loop:between:and:tag:do:",{model:model,start:start,end:end,aSymbol:aSymbol,aBlock:aBlock},smalltalk.Trapped.klass)})},
|
|
|
args: ["model", "start", "end", "aSymbol", "aBlock"],
|
|
|
source: "loop: model between: start and: end tag: aSymbol do: aBlock\x0a (start asJQuery nextUntil: end element) remove.\x0a start with: [ :html | model ifNotNil: [\x0a \x09self envelope: html div loop: model before: end asJQuery tag: aSymbol do: aBlock\x0a\x09]]",
|
|
|
-messageSends: ["remove", "nextUntil:", "element", "asJQuery", "with:", "ifNotNil:", "envelope:loop:before:tag:do:", "div"],
|
|
|
+messageSends: ["remove", "nextUntil:", "asJQuery", "element", "with:", "ifNotNil:", "envelope:loop:before:tag:do:", "div"],
|
|
|
referencedClasses: []
|
|
|
}),
|
|
|
smalltalk.Trapped.klass);
|
|
@@ -548,6 +556,7 @@ return smalltalk.withContext(function($ctx2) {
|
|
|
asNum=_st(each)._asNumber();
|
|
|
asNum;
|
|
|
$2=_st(asNum).__eq(asNum);
|
|
|
+$ctx2.sendIdx["="]=1;
|
|
|
if(smalltalk.assert($2)){
|
|
|
return asNum;
|
|
|
} else {
|
|
@@ -558,12 +567,12 @@ return [_st(each)._allButFirst()];
|
|
|
return each;
|
|
|
};
|
|
|
};
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({each:each,asNum:asNum},$ctx1)})}));
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({each:each,asNum:asNum},$ctx1,1)})}));
|
|
|
return $1;
|
|
|
}, function($ctx1) {$ctx1.fill(self,"parse:",{anArray:anArray},smalltalk.Trapped.klass)})},
|
|
|
args: ["anArray"],
|
|
|
source: "parse: anArray\x0a\x09^anArray collect: [ :each |\x0a \x09| asNum |\x0a \x09asNum := each asNumber.\x0a asNum = asNum ifTrue: [ asNum ] ifFalse: [\x0a\x09\x09\x09each first = '#' ifTrue: [ { each allButFirst } ] ifFalse: [ each ]]]",
|
|
|
-messageSends: ["collect:", "asNumber", "ifTrue:ifFalse:", "allButFirst", "=", "first"],
|
|
|
+messageSends: ["collect:", "asNumber", "ifTrue:ifFalse:", "=", "first", "allButFirst"],
|
|
|
referencedClasses: []
|
|
|
}),
|
|
|
smalltalk.Trapped.klass);
|
|
@@ -635,11 +644,11 @@ return smalltalk.withContext(function($ctx2) {
|
|
|
self["@elements"]=anArray;
|
|
|
self["@elements"];
|
|
|
return _st(aBlock)._value();
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._ensure_((function(){
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._ensure_((function(){
|
|
|
return smalltalk.withContext(function($ctx2) {
|
|
|
self["@elements"]=old;
|
|
|
return self["@elements"];
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"with:do:",{anArray:anArray,aBlock:aBlock,old:old},smalltalk.TrappedPathStack)})},
|
|
|
args: ["anArray", "aBlock"],
|
|
|
source: "with: anArray do: aBlock\x0a\x09| old |\x0a old := elements.\x0a [ elements := anArray.\x0a\x09aBlock value ] ensure: [ elements := old ]",
|
|
@@ -662,11 +671,11 @@ return smalltalk.withContext(function($ctx1) {
|
|
|
_st(_st($TrappedPathStack())._current())._with_do_(self["@path"],(function(){
|
|
|
return smalltalk.withContext(function($ctx2) {
|
|
|
return _st(aBlock)._value_(self["@model"]);
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.TrappedSnapshot)})},
|
|
|
args: ["aBlock"],
|
|
|
source: "do: aBlock\x0a\x09TrappedPathStack current with: path do: [ aBlock value: model ]",
|
|
|
-messageSends: ["with:do:", "value:", "current"],
|
|
|
+messageSends: ["with:do:", "current", "value:"],
|
|
|
referencedClasses: ["TrappedPathStack"]
|
|
|
}),
|
|
|
smalltalk.TrappedSnapshot);
|
|
@@ -700,7 +709,7 @@ _st(self._model())._modify_do_(_st(self._path())._allButFirst(),aBlock);
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"modify:",{aBlock:aBlock},smalltalk.TrappedSnapshot)})},
|
|
|
args: ["aBlock"],
|
|
|
source: "modify: aBlock\x0a\x09self model modify: self path allButFirst do: aBlock",
|
|
|
-messageSends: ["modify:do:", "allButFirst", "path", "model"],
|
|
|
+messageSends: ["modify:do:", "model", "allButFirst", "path"],
|
|
|
referencedClasses: []
|
|
|
}),
|
|
|
smalltalk.TrappedSnapshot);
|
|
@@ -770,14 +779,15 @@ return smalltalk.withContext(function($ctx1) {
|
|
|
self._with_((function(html){
|
|
|
return smalltalk.withContext(function($ctx2) {
|
|
|
start=_st(html)._script();
|
|
|
+$ctx2.sendIdx["script"]=1;
|
|
|
start;
|
|
|
end=_st(html)._script();
|
|
|
return end;
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
|
|
|
_st(start)._trap_read_(path,(function(model){
|
|
|
return smalltalk.withContext(function($ctx2) {
|
|
|
return _st($Trapped())._loop_between_and_tag_do_(model,start,end,aSymbol,aBlock);
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({model:model},$ctx1)})}));
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({model:model},$ctx1,2)})}));
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"trapIter:tag:do:",{path:path,aSymbol:aSymbol,aBlock:aBlock,start:start,end:end},smalltalk.HTMLCanvas)})},
|
|
|
args: ["path", "aSymbol", "aBlock"],
|
|
|
source: "trapIter: path tag: aSymbol do: aBlock\x0a\x09| start end |\x0a self with: [ :html | start := html script. end := html script ].\x0a start trap: path read: [ :model |\x0a \x09Trapped loop: model between: start and: end tag: aSymbol do: aBlock.\x0a ]",
|
|
@@ -825,14 +835,14 @@ return smalltalk.withContext(function($ctx4) {
|
|
|
return self._with_((function(html){
|
|
|
return smalltalk.withContext(function($ctx5) {
|
|
|
return _st(aBlock)._value_value_(data,html);
|
|
|
-}, function($ctx5) {$ctx5.fillBlock({html:html},$ctx4)})}));
|
|
|
-}, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
|
|
|
-}, function($ctx3) {$ctx3.fillBlock({data:data},$ctx2)})}));
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({snap:snap},$ctx1)})}));
|
|
|
+}, function($ctx5) {$ctx5.fillBlock({html:html},$ctx4,5)})}));
|
|
|
+}, function($ctx4) {$ctx4.fillBlock({},$ctx3,4)})}));
|
|
|
+}, function($ctx3) {$ctx3.fillBlock({data:data},$ctx2,2)})}));
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({snap:snap},$ctx1,1)})}));
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"trap:read:",{path:path,aBlock:aBlock},smalltalk.TagBrush)})},
|
|
|
args: ["path", "aBlock"],
|
|
|
source: "trap: path read: aBlock\x0a\x09path trapDescend: [ :snap |\x0a snap model watch: snap path allButFirst do: [ :data |\x0a (self asJQuery closest: 'html') toArray isEmpty ifTrue: [ KeyedPubSubUnsubscribe signal ].\x0a \x09snap do: [ self with: [ :html | aBlock value: data value: html ] ]\x0a \x09]\x0a ]",
|
|
|
-messageSends: ["trapDescend:", "watch:do:", "allButFirst", "path", "ifTrue:", "signal", "isEmpty", "toArray", "closest:", "asJQuery", "do:", "with:", "value:value:", "model"],
|
|
|
+messageSends: ["trapDescend:", "watch:do:", "model", "allButFirst", "path", "ifTrue:", "isEmpty", "toArray", "closest:", "asJQuery", "signal", "do:", "with:", "value:value:"],
|
|
|
referencedClasses: ["KeyedPubSubUnsubscribe"]
|
|
|
}),
|
|
|
smalltalk.TagBrush);
|
|
@@ -847,7 +857,7 @@ return smalltalk.withContext(function($ctx1) {
|
|
|
self._trap_toggle_ifNotPresent_(path,aBlock,(function(){
|
|
|
return smalltalk.withContext(function($ctx2) {
|
|
|
return _st(self._asJQuery())._hide();
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"trap:toggle:",{path:path,aBlock:aBlock},smalltalk.TagBrush)})},
|
|
|
args: ["path", "aBlock"],
|
|
|
source: "trap: path toggle: aBlock\x0a self trap: path toggle: aBlock ifNotPresent: [ self asJQuery hide ]",
|
|
@@ -864,31 +874,34 @@ fn: function (path,aBlock,anotherBlock){
|
|
|
var self=this;
|
|
|
var shown;
|
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
-var $1,$2,$3,$5,$4;
|
|
|
+var $2,$3,$1,$4,$5,$7,$6;
|
|
|
shown=nil;
|
|
|
self._trap_read_(path,(function(data,html){
|
|
|
return smalltalk.withContext(function($ctx2) {
|
|
|
-$1=_st(shown).__eq(_st(data)._notNil());
|
|
|
+$2=shown;
|
|
|
+$3=_st(data)._notNil();
|
|
|
+$ctx2.sendIdx["notNil"]=1;
|
|
|
+$1=_st($2).__eq($3);
|
|
|
if(! smalltalk.assert($1)){
|
|
|
shown=_st(data)._notNil();
|
|
|
shown;
|
|
|
-$2=self._asJQuery();
|
|
|
-_st($2)._empty();
|
|
|
-$3=_st($2)._show();
|
|
|
-$3;
|
|
|
-$5=shown;
|
|
|
-if(smalltalk.assert($5)){
|
|
|
-$4=aBlock;
|
|
|
+$4=self._asJQuery();
|
|
|
+_st($4)._empty();
|
|
|
+$5=_st($4)._show();
|
|
|
+$5;
|
|
|
+$7=shown;
|
|
|
+if(smalltalk.assert($7)){
|
|
|
+$6=aBlock;
|
|
|
} else {
|
|
|
-$4=anotherBlock;
|
|
|
+$6=anotherBlock;
|
|
|
};
|
|
|
-return _st($4)._value_value_(data,html);
|
|
|
+return _st($6)._value_value_(data,html);
|
|
|
};
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({data:data,html:html},$ctx1)})}));
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({data:data,html:html},$ctx1,1)})}));
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"trap:toggle:ifNotPresent:",{path:path,aBlock:aBlock,anotherBlock:anotherBlock,shown:shown},smalltalk.TagBrush)})},
|
|
|
args: ["path", "aBlock", "anotherBlock"],
|
|
|
source: "trap: path toggle: aBlock ifNotPresent: anotherBlock\x0a | shown |\x0a shown := nil.\x0a self trap: path read: [ :data : html |\x0a shown = data notNil ifFalse: [\x0a shown := data notNil.\x0a self asJQuery empty; show.\x0a (shown ifTrue: [aBlock] ifFalse: [anotherBlock]) value: data value: html.\x0a ]\x0a ]",
|
|
|
-messageSends: ["trap:read:", "ifFalse:", "notNil", "empty", "asJQuery", "show", "value:value:", "ifTrue:ifFalse:", "="],
|
|
|
+messageSends: ["trap:read:", "ifFalse:", "=", "notNil", "empty", "asJQuery", "show", "value:value:", "ifTrue:ifFalse:"],
|
|
|
referencedClasses: []
|
|
|
}),
|
|
|
smalltalk.TagBrush);
|