|
@@ -52,81 +52,6 @@ referencedClasses: []
|
|
|
smalltalk.TrappedFly.klass);
|
|
|
|
|
|
|
|
|
-smalltalk.addClass('TrappedPathStack', smalltalk.Object, ['elements'], 'Trapped-Frontend');
|
|
|
-smalltalk.addMethod(
|
|
|
-"_append_",
|
|
|
-smalltalk.method({
|
|
|
-selector: "append:",
|
|
|
-category: 'descending',
|
|
|
-fn: function (anArray){
|
|
|
-var self=this;
|
|
|
-self["@elements"]=smalltalk.send(self["@elements"],"__comma",[anArray]);
|
|
|
-return self},
|
|
|
-args: ["anArray"],
|
|
|
-source: "append: anArray\x0a elements := elements, anArray",
|
|
|
-messageSends: [","],
|
|
|
-referencedClasses: []
|
|
|
-}),
|
|
|
-smalltalk.TrappedPathStack);
|
|
|
-
|
|
|
-smalltalk.addMethod(
|
|
|
-"_elements",
|
|
|
-smalltalk.method({
|
|
|
-selector: "elements",
|
|
|
-category: 'accessing',
|
|
|
-fn: function (){
|
|
|
-var self=this;
|
|
|
-return self["@elements"];
|
|
|
-},
|
|
|
-args: [],
|
|
|
-source: "elements\x0a\x09^elements",
|
|
|
-messageSends: [],
|
|
|
-referencedClasses: []
|
|
|
-}),
|
|
|
-smalltalk.TrappedPathStack);
|
|
|
-
|
|
|
-smalltalk.addMethod(
|
|
|
-"_initialize",
|
|
|
-smalltalk.method({
|
|
|
-selector: "initialize",
|
|
|
-category: 'initializing',
|
|
|
-fn: function (){
|
|
|
-var self=this;
|
|
|
-self["@elements"]=[];
|
|
|
-return self},
|
|
|
-args: [],
|
|
|
-source: "initialize\x0a\x09elements := #().",
|
|
|
-messageSends: [],
|
|
|
-referencedClasses: []
|
|
|
-}),
|
|
|
-smalltalk.TrappedPathStack);
|
|
|
-
|
|
|
-smalltalk.addMethod(
|
|
|
-"_with_do_",
|
|
|
-smalltalk.method({
|
|
|
-selector: "with:do:",
|
|
|
-category: 'descending',
|
|
|
-fn: function (anArray,aBlock){
|
|
|
-var self=this;
|
|
|
-var old;
|
|
|
-old=self["@elements"];
|
|
|
-smalltalk.send((function(){
|
|
|
-smalltalk.send(self,"_append_",[anArray]);
|
|
|
-return smalltalk.send(aBlock,"_value",[]);
|
|
|
-}),"_ensure_",[(function(){
|
|
|
-self["@elements"]=old;
|
|
|
-return self["@elements"];
|
|
|
-})]);
|
|
|
-return self},
|
|
|
-args: ["anArray", "aBlock"],
|
|
|
-source: "with: anArray do: aBlock\x0a\x09| old |\x0a old := elements.\x0a [ self append: anArray.\x0a\x09aBlock value ] ensure: [ elements := old ]",
|
|
|
-messageSends: ["ensure:", "append:", "value"],
|
|
|
-referencedClasses: []
|
|
|
-}),
|
|
|
-smalltalk.TrappedPathStack);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
smalltalk.addClass('TrappedSingleton', smalltalk.Object, [], 'Trapped-Frontend');
|
|
|
smalltalk.addMethod(
|
|
|
"_start",
|
|
@@ -263,67 +188,111 @@ viewName=smalltalk.send(tokens,"_first",[]);
|
|
|
viewName;
|
|
|
modelName=smalltalk.send(tokens,"_second",[]);
|
|
|
modelName;
|
|
|
-return smalltalk.send((smalltalk.Trapped || Trapped),"_with_do_",[[modelName],(function(){
|
|
|
+return smalltalk.send([modelName],"_trapDescend_",[(function(){
|
|
|
return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk),"_current",[]),"_at_",[viewName]),"_new",[]),"_appendToJQuery_",[jq]);
|
|
|
})]);
|
|
|
})]);
|
|
|
return self},
|
|
|
args: [],
|
|
|
-source: "start\x0a\x09'[data-trap]' asJQuery each: [ :index :elem |\x0a \x09| trap jq viewName modelName tokens |\x0a jq := elem asJQuery.\x0a trap := jq attr: 'data-trap'.\x0a tokens := trap tokenize: ':'.\x0a viewName := tokens first.\x0a modelName := tokens second.\x0a Trapped with: { modelName } do: [(Smalltalk current at: viewName) new appendToJQuery: jq].\x0a ]",
|
|
|
-messageSends: ["each:", "asJQuery", "attr:", "tokenize:", "first", "second", "with:do:", "appendToJQuery:", "new", "at:", "current"],
|
|
|
-referencedClasses: ["Smalltalk", "Trapped"]
|
|
|
+source: "start\x0a\x09'[data-trap]' asJQuery each: [ :index :elem |\x0a \x09| trap jq viewName modelName tokens |\x0a jq := elem asJQuery.\x0a trap := jq attr: 'data-trap'.\x0a tokens := trap tokenize: ':'.\x0a viewName := tokens first.\x0a modelName := tokens second.\x0a { modelName } trapDescend: [(Smalltalk current at: viewName) new appendToJQuery: jq].\x0a ]",
|
|
|
+messageSends: ["each:", "asJQuery", "attr:", "tokenize:", "first", "second", "trapDescend:", "appendToJQuery:", "new", "at:", "current"],
|
|
|
+referencedClasses: ["Smalltalk"]
|
|
|
}),
|
|
|
smalltalk.Trapped);
|
|
|
|
|
|
|
|
|
-smalltalk.Trapped.klass.iVarNames = ['path'];
|
|
|
smalltalk.addMethod(
|
|
|
-"_initialize",
|
|
|
+"_path",
|
|
|
smalltalk.method({
|
|
|
-selector: "initialize",
|
|
|
-category: 'initialization',
|
|
|
+selector: "path",
|
|
|
+category: 'accessing',
|
|
|
fn: function (){
|
|
|
var self=this;
|
|
|
-self["@path"]=smalltalk.send((smalltalk.TrappedPathStack || TrappedPathStack),"_new",[]);
|
|
|
-return self},
|
|
|
+var $1;
|
|
|
+$1=smalltalk.send(smalltalk.send((smalltalk.TrappedPathStack || TrappedPathStack),"_current",[]),"_elements",[]);
|
|
|
+return $1;
|
|
|
+},
|
|
|
args: [],
|
|
|
-source: "initialize\x0a\x09path := TrappedPathStack new",
|
|
|
-messageSends: ["new"],
|
|
|
+source: "path\x0a\x09^TrappedPathStack current elements",
|
|
|
+messageSends: ["elements", "current"],
|
|
|
referencedClasses: ["TrappedPathStack"]
|
|
|
}),
|
|
|
smalltalk.Trapped.klass);
|
|
|
|
|
|
+
|
|
|
+smalltalk.addClass('TrappedPathStack', smalltalk.TrappedSingleton, ['elements'], 'Trapped-Frontend');
|
|
|
smalltalk.addMethod(
|
|
|
-"_path",
|
|
|
+"_append_",
|
|
|
smalltalk.method({
|
|
|
-selector: "path",
|
|
|
+selector: "append:",
|
|
|
+category: 'descending',
|
|
|
+fn: function (anArray){
|
|
|
+var self=this;
|
|
|
+self["@elements"]=smalltalk.send(self["@elements"],"__comma",[anArray]);
|
|
|
+return self},
|
|
|
+args: ["anArray"],
|
|
|
+source: "append: anArray\x0a elements := elements, anArray",
|
|
|
+messageSends: [","],
|
|
|
+referencedClasses: []
|
|
|
+}),
|
|
|
+smalltalk.TrappedPathStack);
|
|
|
+
|
|
|
+smalltalk.addMethod(
|
|
|
+"_elements",
|
|
|
+smalltalk.method({
|
|
|
+selector: "elements",
|
|
|
category: 'accessing',
|
|
|
fn: function (){
|
|
|
var self=this;
|
|
|
-return self["@path"];
|
|
|
+return self["@elements"];
|
|
|
},
|
|
|
args: [],
|
|
|
-source: "path\x0a\x09^path",
|
|
|
+source: "elements\x0a\x09^elements",
|
|
|
messageSends: [],
|
|
|
referencedClasses: []
|
|
|
}),
|
|
|
-smalltalk.Trapped.klass);
|
|
|
+smalltalk.TrappedPathStack);
|
|
|
+
|
|
|
+smalltalk.addMethod(
|
|
|
+"_initialize",
|
|
|
+smalltalk.method({
|
|
|
+selector: "initialize",
|
|
|
+category: 'initialization',
|
|
|
+fn: function (){
|
|
|
+var self=this;
|
|
|
+self["@elements"]=[];
|
|
|
+return self},
|
|
|
+args: [],
|
|
|
+source: "initialize\x0a\x09elements := #().",
|
|
|
+messageSends: [],
|
|
|
+referencedClasses: []
|
|
|
+}),
|
|
|
+smalltalk.TrappedPathStack);
|
|
|
|
|
|
smalltalk.addMethod(
|
|
|
"_with_do_",
|
|
|
smalltalk.method({
|
|
|
selector: "with:do:",
|
|
|
-category: 'action',
|
|
|
+category: 'descending',
|
|
|
fn: function (anArray,aBlock){
|
|
|
var self=this;
|
|
|
-smalltalk.send(self["@path"],"_with_do_",[anArray,aBlock]);
|
|
|
+var old;
|
|
|
+old=self["@elements"];
|
|
|
+smalltalk.send((function(){
|
|
|
+smalltalk.send(self,"_append_",[anArray]);
|
|
|
+return smalltalk.send(aBlock,"_value",[]);
|
|
|
+}),"_ensure_",[(function(){
|
|
|
+self["@elements"]=old;
|
|
|
+return self["@elements"];
|
|
|
+})]);
|
|
|
return self},
|
|
|
args: ["anArray", "aBlock"],
|
|
|
-source: "with: anArray do: aBlock\x0a\x09path with: anArray do: aBlock",
|
|
|
-messageSends: ["with:do:"],
|
|
|
+source: "with: anArray do: aBlock\x0a\x09| old |\x0a old := elements.\x0a [ self append: anArray.\x0a\x09aBlock value ] ensure: [ elements := old ]",
|
|
|
+messageSends: ["ensure:", "append:", "value"],
|
|
|
referencedClasses: []
|
|
|
}),
|
|
|
-smalltalk.Trapped.klass);
|
|
|
+smalltalk.TrappedPathStack);
|
|
|
+
|
|
|
|
|
|
|
|
|
smalltalk.addClass('TrappedView', smalltalk.Widget, [], 'Trapped-Frontend');
|
|
@@ -335,14 +304,46 @@ category: 'rendering',
|
|
|
fn: function (html){
|
|
|
var self=this;
|
|
|
smalltalk.send(smalltalk.send(html,"_root",[]),"_empty",[]);
|
|
|
-smalltalk.send(html,"_with_",[smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self,"_class",[]),"_name",[]),"__comma",[": "]),"__comma",[smalltalk.send(smalltalk.send((smalltalk.Trapped || Trapped),"_path",[]),"_elements",[])])]);
|
|
|
+smalltalk.send(html,"_with_",[smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self,"_class",[]),"_name",[]),"__comma",[": "]),"__comma",[smalltalk.send((smalltalk.Trapped || Trapped),"_path",[])])]);
|
|
|
return self},
|
|
|
args: ["html"],
|
|
|
-source: "renderOn: html\x0a\x09html root empty.\x0a\x09html with: self class name, ': ', Trapped path elements",
|
|
|
-messageSends: ["empty", "root", "with:", ",", "elements", "path", "name", "class"],
|
|
|
+source: "renderOn: html\x0a\x09html root empty.\x0a\x09html with: self class name, ': ', Trapped path",
|
|
|
+messageSends: ["empty", "root", "with:", ",", "path", "name", "class"],
|
|
|
referencedClasses: ["Trapped"]
|
|
|
}),
|
|
|
smalltalk.TrappedView);
|
|
|
|
|
|
|
|
|
|
|
|
+smalltalk.addMethod(
|
|
|
+"_trapDescend_",
|
|
|
+smalltalk.method({
|
|
|
+selector: "trapDescend:",
|
|
|
+category: '*Trapped-Frontend',
|
|
|
+fn: function (aBlock){
|
|
|
+var self=this;
|
|
|
+smalltalk.send(smalltalk.send((smalltalk.TrappedPathStack || TrappedPathStack),"_current",[]),"_with_do_",[self,aBlock]);
|
|
|
+return self},
|
|
|
+args: ["aBlock"],
|
|
|
+source: "trapDescend: aBlock\x0a\x09TrappedPathStack current with: self do: aBlock",
|
|
|
+messageSends: ["with:do:", "current"],
|
|
|
+referencedClasses: ["TrappedPathStack"]
|
|
|
+}),
|
|
|
+smalltalk.Array);
|
|
|
+
|
|
|
+smalltalk.addMethod(
|
|
|
+"_trapDescend_",
|
|
|
+smalltalk.method({
|
|
|
+selector: "trapDescend:",
|
|
|
+category: '*Trapped-Frontend',
|
|
|
+fn: function (aBlock){
|
|
|
+var self=this;
|
|
|
+smalltalk.send(smalltalk.send((smalltalk.TrappedPathStack || TrappedPathStack),"_current",[]),"_with_do_",[self,aBlock]);
|
|
|
+return self},
|
|
|
+args: ["aBlock"],
|
|
|
+source: "trapDescend: aBlock\x0a\x09TrappedPathStack current with: self do: aBlock",
|
|
|
+messageSends: ["with:do:", "current"],
|
|
|
+referencedClasses: ["TrappedPathStack"]
|
|
|
+}),
|
|
|
+smalltalk.Array);
|
|
|
+
|