|
@@ -453,6 +453,55 @@ referencedClasses: ["Trapped", "Smalltalk"]
|
|
|
smalltalk.Trapped);
|
|
|
|
|
|
|
|
|
+smalltalk.addMethod(
|
|
|
+"_envelope_loop_before_tag_do_",
|
|
|
+smalltalk.method({
|
|
|
+selector: "envelope:loop:before:tag:do:",
|
|
|
+category: 'private',
|
|
|
+fn: function (envelope,model,endjq,aSymbol,aBlock){
|
|
|
+var self=this;
|
|
|
+var envjq;
|
|
|
+return smalltalk.withContext(function($ctx1) {
envjq=_st(envelope)._asJQuery();
|
|
|
+_st(model)._withIndexDo_((function(item,i){
|
|
|
+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},$ctx1)})}));
|
|
|
+return _st(_st(_st(envjq)._children())._detach())._insertBefore_(endjq);
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({item:item,i:i},$ctx1)})}));
|
|
|
+_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"],
|
|
|
+source: "envelope: envelope loop: model before: endjq tag: aSymbol do: aBlock\x0a \x09| envjq |\x0a envjq := envelope asJQuery.\x0a model withIndexDo: [ :item :i |\x0a envelope with: [ :html | (html perform: aSymbol) trap: {i} read: aBlock ].\x0a envjq children detach insertBefore: endjq.\x0a ].\x0a envjq remove\x0a",
|
|
|
+messageSends: ["asJQuery", "withIndexDo:", "with:", "trap:read:", "perform:", "insertBefore:", "detach", "children", "remove"],
|
|
|
+referencedClasses: []
|
|
|
+}),
|
|
|
+smalltalk.Trapped.klass);
|
|
|
+
|
|
|
+smalltalk.addMethod(
|
|
|
+"_loop_between_and_tag_do_",
|
|
|
+smalltalk.method({
|
|
|
+selector: "loop:between:and:tag:do:",
|
|
|
+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();
|
|
|
+_st(start)._with_((function(html){
|
|
|
+return smalltalk.withContext(function($ctx2) {
$1=model;
|
|
|
+if(($receiver = $1) == nil || $receiver == undefined){
|
|
|
+return $1;
|
|
|
+} else {
|
|
|
+return _st(self)._envelope_loop_before_tag_do_(_st(html)._div(),model,_st(end)._asJQuery(),aSymbol,aBlock);
|
|
|
+};
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
|
|
|
+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]]\x0a",
|
|
|
+messageSends: ["remove", "nextUntil:", "element", "asJQuery", "with:", "ifNotNil:", "envelope:loop:before:tag:do:", "div"],
|
|
|
+referencedClasses: []
|
|
|
+}),
|
|
|
+smalltalk.Trapped.klass);
|
|
|
+
|
|
|
smalltalk.addMethod(
|
|
|
"_parse_",
|
|
|
smalltalk.method({
|
|
@@ -675,6 +724,31 @@ referencedClasses: ["Trapped"]
|
|
|
}),
|
|
|
smalltalk.Array);
|
|
|
|
|
|
+smalltalk.addMethod(
|
|
|
+"_trapIter_tag_do_",
|
|
|
+smalltalk.method({
|
|
|
+selector: "trapIter:tag:do:",
|
|
|
+category: '*Trapped-Frontend',
|
|
|
+fn: function (path,aSymbol,aBlock){
|
|
|
+var self=this;
|
|
|
+var start,end;
|
|
|
+return smalltalk.withContext(function($ctx1) {
_st(self)._with_((function(html){
|
|
|
+return smalltalk.withContext(function($ctx2) {
start=_st(html)._script();
|
|
|
+start;
|
|
|
+end=_st(html)._script();
|
|
|
+return end;
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
|
|
|
+_st(start)._trap_read_(path,(function(model){
|
|
|
+return smalltalk.withContext(function($ctx2) {
return _st((smalltalk.Trapped || Trapped))._loop_between_and_tag_do_(model,start,end,aSymbol,aBlock);
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({model:model},$ctx1)})}));
|
|
|
+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 ]",
|
|
|
+messageSends: ["with:", "script", "trap:read:", "loop:between:and:tag:do:"],
|
|
|
+referencedClasses: ["Trapped"]
|
|
|
+}),
|
|
|
+smalltalk.HTMLCanvas);
|
|
|
+
|
|
|
smalltalk.addMethod(
|
|
|
"_trap_",
|
|
|
smalltalk.method({
|
|
@@ -783,33 +857,3 @@ referencedClasses: []
|
|
|
}),
|
|
|
smalltalk.TagBrush);
|
|
|
|
|
|
-smalltalk.addMethod(
|
|
|
-"_trapIter_tag_do_",
|
|
|
-smalltalk.method({
|
|
|
-selector: "trapIter:tag:do:",
|
|
|
-category: '*Trapped-Frontend',
|
|
|
-fn: function (path,aSymbol,aBlock){
|
|
|
-var self=this;
|
|
|
-return smalltalk.withContext(function($ctx1) {
var $1,$2,$4,$3;
|
|
|
-$1=self;
|
|
|
-$2=path;
|
|
|
-$3=(function(model,html){
|
|
|
-return smalltalk.withContext(function($ctx2) {
_st(_st(html)._root())._empty();
|
|
|
-$4=model;
|
|
|
-if(($receiver = $4) == nil || $receiver == undefined){
|
|
|
-return $4;
|
|
|
-} else {
|
|
|
-return _st(model)._withIndexDo_((function(item,i){
|
|
|
-return smalltalk.withContext(function($ctx3) {
return _st(_st(html)._perform_(aSymbol))._trap_read_([i],aBlock);
|
|
|
-}, function($ctx3) {$ctx3.fillBlock({item:item,i:i},$ctx1)})}));
|
|
|
-};
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({model:model,html:html},$ctx1)})});
|
|
|
-_st($1)._trap_read_($2,$3);
|
|
|
-return self}, function($ctx1) {$ctx1.fill(self,"trapIter:tag:do:",{path:path,aSymbol:aSymbol,aBlock:aBlock}, smalltalk.TagBrush)})},
|
|
|
-args: ["path", "aSymbol", "aBlock"],
|
|
|
-source: "trapIter: path tag: aSymbol do: aBlock\x0a self trap: path read: [ :model :html |\x0a html root empty.\x0a model ifNotNil: [ model withIndexDo: [ :item :i |\x0a (html perform: aSymbol) trap: {i} read: aBlock\x0a ]]\x0a ]",
|
|
|
-messageSends: ["trap:read:", "empty", "root", "ifNotNil:", "withIndexDo:", "perform:"],
|
|
|
-referencedClasses: []
|
|
|
-}),
|
|
|
-smalltalk.TagBrush);
|
|
|
-
|