Trapped-Processors.js 46 KB

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