Trapped-Processors.js 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195
  1. define("gh_herby_trapped/Trapped-Processors", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "gh_herby_trapped/Trapped-Frontend"], function(smalltalk,nil,_st){
  2. smalltalk.addPackage('Trapped-Processors');
  3. smalltalk.packages["Trapped-Processors"].transport = {"type":"amd","amdNamespace":"gh_herby_trapped"};
  4. smalltalk.addClass('TrappedProcessorAttribute', smalltalk.TrappedDataExpectingProcessor, ['attrName'], 'Trapped-Processors');
  5. smalltalk.TrappedProcessorAttribute.comment="I set the data into an attribute speciried when creating me.\x0aNo observing and sending back, atm.";
  6. smalltalk.addMethod(
  7. smalltalk.method({
  8. selector: "attrName:",
  9. category: 'accessing',
  10. fn: function (aString){
  11. var self=this;
  12. return smalltalk.withContext(function($ctx1) {
  13. self["@attrName"]=aString;
  14. return self}, function($ctx1) {$ctx1.fill(self,"attrName:",{aString:aString},smalltalk.TrappedProcessorAttribute)})},
  15. args: ["aString"],
  16. source: "attrName: aString\x0a\x09attrName := aString",
  17. messageSends: [],
  18. referencedClasses: []
  19. }),
  20. smalltalk.TrappedProcessorAttribute);
  21. smalltalk.addMethod(
  22. smalltalk.method({
  23. selector: "toView:",
  24. category: 'data transformation',
  25. fn: function (aDataCarrier){
  26. var self=this;
  27. return smalltalk.withContext(function($ctx1) {
  28. _st(aDataCarrier)._toTargetAttr_(self["@attrName"]);
  29. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorAttribute)})},
  30. args: ["aDataCarrier"],
  31. source: "toView: aDataCarrier\x0a\x09aDataCarrier toTargetAttr: attrName",
  32. messageSends: ["toTargetAttr:"],
  33. referencedClasses: []
  34. }),
  35. smalltalk.TrappedProcessorAttribute);
  36. smalltalk.addMethod(
  37. smalltalk.method({
  38. selector: "new:",
  39. category: 'instance creation',
  40. fn: function (aString){
  41. var self=this;
  42. return smalltalk.withContext(function($ctx1) {
  43. var $2,$3,$1;
  44. $2=self._new();
  45. _st($2)._attrName_(aString);
  46. $3=_st($2)._yourself();
  47. $1=$3;
  48. return $1;
  49. }, function($ctx1) {$ctx1.fill(self,"new:",{aString:aString},smalltalk.TrappedProcessorAttribute.klass)})},
  50. args: ["aString"],
  51. source: "new: aString\x0a\x09^self new\x0a\x09\x09attrName: aString;\x0a\x09\x09yourself",
  52. messageSends: ["attrName:", "new", "yourself"],
  53. referencedClasses: []
  54. }),
  55. smalltalk.TrappedProcessorAttribute.klass);
  56. smalltalk.addClass('TrappedProcessorDataAdhoc', smalltalk.TrappedDataExpectingProcessor, ['toViewBlock'], 'Trapped-Processors');
  57. smalltalk.TrappedProcessorDataAdhoc.comment="I put data into target via contents: in toView:";
  58. smalltalk.addMethod(
  59. smalltalk.method({
  60. selector: "toView:",
  61. category: 'data transformation',
  62. fn: function (aDataCarrier){
  63. var self=this;
  64. return smalltalk.withContext(function($ctx1) {
  65. _st(self["@toViewBlock"])._value_(aDataCarrier);
  66. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorDataAdhoc)})},
  67. args: ["aDataCarrier"],
  68. source: "toView: aDataCarrier\x0a\x09toViewBlock value: aDataCarrier",
  69. messageSends: ["value:"],
  70. referencedClasses: []
  71. }),
  72. smalltalk.TrappedProcessorDataAdhoc);
  73. smalltalk.addMethod(
  74. smalltalk.method({
  75. selector: "toViewBlock:",
  76. category: 'accessing',
  77. fn: function (aBlock){
  78. var self=this;
  79. return smalltalk.withContext(function($ctx1) {
  80. self["@toViewBlock"]=aBlock;
  81. return self}, function($ctx1) {$ctx1.fill(self,"toViewBlock:",{aBlock:aBlock},smalltalk.TrappedProcessorDataAdhoc)})},
  82. args: ["aBlock"],
  83. source: "toViewBlock: aBlock\x0a\x09toViewBlock := aBlock",
  84. messageSends: [],
  85. referencedClasses: []
  86. }),
  87. smalltalk.TrappedProcessorDataAdhoc);
  88. smalltalk.addMethod(
  89. smalltalk.method({
  90. selector: "newToView:",
  91. category: 'instance creation',
  92. fn: function (aBlock){
  93. var self=this;
  94. return smalltalk.withContext(function($ctx1) {
  95. var $2,$3,$1;
  96. $2=self._new();
  97. _st($2)._toViewBlock_(aBlock);
  98. $3=_st($2)._yourself();
  99. $1=$3;
  100. return $1;
  101. }, function($ctx1) {$ctx1.fill(self,"newToView:",{aBlock:aBlock},smalltalk.TrappedProcessorDataAdhoc.klass)})},
  102. args: ["aBlock"],
  103. source: "newToView: aBlock\x0a\x09^self new\x0a\x09\x09toViewBlock: aBlock;\x0a\x09\x09yourself",
  104. messageSends: ["toViewBlock:", "new", "yourself"],
  105. referencedClasses: []
  106. }),
  107. smalltalk.TrappedProcessorDataAdhoc.klass);
  108. smalltalk.addClass('TrappedProcessorDescend', smalltalk.TrappedProcessor, [], 'Trapped-Processors');
  109. smalltalk.TrappedProcessorDescend.comment="I intepret data-trap in descendants of my brush.";
  110. smalltalk.addMethod(
  111. smalltalk.method({
  112. selector: "toView:",
  113. category: 'data transformation',
  114. fn: function (aDataCarrier){
  115. var self=this;
  116. function $Trapped(){return smalltalk.Trapped||(typeof Trapped=="undefined"?nil:Trapped)}
  117. return smalltalk.withContext(function($ctx1) {
  118. _st(_st($Trapped())._current())._injectToJQuery_(_st(_st(_st(aDataCarrier)._target())._asJQuery())._children());
  119. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorDescend)})},
  120. args: ["aDataCarrier"],
  121. source: "toView: aDataCarrier\x0a\x09Trapped current injectToJQuery: aDataCarrier target asJQuery children",
  122. messageSends: ["injectToJQuery:", "current", "children", "asJQuery", "target"],
  123. referencedClasses: ["Trapped"]
  124. }),
  125. smalltalk.TrappedProcessorDescend);
  126. smalltalk.addClass('TrappedProcessorGuardBase', smalltalk.TrappedProcessor, ['guardPath'], 'Trapped-Processors');
  127. smalltalk.TrappedProcessorGuardBase.comment="I serve as base class for brush-guarding processors.\x0a\x0aI cover instantiation and subclasses have to provide\x0aimplementation of toVIew: that react appropriately to guard releasing.";
  128. smalltalk.addMethod(
  129. smalltalk.method({
  130. selector: "guardPath:",
  131. category: 'accessing',
  132. fn: function (anArray){
  133. var self=this;
  134. return smalltalk.withContext(function($ctx1) {
  135. self["@guardPath"]=anArray;
  136. return self}, function($ctx1) {$ctx1.fill(self,"guardPath:",{anArray:anArray},smalltalk.TrappedProcessorGuardBase)})},
  137. args: ["anArray"],
  138. source: "guardPath: anArray\x0a\x09guardPath := anArray",
  139. messageSends: [],
  140. referencedClasses: []
  141. }),
  142. smalltalk.TrappedProcessorGuardBase);
  143. smalltalk.addMethod(
  144. smalltalk.method({
  145. selector: "toModel:",
  146. category: 'data transformation',
  147. fn: function (aDataCarrier){
  148. var self=this;
  149. return smalltalk.withContext(function($ctx1) {
  150. return self}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorGuardBase)})},
  151. args: ["aDataCarrier"],
  152. source: "toModel: aDataCarrier\x0a\x09\x22stop\x22",
  153. messageSends: [],
  154. referencedClasses: []
  155. }),
  156. smalltalk.TrappedProcessorGuardBase);
  157. smalltalk.addMethod(
  158. smalltalk.method({
  159. selector: "toView:",
  160. category: 'data transformation',
  161. fn: function (aDataCarrier){
  162. var self=this;
  163. return smalltalk.withContext(function($ctx1) {
  164. self._subclassResponsibility();
  165. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorGuardBase)})},
  166. args: ["aDataCarrier"],
  167. source: "toView: aDataCarrier\x0a\x09self subclassResponsibility",
  168. messageSends: ["subclassResponsibility"],
  169. referencedClasses: []
  170. }),
  171. smalltalk.TrappedProcessorGuardBase);
  172. smalltalk.addMethod(
  173. smalltalk.method({
  174. selector: "new:",
  175. category: 'instance creation',
  176. fn: function (anArray){
  177. var self=this;
  178. return smalltalk.withContext(function($ctx1) {
  179. var $2,$3,$1;
  180. $2=self._new();
  181. _st($2)._guardPath_(anArray);
  182. $3=_st($2)._yourself();
  183. $1=$3;
  184. return $1;
  185. }, function($ctx1) {$ctx1.fill(self,"new:",{anArray:anArray},smalltalk.TrappedProcessorGuardBase.klass)})},
  186. args: ["anArray"],
  187. source: "new: anArray\x0a\x09^ self new\x0a\x09\x09guardPath: anArray;\x0a\x09\x09yourself",
  188. messageSends: ["guardPath:", "new", "yourself"],
  189. referencedClasses: []
  190. }),
  191. smalltalk.TrappedProcessorGuardBase.klass);
  192. smalltalk.addClass('TrappedProcessorGuardContents', smalltalk.TrappedProcessorGuardBase, [], 'Trapped-Processors');
  193. smalltalk.TrappedProcessorGuardContents.comment="I am used to guard contents of the brush I am installed on.\x0a\x0aI save the brush contents, then I observe guard expression in the model,\x0aand when it changes to nil or false, I delete the brush contents;\x0aon the other hand, when it changes to non-nil and non-false,\x0aI restore it from remembered state and interpret all contained\x0adata-trap attributes inside.";
  194. smalltalk.addMethod(
  195. smalltalk.method({
  196. selector: "toView:",
  197. category: 'data transformation',
  198. fn: function (aDataCarrier){
  199. var self=this;
  200. var frozen,contents;
  201. function $Trapped(){return smalltalk.Trapped||(typeof Trapped=="undefined"?nil:Trapped)}
  202. return smalltalk.withContext(function($ctx1) {
  203. var $3,$2,$1,$5,$4;
  204. frozen=_st(aDataCarrier)._copy();
  205. $3=_st(frozen)._target();
  206. $ctx1.sendIdx["target"]=1;
  207. $2=_st($3)._asJQuery();
  208. $ctx1.sendIdx["asJQuery"]=1;
  209. $1=_st($2)._contents();
  210. contents=_st($1)._detach();
  211. _st(_st(frozen)._target())._trapGuard_contents_(self["@guardPath"],(function(html){
  212. return smalltalk.withContext(function($ctx2) {
  213. $5=_st(html)._root();
  214. $ctx2.sendIdx["root"]=1;
  215. $4=_st($5)._asJQuery();
  216. $ctx2.sendIdx["asJQuery"]=2;
  217. _st($4)._append_(contents);
  218. return _st(_st($Trapped())._current())._injectToJQuery_(_st(_st(html)._root())._asJQuery());
  219. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  220. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier,frozen:frozen,contents:contents},smalltalk.TrappedProcessorGuardContents)})},
  221. args: ["aDataCarrier"],
  222. source: "toView: aDataCarrier\x0a\x09| frozen contents |\x0a\x09frozen := aDataCarrier copy.\x0a\x09contents := frozen target asJQuery contents detach.\x0a\x09frozen target trapGuard: guardPath contents: [ :html |\x0a\x09\x09html root asJQuery append: contents.\x0a\x09\x09Trapped current injectToJQuery: html root asJQuery ]",
  223. messageSends: ["copy", "detach", "contents", "asJQuery", "target", "trapGuard:contents:", "append:", "root", "injectToJQuery:", "current"],
  224. referencedClasses: ["Trapped"]
  225. }),
  226. smalltalk.TrappedProcessorGuardContents);
  227. smalltalk.addClass('TrappedProcessorGuardProc', smalltalk.TrappedProcessorGuardBase, [], 'Trapped-Processors');
  228. smalltalk.TrappedProcessorGuardProc.comment="I am used to guard contents filling process of the brush I am installed on.\x0a\x0aI observe guard expression in the model,\x0aand when it changes to nil or false, I delete the brush contents;\x0aon the other hand, when it changes to non-nil and non-false,\x0aI run the rest on the chain, which should be one-time\x0athat sets up the contents,";
  229. smalltalk.addMethod(
  230. smalltalk.method({
  231. selector: "toView:",
  232. category: 'data transformation',
  233. fn: function (aDataCarrier){
  234. var self=this;
  235. var frozen;
  236. return smalltalk.withContext(function($ctx1) {
  237. frozen=_st(aDataCarrier)._copy();
  238. $ctx1.sendIdx["copy"]=1;
  239. _st(_st(frozen)._target())._trapGuard_contents_(self["@guardPath"],(function(){
  240. return smalltalk.withContext(function($ctx2) {
  241. return _st(_st(frozen)._copy())._proceed();
  242. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  243. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier,frozen:frozen},smalltalk.TrappedProcessorGuardProc)})},
  244. args: ["aDataCarrier"],
  245. source: "toView: aDataCarrier\x0a\x09| frozen |\x0a\x09frozen := aDataCarrier copy.\x0a\x09frozen target trapGuard: guardPath contents: [ frozen copy proceed ]",
  246. messageSends: ["copy", "trapGuard:contents:", "target", "proceed"],
  247. referencedClasses: []
  248. }),
  249. smalltalk.TrappedProcessorGuardProc);
  250. smalltalk.addClass('TrappedProcessorInputChecked', smalltalk.TrappedDataExpectingProcessor, [], 'Trapped-Processors');
  251. smalltalk.TrappedProcessorInputChecked.comment="I bind to checkbox checked attribute.";
  252. smalltalk.addMethod(
  253. smalltalk.method({
  254. selector: "installToView:toModel:",
  255. category: 'installation',
  256. fn: function (aDataCarrier,anotherDataCarrier){
  257. var self=this;
  258. var brush;
  259. return smalltalk.withContext(function($ctx1) {
  260. var $1,$2;
  261. brush=_st(aDataCarrier)._target();
  262. _st(brush)._onChange_((function(){
  263. return smalltalk.withContext(function($ctx2) {
  264. $1=_st(anotherDataCarrier)._copy();
  265. _st($1)._value_(_st(_st(_st(brush)._asJQuery())._attr_("checked"))._notNil());
  266. $2=_st($1)._proceed();
  267. return $2;
  268. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  269. return self}, function($ctx1) {$ctx1.fill(self,"installToView:toModel:",{aDataCarrier:aDataCarrier,anotherDataCarrier:anotherDataCarrier,brush:brush},smalltalk.TrappedProcessorInputChecked)})},
  270. args: ["aDataCarrier", "anotherDataCarrier"],
  271. source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09| brush |\x0a\x09brush := aDataCarrier target.\x0a\x09brush onChange: [ anotherDataCarrier copy value: (brush asJQuery attr: 'checked') notNil; proceed ]",
  272. messageSends: ["target", "onChange:", "value:", "copy", "notNil", "attr:", "asJQuery", "proceed"],
  273. referencedClasses: []
  274. }),
  275. smalltalk.TrappedProcessorInputChecked);
  276. smalltalk.addMethod(
  277. smalltalk.method({
  278. selector: "toView:",
  279. category: 'data transformation',
  280. fn: function (aDataCarrier){
  281. var self=this;
  282. return smalltalk.withContext(function($ctx1) {
  283. _st(aDataCarrier)._toTargetAttr_("checked");
  284. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorInputChecked)})},
  285. args: ["aDataCarrier"],
  286. source: "toView: aDataCarrier\x0a\x09aDataCarrier toTargetAttr: 'checked'",
  287. messageSends: ["toTargetAttr:"],
  288. referencedClasses: []
  289. }),
  290. smalltalk.TrappedProcessorInputChecked);
  291. smalltalk.addClass('TrappedProcessorInputValue', smalltalk.TrappedDataExpectingProcessor, [], 'Trapped-Processors');
  292. smalltalk.TrappedProcessorInputValue.comment="I bind to input value.";
  293. smalltalk.addMethod(
  294. smalltalk.method({
  295. selector: "installToView:toModel:",
  296. category: 'installation',
  297. fn: function (aDataCarrier,anotherDataCarrier){
  298. var self=this;
  299. var brush;
  300. return smalltalk.withContext(function($ctx1) {
  301. var $1,$2;
  302. brush=_st(aDataCarrier)._target();
  303. _st(brush)._onChange_((function(){
  304. return smalltalk.withContext(function($ctx2) {
  305. $1=_st(anotherDataCarrier)._copy();
  306. _st($1)._value_(_st(_st(brush)._asJQuery())._val());
  307. $2=_st($1)._proceed();
  308. return $2;
  309. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  310. return self}, function($ctx1) {$ctx1.fill(self,"installToView:toModel:",{aDataCarrier:aDataCarrier,anotherDataCarrier:anotherDataCarrier,brush:brush},smalltalk.TrappedProcessorInputValue)})},
  311. args: ["aDataCarrier", "anotherDataCarrier"],
  312. source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09| brush |\x0a\x09brush := aDataCarrier target.\x0a\x09brush onChange: [ anotherDataCarrier copy value: brush asJQuery val; proceed ]",
  313. messageSends: ["target", "onChange:", "value:", "copy", "val", "asJQuery", "proceed"],
  314. referencedClasses: []
  315. }),
  316. smalltalk.TrappedProcessorInputValue);
  317. smalltalk.addMethod(
  318. smalltalk.method({
  319. selector: "toView:",
  320. category: 'data transformation',
  321. fn: function (aDataCarrier){
  322. var self=this;
  323. return smalltalk.withContext(function($ctx1) {
  324. _st(aDataCarrier)._toTargetValue();
  325. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorInputValue)})},
  326. args: ["aDataCarrier"],
  327. source: "toView: aDataCarrier\x0a\x09aDataCarrier toTargetValue",
  328. messageSends: ["toTargetValue"],
  329. referencedClasses: []
  330. }),
  331. smalltalk.TrappedProcessorInputValue);
  332. smalltalk.addClass('TrappedProcessorLoopBase', smalltalk.TrappedProcessor, [], 'Trapped-Processors');
  333. smalltalk.TrappedProcessorLoopBase.comment="I serve as base class for looping processors.\x0a\x0aI cover instantiation and subclasses have to provide\x0aimplementation of toVIew: that loops appropriately.";
  334. smalltalk.addMethod(
  335. smalltalk.method({
  336. selector: "toModel:",
  337. category: 'data transformation',
  338. fn: function (aDataCarrier){
  339. var self=this;
  340. return smalltalk.withContext(function($ctx1) {
  341. return self}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorLoopBase)})},
  342. args: ["aDataCarrier"],
  343. source: "toModel: aDataCarrier\x0a\x09\x22stop\x22",
  344. messageSends: [],
  345. referencedClasses: []
  346. }),
  347. smalltalk.TrappedProcessorLoopBase);
  348. smalltalk.addMethod(
  349. smalltalk.method({
  350. selector: "toView:",
  351. category: 'data transformation',
  352. fn: function (aDataCarrier){
  353. var self=this;
  354. return smalltalk.withContext(function($ctx1) {
  355. self._subclassResponsibility();
  356. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorLoopBase)})},
  357. args: ["aDataCarrier"],
  358. source: "toView: aDataCarrier\x0a\x09self subclassResponsibility",
  359. messageSends: ["subclassResponsibility"],
  360. referencedClasses: []
  361. }),
  362. smalltalk.TrappedProcessorLoopBase);
  363. smalltalk.addClass('TrappedProcessorLoopContents', smalltalk.TrappedProcessorLoopBase, [], 'Trapped-Processors');
  364. smalltalk.TrappedProcessorLoopContents.comment="I am used to loop over data and repeat the contents\x0aof the brush I am installed on.\x0a\x0aI save the brush contents, then I observe the data in the model,\x0aand when it changes, I loop over it\x0aand restore the contents from remembered state\x0aand interpret all contained data-trap attributes inside\x0afor each element, putting the result _after_ my brush.\x0a\x0aMy brush itself should be as least visible as possible,\x0aas it only serve as a position flag (use for example\x0anoscript, ins or del).";
  365. smalltalk.addMethod(
  366. smalltalk.method({
  367. selector: "toView:",
  368. category: 'data transformation',
  369. fn: function (aDataCarrier){
  370. var self=this;
  371. var frozen,contents,tag;
  372. function $Trapped(){return smalltalk.Trapped||(typeof Trapped=="undefined"?nil:Trapped)}
  373. return smalltalk.withContext(function($ctx1) {
  374. var $3,$2,$1,$4,$7,$6,$5,$10,$9,$8,$12,$11;
  375. frozen=_st(aDataCarrier)._copy();
  376. $3=_st(frozen)._target();
  377. $ctx1.sendIdx["target"]=1;
  378. $2=_st($3)._element();
  379. $ctx1.sendIdx["element"]=1;
  380. $1=_st($2)._at_("tagName");
  381. tag=_st($1)._asLowercase();
  382. $4=_st(tag).__eq("template");
  383. if(smalltalk.assert($4)){
  384. $7=_st(frozen)._target();
  385. $ctx1.sendIdx["target"]=2;
  386. $6=_st($7)._element();
  387. $5=_st($6)._content();
  388. contents=_st($5)._asJQuery();
  389. $ctx1.sendIdx["asJQuery"]=1;
  390. } else {
  391. $10=_st(frozen)._target();
  392. $ctx1.sendIdx["target"]=3;
  393. $9=_st($10)._asJQuery();
  394. $ctx1.sendIdx["asJQuery"]=2;
  395. $8=_st($9)._contents();
  396. contents=_st($8)._detach();
  397. };
  398. _st(_st(frozen)._target())._trapIter_after_([],(function(html){
  399. return smalltalk.withContext(function($ctx2) {
  400. $12=_st(html)._root();
  401. $ctx2.sendIdx["root"]=1;
  402. $11=_st($12)._asJQuery();
  403. $ctx2.sendIdx["asJQuery"]=3;
  404. _st($11)._append_(_st(contents)._clone());
  405. return _st(_st($Trapped())._current())._injectToJQuery_(_st(_st(html)._root())._asJQuery());
  406. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,3)})}));
  407. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier,frozen:frozen,contents:contents,tag:tag},smalltalk.TrappedProcessorLoopContents)})},
  408. args: ["aDataCarrier"],
  409. source: "toView: aDataCarrier\x0a\x09| frozen contents tag |\x0a\x09frozen := aDataCarrier copy.\x0a\x09tag := (frozen target element at: 'tagName') asLowercase.\x0a\x09contents := tag = 'template'\x0a\x09\x09ifTrue: [ frozen target element content asJQuery ]\x0a\x09\x09ifFalse: [ frozen target asJQuery contents detach ].\x0a\x09frozen target trapIter: #() after: [ :html |\x0a\x09\x09html root asJQuery append: contents clone.\x0a\x09\x09Trapped current injectToJQuery: html root asJQuery ]",
  410. messageSends: ["copy", "asLowercase", "at:", "element", "target", "ifTrue:ifFalse:", "=", "asJQuery", "content", "detach", "contents", "trapIter:after:", "append:", "root", "clone", "injectToJQuery:", "current"],
  411. referencedClasses: ["Trapped"]
  412. }),
  413. smalltalk.TrappedProcessorLoopContents);
  414. smalltalk.addClass('TrappedProcessorLoopProc', smalltalk.TrappedProcessorLoopBase, [], 'Trapped-Processors');
  415. smalltalk.TrappedProcessorLoopProc.comment="I am used to loop over data and repeat the contents filling process\x0aof the brush I am installed on.\x0a\x0aI observe the data in the model,\x0aand when it changes, I loop over it\x0aand run the rest of the processing chain\x0afor each element, putting the result _after_ my brush.\x0a\x0aMy brush itself should be as least visible as possible,\x0aas it only serve as a position flag (use for example\x0anoscript, ins or del).";
  416. smalltalk.addMethod(
  417. smalltalk.method({
  418. selector: "toView:",
  419. category: 'data transformation',
  420. fn: function (aDataCarrier){
  421. var self=this;
  422. var frozen;
  423. return smalltalk.withContext(function($ctx1) {
  424. var $1,$2;
  425. frozen=_st(aDataCarrier)._copy();
  426. $ctx1.sendIdx["copy"]=1;
  427. _st(_st(frozen)._target())._trapIter_after_([],(function(html){
  428. return smalltalk.withContext(function($ctx2) {
  429. $1=_st(frozen)._copy();
  430. _st($1)._target_(_st(html)._root());
  431. $2=_st($1)._proceed();
  432. return $2;
  433. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  434. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier,frozen:frozen},smalltalk.TrappedProcessorLoopProc)})},
  435. args: ["aDataCarrier"],
  436. source: "toView: aDataCarrier\x0a\x09| frozen |\x0a\x09frozen := aDataCarrier copy.\x0a\x09frozen target trapIter: #() after: [ :html | frozen copy target: html root; proceed ]",
  437. messageSends: ["copy", "trapIter:after:", "target", "target:", "root", "proceed"],
  438. referencedClasses: []
  439. }),
  440. smalltalk.TrappedProcessorLoopProc);
  441. smalltalk.addClass('TrappedProcessorReplace', smalltalk.TrappedProcessor, ['left', 'right'], 'Trapped-Processors');
  442. smalltalk.TrappedProcessorReplace.comment="I convert data to string representation and do a regex replace.\x0aI get two parameters, in toView:, first is replaced with second,\x0aand in toModel:, the second is replaced with first.\x0a\x0aI remove leading '^' and ending '$' from the string used as replacement,\x0aso it safe to replace ^to with ^To, for example.\x0a";
  443. smalltalk.addMethod(
  444. smalltalk.method({
  445. selector: "left:",
  446. category: 'accessing',
  447. fn: function (aString){
  448. var self=this;
  449. return smalltalk.withContext(function($ctx1) {
  450. self["@left"]=aString;
  451. return self}, function($ctx1) {$ctx1.fill(self,"left:",{aString:aString},smalltalk.TrappedProcessorReplace)})},
  452. args: ["aString"],
  453. source: "left: aString\x0a\x09left := aString",
  454. messageSends: [],
  455. referencedClasses: []
  456. }),
  457. smalltalk.TrappedProcessorReplace);
  458. smalltalk.addMethod(
  459. smalltalk.method({
  460. selector: "right:",
  461. category: 'accessing',
  462. fn: function (aString){
  463. var self=this;
  464. return smalltalk.withContext(function($ctx1) {
  465. self["@right"]=aString;
  466. return self}, function($ctx1) {$ctx1.fill(self,"right:",{aString:aString},smalltalk.TrappedProcessorReplace)})},
  467. args: ["aString"],
  468. source: "right: aString\x0a\x09right := aString",
  469. messageSends: [],
  470. referencedClasses: []
  471. }),
  472. smalltalk.TrappedProcessorReplace);
  473. smalltalk.addMethod(
  474. smalltalk.method({
  475. selector: "toModel:",
  476. category: 'data transformation',
  477. fn: function (aDataCarrier){
  478. var self=this;
  479. var replacement,old;
  480. return smalltalk.withContext(function($ctx1) {
  481. var $1,$2;
  482. $1=_st(self["@left"])._replace_with_("^\x5c^","");
  483. $ctx1.sendIdx["replace:with:"]=2;
  484. replacement=_st($1)._replace_with_("\x5c$$","");
  485. $ctx1.sendIdx["replace:with:"]=1;
  486. old=_st(_st(aDataCarrier)._value())._asString();
  487. _st(aDataCarrier)._value_whenDifferentFrom_(_st(old)._replace_with_(self["@right"],replacement),old);
  488. $2=_st(aDataCarrier)._proceed();
  489. return self}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier,replacement:replacement,old:old},smalltalk.TrappedProcessorReplace)})},
  490. args: ["aDataCarrier"],
  491. source: "toModel: aDataCarrier\x0a\x09| replacement old |\x0a\x09replacement := (left replace: '^\x5c^' with: '') replace: '\x5c$$' with: ''.\x0a\x09old := aDataCarrier value asString.\x0a\x09aDataCarrier\x0a\x09\x09value: (old replace: right with: replacement) whenDifferentFrom: old;\x0a\x09\x09proceed",
  492. messageSends: ["replace:with:", "asString", "value", "value:whenDifferentFrom:", "proceed"],
  493. referencedClasses: []
  494. }),
  495. smalltalk.TrappedProcessorReplace);
  496. smalltalk.addMethod(
  497. smalltalk.method({
  498. selector: "toView:",
  499. category: 'data transformation',
  500. fn: function (aDataCarrier){
  501. var self=this;
  502. var replacement,old;
  503. return smalltalk.withContext(function($ctx1) {
  504. var $1,$2;
  505. $1=_st(self["@right"])._replace_with_("^\x5c^","");
  506. $ctx1.sendIdx["replace:with:"]=2;
  507. replacement=_st($1)._replace_with_("\x5c$$","");
  508. $ctx1.sendIdx["replace:with:"]=1;
  509. old=_st(_st(aDataCarrier)._value())._asString();
  510. _st(aDataCarrier)._value_whenDifferentFrom_(_st(old)._replace_with_(self["@left"],replacement),old);
  511. $2=_st(aDataCarrier)._proceed();
  512. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier,replacement:replacement,old:old},smalltalk.TrappedProcessorReplace)})},
  513. args: ["aDataCarrier"],
  514. source: "toView: aDataCarrier\x0a\x09| replacement old |\x0a\x09replacement := (right replace: '^\x5c^' with: '') replace: '\x5c$$' with: ''.\x0a\x09old := aDataCarrier value asString.\x0a\x09aDataCarrier\x0a\x09\x09value: (old replace: left with: replacement) whenDifferentFrom: old;\x0a\x09\x09proceed",
  515. messageSends: ["replace:with:", "asString", "value", "value:whenDifferentFrom:", "proceed"],
  516. referencedClasses: []
  517. }),
  518. smalltalk.TrappedProcessorReplace);
  519. smalltalk.addMethod(
  520. smalltalk.method({
  521. selector: "new:with:",
  522. category: 'instance creation',
  523. fn: function (aString,anotherString){
  524. var self=this;
  525. return smalltalk.withContext(function($ctx1) {
  526. var $2,$3,$4,$5,$1;
  527. $2=self._new();
  528. $3=$2;
  529. $4=_st(aString)._asString();
  530. $ctx1.sendIdx["asString"]=1;
  531. _st($3)._left_($4);
  532. _st($2)._right_(_st(anotherString)._asString());
  533. $5=_st($2)._yourself();
  534. $1=$5;
  535. return $1;
  536. }, function($ctx1) {$ctx1.fill(self,"new:with:",{aString:aString,anotherString:anotherString},smalltalk.TrappedProcessorReplace.klass)})},
  537. args: ["aString", "anotherString"],
  538. source: "new: aString with: anotherString\x0a\x09^ self new\x0a\x09\x09left: aString asString;\x0a\x09\x09right: anotherString asString;\x0a\x09\x09yourself",
  539. messageSends: ["left:", "new", "asString", "right:", "yourself"],
  540. referencedClasses: []
  541. }),
  542. smalltalk.TrappedProcessorReplace.klass);
  543. smalltalk.addClass('TrappedProcessorSignal', smalltalk.TrappedProcessor, ['selector'], 'Trapped-Processors');
  544. smalltalk.TrappedProcessorSignal.comment="Instead of writing data directly to model,\x0aI instead modify it by sending a message specified when instantiating me.";
  545. smalltalk.addMethod(
  546. smalltalk.method({
  547. selector: "selector:",
  548. category: 'accessing',
  549. fn: function (aString){
  550. var self=this;
  551. return smalltalk.withContext(function($ctx1) {
  552. self["@selector"]=aString;
  553. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.TrappedProcessorSignal)})},
  554. args: ["aString"],
  555. source: "selector: aString\x0a\x09selector := aString",
  556. messageSends: [],
  557. referencedClasses: []
  558. }),
  559. smalltalk.TrappedProcessorSignal);
  560. smalltalk.addMethod(
  561. smalltalk.method({
  562. selector: "toModel:",
  563. category: 'data transformation',
  564. fn: function (aDataCarrier){
  565. var self=this;
  566. return smalltalk.withContext(function($ctx1) {
  567. _st(aDataCarrier)._modifyTargetByPerforming_(self["@selector"]);
  568. return self}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorSignal)})},
  569. args: ["aDataCarrier"],
  570. source: "toModel: aDataCarrier\x0a\x09aDataCarrier modifyTargetByPerforming: selector",
  571. messageSends: ["modifyTargetByPerforming:"],
  572. referencedClasses: []
  573. }),
  574. smalltalk.TrappedProcessorSignal);
  575. smalltalk.addMethod(
  576. smalltalk.method({
  577. selector: "toView:",
  578. category: 'data transformation',
  579. fn: function (aDataCarrier){
  580. var self=this;
  581. return smalltalk.withContext(function($ctx1) {
  582. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorSignal)})},
  583. args: ["aDataCarrier"],
  584. source: "toView: aDataCarrier\x0a\x09\x22stop\x22",
  585. messageSends: [],
  586. referencedClasses: []
  587. }),
  588. smalltalk.TrappedProcessorSignal);
  589. smalltalk.addMethod(
  590. smalltalk.method({
  591. selector: "new:",
  592. category: 'instance creation',
  593. fn: function (aString){
  594. var self=this;
  595. return smalltalk.withContext(function($ctx1) {
  596. var $2,$3,$1;
  597. $2=self._new();
  598. _st($2)._selector_(aString);
  599. $3=_st($2)._yourself();
  600. $1=$3;
  601. return $1;
  602. }, function($ctx1) {$ctx1.fill(self,"new:",{aString:aString},smalltalk.TrappedProcessorSignal.klass)})},
  603. args: ["aString"],
  604. source: "new: aString\x0a\x09^self new\x0a\x09\x09selector: aString;\x0a\x09\x09yourself",
  605. messageSends: ["selector:", "new", "yourself"],
  606. referencedClasses: []
  607. }),
  608. smalltalk.TrappedProcessorSignal.klass);
  609. smalltalk.addClass('TrappedProcessorToBlackboard', smalltalk.TrappedDataExpectingProcessor, [], 'Trapped-Processors');
  610. smalltalk.TrappedProcessorToBlackboard.comment="I save the data to blackboard in toModel:, to position specified by path.";
  611. smalltalk.addMethod(
  612. smalltalk.method({
  613. selector: "toModel:",
  614. category: 'data transformation',
  615. fn: function (aDataCarrier){
  616. var self=this;
  617. return smalltalk.withContext(function($ctx1) {
  618. _st(_st(aDataCarrier)._target())._modify_((function(){
  619. return smalltalk.withContext(function($ctx2) {
  620. return _st(aDataCarrier)._value();
  621. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  622. return self}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorToBlackboard)})},
  623. args: ["aDataCarrier"],
  624. source: "toModel: aDataCarrier\x0a\x09aDataCarrier target modify: [ aDataCarrier value ]",
  625. messageSends: ["modify:", "target", "value"],
  626. referencedClasses: []
  627. }),
  628. smalltalk.TrappedProcessorToBlackboard);
  629. smalltalk.addClass('TrappedProcessorWhenClicked', smalltalk.TrappedProcessor, [], 'Trapped-Processors');
  630. smalltalk.TrappedProcessorWhenClicked.comment="I bind to an element and send true to blackboard when clicked.";
  631. smalltalk.addMethod(
  632. smalltalk.method({
  633. selector: "installToView:toModel:",
  634. category: 'installation',
  635. fn: function (aDataCarrier,anotherDataCarrier){
  636. var self=this;
  637. return smalltalk.withContext(function($ctx1) {
  638. _st(_st(aDataCarrier)._target())._onClick_((function(){
  639. return smalltalk.withContext(function($ctx2) {
  640. _st(_st(anotherDataCarrier)._copy())._proceed();
  641. return false;
  642. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  643. return self}, function($ctx1) {$ctx1.fill(self,"installToView:toModel:",{aDataCarrier:aDataCarrier,anotherDataCarrier:anotherDataCarrier},smalltalk.TrappedProcessorWhenClicked)})},
  644. args: ["aDataCarrier", "anotherDataCarrier"],
  645. source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09aDataCarrier target onClick: [ anotherDataCarrier copy proceed. false ]",
  646. messageSends: ["onClick:", "target", "proceed", "copy"],
  647. referencedClasses: []
  648. }),
  649. smalltalk.TrappedProcessorWhenClicked);
  650. smalltalk.addClass('TrappedProcessorWhenSubmitted', smalltalk.TrappedProcessor, [], 'Trapped-Processors');
  651. smalltalk.TrappedProcessorWhenSubmitted.comment="I bind to a form and send true to blackboard when submitted.";
  652. smalltalk.addMethod(
  653. smalltalk.method({
  654. selector: "installToView:toModel:",
  655. category: 'installation',
  656. fn: function (aDataCarrier,anotherDataCarrier){
  657. var self=this;
  658. return smalltalk.withContext(function($ctx1) {
  659. _st(_st(aDataCarrier)._target())._onSubmit_((function(){
  660. return smalltalk.withContext(function($ctx2) {
  661. _st(_st(anotherDataCarrier)._copy())._proceed();
  662. return false;
  663. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  664. return self}, function($ctx1) {$ctx1.fill(self,"installToView:toModel:",{aDataCarrier:aDataCarrier,anotherDataCarrier:anotherDataCarrier},smalltalk.TrappedProcessorWhenSubmitted)})},
  665. args: ["aDataCarrier", "anotherDataCarrier"],
  666. source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09aDataCarrier target onSubmit: [ anotherDataCarrier copy proceed. false ]",
  667. messageSends: ["onSubmit:", "target", "proceed", "copy"],
  668. referencedClasses: []
  669. }),
  670. smalltalk.TrappedProcessorWhenSubmitted);
  671. smalltalk.addClass('TrappedProcessorWidget', smalltalk.TrappedProcessor, ['viewName'], 'Trapped-Processors');
  672. smalltalk.TrappedProcessorWidget.comment="I insert a widget instance of the class specified when creating me.";
  673. smalltalk.addMethod(
  674. smalltalk.method({
  675. selector: "toView:",
  676. category: 'data transformation',
  677. fn: function (aDataCarrier){
  678. var self=this;
  679. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  680. return smalltalk.withContext(function($ctx1) {
  681. _st(_st(aDataCarrier)._target())._with_(_st(_st(_st($Smalltalk())._current())._at_(self["@viewName"]))._new());
  682. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorWidget)})},
  683. args: ["aDataCarrier"],
  684. source: "toView: aDataCarrier\x0a\x09aDataCarrier target with: (Smalltalk current at: viewName) new",
  685. messageSends: ["with:", "target", "new", "at:", "current"],
  686. referencedClasses: ["Smalltalk"]
  687. }),
  688. smalltalk.TrappedProcessorWidget);
  689. smalltalk.addMethod(
  690. smalltalk.method({
  691. selector: "viewName:",
  692. category: 'accessing',
  693. fn: function (aString){
  694. var self=this;
  695. return smalltalk.withContext(function($ctx1) {
  696. self["@viewName"]=aString;
  697. return self}, function($ctx1) {$ctx1.fill(self,"viewName:",{aString:aString},smalltalk.TrappedProcessorWidget)})},
  698. args: ["aString"],
  699. source: "viewName: aString\x0a\x09viewName := aString",
  700. messageSends: [],
  701. referencedClasses: []
  702. }),
  703. smalltalk.TrappedProcessorWidget);
  704. smalltalk.addMethod(
  705. smalltalk.method({
  706. selector: "new:",
  707. category: 'instance creation',
  708. fn: function (aString){
  709. var self=this;
  710. return smalltalk.withContext(function($ctx1) {
  711. var $2,$3,$1;
  712. $2=self._new();
  713. _st($2)._viewName_(aString);
  714. $3=_st($2)._yourself();
  715. $1=$3;
  716. return $1;
  717. }, function($ctx1) {$ctx1.fill(self,"new:",{aString:aString},smalltalk.TrappedProcessorWidget.klass)})},
  718. args: ["aString"],
  719. source: "new: aString\x0a\x09^self new\x0a\x09\x09viewName: aString;\x0a\x09\x09yourself",
  720. messageSends: ["viewName:", "new", "yourself"],
  721. referencedClasses: []
  722. }),
  723. smalltalk.TrappedProcessorWidget.klass);
  724. smalltalk.addMethod(
  725. smalltalk.method({
  726. selector: "modifyTarget",
  727. category: '*Trapped-Processors',
  728. fn: function (){
  729. var self=this;
  730. return smalltalk.withContext(function($ctx1) {
  731. _st(self._target())._modify_((function(){
  732. return smalltalk.withContext(function($ctx2) {
  733. return self._value();
  734. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  735. return self}, function($ctx1) {$ctx1.fill(self,"modifyTarget",{},smalltalk.TrappedDataCarrier)})},
  736. args: [],
  737. source: "modifyTarget\x0a\x09self target modify: [ self value ]",
  738. messageSends: ["modify:", "target", "value"],
  739. referencedClasses: []
  740. }),
  741. smalltalk.TrappedDataCarrier);
  742. smalltalk.addMethod(
  743. smalltalk.method({
  744. selector: "modifyTargetByPerforming:",
  745. category: '*Trapped-Processors',
  746. fn: function (aString){
  747. var self=this;
  748. return smalltalk.withContext(function($ctx1) {
  749. _st(self._target())._modify_((function(m){
  750. return smalltalk.withContext(function($ctx2) {
  751. return _st(m)._perform_(aString);
  752. }, function($ctx2) {$ctx2.fillBlock({m:m},$ctx1,1)})}));
  753. return self}, function($ctx1) {$ctx1.fill(self,"modifyTargetByPerforming:",{aString:aString},smalltalk.TrappedDataCarrier)})},
  754. args: ["aString"],
  755. source: "modifyTargetByPerforming: aString\x0a\x09self target modify: [ :m | m perform: aString ]",
  756. messageSends: ["modify:", "target", "perform:"],
  757. referencedClasses: []
  758. }),
  759. smalltalk.TrappedDataCarrier);
  760. smalltalk.addMethod(
  761. smalltalk.method({
  762. selector: "toTargetAttr:",
  763. category: '*Trapped-Processors',
  764. fn: function (aString){
  765. var self=this;
  766. return smalltalk.withContext(function($ctx1) {
  767. var $1,$2,$3,$5,$4;
  768. $1=self._falseAsNilValue();
  769. if(($receiver = $1) == nil || $receiver == null){
  770. $2=self._target();
  771. $ctx1.sendIdx["target"]=1;
  772. _st($2)._removeAt_(aString);
  773. } else {
  774. var value;
  775. value=$receiver;
  776. $3=self._target();
  777. $5=_st(value).__eq(true);
  778. if(smalltalk.assert($5)){
  779. $4=aString;
  780. } else {
  781. $4=value;
  782. };
  783. _st($3)._at_put_(aString,$4);
  784. };
  785. return self}, function($ctx1) {$ctx1.fill(self,"toTargetAttr:",{aString:aString},smalltalk.TrappedDataCarrier)})},
  786. args: ["aString"],
  787. source: "toTargetAttr: aString\x0a\x09self falseAsNilValue\x0a\x09\x09ifNil: [ self target removeAt: aString ]\x0a\x09\x09ifNotNil: [ :value | self target at: aString put: (value = true ifTrue: [ aString ] ifFalse: [ value ]) ]",
  788. messageSends: ["ifNil:ifNotNil:", "falseAsNilValue", "removeAt:", "target", "at:put:", "ifTrue:ifFalse:", "="],
  789. referencedClasses: []
  790. }),
  791. smalltalk.TrappedDataCarrier);
  792. smalltalk.addMethod(
  793. smalltalk.method({
  794. selector: "toTargetContents",
  795. category: '*Trapped-Processors',
  796. fn: function (){
  797. var self=this;
  798. return smalltalk.withContext(function($ctx1) {
  799. _st(self._target())._contents_(self._value());
  800. return self}, function($ctx1) {$ctx1.fill(self,"toTargetContents",{},smalltalk.TrappedDataCarrier)})},
  801. args: [],
  802. source: "toTargetContents\x0a\x09self target contents: self value",
  803. messageSends: ["contents:", "target", "value"],
  804. referencedClasses: []
  805. }),
  806. smalltalk.TrappedDataCarrier);
  807. smalltalk.addMethod(
  808. smalltalk.method({
  809. selector: "toTargetValue",
  810. category: '*Trapped-Processors',
  811. fn: function (){
  812. var self=this;
  813. return smalltalk.withContext(function($ctx1) {
  814. var $1,$3,$2;
  815. $1=_st(self._target())._asJQuery();
  816. $3=self._value();
  817. $ctx1.sendIdx["value"]=1;
  818. if(($receiver = $3) == nil || $receiver == null){
  819. $2=(function(){
  820. return smalltalk.withContext(function($ctx2) {
  821. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})});
  822. } else {
  823. var o;
  824. o=$receiver;
  825. $2=_st(o)._value();
  826. };
  827. _st($1)._val_($2);
  828. return self}, function($ctx1) {$ctx1.fill(self,"toTargetValue",{},smalltalk.TrappedDataCarrier)})},
  829. args: [],
  830. source: "toTargetValue\x0a\x09self target asJQuery val: (self value ifNotNil: [ :o | o value ] ifNil: [[]])",
  831. messageSends: ["val:", "asJQuery", "target", "ifNotNil:ifNil:", "value"],
  832. referencedClasses: []
  833. }),
  834. smalltalk.TrappedDataCarrier);
  835. smalltalk.addMethod(
  836. smalltalk.method({
  837. selector: "attr:",
  838. category: '*Trapped-Processors',
  839. fn: function (aString){
  840. var self=this;
  841. function $TrappedProcessorAttribute(){return smalltalk.TrappedProcessorAttribute||(typeof TrappedProcessorAttribute=="undefined"?nil:TrappedProcessorAttribute)}
  842. return smalltalk.withContext(function($ctx1) {
  843. var $1;
  844. $1=_st($TrappedProcessorAttribute())._new_(aString);
  845. return $1;
  846. }, function($ctx1) {$ctx1.fill(self,"attr:",{aString:aString},smalltalk.TrappedProcessor.klass)})},
  847. args: ["aString"],
  848. source: "attr: aString\x0a\x09^TrappedProcessorAttribute new: aString",
  849. messageSends: ["new:"],
  850. referencedClasses: ["TrappedProcessorAttribute"]
  851. }),
  852. smalltalk.TrappedProcessor.klass);
  853. smalltalk.addMethod(
  854. smalltalk.method({
  855. selector: "dataToView:",
  856. category: '*Trapped-Processors',
  857. fn: function (aBlock){
  858. var self=this;
  859. function $TrappedProcessorDataAdhoc(){return smalltalk.TrappedProcessorDataAdhoc||(typeof TrappedProcessorDataAdhoc=="undefined"?nil:TrappedProcessorDataAdhoc)}
  860. return smalltalk.withContext(function($ctx1) {
  861. var $1;
  862. $1=_st($TrappedProcessorDataAdhoc())._newToView_(aBlock);
  863. return $1;
  864. }, function($ctx1) {$ctx1.fill(self,"dataToView:",{aBlock:aBlock},smalltalk.TrappedProcessor.klass)})},
  865. args: ["aBlock"],
  866. source: "dataToView: aBlock\x0a\x09^TrappedProcessorDataAdhoc newToView: aBlock",
  867. messageSends: ["newToView:"],
  868. referencedClasses: ["TrappedProcessorDataAdhoc"]
  869. }),
  870. smalltalk.TrappedProcessor.klass);
  871. smalltalk.addMethod(
  872. smalltalk.method({
  873. selector: "guardContents:",
  874. category: '*Trapped-Processors',
  875. fn: function (anArray){
  876. var self=this;
  877. function $TrappedProcessorGuardContents(){return smalltalk.TrappedProcessorGuardContents||(typeof TrappedProcessorGuardContents=="undefined"?nil:TrappedProcessorGuardContents)}
  878. return smalltalk.withContext(function($ctx1) {
  879. var $1;
  880. $1=_st($TrappedProcessorGuardContents())._new_(anArray);
  881. return $1;
  882. }, function($ctx1) {$ctx1.fill(self,"guardContents:",{anArray:anArray},smalltalk.TrappedProcessor.klass)})},
  883. args: ["anArray"],
  884. source: "guardContents: anArray\x0a\x09^TrappedProcessorGuardContents new: anArray",
  885. messageSends: ["new:"],
  886. referencedClasses: ["TrappedProcessorGuardContents"]
  887. }),
  888. smalltalk.TrappedProcessor.klass);
  889. smalltalk.addMethod(
  890. smalltalk.method({
  891. selector: "guardProc:",
  892. category: '*Trapped-Processors',
  893. fn: function (anArray){
  894. var self=this;
  895. function $TrappedProcessorGuardProc(){return smalltalk.TrappedProcessorGuardProc||(typeof TrappedProcessorGuardProc=="undefined"?nil:TrappedProcessorGuardProc)}
  896. return smalltalk.withContext(function($ctx1) {
  897. var $1;
  898. $1=_st($TrappedProcessorGuardProc())._new_(anArray);
  899. return $1;
  900. }, function($ctx1) {$ctx1.fill(self,"guardProc:",{anArray:anArray},smalltalk.TrappedProcessor.klass)})},
  901. args: ["anArray"],
  902. source: "guardProc: anArray\x0a\x09^TrappedProcessorGuardProc new: anArray",
  903. messageSends: ["new:"],
  904. referencedClasses: ["TrappedProcessorGuardProc"]
  905. }),
  906. smalltalk.TrappedProcessor.klass);
  907. smalltalk.addMethod(
  908. smalltalk.method({
  909. selector: "inputChecked",
  910. category: '*Trapped-Processors',
  911. fn: function (){
  912. var self=this;
  913. function $TrappedProcessorInputChecked(){return smalltalk.TrappedProcessorInputChecked||(typeof TrappedProcessorInputChecked=="undefined"?nil:TrappedProcessorInputChecked)}
  914. return smalltalk.withContext(function($ctx1) {
  915. var $1;
  916. $1=_st($TrappedProcessorInputChecked())._new();
  917. return $1;
  918. }, function($ctx1) {$ctx1.fill(self,"inputChecked",{},smalltalk.TrappedProcessor.klass)})},
  919. args: [],
  920. source: "inputChecked\x0a\x09^TrappedProcessorInputChecked new",
  921. messageSends: ["new"],
  922. referencedClasses: ["TrappedProcessorInputChecked"]
  923. }),
  924. smalltalk.TrappedProcessor.klass);
  925. smalltalk.addMethod(
  926. smalltalk.method({
  927. selector: "inputValue",
  928. category: '*Trapped-Processors',
  929. fn: function (){
  930. var self=this;
  931. function $TrappedProcessorInputValue(){return smalltalk.TrappedProcessorInputValue||(typeof TrappedProcessorInputValue=="undefined"?nil:TrappedProcessorInputValue)}
  932. return smalltalk.withContext(function($ctx1) {
  933. var $1;
  934. $1=_st($TrappedProcessorInputValue())._new();
  935. return $1;
  936. }, function($ctx1) {$ctx1.fill(self,"inputValue",{},smalltalk.TrappedProcessor.klass)})},
  937. args: [],
  938. source: "inputValue\x0a\x09^TrappedProcessorInputValue new",
  939. messageSends: ["new"],
  940. referencedClasses: ["TrappedProcessorInputValue"]
  941. }),
  942. smalltalk.TrappedProcessor.klass);
  943. smalltalk.addMethod(
  944. smalltalk.method({
  945. selector: "loopContents",
  946. category: '*Trapped-Processors',
  947. fn: function (){
  948. var self=this;
  949. function $TrappedProcessorLoopContents(){return smalltalk.TrappedProcessorLoopContents||(typeof TrappedProcessorLoopContents=="undefined"?nil:TrappedProcessorLoopContents)}
  950. return smalltalk.withContext(function($ctx1) {
  951. var $1;
  952. $1=_st($TrappedProcessorLoopContents())._new();
  953. return $1;
  954. }, function($ctx1) {$ctx1.fill(self,"loopContents",{},smalltalk.TrappedProcessor.klass)})},
  955. args: [],
  956. source: "loopContents\x0a\x09^TrappedProcessorLoopContents new",
  957. messageSends: ["new"],
  958. referencedClasses: ["TrappedProcessorLoopContents"]
  959. }),
  960. smalltalk.TrappedProcessor.klass);
  961. smalltalk.addMethod(
  962. smalltalk.method({
  963. selector: "loopProc",
  964. category: '*Trapped-Processors',
  965. fn: function (){
  966. var self=this;
  967. function $TrappedProcessorLoopProc(){return smalltalk.TrappedProcessorLoopProc||(typeof TrappedProcessorLoopProc=="undefined"?nil:TrappedProcessorLoopProc)}
  968. return smalltalk.withContext(function($ctx1) {
  969. var $1;
  970. $1=_st($TrappedProcessorLoopProc())._new();
  971. return $1;
  972. }, function($ctx1) {$ctx1.fill(self,"loopProc",{},smalltalk.TrappedProcessor.klass)})},
  973. args: [],
  974. source: "loopProc\x0a\x09^TrappedProcessorLoopProc new",
  975. messageSends: ["new"],
  976. referencedClasses: ["TrappedProcessorLoopProc"]
  977. }),
  978. smalltalk.TrappedProcessor.klass);
  979. smalltalk.addMethod(
  980. smalltalk.method({
  981. selector: "path",
  982. category: '*Trapped-Processors',
  983. fn: function (){
  984. var self=this;
  985. function $TrappedProcessorDescend(){return smalltalk.TrappedProcessorDescend||(typeof TrappedProcessorDescend=="undefined"?nil:TrappedProcessorDescend)}
  986. return smalltalk.withContext(function($ctx1) {
  987. var $1;
  988. $1=_st($TrappedProcessorDescend())._new();
  989. return $1;
  990. }, function($ctx1) {$ctx1.fill(self,"path",{},smalltalk.TrappedProcessor.klass)})},
  991. args: [],
  992. source: "path\x0a\x09^TrappedProcessorDescend new",
  993. messageSends: ["new"],
  994. referencedClasses: ["TrappedProcessorDescend"]
  995. }),
  996. smalltalk.TrappedProcessor.klass);
  997. smalltalk.addMethod(
  998. smalltalk.method({
  999. selector: "replace:with:",
  1000. category: '*Trapped-Processors',
  1001. fn: function (aString,anotherString){
  1002. var self=this;
  1003. function $TrappedProcessorReplace(){return smalltalk.TrappedProcessorReplace||(typeof TrappedProcessorReplace=="undefined"?nil:TrappedProcessorReplace)}
  1004. return smalltalk.withContext(function($ctx1) {
  1005. var $1;
  1006. $1=_st($TrappedProcessorReplace())._new_with_(aString,anotherString);
  1007. return $1;
  1008. }, function($ctx1) {$ctx1.fill(self,"replace:with:",{aString:aString,anotherString:anotherString},smalltalk.TrappedProcessor.klass)})},
  1009. args: ["aString", "anotherString"],
  1010. source: "replace: aString with: anotherString\x0a\x09^TrappedProcessorReplace new: aString with: anotherString",
  1011. messageSends: ["new:with:"],
  1012. referencedClasses: ["TrappedProcessorReplace"]
  1013. }),
  1014. smalltalk.TrappedProcessor.klass);
  1015. smalltalk.addMethod(
  1016. smalltalk.method({
  1017. selector: "signal:",
  1018. category: '*Trapped-Processors',
  1019. fn: function (aString){
  1020. var self=this;
  1021. function $TrappedProcessorSignal(){return smalltalk.TrappedProcessorSignal||(typeof TrappedProcessorSignal=="undefined"?nil:TrappedProcessorSignal)}
  1022. return smalltalk.withContext(function($ctx1) {
  1023. var $1;
  1024. $1=_st($TrappedProcessorSignal())._new_(aString);
  1025. return $1;
  1026. }, function($ctx1) {$ctx1.fill(self,"signal:",{aString:aString},smalltalk.TrappedProcessor.klass)})},
  1027. args: ["aString"],
  1028. source: "signal: aString\x0a\x09^TrappedProcessorSignal new: aString",
  1029. messageSends: ["new:"],
  1030. referencedClasses: ["TrappedProcessorSignal"]
  1031. }),
  1032. smalltalk.TrappedProcessor.klass);
  1033. smalltalk.addMethod(
  1034. smalltalk.method({
  1035. selector: "toBlackboard",
  1036. category: '*Trapped-Processors',
  1037. fn: function (){
  1038. var self=this;
  1039. function $TrappedProcessorToBlackboard(){return smalltalk.TrappedProcessorToBlackboard||(typeof TrappedProcessorToBlackboard=="undefined"?nil:TrappedProcessorToBlackboard)}
  1040. return smalltalk.withContext(function($ctx1) {
  1041. var $1;
  1042. $1=_st($TrappedProcessorToBlackboard())._new();
  1043. return $1;
  1044. }, function($ctx1) {$ctx1.fill(self,"toBlackboard",{},smalltalk.TrappedProcessor.klass)})},
  1045. args: [],
  1046. source: "toBlackboard\x0a\x09^TrappedProcessorToBlackboard new",
  1047. messageSends: ["new"],
  1048. referencedClasses: ["TrappedProcessorToBlackboard"]
  1049. }),
  1050. smalltalk.TrappedProcessor.klass);
  1051. smalltalk.addMethod(
  1052. smalltalk.method({
  1053. selector: "whenClicked",
  1054. category: '*Trapped-Processors',
  1055. fn: function (){
  1056. var self=this;
  1057. function $TrappedProcessorWhenClicked(){return smalltalk.TrappedProcessorWhenClicked||(typeof TrappedProcessorWhenClicked=="undefined"?nil:TrappedProcessorWhenClicked)}
  1058. return smalltalk.withContext(function($ctx1) {
  1059. var $1;
  1060. $1=_st($TrappedProcessorWhenClicked())._new();
  1061. return $1;
  1062. }, function($ctx1) {$ctx1.fill(self,"whenClicked",{},smalltalk.TrappedProcessor.klass)})},
  1063. args: [],
  1064. source: "whenClicked\x0a\x09^TrappedProcessorWhenClicked new",
  1065. messageSends: ["new"],
  1066. referencedClasses: ["TrappedProcessorWhenClicked"]
  1067. }),
  1068. smalltalk.TrappedProcessor.klass);
  1069. smalltalk.addMethod(
  1070. smalltalk.method({
  1071. selector: "whenSubmitted",
  1072. category: '*Trapped-Processors',
  1073. fn: function (){
  1074. var self=this;
  1075. function $TrappedProcessorWhenSubmitted(){return smalltalk.TrappedProcessorWhenSubmitted||(typeof TrappedProcessorWhenSubmitted=="undefined"?nil:TrappedProcessorWhenSubmitted)}
  1076. return smalltalk.withContext(function($ctx1) {
  1077. var $1;
  1078. $1=_st($TrappedProcessorWhenSubmitted())._new();
  1079. return $1;
  1080. }, function($ctx1) {$ctx1.fill(self,"whenSubmitted",{},smalltalk.TrappedProcessor.klass)})},
  1081. args: [],
  1082. source: "whenSubmitted\x0a\x09^TrappedProcessorWhenSubmitted new",
  1083. messageSends: ["new"],
  1084. referencedClasses: ["TrappedProcessorWhenSubmitted"]
  1085. }),
  1086. smalltalk.TrappedProcessor.klass);
  1087. smalltalk.addMethod(
  1088. smalltalk.method({
  1089. selector: "widget:",
  1090. category: '*Trapped-Processors',
  1091. fn: function (aString){
  1092. var self=this;
  1093. function $TrappedProcessorWidget(){return smalltalk.TrappedProcessorWidget||(typeof TrappedProcessorWidget=="undefined"?nil:TrappedProcessorWidget)}
  1094. return smalltalk.withContext(function($ctx1) {
  1095. var $1;
  1096. $1=_st($TrappedProcessorWidget())._new_(aString);
  1097. return $1;
  1098. }, function($ctx1) {$ctx1.fill(self,"widget:",{aString:aString},smalltalk.TrappedProcessor.klass)})},
  1099. args: ["aString"],
  1100. source: "widget: aString\x0a\x09^TrappedProcessorWidget new: aString",
  1101. messageSends: ["new:"],
  1102. referencedClasses: ["TrappedProcessorWidget"]
  1103. }),
  1104. smalltalk.TrappedProcessor.klass);
  1105. });