Trapped-Frontend.js 67 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780
  1. define("gh_herby_trapped/Trapped-Frontend", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Kernel-Objects", "amber_core/Canvas", "amber_core/Kernel-Collections"], function(smalltalk,nil,_st){
  2. smalltalk.addPackage('Trapped-Frontend');
  3. smalltalk.packages["Trapped-Frontend"].transport = {"type":"amd","amdNamespace":"gh_herby_trapped"};
  4. smalltalk.addClass('TrappedDataCarrier', smalltalk.Object, ['target', 'model', 'chain'], 'Trapped-Frontend');
  5. smalltalk.addMethod(
  6. smalltalk.method({
  7. selector: "chain:",
  8. category: 'accessing',
  9. fn: function (aDataChain){
  10. var self=this;
  11. return smalltalk.withContext(function($ctx1) {
  12. self["@chain"]=aDataChain;
  13. return self}, function($ctx1) {$ctx1.fill(self,"chain:",{aDataChain:aDataChain},smalltalk.TrappedDataCarrier)})},
  14. args: ["aDataChain"],
  15. source: "chain: aDataChain\x0a\x09chain := aDataChain",
  16. messageSends: [],
  17. referencedClasses: []
  18. }),
  19. smalltalk.TrappedDataCarrier);
  20. smalltalk.addMethod(
  21. smalltalk.method({
  22. selector: "modifyTarget",
  23. category: 'action',
  24. fn: function (){
  25. var self=this;
  26. return smalltalk.withContext(function($ctx1) {
  27. _st(self._target())._modify_((function(){
  28. return smalltalk.withContext(function($ctx2) {
  29. return self._value();
  30. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  31. return self}, function($ctx1) {$ctx1.fill(self,"modifyTarget",{},smalltalk.TrappedDataCarrier)})},
  32. args: [],
  33. source: "modifyTarget\x0a\x09self target modify: [ self value ]",
  34. messageSends: ["modify:", "target", "value"],
  35. referencedClasses: []
  36. }),
  37. smalltalk.TrappedDataCarrier);
  38. smalltalk.addMethod(
  39. smalltalk.method({
  40. selector: "modifyTargetByPerforming:",
  41. category: 'action',
  42. fn: function (aString){
  43. var self=this;
  44. return smalltalk.withContext(function($ctx1) {
  45. _st(self._target())._modify_((function(m){
  46. return smalltalk.withContext(function($ctx2) {
  47. return _st(m)._perform_(aString);
  48. }, function($ctx2) {$ctx2.fillBlock({m:m},$ctx1,1)})}));
  49. return self}, function($ctx1) {$ctx1.fill(self,"modifyTargetByPerforming:",{aString:aString},smalltalk.TrappedDataCarrier)})},
  50. args: ["aString"],
  51. source: "modifyTargetByPerforming: aString\x0a\x09self target modify: [ :m | m perform: aString ]",
  52. messageSends: ["modify:", "target", "perform:"],
  53. referencedClasses: []
  54. }),
  55. smalltalk.TrappedDataCarrier);
  56. smalltalk.addMethod(
  57. smalltalk.method({
  58. selector: "target",
  59. category: 'accessing',
  60. fn: function (){
  61. var self=this;
  62. return smalltalk.withContext(function($ctx1) {
  63. var $1;
  64. $1=self["@target"];
  65. return $1;
  66. }, function($ctx1) {$ctx1.fill(self,"target",{},smalltalk.TrappedDataCarrier)})},
  67. args: [],
  68. source: "target\x0a\x09^target",
  69. messageSends: [],
  70. referencedClasses: []
  71. }),
  72. smalltalk.TrappedDataCarrier);
  73. smalltalk.addMethod(
  74. smalltalk.method({
  75. selector: "target:",
  76. category: 'accessing',
  77. fn: function (anObject){
  78. var self=this;
  79. return smalltalk.withContext(function($ctx1) {
  80. self["@target"]=anObject;
  81. return self}, function($ctx1) {$ctx1.fill(self,"target:",{anObject:anObject},smalltalk.TrappedDataCarrier)})},
  82. args: ["anObject"],
  83. source: "target: anObject\x0a\x09target := anObject",
  84. messageSends: [],
  85. referencedClasses: []
  86. }),
  87. smalltalk.TrappedDataCarrier);
  88. smalltalk.addMethod(
  89. smalltalk.method({
  90. selector: "toTargetAttr:",
  91. category: 'action',
  92. fn: function (aString){
  93. var self=this;
  94. return smalltalk.withContext(function($ctx1) {
  95. var $1,$3,$2;
  96. $1=_st(self._target())._asJQuery();
  97. $3=self._value();
  98. $ctx1.sendIdx["value"]=1;
  99. if(($receiver = $3) == nil || $receiver == null){
  100. $2=(function(){
  101. return smalltalk.withContext(function($ctx2) {
  102. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})});
  103. } else {
  104. var o;
  105. o=$receiver;
  106. $2=_st(o)._value();
  107. };
  108. _st($1)._attr_put_(aString,$2);
  109. return self}, function($ctx1) {$ctx1.fill(self,"toTargetAttr:",{aString:aString},smalltalk.TrappedDataCarrier)})},
  110. args: ["aString"],
  111. source: "toTargetAttr: aString\x0a\x09self target asJQuery attr: aString put: (self value ifNotNil: [ :o | o value ] ifNil: [[]])",
  112. messageSends: ["attr:put:", "asJQuery", "target", "ifNotNil:ifNil:", "value"],
  113. referencedClasses: []
  114. }),
  115. smalltalk.TrappedDataCarrier);
  116. smalltalk.addMethod(
  117. smalltalk.method({
  118. selector: "toTargetContents",
  119. category: 'action',
  120. fn: function (){
  121. var self=this;
  122. return smalltalk.withContext(function($ctx1) {
  123. _st(self._target())._contents_(self._value());
  124. return self}, function($ctx1) {$ctx1.fill(self,"toTargetContents",{},smalltalk.TrappedDataCarrier)})},
  125. args: [],
  126. source: "toTargetContents\x0a\x09self target contents: self value",
  127. messageSends: ["contents:", "target", "value"],
  128. referencedClasses: []
  129. }),
  130. smalltalk.TrappedDataCarrier);
  131. smalltalk.addMethod(
  132. smalltalk.method({
  133. selector: "toTargetValue",
  134. category: 'action',
  135. fn: function (){
  136. var self=this;
  137. return smalltalk.withContext(function($ctx1) {
  138. var $1,$3,$2;
  139. $1=_st(self._target())._asJQuery();
  140. $3=self._value();
  141. $ctx1.sendIdx["value"]=1;
  142. if(($receiver = $3) == nil || $receiver == null){
  143. $2=(function(){
  144. return smalltalk.withContext(function($ctx2) {
  145. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})});
  146. } else {
  147. var o;
  148. o=$receiver;
  149. $2=_st(o)._value();
  150. };
  151. _st($1)._val_($2);
  152. return self}, function($ctx1) {$ctx1.fill(self,"toTargetValue",{},smalltalk.TrappedDataCarrier)})},
  153. args: [],
  154. source: "toTargetValue\x0a\x09self target asJQuery val: (self value ifNotNil: [ :o | o value ] ifNil: [[]])",
  155. messageSends: ["val:", "asJQuery", "target", "ifNotNil:ifNil:", "value"],
  156. referencedClasses: []
  157. }),
  158. smalltalk.TrappedDataCarrier);
  159. smalltalk.addMethod(
  160. smalltalk.method({
  161. selector: "value",
  162. category: 'accessing',
  163. fn: function (){
  164. var self=this;
  165. return smalltalk.withContext(function($ctx1) {
  166. var $1;
  167. $1=self["@model"];
  168. return $1;
  169. }, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.TrappedDataCarrier)})},
  170. args: [],
  171. source: "value\x0a\x09^model",
  172. messageSends: [],
  173. referencedClasses: []
  174. }),
  175. smalltalk.TrappedDataCarrier);
  176. smalltalk.addMethod(
  177. smalltalk.method({
  178. selector: "value:",
  179. category: 'accessing',
  180. fn: function (anObject){
  181. var self=this;
  182. return smalltalk.withContext(function($ctx1) {
  183. self["@model"]=anObject;
  184. return self}, function($ctx1) {$ctx1.fill(self,"value:",{anObject:anObject},smalltalk.TrappedDataCarrier)})},
  185. args: ["anObject"],
  186. source: "value: anObject\x0a\x09model := anObject",
  187. messageSends: [],
  188. referencedClasses: []
  189. }),
  190. smalltalk.TrappedDataCarrier);
  191. smalltalk.addMethod(
  192. smalltalk.method({
  193. selector: "on:target:",
  194. category: 'not yet classified',
  195. fn: function (aDataChain,anObject){
  196. var self=this;
  197. return smalltalk.withContext(function($ctx1) {
  198. var $2,$3,$1;
  199. $2=self._new();
  200. _st($2)._chain_(aDataChain);
  201. _st($2)._target_(anObject);
  202. $3=_st($2)._yourself();
  203. $1=$3;
  204. return $1;
  205. }, function($ctx1) {$ctx1.fill(self,"on:target:",{aDataChain:aDataChain,anObject:anObject},smalltalk.TrappedDataCarrier.klass)})},
  206. args: ["aDataChain", "anObject"],
  207. source: "on: aDataChain target: anObject\x0a\x09^self new\x0a\x09\x09chain: aDataChain;\x0a\x09\x09target: anObject;\x0a\x09\x09yourself",
  208. messageSends: ["chain:", "new", "target:", "yourself"],
  209. referencedClasses: []
  210. }),
  211. smalltalk.TrappedDataCarrier.klass);
  212. smalltalk.addClass('TrappedDataCarrierToModel', smalltalk.TrappedDataCarrier, ['index'], 'Trapped-Frontend');
  213. smalltalk.addMethod(
  214. smalltalk.method({
  215. selector: "proceed",
  216. category: 'not yet classified',
  217. fn: function (){
  218. var self=this;
  219. return smalltalk.withContext(function($ctx1) {
  220. var $1;
  221. $1=self["@index"];
  222. if(($receiver = $1) == nil || $receiver == null){
  223. self["@index"]=_st(self["@chain"])._lastProcessorNo();
  224. } else {
  225. self["@index"]=_st(self["@index"]).__minus((1));
  226. };
  227. _st(_st(self["@chain"])._processorNo_(self["@index"]))._toModel_(self);
  228. return self}, function($ctx1) {$ctx1.fill(self,"proceed",{},smalltalk.TrappedDataCarrierToModel)})},
  229. args: [],
  230. source: "proceed\x0a\x09index := index ifNil: [ chain lastProcessorNo ] ifNotNil: [ index - 1 ].\x0a\x09(chain processorNo: index) toModel: self",
  231. messageSends: ["ifNil:ifNotNil:", "lastProcessorNo", "-", "toModel:", "processorNo:"],
  232. referencedClasses: []
  233. }),
  234. smalltalk.TrappedDataCarrierToModel);
  235. smalltalk.addClass('TrappedDataCarrierToView', smalltalk.TrappedDataCarrier, ['index'], 'Trapped-Frontend');
  236. smalltalk.addMethod(
  237. smalltalk.method({
  238. selector: "proceed",
  239. category: 'not yet classified',
  240. fn: function (){
  241. var self=this;
  242. return smalltalk.withContext(function($ctx1) {
  243. var $1;
  244. $1=self["@index"];
  245. if(($receiver = $1) == nil || $receiver == null){
  246. self["@index"]=_st(self["@chain"])._firstProcessorNo();
  247. } else {
  248. self["@index"]=_st(self["@index"]).__plus((1));
  249. };
  250. _st(_st(self["@chain"])._processorNo_(self["@index"]))._toView_(self);
  251. return self}, function($ctx1) {$ctx1.fill(self,"proceed",{},smalltalk.TrappedDataCarrierToView)})},
  252. args: [],
  253. source: "proceed\x0a\x09index := index ifNil: [ chain firstProcessorNo ] ifNotNil: [ index + 1 ].\x0a\x09(chain processorNo: index) toView: self",
  254. messageSends: ["ifNil:ifNotNil:", "firstProcessorNo", "+", "toView:", "processorNo:"],
  255. referencedClasses: []
  256. }),
  257. smalltalk.TrappedDataCarrierToView);
  258. smalltalk.addClass('TrappedDataChain', smalltalk.Object, ['processors'], 'Trapped-Frontend');
  259. smalltalk.addMethod(
  260. smalltalk.method({
  261. selector: "firstProcessorNo",
  262. category: 'accessing',
  263. fn: function (){
  264. var self=this;
  265. return smalltalk.withContext(function($ctx1) {
  266. return (1);
  267. }, function($ctx1) {$ctx1.fill(self,"firstProcessorNo",{},smalltalk.TrappedDataChain)})},
  268. args: [],
  269. source: "firstProcessorNo\x0a\x09^1",
  270. messageSends: [],
  271. referencedClasses: []
  272. }),
  273. smalltalk.TrappedDataChain);
  274. smalltalk.addMethod(
  275. smalltalk.method({
  276. selector: "forSnapshot:andBrush:",
  277. category: 'action',
  278. fn: function (aSnapshot,aTagBrush){
  279. var self=this;
  280. var toViewCarrier,toModelCarrier;
  281. function $TrappedDataCarrierToView(){return smalltalk.TrappedDataCarrierToView||(typeof TrappedDataCarrierToView=="undefined"?nil:TrappedDataCarrierToView)}
  282. function $TrappedDataCarrierToModel(){return smalltalk.TrappedDataCarrierToModel||(typeof TrappedDataCarrierToModel=="undefined"?nil:TrappedDataCarrierToModel)}
  283. return smalltalk.withContext(function($ctx1) {
  284. toViewCarrier=_st($TrappedDataCarrierToView())._on_target_(self,aTagBrush);
  285. $ctx1.sendIdx["on:target:"]=1;
  286. toModelCarrier=_st($TrappedDataCarrierToModel())._on_target_(self,aSnapshot);
  287. _st(self["@processors"])._do_((function(each){
  288. return smalltalk.withContext(function($ctx2) {
  289. return _st(each)._installToView_toModel_(toViewCarrier,toModelCarrier);
  290. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  291. return self}, function($ctx1) {$ctx1.fill(self,"forSnapshot:andBrush:",{aSnapshot:aSnapshot,aTagBrush:aTagBrush,toViewCarrier:toViewCarrier,toModelCarrier:toModelCarrier},smalltalk.TrappedDataChain)})},
  292. args: ["aSnapshot", "aTagBrush"],
  293. source: "forSnapshot: aSnapshot andBrush: aTagBrush\x0a\x09| toViewCarrier toModelCarrier |\x0a\x09toViewCarrier := TrappedDataCarrierToView on: self target: aTagBrush.\x0a\x09toModelCarrier := TrappedDataCarrierToModel on: self target: aSnapshot.\x0a\x09processors do: [ :each | each installToView: toViewCarrier toModel: toModelCarrier ]",
  294. messageSends: ["on:target:", "do:", "installToView:toModel:"],
  295. referencedClasses: ["TrappedDataCarrierToView", "TrappedDataCarrierToModel"]
  296. }),
  297. smalltalk.TrappedDataChain);
  298. smalltalk.addMethod(
  299. smalltalk.method({
  300. selector: "lastProcessorNo",
  301. category: 'accessing',
  302. fn: function (){
  303. var self=this;
  304. return smalltalk.withContext(function($ctx1) {
  305. var $1;
  306. $1=_st(self["@processors"])._size();
  307. return $1;
  308. }, function($ctx1) {$ctx1.fill(self,"lastProcessorNo",{},smalltalk.TrappedDataChain)})},
  309. args: [],
  310. source: "lastProcessorNo\x0a\x09^processors size",
  311. messageSends: ["size"],
  312. referencedClasses: []
  313. }),
  314. smalltalk.TrappedDataChain);
  315. smalltalk.addMethod(
  316. smalltalk.method({
  317. selector: "processorNo:",
  318. category: 'accessing',
  319. fn: function (aNumber){
  320. var self=this;
  321. return smalltalk.withContext(function($ctx1) {
  322. var $1;
  323. $1=_st(self["@processors"])._at_(aNumber);
  324. return $1;
  325. }, function($ctx1) {$ctx1.fill(self,"processorNo:",{aNumber:aNumber},smalltalk.TrappedDataChain)})},
  326. args: ["aNumber"],
  327. source: "processorNo: aNumber\x0a\x09^processors at: aNumber",
  328. messageSends: ["at:"],
  329. referencedClasses: []
  330. }),
  331. smalltalk.TrappedDataChain);
  332. smalltalk.addMethod(
  333. smalltalk.method({
  334. selector: "processors:",
  335. category: 'accessing',
  336. fn: function (anArray){
  337. var self=this;
  338. return smalltalk.withContext(function($ctx1) {
  339. self["@processors"]=anArray;
  340. return self}, function($ctx1) {$ctx1.fill(self,"processors:",{anArray:anArray},smalltalk.TrappedDataChain)})},
  341. args: ["anArray"],
  342. source: "processors: anArray\x0a\x09processors := anArray",
  343. messageSends: [],
  344. referencedClasses: []
  345. }),
  346. smalltalk.TrappedDataChain);
  347. smalltalk.addMethod(
  348. smalltalk.method({
  349. selector: "blackboardReaderWriter",
  350. category: 'private',
  351. fn: function (){
  352. var self=this;
  353. function $TrappedProcessorBlackboard(){return smalltalk.TrappedProcessorBlackboard||(typeof TrappedProcessorBlackboard=="undefined"?nil:TrappedProcessorBlackboard)}
  354. return smalltalk.withContext(function($ctx1) {
  355. var $1;
  356. $1=_st($TrappedProcessorBlackboard())._new();
  357. return $1;
  358. }, function($ctx1) {$ctx1.fill(self,"blackboardReaderWriter",{},smalltalk.TrappedDataChain.klass)})},
  359. args: [],
  360. source: "blackboardReaderWriter\x0a\x09^TrappedProcessorBlackboard new",
  361. messageSends: ["new"],
  362. referencedClasses: ["TrappedProcessorBlackboard"]
  363. }),
  364. smalltalk.TrappedDataChain.klass);
  365. smalltalk.addMethod(
  366. smalltalk.method({
  367. selector: "new:",
  368. category: 'instance creation',
  369. fn: function (anArray){
  370. var self=this;
  371. return smalltalk.withContext(function($ctx1) {
  372. var $2,$3,$1;
  373. $2=self._new();
  374. _st($2)._processors_(_st([self._blackboardReaderWriter()]).__comma(anArray));
  375. $3=_st($2)._yourself();
  376. $1=$3;
  377. return $1;
  378. }, function($ctx1) {$ctx1.fill(self,"new:",{anArray:anArray},smalltalk.TrappedDataChain.klass)})},
  379. args: ["anArray"],
  380. source: "new: anArray\x0a\x09^self new\x0a\x09\x09processors: { self blackboardReaderWriter }, anArray;\x0a\x09\x09yourself",
  381. messageSends: ["processors:", "new", ",", "blackboardReaderWriter", "yourself"],
  382. referencedClasses: []
  383. }),
  384. smalltalk.TrappedDataChain.klass);
  385. smalltalk.addMethod(
  386. smalltalk.method({
  387. selector: "newFromProcessorSpecs:",
  388. category: 'instance creation',
  389. fn: function (anArray){
  390. var self=this;
  391. function $TrappedProcessor(){return smalltalk.TrappedProcessor||(typeof TrappedProcessor=="undefined"?nil:TrappedProcessor)}
  392. return smalltalk.withContext(function($ctx1) {
  393. var $2,$3,$1;
  394. $1=self._new_(_st(anArray)._collect_((function(each){
  395. return smalltalk.withContext(function($ctx2) {
  396. $2=_st(each)._isString();
  397. if(smalltalk.assert($2)){
  398. return _st($TrappedProcessor())._perform_(each);
  399. } else {
  400. var selector,args;
  401. selector="";
  402. selector;
  403. args=[];
  404. args;
  405. _st(each)._withIndexDo_((function(element,index){
  406. return smalltalk.withContext(function($ctx3) {
  407. $3=_st(index)._odd();
  408. if(smalltalk.assert($3)){
  409. selector=_st(selector).__comma(element);
  410. $ctx3.sendIdx[","]=1;
  411. return selector;
  412. } else {
  413. selector=_st(selector).__comma(":");
  414. selector;
  415. return _st(args)._add_(element);
  416. };
  417. }, function($ctx3) {$ctx3.fillBlock({element:element,index:index},$ctx2,4)})}));
  418. return _st($TrappedProcessor())._perform_withArguments_(selector,args);
  419. };
  420. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})})));
  421. return $1;
  422. }, function($ctx1) {$ctx1.fill(self,"newFromProcessorSpecs:",{anArray:anArray},smalltalk.TrappedDataChain.klass)})},
  423. args: ["anArray"],
  424. source: "newFromProcessorSpecs: anArray\x0a\x09^self new: (anArray collect: [ :each | each isString\x0a\x09\x09ifTrue: [ TrappedProcessor perform: each ]\x0a\x09\x09ifFalse: [\x0a\x09\x09\x09| selector args |\x0a\x09\x09\x09selector := ''.\x0a\x09\x09\x09args := #().\x0a\x09\x09\x09each withIndexDo: [ :element :index | index odd\x0a\x09\x09\x09\x09ifTrue: [ selector := selector, element ]\x0a\x09\x09\x09\x09ifFalse: [ selector := selector, ':'. args add: element ] ].\x0a\x09\x09\x09TrappedProcessor perform: selector withArguments: args ] ])",
  425. messageSends: ["new:", "collect:", "ifTrue:ifFalse:", "isString", "perform:", "withIndexDo:", "odd", ",", "add:", "perform:withArguments:"],
  426. referencedClasses: ["TrappedProcessor"]
  427. }),
  428. smalltalk.TrappedDataChain.klass);
  429. smalltalk.addClass('TrappedDumbView', smalltalk.Widget, [], 'Trapped-Frontend');
  430. smalltalk.TrappedDumbView.comment="I just read and show an actual path.";
  431. smalltalk.addMethod(
  432. smalltalk.method({
  433. selector: "renderOn:",
  434. category: 'rendering',
  435. fn: function (html){
  436. var self=this;
  437. return smalltalk.withContext(function($ctx1) {
  438. _st(_st(html)._root())._trap_([]);
  439. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.TrappedDumbView)})},
  440. args: ["html"],
  441. source: "renderOn: html\x0a\x09html root trap: #()",
  442. messageSends: ["trap:", "root"],
  443. referencedClasses: []
  444. }),
  445. smalltalk.TrappedDumbView);
  446. smalltalk.addClass('TrappedProcessor', smalltalk.Object, [], 'Trapped-Frontend');
  447. smalltalk.TrappedProcessor.comment="I process data in TrappedDataChain.\x0aI am stateless flyweight (aka servant)\x0aand will get all necessary data as arguments in API calls.\x0a\x0aMy public API is:\x0a - installToView:toModel:\x0a This gets two TrappedDataCarriers set up without actual data\x0a and at the beginning of their chains. It should do one-time\x0a installation task needed (install event handlers etc.).\x0a To start a chain, do: dataCarrier copy value: data; proceed.\x0a - toView:\x0a This performs transformation of TrappedDataCarrier on its way from model to view.\x0a Should call aDataCarrier proceed to proceed to subsequent step.\x0a - toModel:\x0a This performs transformation of TrappedDataToken on its way from view to model.\x0a Should call aDataCarrier proceed to proceed to subsequent step.\x0a";
  448. smalltalk.addMethod(
  449. smalltalk.method({
  450. selector: "installToView:toModel:",
  451. category: 'installation',
  452. fn: function (aDataCarrier,anotherDataCarrier){
  453. var self=this;
  454. return smalltalk.withContext(function($ctx1) {
  455. return self}, function($ctx1) {$ctx1.fill(self,"installToView:toModel:",{aDataCarrier:aDataCarrier,anotherDataCarrier:anotherDataCarrier},smalltalk.TrappedProcessor)})},
  456. args: ["aDataCarrier", "anotherDataCarrier"],
  457. source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09\x22by default, do nothing\x22",
  458. messageSends: [],
  459. referencedClasses: []
  460. }),
  461. smalltalk.TrappedProcessor);
  462. smalltalk.addMethod(
  463. smalltalk.method({
  464. selector: "toModel:",
  465. category: 'data transformation',
  466. fn: function (aDataCarrier){
  467. var self=this;
  468. return smalltalk.withContext(function($ctx1) {
  469. _st(aDataCarrier)._proceed();
  470. return self}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessor)})},
  471. args: ["aDataCarrier"],
  472. source: "toModel: aDataCarrier\x0a\x09\x22by default, proceed\x22\x0a\x09aDataCarrier proceed",
  473. messageSends: ["proceed"],
  474. referencedClasses: []
  475. }),
  476. smalltalk.TrappedProcessor);
  477. smalltalk.addMethod(
  478. smalltalk.method({
  479. selector: "toView:",
  480. category: 'data transformation',
  481. fn: function (aDataCarrier){
  482. var self=this;
  483. return smalltalk.withContext(function($ctx1) {
  484. _st(aDataCarrier)._proceed();
  485. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessor)})},
  486. args: ["aDataCarrier"],
  487. source: "toView: aDataCarrier\x0a\x09\x22by default, proceed\x22\x0a\x09aDataCarrier proceed",
  488. messageSends: ["proceed"],
  489. referencedClasses: []
  490. }),
  491. smalltalk.TrappedProcessor);
  492. smalltalk.addMethod(
  493. smalltalk.method({
  494. selector: "contents",
  495. category: 'factory',
  496. fn: function (){
  497. var self=this;
  498. function $TrappedProcessorContents(){return smalltalk.TrappedProcessorContents||(typeof TrappedProcessorContents=="undefined"?nil:TrappedProcessorContents)}
  499. return smalltalk.withContext(function($ctx1) {
  500. var $1;
  501. $1=_st($TrappedProcessorContents())._new();
  502. return $1;
  503. }, function($ctx1) {$ctx1.fill(self,"contents",{},smalltalk.TrappedProcessor.klass)})},
  504. args: [],
  505. source: "contents\x0a\x09^TrappedProcessorContents new",
  506. messageSends: ["new"],
  507. referencedClasses: ["TrappedProcessorContents"]
  508. }),
  509. smalltalk.TrappedProcessor.klass);
  510. smalltalk.addMethod(
  511. smalltalk.method({
  512. selector: "inputChecked",
  513. category: 'factory',
  514. fn: function (){
  515. var self=this;
  516. function $TrappedProcessorInputChecked(){return smalltalk.TrappedProcessorInputChecked||(typeof TrappedProcessorInputChecked=="undefined"?nil:TrappedProcessorInputChecked)}
  517. return smalltalk.withContext(function($ctx1) {
  518. var $1;
  519. $1=_st($TrappedProcessorInputChecked())._new();
  520. return $1;
  521. }, function($ctx1) {$ctx1.fill(self,"inputChecked",{},smalltalk.TrappedProcessor.klass)})},
  522. args: [],
  523. source: "inputChecked\x0a\x09^TrappedProcessorInputChecked new",
  524. messageSends: ["new"],
  525. referencedClasses: ["TrappedProcessorInputChecked"]
  526. }),
  527. smalltalk.TrappedProcessor.klass);
  528. smalltalk.addMethod(
  529. smalltalk.method({
  530. selector: "inputValue",
  531. category: 'factory',
  532. fn: function (){
  533. var self=this;
  534. function $TrappedProcessorInputValue(){return smalltalk.TrappedProcessorInputValue||(typeof TrappedProcessorInputValue=="undefined"?nil:TrappedProcessorInputValue)}
  535. return smalltalk.withContext(function($ctx1) {
  536. var $1;
  537. $1=_st($TrappedProcessorInputValue())._new();
  538. return $1;
  539. }, function($ctx1) {$ctx1.fill(self,"inputValue",{},smalltalk.TrappedProcessor.klass)})},
  540. args: [],
  541. source: "inputValue\x0a\x09^TrappedProcessorInputValue new",
  542. messageSends: ["new"],
  543. referencedClasses: ["TrappedProcessorInputValue"]
  544. }),
  545. smalltalk.TrappedProcessor.klass);
  546. smalltalk.addMethod(
  547. smalltalk.method({
  548. selector: "signal:",
  549. category: 'factory',
  550. fn: function (aString){
  551. var self=this;
  552. function $TrappedProcessorSignal(){return smalltalk.TrappedProcessorSignal||(typeof TrappedProcessorSignal=="undefined"?nil:TrappedProcessorSignal)}
  553. return smalltalk.withContext(function($ctx1) {
  554. var $1;
  555. $1=_st($TrappedProcessorSignal())._new_(aString);
  556. return $1;
  557. }, function($ctx1) {$ctx1.fill(self,"signal:",{aString:aString},smalltalk.TrappedProcessor.klass)})},
  558. args: ["aString"],
  559. source: "signal: aString\x0a\x09^TrappedProcessorSignal new: aString",
  560. messageSends: ["new:"],
  561. referencedClasses: ["TrappedProcessorSignal"]
  562. }),
  563. smalltalk.TrappedProcessor.klass);
  564. smalltalk.addMethod(
  565. smalltalk.method({
  566. selector: "whenClicked",
  567. category: 'factory',
  568. fn: function (){
  569. var self=this;
  570. function $TrappedProcessorWhenClicked(){return smalltalk.TrappedProcessorWhenClicked||(typeof TrappedProcessorWhenClicked=="undefined"?nil:TrappedProcessorWhenClicked)}
  571. return smalltalk.withContext(function($ctx1) {
  572. var $1;
  573. $1=_st($TrappedProcessorWhenClicked())._new();
  574. return $1;
  575. }, function($ctx1) {$ctx1.fill(self,"whenClicked",{},smalltalk.TrappedProcessor.klass)})},
  576. args: [],
  577. source: "whenClicked\x0a\x09^TrappedProcessorWhenClicked new",
  578. messageSends: ["new"],
  579. referencedClasses: ["TrappedProcessorWhenClicked"]
  580. }),
  581. smalltalk.TrappedProcessor.klass);
  582. smalltalk.addMethod(
  583. smalltalk.method({
  584. selector: "whenSubmitted",
  585. category: 'factory',
  586. fn: function (){
  587. var self=this;
  588. function $TrappedProcessorWhenSubmitted(){return smalltalk.TrappedProcessorWhenSubmitted||(typeof TrappedProcessorWhenSubmitted=="undefined"?nil:TrappedProcessorWhenSubmitted)}
  589. return smalltalk.withContext(function($ctx1) {
  590. var $1;
  591. $1=_st($TrappedProcessorWhenSubmitted())._new();
  592. return $1;
  593. }, function($ctx1) {$ctx1.fill(self,"whenSubmitted",{},smalltalk.TrappedProcessor.klass)})},
  594. args: [],
  595. source: "whenSubmitted\x0a\x09^TrappedProcessorWhenSubmitted new",
  596. messageSends: ["new"],
  597. referencedClasses: ["TrappedProcessorWhenSubmitted"]
  598. }),
  599. smalltalk.TrappedProcessor.klass);
  600. smalltalk.addMethod(
  601. smalltalk.method({
  602. selector: "widget:",
  603. category: 'factory',
  604. fn: function (aString){
  605. var self=this;
  606. function $TrappedProcessorWidget(){return smalltalk.TrappedProcessorWidget||(typeof TrappedProcessorWidget=="undefined"?nil:TrappedProcessorWidget)}
  607. return smalltalk.withContext(function($ctx1) {
  608. var $1;
  609. $1=_st($TrappedProcessorWidget())._new_(aString);
  610. return $1;
  611. }, function($ctx1) {$ctx1.fill(self,"widget:",{aString:aString},smalltalk.TrappedProcessor.klass)})},
  612. args: ["aString"],
  613. source: "widget: aString\x0a\x09^TrappedProcessorWidget new: aString",
  614. messageSends: ["new:"],
  615. referencedClasses: ["TrappedProcessorWidget"]
  616. }),
  617. smalltalk.TrappedProcessor.klass);
  618. smalltalk.addClass('TrappedProcessorBlackboard', smalltalk.TrappedProcessor, [], 'Trapped-Frontend');
  619. smalltalk.TrappedProcessorBlackboard.comment="I am used internally to fetch data from blackboard\x0aor write it back.";
  620. smalltalk.addMethod(
  621. smalltalk.method({
  622. selector: "installToView:toModel:",
  623. category: 'installation',
  624. fn: function (aDataCarrier,anotherDataCarrier){
  625. var self=this;
  626. var snap;
  627. function $KeyedPubSubUnsubscribe(){return smalltalk.KeyedPubSubUnsubscribe||(typeof KeyedPubSubUnsubscribe=="undefined"?nil:KeyedPubSubUnsubscribe)}
  628. return smalltalk.withContext(function($ctx1) {
  629. var $1,$2,$3;
  630. snap=_st(anotherDataCarrier)._target();
  631. $ctx1.sendIdx["target"]=1;
  632. _st(snap)._watch_((function(data){
  633. return smalltalk.withContext(function($ctx2) {
  634. $1=_st(_st(_st(_st(_st(aDataCarrier)._target())._asJQuery())._closest_("html"))._toArray())._isEmpty();
  635. if(smalltalk.assert($1)){
  636. _st($KeyedPubSubUnsubscribe())._signal();
  637. };
  638. return _st(snap)._do_((function(){
  639. return smalltalk.withContext(function($ctx3) {
  640. $2=_st(aDataCarrier)._copy();
  641. _st($2)._value_(data);
  642. $3=_st($2)._proceed();
  643. return $3;
  644. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  645. }, function($ctx2) {$ctx2.fillBlock({data:data},$ctx1,1)})}));
  646. return self}, function($ctx1) {$ctx1.fill(self,"installToView:toModel:",{aDataCarrier:aDataCarrier,anotherDataCarrier:anotherDataCarrier,snap:snap},smalltalk.TrappedProcessorBlackboard)})},
  647. args: ["aDataCarrier", "anotherDataCarrier"],
  648. source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09| snap |\x0a\x09snap := anotherDataCarrier target.\x0a\x09snap watch: [ :data |\x0a\x09\x09(aDataCarrier target asJQuery closest: 'html') toArray isEmpty ifTrue: [ KeyedPubSubUnsubscribe signal ].\x0a snap do: [ aDataCarrier copy value: data; proceed ] ]",
  649. messageSends: ["target", "watch:", "ifTrue:", "isEmpty", "toArray", "closest:", "asJQuery", "signal", "do:", "value:", "copy", "proceed"],
  650. referencedClasses: ["KeyedPubSubUnsubscribe"]
  651. }),
  652. smalltalk.TrappedProcessorBlackboard);
  653. smalltalk.addMethod(
  654. smalltalk.method({
  655. selector: "toModel:",
  656. category: 'data transformation',
  657. fn: function (aDataCarrier){
  658. var self=this;
  659. return smalltalk.withContext(function($ctx1) {
  660. _st(aDataCarrier)._modifyTarget();
  661. return self}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorBlackboard)})},
  662. args: ["aDataCarrier"],
  663. source: "toModel: aDataCarrier\x0a\x09aDataCarrier modifyTarget",
  664. messageSends: ["modifyTarget"],
  665. referencedClasses: []
  666. }),
  667. smalltalk.TrappedProcessorBlackboard);
  668. smalltalk.addClass('TrappedProcessorContents', smalltalk.TrappedProcessor, [], 'Trapped-Frontend');
  669. smalltalk.TrappedProcessorContents.comment="I put data into target via contents: in toView:";
  670. smalltalk.addMethod(
  671. smalltalk.method({
  672. selector: "toView:",
  673. category: 'data transformation',
  674. fn: function (aDataCarrier){
  675. var self=this;
  676. return smalltalk.withContext(function($ctx1) {
  677. _st(aDataCarrier)._toTargetContents();
  678. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorContents)})},
  679. args: ["aDataCarrier"],
  680. source: "toView: aDataCarrier\x0a\x09aDataCarrier toTargetContents",
  681. messageSends: ["toTargetContents"],
  682. referencedClasses: []
  683. }),
  684. smalltalk.TrappedProcessorContents);
  685. smalltalk.addClass('TrappedProcessorInputChecked', smalltalk.TrappedProcessor, [], 'Trapped-Frontend');
  686. smalltalk.TrappedProcessorInputChecked.comment="I bind to checkbox checked attribute.";
  687. smalltalk.addMethod(
  688. smalltalk.method({
  689. selector: "installToView:toModel:",
  690. category: 'installation',
  691. fn: function (aDataCarrier,anotherDataCarrier){
  692. var self=this;
  693. var brush;
  694. return smalltalk.withContext(function($ctx1) {
  695. var $1,$2;
  696. brush=_st(aDataCarrier)._target();
  697. _st(brush)._onChange_((function(){
  698. return smalltalk.withContext(function($ctx2) {
  699. $1=_st(anotherDataCarrier)._copy();
  700. _st($1)._value_(_st(_st(_st(brush)._asJQuery())._attr_("checked"))._notNil());
  701. $2=_st($1)._proceed();
  702. return $2;
  703. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  704. return self}, function($ctx1) {$ctx1.fill(self,"installToView:toModel:",{aDataCarrier:aDataCarrier,anotherDataCarrier:anotherDataCarrier,brush:brush},smalltalk.TrappedProcessorInputChecked)})},
  705. args: ["aDataCarrier", "anotherDataCarrier"],
  706. source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09| brush |\x0a\x09brush := aDataCarrier target.\x0a\x09brush onChange: [ anotherDataCarrier copy value: (brush asJQuery attr: 'checked') notNil; proceed ]",
  707. messageSends: ["target", "onChange:", "value:", "copy", "notNil", "attr:", "asJQuery", "proceed"],
  708. referencedClasses: []
  709. }),
  710. smalltalk.TrappedProcessorInputChecked);
  711. smalltalk.addMethod(
  712. smalltalk.method({
  713. selector: "toView:",
  714. category: 'data transformation',
  715. fn: function (aDataCarrier){
  716. var self=this;
  717. return smalltalk.withContext(function($ctx1) {
  718. _st(aDataCarrier)._toTargetAttr_("checked");
  719. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorInputChecked)})},
  720. args: ["aDataCarrier"],
  721. source: "toView: aDataCarrier\x0a\x09aDataCarrier toTargetAttr: 'checked'",
  722. messageSends: ["toTargetAttr:"],
  723. referencedClasses: []
  724. }),
  725. smalltalk.TrappedProcessorInputChecked);
  726. smalltalk.addClass('TrappedProcessorInputValue', smalltalk.TrappedProcessor, [], 'Trapped-Frontend');
  727. smalltalk.TrappedProcessorInputValue.comment="I bind to input value.";
  728. smalltalk.addMethod(
  729. smalltalk.method({
  730. selector: "installToView:toModel:",
  731. category: 'installation',
  732. fn: function (aDataCarrier,anotherDataCarrier){
  733. var self=this;
  734. var brush;
  735. return smalltalk.withContext(function($ctx1) {
  736. var $1,$2;
  737. brush=_st(aDataCarrier)._target();
  738. _st(brush)._onChange_((function(){
  739. return smalltalk.withContext(function($ctx2) {
  740. $1=_st(anotherDataCarrier)._copy();
  741. _st($1)._value_(_st(_st(brush)._asJQuery())._val());
  742. $2=_st($1)._proceed();
  743. return $2;
  744. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  745. return self}, function($ctx1) {$ctx1.fill(self,"installToView:toModel:",{aDataCarrier:aDataCarrier,anotherDataCarrier:anotherDataCarrier,brush:brush},smalltalk.TrappedProcessorInputValue)})},
  746. args: ["aDataCarrier", "anotherDataCarrier"],
  747. source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09| brush |\x0a\x09brush := aDataCarrier target.\x0a\x09brush onChange: [ anotherDataCarrier copy value: brush asJQuery val; proceed ]",
  748. messageSends: ["target", "onChange:", "value:", "copy", "val", "asJQuery", "proceed"],
  749. referencedClasses: []
  750. }),
  751. smalltalk.TrappedProcessorInputValue);
  752. smalltalk.addMethod(
  753. smalltalk.method({
  754. selector: "toView:",
  755. category: 'data transformation',
  756. fn: function (aDataCarrier){
  757. var self=this;
  758. return smalltalk.withContext(function($ctx1) {
  759. _st(aDataCarrier)._toTargetValue();
  760. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorInputValue)})},
  761. args: ["aDataCarrier"],
  762. source: "toView: aDataCarrier\x0a\x09aDataCarrier toTargetValue",
  763. messageSends: ["toTargetValue"],
  764. referencedClasses: []
  765. }),
  766. smalltalk.TrappedProcessorInputValue);
  767. smalltalk.addClass('TrappedProcessorSignal', smalltalk.TrappedProcessor, ['selector'], 'Trapped-Frontend');
  768. smalltalk.TrappedProcessorSignal.comment="Instead of writing data directly to model,\x0aI instead modify it by sending a message specified when instantiating me.";
  769. smalltalk.addMethod(
  770. smalltalk.method({
  771. selector: "selector:",
  772. category: 'accessing',
  773. fn: function (aString){
  774. var self=this;
  775. return smalltalk.withContext(function($ctx1) {
  776. self["@selector"]=aString;
  777. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.TrappedProcessorSignal)})},
  778. args: ["aString"],
  779. source: "selector: aString\x0a\x09selector := aString",
  780. messageSends: [],
  781. referencedClasses: []
  782. }),
  783. smalltalk.TrappedProcessorSignal);
  784. smalltalk.addMethod(
  785. smalltalk.method({
  786. selector: "toModel:",
  787. category: 'data transformation',
  788. fn: function (aDataCarrier){
  789. var self=this;
  790. return smalltalk.withContext(function($ctx1) {
  791. _st(aDataCarrier)._modifyTargetByPerforming_(self["@selector"]);
  792. return self}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorSignal)})},
  793. args: ["aDataCarrier"],
  794. source: "toModel: aDataCarrier\x0a\x09aDataCarrier modifyTargetByPerforming: selector",
  795. messageSends: ["modifyTargetByPerforming:"],
  796. referencedClasses: []
  797. }),
  798. smalltalk.TrappedProcessorSignal);
  799. smalltalk.addMethod(
  800. smalltalk.method({
  801. selector: "toView:",
  802. category: 'data transformation',
  803. fn: function (aDataCarrier){
  804. var self=this;
  805. return smalltalk.withContext(function($ctx1) {
  806. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorSignal)})},
  807. args: ["aDataCarrier"],
  808. source: "toView: aDataCarrier\x0a\x09\x22stop\x22",
  809. messageSends: [],
  810. referencedClasses: []
  811. }),
  812. smalltalk.TrappedProcessorSignal);
  813. smalltalk.addMethod(
  814. smalltalk.method({
  815. selector: "new:",
  816. category: 'instance creation',
  817. fn: function (aString){
  818. var self=this;
  819. return smalltalk.withContext(function($ctx1) {
  820. var $2,$3,$1;
  821. $2=self._new();
  822. _st($2)._selector_(aString);
  823. $3=_st($2)._yourself();
  824. $1=$3;
  825. return $1;
  826. }, function($ctx1) {$ctx1.fill(self,"new:",{aString:aString},smalltalk.TrappedProcessorSignal.klass)})},
  827. args: ["aString"],
  828. source: "new: aString\x0a\x09^self new\x0a\x09\x09selector: aString;\x0a\x09\x09yourself",
  829. messageSends: ["selector:", "new", "yourself"],
  830. referencedClasses: []
  831. }),
  832. smalltalk.TrappedProcessorSignal.klass);
  833. smalltalk.addClass('TrappedProcessorWhenClicked', smalltalk.TrappedProcessor, [], 'Trapped-Frontend');
  834. smalltalk.TrappedProcessorWhenClicked.comment="I bind to an element and send true to blackboard when clicked.";
  835. smalltalk.addMethod(
  836. smalltalk.method({
  837. selector: "installToView:toModel:",
  838. category: 'installation',
  839. fn: function (aDataCarrier,anotherDataCarrier){
  840. var self=this;
  841. return smalltalk.withContext(function($ctx1) {
  842. var $1,$2;
  843. _st(_st(aDataCarrier)._target())._onClick_((function(){
  844. return smalltalk.withContext(function($ctx2) {
  845. $1=_st(anotherDataCarrier)._copy();
  846. _st($1)._value_(true);
  847. $2=_st($1)._proceed();
  848. $2;
  849. return false;
  850. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  851. return self}, function($ctx1) {$ctx1.fill(self,"installToView:toModel:",{aDataCarrier:aDataCarrier,anotherDataCarrier:anotherDataCarrier},smalltalk.TrappedProcessorWhenClicked)})},
  852. args: ["aDataCarrier", "anotherDataCarrier"],
  853. source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09aDataCarrier target onClick: [ anotherDataCarrier copy value: true; proceed. false ]",
  854. messageSends: ["onClick:", "target", "value:", "copy", "proceed"],
  855. referencedClasses: []
  856. }),
  857. smalltalk.TrappedProcessorWhenClicked);
  858. smalltalk.addClass('TrappedProcessorWhenSubmitted', smalltalk.TrappedProcessor, [], 'Trapped-Frontend');
  859. smalltalk.TrappedProcessorWhenSubmitted.comment="I bind to a form and send true to blackboard when submitted.";
  860. smalltalk.addMethod(
  861. smalltalk.method({
  862. selector: "installToView:toModel:",
  863. category: 'installation',
  864. fn: function (aDataCarrier,anotherDataCarrier){
  865. var self=this;
  866. return smalltalk.withContext(function($ctx1) {
  867. var $1,$2;
  868. _st(_st(aDataCarrier)._target())._onSubmit_((function(){
  869. return smalltalk.withContext(function($ctx2) {
  870. $1=_st(anotherDataCarrier)._copy();
  871. _st($1)._value_(true);
  872. $2=_st($1)._proceed();
  873. $2;
  874. return false;
  875. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  876. return self}, function($ctx1) {$ctx1.fill(self,"installToView:toModel:",{aDataCarrier:aDataCarrier,anotherDataCarrier:anotherDataCarrier},smalltalk.TrappedProcessorWhenSubmitted)})},
  877. args: ["aDataCarrier", "anotherDataCarrier"],
  878. source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09aDataCarrier target onSubmit: [ anotherDataCarrier copy value: true; proceed. false ]",
  879. messageSends: ["onSubmit:", "target", "value:", "copy", "proceed"],
  880. referencedClasses: []
  881. }),
  882. smalltalk.TrappedProcessorWhenSubmitted);
  883. smalltalk.addClass('TrappedStoppingProcessor', smalltalk.TrappedProcessor, [], 'Trapped-Frontend');
  884. smalltalk.TrappedStoppingProcessor.comment="I do not proceed in toView: nor in toModel:\x0a\x0aI am therefore only interesting for my side-effects from install step.";
  885. smalltalk.addMethod(
  886. smalltalk.method({
  887. selector: "toModel:",
  888. category: 'data transformation',
  889. fn: function (aDataCarrier){
  890. var self=this;
  891. return smalltalk.withContext(function($ctx1) {
  892. return self}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},smalltalk.TrappedStoppingProcessor)})},
  893. args: ["aDataCarrier"],
  894. source: "toModel: aDataCarrier\x0a\x09\x22stop\x22",
  895. messageSends: [],
  896. referencedClasses: []
  897. }),
  898. smalltalk.TrappedStoppingProcessor);
  899. smalltalk.addMethod(
  900. smalltalk.method({
  901. selector: "toView:",
  902. category: 'data transformation',
  903. fn: function (aDataCarrier){
  904. var self=this;
  905. return smalltalk.withContext(function($ctx1) {
  906. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedStoppingProcessor)})},
  907. args: ["aDataCarrier"],
  908. source: "toView: aDataCarrier\x0a\x09\x22stop\x22",
  909. messageSends: [],
  910. referencedClasses: []
  911. }),
  912. smalltalk.TrappedStoppingProcessor);
  913. smalltalk.addClass('TrappedProcessorWidget', smalltalk.TrappedStoppingProcessor, ['viewName'], 'Trapped-Frontend');
  914. smalltalk.TrappedProcessorWidget.comment="When installed, I insert a widget instance of the class specified when creating me.";
  915. smalltalk.addMethod(
  916. smalltalk.method({
  917. selector: "installToView:toModel:",
  918. category: 'installation',
  919. fn: function (aDataCarrier,anotherDataCarrier){
  920. var self=this;
  921. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  922. return smalltalk.withContext(function($ctx1) {
  923. var $1;
  924. $1=_st(anotherDataCarrier)._target();
  925. $ctx1.sendIdx["target"]=1;
  926. _st($1)._do_((function(){
  927. return smalltalk.withContext(function($ctx2) {
  928. return _st(_st(aDataCarrier)._target())._with_(_st(_st(_st($Smalltalk())._current())._at_(self["@viewName"]))._new());
  929. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  930. return self}, function($ctx1) {$ctx1.fill(self,"installToView:toModel:",{aDataCarrier:aDataCarrier,anotherDataCarrier:anotherDataCarrier},smalltalk.TrappedProcessorWidget)})},
  931. args: ["aDataCarrier", "anotherDataCarrier"],
  932. source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09anotherDataCarrier target do: [ aDataCarrier target with: (Smalltalk current at: viewName) new ]",
  933. messageSends: ["do:", "target", "with:", "new", "at:", "current"],
  934. referencedClasses: ["Smalltalk"]
  935. }),
  936. smalltalk.TrappedProcessorWidget);
  937. smalltalk.addMethod(
  938. smalltalk.method({
  939. selector: "viewName:",
  940. category: 'accessing',
  941. fn: function (aString){
  942. var self=this;
  943. return smalltalk.withContext(function($ctx1) {
  944. self["@viewName"]=aString;
  945. return self}, function($ctx1) {$ctx1.fill(self,"viewName:",{aString:aString},smalltalk.TrappedProcessorWidget)})},
  946. args: ["aString"],
  947. source: "viewName: aString\x0a\x09viewName := aString",
  948. messageSends: [],
  949. referencedClasses: []
  950. }),
  951. smalltalk.TrappedProcessorWidget);
  952. smalltalk.addMethod(
  953. smalltalk.method({
  954. selector: "new:",
  955. category: 'instance creation',
  956. fn: function (aString){
  957. var self=this;
  958. return smalltalk.withContext(function($ctx1) {
  959. var $2,$3,$1;
  960. $2=self._new();
  961. _st($2)._viewName_(aString);
  962. $3=_st($2)._yourself();
  963. $1=$3;
  964. return $1;
  965. }, function($ctx1) {$ctx1.fill(self,"new:",{aString:aString},smalltalk.TrappedProcessorWidget.klass)})},
  966. args: ["aString"],
  967. source: "new: aString\x0a\x09^self new\x0a\x09\x09viewName: aString;\x0a\x09\x09yourself",
  968. messageSends: ["viewName:", "new", "yourself"],
  969. referencedClasses: []
  970. }),
  971. smalltalk.TrappedProcessorWidget.klass);
  972. smalltalk.addClass('TrappedSingleton', smalltalk.Object, [], 'Trapped-Frontend');
  973. smalltalk.addMethod(
  974. smalltalk.method({
  975. selector: "start:",
  976. category: 'action',
  977. fn: function (args){
  978. var self=this;
  979. return smalltalk.withContext(function($ctx1) {
  980. var $1;
  981. $1=self._subclassResponsibility();
  982. return $1;
  983. }, function($ctx1) {$ctx1.fill(self,"start:",{args:args},smalltalk.TrappedSingleton)})},
  984. args: ["args"],
  985. source: "start: args\x0a\x09^ self subclassResponsibility",
  986. messageSends: ["subclassResponsibility"],
  987. referencedClasses: []
  988. }),
  989. smalltalk.TrappedSingleton);
  990. smalltalk.TrappedSingleton.klass.iVarNames = ['current'];
  991. smalltalk.addMethod(
  992. smalltalk.method({
  993. selector: "current",
  994. category: 'accessing',
  995. fn: function (){
  996. var self=this;
  997. return smalltalk.withContext(function($ctx1) {
  998. var $2,$1;
  999. $2=self["@current"];
  1000. if(($receiver = $2) == nil || $receiver == null){
  1001. self["@current"]=self._new();
  1002. $1=self["@current"];
  1003. } else {
  1004. $1=$2;
  1005. };
  1006. return $1;
  1007. }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.TrappedSingleton.klass)})},
  1008. args: [],
  1009. source: "current\x0a\x09^ current ifNil: [ current := self new ]",
  1010. messageSends: ["ifNil:", "new"],
  1011. referencedClasses: []
  1012. }),
  1013. smalltalk.TrappedSingleton.klass);
  1014. smalltalk.addMethod(
  1015. smalltalk.method({
  1016. selector: "start:",
  1017. category: 'action',
  1018. fn: function (args){
  1019. var self=this;
  1020. return smalltalk.withContext(function($ctx1) {
  1021. _st(self._current())._start_(args);
  1022. return self}, function($ctx1) {$ctx1.fill(self,"start:",{args:args},smalltalk.TrappedSingleton.klass)})},
  1023. args: ["args"],
  1024. source: "start: args\x0a\x09self current start: args",
  1025. messageSends: ["start:", "current"],
  1026. referencedClasses: []
  1027. }),
  1028. smalltalk.TrappedSingleton.klass);
  1029. smalltalk.addClass('Trapped', smalltalk.TrappedSingleton, ['registry'], 'Trapped-Frontend');
  1030. smalltalk.addMethod(
  1031. smalltalk.method({
  1032. selector: "byName:",
  1033. category: 'accessing',
  1034. fn: function (aString){
  1035. var self=this;
  1036. return smalltalk.withContext(function($ctx1) {
  1037. var $1;
  1038. $1=_st(self["@registry"])._at_(aString);
  1039. return $1;
  1040. }, function($ctx1) {$ctx1.fill(self,"byName:",{aString:aString},smalltalk.Trapped)})},
  1041. args: ["aString"],
  1042. source: "byName: aString\x0a\x09^ registry at: aString",
  1043. messageSends: ["at:"],
  1044. referencedClasses: []
  1045. }),
  1046. smalltalk.Trapped);
  1047. smalltalk.addMethod(
  1048. smalltalk.method({
  1049. selector: "descend:snapshotDo:",
  1050. category: 'action',
  1051. fn: function (anArray,aBlock){
  1052. var self=this;
  1053. var tpsc;
  1054. function $TrappedPathStack(){return smalltalk.TrappedPathStack||(typeof TrappedPathStack=="undefined"?nil:TrappedPathStack)}
  1055. function $TrappedSnapshot(){return smalltalk.TrappedSnapshot||(typeof TrappedSnapshot=="undefined"?nil:TrappedSnapshot)}
  1056. return smalltalk.withContext(function($ctx1) {
  1057. tpsc=_st($TrappedPathStack())._current();
  1058. _st(tpsc)._append_do_(anArray,(function(){
  1059. var path,model;
  1060. return smalltalk.withContext(function($ctx2) {
  1061. path=_st(_st(tpsc)._elements())._copy();
  1062. path;
  1063. model=self._byName_(_st(path)._first());
  1064. model;
  1065. return _st(aBlock)._value_(_st(_st($TrappedSnapshot())._new())._path_model_(path,model));
  1066. }, function($ctx2) {$ctx2.fillBlock({path:path,model:model},$ctx1,1)})}));
  1067. return self}, function($ctx1) {$ctx1.fill(self,"descend:snapshotDo:",{anArray:anArray,aBlock:aBlock,tpsc:tpsc},smalltalk.Trapped)})},
  1068. args: ["anArray", "aBlock"],
  1069. 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 ]",
  1070. messageSends: ["current", "append:do:", "copy", "elements", "byName:", "first", "value:", "path:model:", "new"],
  1071. referencedClasses: ["TrappedPathStack", "TrappedSnapshot"]
  1072. }),
  1073. smalltalk.Trapped);
  1074. smalltalk.addMethod(
  1075. smalltalk.method({
  1076. selector: "initialize",
  1077. category: 'initialization',
  1078. fn: function (){
  1079. var self=this;
  1080. return smalltalk.withContext(function($ctx1) {
  1081. smalltalk.Trapped.superclass.fn.prototype._initialize.apply(_st(self), []);
  1082. self["@registry"]=smalltalk.HashedCollection._from_([]);
  1083. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Trapped)})},
  1084. args: [],
  1085. source: "initialize\x0a\x09super initialize.\x0a\x09registry := #{}.",
  1086. messageSends: ["initialize"],
  1087. referencedClasses: []
  1088. }),
  1089. smalltalk.Trapped);
  1090. smalltalk.addMethod(
  1091. smalltalk.method({
  1092. selector: "injectToJQuery:",
  1093. category: 'action',
  1094. fn: function (aJQuery){
  1095. var self=this;
  1096. function $Trapped(){return smalltalk.Trapped||(typeof Trapped=="undefined"?nil:Trapped)}
  1097. function $HTMLCanvas(){return smalltalk.HTMLCanvas||(typeof HTMLCanvas=="undefined"?nil:HTMLCanvas)}
  1098. return smalltalk.withContext(function($ctx1) {
  1099. _st(_st(aJQuery)._find_("[data-trap]"))._each_((function(index,elem){
  1100. var jq,parsed;
  1101. return smalltalk.withContext(function($ctx2) {
  1102. jq=_st(elem)._asJQuery();
  1103. jq;
  1104. parsed=_st($Trapped())._parse_(_st(jq)._attr_("data-trap"));
  1105. parsed;
  1106. _st(parsed)._do_((function(rule){
  1107. return smalltalk.withContext(function($ctx3) {
  1108. return _st(_st(_st($HTMLCanvas())._onJQuery_(jq))._root())._trap_processors_(_st(rule)._first(),_st(rule)._at_ifAbsent_((2),(function(){
  1109. return smalltalk.withContext(function($ctx4) {
  1110. return [];
  1111. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,3)})})));
  1112. }, function($ctx3) {$ctx3.fillBlock({rule:rule},$ctx2,2)})}));
  1113. return _st(jq)._removeAttr_("data-trap");
  1114. }, function($ctx2) {$ctx2.fillBlock({index:index,elem:elem,jq:jq,parsed:parsed},$ctx1,1)})}));
  1115. return self}, function($ctx1) {$ctx1.fill(self,"injectToJQuery:",{aJQuery:aJQuery},smalltalk.Trapped)})},
  1116. args: ["aJQuery"],
  1117. source: "injectToJQuery: aJQuery\x0a\x09(aJQuery find: '[data-trap]') each: [ :index :elem |\x0a\x09\x09| jq parsed |\x0a\x09\x09jq := elem asJQuery.\x0a\x09\x09parsed := Trapped parse: (jq attr: 'data-trap').\x0a\x09\x09parsed do: [ :rule |\x0a\x09\x09\x09(HTMLCanvas onJQuery: jq) root trap: rule first processors: (rule at: 2 ifAbsent: [#()]) ].\x0a\x09\x09jq removeAttr: 'data-trap' ]",
  1118. messageSends: ["each:", "find:", "asJQuery", "parse:", "attr:", "do:", "trap:processors:", "root", "onJQuery:", "first", "at:ifAbsent:", "removeAttr:"],
  1119. referencedClasses: ["Trapped", "HTMLCanvas"]
  1120. }),
  1121. smalltalk.Trapped);
  1122. smalltalk.addMethod(
  1123. smalltalk.method({
  1124. selector: "register:",
  1125. category: 'accessing',
  1126. fn: function (aListKeyedEntity){
  1127. var self=this;
  1128. return smalltalk.withContext(function($ctx1) {
  1129. self._register_name_(aListKeyedEntity,_st(_st(aListKeyedEntity)._class())._name());
  1130. return self}, function($ctx1) {$ctx1.fill(self,"register:",{aListKeyedEntity:aListKeyedEntity},smalltalk.Trapped)})},
  1131. args: ["aListKeyedEntity"],
  1132. source: "register: aListKeyedEntity\x0a\x09self register: aListKeyedEntity name: aListKeyedEntity class name",
  1133. messageSends: ["register:name:", "name", "class"],
  1134. referencedClasses: []
  1135. }),
  1136. smalltalk.Trapped);
  1137. smalltalk.addMethod(
  1138. smalltalk.method({
  1139. selector: "register:name:",
  1140. category: 'accessing',
  1141. fn: function (aListKeyedEntity,aString){
  1142. var self=this;
  1143. return smalltalk.withContext(function($ctx1) {
  1144. _st(self["@registry"])._at_put_(aString,aListKeyedEntity);
  1145. return self}, function($ctx1) {$ctx1.fill(self,"register:name:",{aListKeyedEntity:aListKeyedEntity,aString:aString},smalltalk.Trapped)})},
  1146. args: ["aListKeyedEntity", "aString"],
  1147. source: "register: aListKeyedEntity name: aString\x0a\x09registry at: aString put: aListKeyedEntity",
  1148. messageSends: ["at:put:"],
  1149. referencedClasses: []
  1150. }),
  1151. smalltalk.Trapped);
  1152. smalltalk.addMethod(
  1153. smalltalk.method({
  1154. selector: "start:",
  1155. category: 'action',
  1156. fn: function (args){
  1157. var self=this;
  1158. return smalltalk.withContext(function($ctx1) {
  1159. _st(args)._do_((function(each){
  1160. return smalltalk.withContext(function($ctx2) {
  1161. return self._register_(each);
  1162. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  1163. self._injectToJQuery_("html"._asJQuery());
  1164. return self}, function($ctx1) {$ctx1.fill(self,"start:",{args:args},smalltalk.Trapped)})},
  1165. args: ["args"],
  1166. source: "start: args\x0a\x09args do: [ :each | self register: each ].\x0a\x09self injectToJQuery: 'html' asJQuery",
  1167. messageSends: ["do:", "register:", "injectToJQuery:", "asJQuery"],
  1168. referencedClasses: []
  1169. }),
  1170. smalltalk.Trapped);
  1171. smalltalk.addMethod(
  1172. smalltalk.method({
  1173. selector: "envelope:loop:before:tag:do:",
  1174. category: 'private',
  1175. fn: function (envelope,model,endjq,aSymbol,aBlock){
  1176. var self=this;
  1177. var envjq;
  1178. return smalltalk.withContext(function($ctx1) {
  1179. envjq=_st(envelope)._asJQuery();
  1180. _st(model)._withIndexDo_((function(item,i){
  1181. return smalltalk.withContext(function($ctx2) {
  1182. _st(envelope)._with_((function(html){
  1183. return smalltalk.withContext(function($ctx3) {
  1184. return _st(_st(html)._perform_(aSymbol))._trap_read_([i],aBlock);
  1185. }, function($ctx3) {$ctx3.fillBlock({html:html},$ctx2,2)})}));
  1186. return _st(_st(_st(envjq)._children())._detach())._insertBefore_(endjq);
  1187. }, function($ctx2) {$ctx2.fillBlock({item:item,i:i},$ctx1,1)})}));
  1188. _st(envjq)._remove();
  1189. 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)})},
  1190. args: ["envelope", "model", "endjq", "aSymbol", "aBlock"],
  1191. 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",
  1192. messageSends: ["asJQuery", "withIndexDo:", "with:", "trap:read:", "perform:", "insertBefore:", "detach", "children", "remove"],
  1193. referencedClasses: []
  1194. }),
  1195. smalltalk.Trapped.klass);
  1196. smalltalk.addMethod(
  1197. smalltalk.method({
  1198. selector: "loop:between:and:tag:do:",
  1199. category: 'private',
  1200. fn: function (model,start,end,aSymbol,aBlock){
  1201. var self=this;
  1202. return smalltalk.withContext(function($ctx1) {
  1203. var $2,$1;
  1204. $2=_st(start)._asJQuery();
  1205. $ctx1.sendIdx["asJQuery"]=1;
  1206. $1=_st($2)._nextUntil_(_st(end)._element());
  1207. _st($1)._remove();
  1208. _st(start)._with_((function(html){
  1209. return smalltalk.withContext(function($ctx2) {
  1210. if(($receiver = model) == nil || $receiver == null){
  1211. return model;
  1212. } else {
  1213. return self._envelope_loop_before_tag_do_(_st(html)._div(),model,_st(end)._asJQuery(),aSymbol,aBlock);
  1214. };
  1215. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  1216. 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)})},
  1217. args: ["model", "start", "end", "aSymbol", "aBlock"],
  1218. 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]]",
  1219. messageSends: ["remove", "nextUntil:", "asJQuery", "element", "with:", "ifNotNil:", "envelope:loop:before:tag:do:", "div"],
  1220. referencedClasses: []
  1221. }),
  1222. smalltalk.Trapped.klass);
  1223. smalltalk.addMethod(
  1224. smalltalk.method({
  1225. selector: "parse:",
  1226. category: 'accessing',
  1227. fn: function (aString){
  1228. var self=this;
  1229. return smalltalk.withContext(function($ctx1) {
  1230. var $2,$3,$4,$5,$7,$6,$8,$9,$10,$1;
  1231. $2=_st(aString)._tokenize_(".");
  1232. $ctx1.sendIdx["tokenize:"]=1;
  1233. $1=_st($2)._collect_((function(rule){
  1234. return smalltalk.withContext(function($ctx2) {
  1235. $3=_st(rule)._tokenize_(":");
  1236. $ctx2.sendIdx["tokenize:"]=2;
  1237. return _st($3)._collect_((function(message){
  1238. var result,stack,anArray;
  1239. return smalltalk.withContext(function($ctx3) {
  1240. anArray=_st(message)._tokenize_(" ");
  1241. anArray;
  1242. result=[];
  1243. result;
  1244. stack=[result];
  1245. stack;
  1246. _st(anArray)._do_((function(each){
  1247. var asNum,inner,close;
  1248. return smalltalk.withContext(function($ctx4) {
  1249. close=(0);
  1250. close;
  1251. inner=each;
  1252. inner;
  1253. _st((function(){
  1254. return smalltalk.withContext(function($ctx5) {
  1255. $4=_st(inner)._notEmpty();
  1256. $ctx5.sendIdx["notEmpty"]=1;
  1257. return _st($4)._and_((function(){
  1258. return smalltalk.withContext(function($ctx6) {
  1259. return _st(_st(inner)._first()).__eq("(");
  1260. $ctx6.sendIdx["="]=1;
  1261. }, function($ctx6) {$ctx6.fillBlock({},$ctx5,5)})}));
  1262. $ctx5.sendIdx["and:"]=1;
  1263. }, function($ctx5) {$ctx5.fillBlock({},$ctx4,4)})}))._whileTrue_((function(){
  1264. return smalltalk.withContext(function($ctx5) {
  1265. inner=_st(inner)._allButFirst();
  1266. inner;
  1267. $5=stack;
  1268. $7=_st(stack)._last();
  1269. $ctx5.sendIdx["last"]=1;
  1270. $6=_st($7)._add_([]);
  1271. $ctx5.sendIdx["add:"]=2;
  1272. return _st($5)._add_($6);
  1273. $ctx5.sendIdx["add:"]=1;
  1274. }, function($ctx5) {$ctx5.fillBlock({},$ctx4,6)})}));
  1275. $ctx4.sendIdx["whileTrue:"]=1;
  1276. _st((function(){
  1277. return smalltalk.withContext(function($ctx5) {
  1278. return _st(_st(inner)._notEmpty())._and_((function(){
  1279. return smalltalk.withContext(function($ctx6) {
  1280. $8=_st(inner)._last();
  1281. $ctx6.sendIdx["last"]=2;
  1282. return _st($8).__eq(")");
  1283. $ctx6.sendIdx["="]=2;
  1284. }, function($ctx6) {$ctx6.fillBlock({},$ctx5,8)})}));
  1285. }, function($ctx5) {$ctx5.fillBlock({},$ctx4,7)})}))._whileTrue_((function(){
  1286. return smalltalk.withContext(function($ctx5) {
  1287. inner=_st(inner)._allButLast();
  1288. inner;
  1289. close=_st(close).__plus((1));
  1290. return close;
  1291. }, function($ctx5) {$ctx5.fillBlock({},$ctx4,9)})}));
  1292. asNum=_st(_st(inner)._ifEmpty_((function(){
  1293. return smalltalk.withContext(function($ctx5) {
  1294. return "NaN";
  1295. }, function($ctx5) {$ctx5.fillBlock({},$ctx4,10)})})))._asNumber();
  1296. asNum;
  1297. $9=_st(asNum).__eq(asNum);
  1298. if(smalltalk.assert($9)){
  1299. $10=_st(stack)._last();
  1300. $ctx4.sendIdx["last"]=3;
  1301. _st($10)._add_(asNum);
  1302. $ctx4.sendIdx["add:"]=3;
  1303. } else {
  1304. _st(inner)._ifNotEmpty_((function(){
  1305. return smalltalk.withContext(function($ctx5) {
  1306. return _st(_st(stack)._last())._add_(inner);
  1307. }, function($ctx5) {$ctx5.fillBlock({},$ctx4,13)})}));
  1308. };
  1309. return _st(close)._timesRepeat_((function(){
  1310. return smalltalk.withContext(function($ctx5) {
  1311. return _st(stack)._removeLast();
  1312. }, function($ctx5) {$ctx5.fillBlock({},$ctx4,14)})}));
  1313. }, function($ctx4) {$ctx4.fillBlock({each:each,asNum:asNum,inner:inner,close:close},$ctx3,3)})}));
  1314. return result;
  1315. }, function($ctx3) {$ctx3.fillBlock({message:message,result:result,stack:stack,anArray:anArray},$ctx2,2)})}));
  1316. }, function($ctx2) {$ctx2.fillBlock({rule:rule},$ctx1,1)})}));
  1317. $ctx1.sendIdx["collect:"]=1;
  1318. return $1;
  1319. }, function($ctx1) {$ctx1.fill(self,"parse:",{aString:aString},smalltalk.Trapped.klass)})},
  1320. args: ["aString"],
  1321. source: "parse: aString\x0a\x09^ (aString tokenize: '.') collect: [ :rule |\x0a\x09\x09(rule tokenize: ':') collect: [ :message |\x0a\x09\x09\x09| result stack anArray |\x0a\x09\x09\x09anArray := message tokenize: ' '.\x0a\x09\x09\x09result := #().\x0a\x09\x09\x09stack := { result }.\x0a\x09\x09\x09anArray do: [ :each |\x0a \x09\x09\x09| asNum inner close |\x0a\x09\x09\x09\x09close := 0.\x0a\x09\x09\x09\x09inner := each.\x0a\x09\x09\x09\x09[ inner notEmpty and: [ inner first = '(' ]] whileTrue: [ inner := inner allButFirst. stack add: (stack last add: #()) ].\x0a\x09\x09\x09\x09[ inner notEmpty and: [ inner last = ')' ]] whileTrue: [ inner := inner allButLast. close := close + 1 ].\x0a\x09\x09 \x09asNum := (inner ifEmpty: [ 'NaN' ]) asNumber.\x0a \x09\x09asNum = asNum ifTrue: [ stack last add: asNum ] ifFalse: [\x0a\x09\x09\x09\x09\x09inner ifNotEmpty: [ stack last add: inner ] ].\x0a\x09\x09\x09\x09close timesRepeat: [ stack removeLast ] ].\x0a\x09\x09\x09result ] ]",
  1322. messageSends: ["collect:", "tokenize:", "do:", "whileTrue:", "and:", "notEmpty", "=", "first", "allButFirst", "add:", "last", "allButLast", "+", "asNumber", "ifEmpty:", "ifTrue:ifFalse:", "ifNotEmpty:", "timesRepeat:", "removeLast"],
  1323. referencedClasses: []
  1324. }),
  1325. smalltalk.Trapped.klass);
  1326. smalltalk.addClass('TrappedPathStack', smalltalk.TrappedSingleton, ['elements'], 'Trapped-Frontend');
  1327. smalltalk.addMethod(
  1328. smalltalk.method({
  1329. selector: "append:do:",
  1330. category: 'descending',
  1331. fn: function (anArray,aBlock){
  1332. var self=this;
  1333. return smalltalk.withContext(function($ctx1) {
  1334. self._with_do_(_st(self["@elements"]).__comma(anArray),aBlock);
  1335. return self}, function($ctx1) {$ctx1.fill(self,"append:do:",{anArray:anArray,aBlock:aBlock},smalltalk.TrappedPathStack)})},
  1336. args: ["anArray", "aBlock"],
  1337. source: "append: anArray do: aBlock\x0a self with: elements, anArray do: aBlock",
  1338. messageSends: ["with:do:", ","],
  1339. referencedClasses: []
  1340. }),
  1341. smalltalk.TrappedPathStack);
  1342. smalltalk.addMethod(
  1343. smalltalk.method({
  1344. selector: "elements",
  1345. category: 'accessing',
  1346. fn: function (){
  1347. var self=this;
  1348. return smalltalk.withContext(function($ctx1) {
  1349. var $1;
  1350. $1=self["@elements"];
  1351. return $1;
  1352. }, function($ctx1) {$ctx1.fill(self,"elements",{},smalltalk.TrappedPathStack)})},
  1353. args: [],
  1354. source: "elements\x0a\x09^elements",
  1355. messageSends: [],
  1356. referencedClasses: []
  1357. }),
  1358. smalltalk.TrappedPathStack);
  1359. smalltalk.addMethod(
  1360. smalltalk.method({
  1361. selector: "initialize",
  1362. category: 'initialization',
  1363. fn: function (){
  1364. var self=this;
  1365. return smalltalk.withContext(function($ctx1) {
  1366. smalltalk.TrappedPathStack.superclass.fn.prototype._initialize.apply(_st(self), []);
  1367. self["@elements"]=[];
  1368. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.TrappedPathStack)})},
  1369. args: [],
  1370. source: "initialize\x0a super initialize.\x0a\x09elements := #().",
  1371. messageSends: ["initialize"],
  1372. referencedClasses: []
  1373. }),
  1374. smalltalk.TrappedPathStack);
  1375. smalltalk.addMethod(
  1376. smalltalk.method({
  1377. selector: "with:do:",
  1378. category: 'descending',
  1379. fn: function (anArray,aBlock){
  1380. var self=this;
  1381. var old;
  1382. return smalltalk.withContext(function($ctx1) {
  1383. old=self["@elements"];
  1384. _st((function(){
  1385. return smalltalk.withContext(function($ctx2) {
  1386. self["@elements"]=anArray;
  1387. self["@elements"];
  1388. return _st(aBlock)._value();
  1389. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._ensure_((function(){
  1390. return smalltalk.withContext(function($ctx2) {
  1391. self["@elements"]=old;
  1392. return self["@elements"];
  1393. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1394. return self}, function($ctx1) {$ctx1.fill(self,"with:do:",{anArray:anArray,aBlock:aBlock,old:old},smalltalk.TrappedPathStack)})},
  1395. args: ["anArray", "aBlock"],
  1396. source: "with: anArray do: aBlock\x0a\x09| old |\x0a old := elements.\x0a [ elements := anArray.\x0a\x09aBlock value ] ensure: [ elements := old ]",
  1397. messageSends: ["ensure:", "value"],
  1398. referencedClasses: []
  1399. }),
  1400. smalltalk.TrappedPathStack);
  1401. smalltalk.addClass('TrappedSnapshot', smalltalk.Object, ['path', 'model'], 'Trapped-Frontend');
  1402. smalltalk.addMethod(
  1403. smalltalk.method({
  1404. selector: "do:",
  1405. category: 'action',
  1406. fn: function (aBlock){
  1407. var self=this;
  1408. function $TrappedPathStack(){return smalltalk.TrappedPathStack||(typeof TrappedPathStack=="undefined"?nil:TrappedPathStack)}
  1409. return smalltalk.withContext(function($ctx1) {
  1410. _st(_st($TrappedPathStack())._current())._with_do_(self["@path"],(function(){
  1411. return smalltalk.withContext(function($ctx2) {
  1412. return _st(aBlock)._value_(self["@model"]);
  1413. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1414. return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.TrappedSnapshot)})},
  1415. args: ["aBlock"],
  1416. source: "do: aBlock\x0a\x09TrappedPathStack current with: path do: [ aBlock value: model ]",
  1417. messageSends: ["with:do:", "current", "value:"],
  1418. referencedClasses: ["TrappedPathStack"]
  1419. }),
  1420. smalltalk.TrappedSnapshot);
  1421. smalltalk.addMethod(
  1422. smalltalk.method({
  1423. selector: "model",
  1424. category: 'accessing',
  1425. fn: function (){
  1426. var self=this;
  1427. return smalltalk.withContext(function($ctx1) {
  1428. var $1;
  1429. $1=self["@model"];
  1430. return $1;
  1431. }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.TrappedSnapshot)})},
  1432. args: [],
  1433. source: "model\x0a\x09^model",
  1434. messageSends: [],
  1435. referencedClasses: []
  1436. }),
  1437. smalltalk.TrappedSnapshot);
  1438. smalltalk.addMethod(
  1439. smalltalk.method({
  1440. selector: "modify:",
  1441. category: 'action',
  1442. fn: function (aBlock){
  1443. var self=this;
  1444. return smalltalk.withContext(function($ctx1) {
  1445. _st(self._model())._modify_do_(_st(self._path())._allButFirst(),aBlock);
  1446. return self}, function($ctx1) {$ctx1.fill(self,"modify:",{aBlock:aBlock},smalltalk.TrappedSnapshot)})},
  1447. args: ["aBlock"],
  1448. source: "modify: aBlock\x0a\x09self model modify: self path allButFirst do: aBlock",
  1449. messageSends: ["modify:do:", "model", "allButFirst", "path"],
  1450. referencedClasses: []
  1451. }),
  1452. smalltalk.TrappedSnapshot);
  1453. smalltalk.addMethod(
  1454. smalltalk.method({
  1455. selector: "path",
  1456. category: 'accessing',
  1457. fn: function (){
  1458. var self=this;
  1459. return smalltalk.withContext(function($ctx1) {
  1460. var $1;
  1461. $1=self["@path"];
  1462. return $1;
  1463. }, function($ctx1) {$ctx1.fill(self,"path",{},smalltalk.TrappedSnapshot)})},
  1464. args: [],
  1465. source: "path\x0a\x09^path",
  1466. messageSends: [],
  1467. referencedClasses: []
  1468. }),
  1469. smalltalk.TrappedSnapshot);
  1470. smalltalk.addMethod(
  1471. smalltalk.method({
  1472. selector: "path:model:",
  1473. category: 'accessing',
  1474. fn: function (anArray,aTrappedMW){
  1475. var self=this;
  1476. return smalltalk.withContext(function($ctx1) {
  1477. self["@path"]=anArray;
  1478. self["@model"]=aTrappedMW;
  1479. return self}, function($ctx1) {$ctx1.fill(self,"path:model:",{anArray:anArray,aTrappedMW:aTrappedMW},smalltalk.TrappedSnapshot)})},
  1480. args: ["anArray", "aTrappedMW"],
  1481. source: "path: anArray model: aTrappedMW\x0a\x09path := anArray.\x0a model := aTrappedMW",
  1482. messageSends: [],
  1483. referencedClasses: []
  1484. }),
  1485. smalltalk.TrappedSnapshot);
  1486. smalltalk.addMethod(
  1487. smalltalk.method({
  1488. selector: "watch:",
  1489. category: 'action',
  1490. fn: function (aBlock){
  1491. var self=this;
  1492. return smalltalk.withContext(function($ctx1) {
  1493. _st(self._model())._watch_do_(_st(self._path())._allButFirst(),aBlock);
  1494. return self}, function($ctx1) {$ctx1.fill(self,"watch:",{aBlock:aBlock},smalltalk.TrappedSnapshot)})},
  1495. args: ["aBlock"],
  1496. source: "watch: aBlock\x0a\x09self model watch: self path allButFirst do: aBlock",
  1497. messageSends: ["watch:do:", "model", "allButFirst", "path"],
  1498. referencedClasses: []
  1499. }),
  1500. smalltalk.TrappedSnapshot);
  1501. smalltalk.addMethod(
  1502. smalltalk.method({
  1503. selector: "trapDescend:",
  1504. category: '*Trapped-Frontend',
  1505. fn: function (aBlock){
  1506. var self=this;
  1507. function $Trapped(){return smalltalk.Trapped||(typeof Trapped=="undefined"?nil:Trapped)}
  1508. return smalltalk.withContext(function($ctx1) {
  1509. _st(_st($Trapped())._current())._descend_snapshotDo_(self,aBlock);
  1510. return self}, function($ctx1) {$ctx1.fill(self,"trapDescend:",{aBlock:aBlock},smalltalk.Array)})},
  1511. args: ["aBlock"],
  1512. source: "trapDescend: aBlock\x0a\x09Trapped current descend: self snapshotDo: aBlock",
  1513. messageSends: ["descend:snapshotDo:", "current"],
  1514. referencedClasses: ["Trapped"]
  1515. }),
  1516. smalltalk.Array);
  1517. smalltalk.addMethod(
  1518. smalltalk.method({
  1519. selector: "trapIter:tag:do:",
  1520. category: '*Trapped-Frontend',
  1521. fn: function (path,aSymbol,aBlock){
  1522. var self=this;
  1523. var start,end;
  1524. function $Trapped(){return smalltalk.Trapped||(typeof Trapped=="undefined"?nil:Trapped)}
  1525. return smalltalk.withContext(function($ctx1) {
  1526. self._with_((function(html){
  1527. return smalltalk.withContext(function($ctx2) {
  1528. start=_st(html)._script();
  1529. $ctx2.sendIdx["script"]=1;
  1530. start;
  1531. end=_st(html)._script();
  1532. return end;
  1533. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  1534. _st(start)._trap_read_(path,(function(model){
  1535. return smalltalk.withContext(function($ctx2) {
  1536. return _st($Trapped())._loop_between_and_tag_do_(model,start,end,aSymbol,aBlock);
  1537. }, function($ctx2) {$ctx2.fillBlock({model:model},$ctx1,2)})}));
  1538. return self}, function($ctx1) {$ctx1.fill(self,"trapIter:tag:do:",{path:path,aSymbol:aSymbol,aBlock:aBlock,start:start,end:end},smalltalk.HTMLCanvas)})},
  1539. args: ["path", "aSymbol", "aBlock"],
  1540. 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 ]",
  1541. messageSends: ["with:", "script", "trap:read:", "loop:between:and:tag:do:"],
  1542. referencedClasses: ["Trapped"]
  1543. }),
  1544. smalltalk.HTMLCanvas);
  1545. smalltalk.addMethod(
  1546. smalltalk.method({
  1547. selector: "trap:",
  1548. category: '*Trapped-Frontend',
  1549. fn: function (path){
  1550. var self=this;
  1551. return smalltalk.withContext(function($ctx1) {
  1552. self._trap_processors_(path,["contents"]);
  1553. return self}, function($ctx1) {$ctx1.fill(self,"trap:",{path:path},smalltalk.TagBrush)})},
  1554. args: ["path"],
  1555. source: "trap: path\x0a\x09self trap: path processors: #(contents)",
  1556. messageSends: ["trap:processors:"],
  1557. referencedClasses: []
  1558. }),
  1559. smalltalk.TagBrush);
  1560. smalltalk.addMethod(
  1561. smalltalk.method({
  1562. selector: "trap:processors:",
  1563. category: '*Trapped-Frontend',
  1564. fn: function (path,anArray){
  1565. var self=this;
  1566. function $TrappedDataChain(){return smalltalk.TrappedDataChain||(typeof TrappedDataChain=="undefined"?nil:TrappedDataChain)}
  1567. return smalltalk.withContext(function($ctx1) {
  1568. _st(path)._trapDescend_((function(snap){
  1569. return smalltalk.withContext(function($ctx2) {
  1570. return _st(_st($TrappedDataChain())._newFromProcessorSpecs_(anArray))._forSnapshot_andBrush_(snap,self);
  1571. }, function($ctx2) {$ctx2.fillBlock({snap:snap},$ctx1,1)})}));
  1572. return self}, function($ctx1) {$ctx1.fill(self,"trap:processors:",{path:path,anArray:anArray},smalltalk.TagBrush)})},
  1573. args: ["path", "anArray"],
  1574. source: "trap: path processors: anArray\x0a\x09path trapDescend: [ :snap |\x0a\x09\x09(TrappedDataChain newFromProcessorSpecs: anArray)\x0a\x09\x09\x09forSnapshot: snap andBrush: self ]",
  1575. messageSends: ["trapDescend:", "forSnapshot:andBrush:", "newFromProcessorSpecs:"],
  1576. referencedClasses: ["TrappedDataChain"]
  1577. }),
  1578. smalltalk.TagBrush);
  1579. smalltalk.addMethod(
  1580. smalltalk.method({
  1581. selector: "trap:read:",
  1582. category: '*Trapped-Frontend',
  1583. fn: function (path,aBlock){
  1584. var self=this;
  1585. function $KeyedPubSubUnsubscribe(){return smalltalk.KeyedPubSubUnsubscribe||(typeof KeyedPubSubUnsubscribe=="undefined"?nil:KeyedPubSubUnsubscribe)}
  1586. return smalltalk.withContext(function($ctx1) {
  1587. var $1;
  1588. _st(path)._trapDescend_((function(snap){
  1589. return smalltalk.withContext(function($ctx2) {
  1590. return _st(snap)._watch_((function(data){
  1591. return smalltalk.withContext(function($ctx3) {
  1592. $1=_st(_st(_st(self._asJQuery())._closest_("html"))._toArray())._isEmpty();
  1593. if(smalltalk.assert($1)){
  1594. _st($KeyedPubSubUnsubscribe())._signal();
  1595. };
  1596. return _st(snap)._do_((function(){
  1597. return smalltalk.withContext(function($ctx4) {
  1598. return self._with_((function(html){
  1599. return smalltalk.withContext(function($ctx5) {
  1600. return _st(aBlock)._value_value_(data,html);
  1601. }, function($ctx5) {$ctx5.fillBlock({html:html},$ctx4,5)})}));
  1602. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,4)})}));
  1603. }, function($ctx3) {$ctx3.fillBlock({data:data},$ctx2,2)})}));
  1604. }, function($ctx2) {$ctx2.fillBlock({snap:snap},$ctx1,1)})}));
  1605. return self}, function($ctx1) {$ctx1.fill(self,"trap:read:",{path:path,aBlock:aBlock},smalltalk.TagBrush)})},
  1606. args: ["path", "aBlock"],
  1607. source: "trap: path read: aBlock\x0a\x09path trapDescend: [ :snap |\x0a snap watch: [ :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 ]",
  1608. messageSends: ["trapDescend:", "watch:", "ifTrue:", "isEmpty", "toArray", "closest:", "asJQuery", "signal", "do:", "with:", "value:value:"],
  1609. referencedClasses: ["KeyedPubSubUnsubscribe"]
  1610. }),
  1611. smalltalk.TagBrush);
  1612. smalltalk.addMethod(
  1613. smalltalk.method({
  1614. selector: "trapGuard:contents:",
  1615. category: '*Trapped-Frontend',
  1616. fn: function (anArray,aBlock){
  1617. var self=this;
  1618. return smalltalk.withContext(function($ctx1) {
  1619. var $1,$2,$3,$4,$5;
  1620. []._trapDescend_((function(snap){
  1621. var shown;
  1622. return smalltalk.withContext(function($ctx2) {
  1623. shown=nil;
  1624. shown;
  1625. return self._trap_read_(anArray,(function(gdata){
  1626. var sanitized;
  1627. return smalltalk.withContext(function($ctx3) {
  1628. if(($receiver = gdata) == nil || $receiver == null){
  1629. sanitized=false;
  1630. } else {
  1631. sanitized=gdata;
  1632. };
  1633. sanitized;
  1634. $1=_st(shown).__eq(sanitized);
  1635. if(! smalltalk.assert($1)){
  1636. shown=sanitized;
  1637. shown;
  1638. $2=shown;
  1639. if(smalltalk.assert($2)){
  1640. _st(snap)._do_((function(){
  1641. return smalltalk.withContext(function($ctx4) {
  1642. return self._contents_(aBlock);
  1643. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,6)})}));
  1644. $3=self._asJQuery();
  1645. $ctx3.sendIdx["asJQuery"]=1;
  1646. return _st($3)._show();
  1647. } else {
  1648. $4=self._asJQuery();
  1649. _st($4)._hide();
  1650. $5=_st($4)._empty();
  1651. return $5;
  1652. };
  1653. };
  1654. }, function($ctx3) {$ctx3.fillBlock({gdata:gdata,sanitized:sanitized},$ctx2,2)})}));
  1655. }, function($ctx2) {$ctx2.fillBlock({snap:snap,shown:shown},$ctx1,1)})}));
  1656. return self}, function($ctx1) {$ctx1.fill(self,"trapGuard:contents:",{anArray:anArray,aBlock:aBlock},smalltalk.TagBrush)})},
  1657. args: ["anArray", "aBlock"],
  1658. source: "trapGuard: anArray contents: aBlock\x0a\x09#() trapDescend: [ :snap |\x0a\x09 | shown |\x0a \x09shown := nil.\x0a\x09 self trap: anArray read: [ :gdata |\x0a\x09\x09\x09| sanitized |\x0a\x09\x09\x09sanitized := gdata ifNil: [ false ].\x0a \x09 shown = sanitized ifFalse: [\x0a \x09 shown := sanitized.\x0a \x09shown\x0a\x09\x09\x09\x09\x09ifTrue: [ snap do: [ self contents: aBlock ]. self asJQuery show ]\x0a\x09\x09\x09\x09\x09ifFalse: [ self asJQuery hide; empty ] ] ] ]",
  1659. messageSends: ["trapDescend:", "trap:read:", "ifNil:", "ifFalse:", "=", "ifTrue:ifFalse:", "do:", "contents:", "show", "asJQuery", "hide", "empty"],
  1660. referencedClasses: []
  1661. }),
  1662. smalltalk.TagBrush);
  1663. });