Trapped-Processors.js 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179
  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;
  372. function $Trapped(){return smalltalk.Trapped||(typeof Trapped=="undefined"?nil:Trapped)}
  373. return smalltalk.withContext(function($ctx1) {
  374. var $3,$2,$1,$5,$4;
  375. frozen=_st(aDataCarrier)._copy();
  376. $3=_st(frozen)._target();
  377. $ctx1.sendIdx["target"]=1;
  378. $2=_st($3)._asJQuery();
  379. $ctx1.sendIdx["asJQuery"]=1;
  380. $1=_st($2)._contents();
  381. contents=_st($1)._detach();
  382. _st(_st(frozen)._target())._trapIter_after_([],(function(html){
  383. return smalltalk.withContext(function($ctx2) {
  384. $5=_st(html)._root();
  385. $ctx2.sendIdx["root"]=1;
  386. $4=_st($5)._asJQuery();
  387. $ctx2.sendIdx["asJQuery"]=2;
  388. _st($4)._append_(_st(contents)._clone());
  389. return _st(_st($Trapped())._current())._injectToJQuery_(_st(_st(html)._root())._asJQuery());
  390. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  391. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier,frozen:frozen,contents:contents},smalltalk.TrappedProcessorLoopContents)})},
  392. args: ["aDataCarrier"],
  393. 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 ]",
  394. messageSends: ["copy", "detach", "contents", "asJQuery", "target", "trapIter:after:", "append:", "root", "clone", "injectToJQuery:", "current"],
  395. referencedClasses: ["Trapped"]
  396. }),
  397. smalltalk.TrappedProcessorLoopContents);
  398. smalltalk.addClass('TrappedProcessorLoopProc', smalltalk.TrappedProcessorLoopBase, [], 'Trapped-Processors');
  399. 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).";
  400. smalltalk.addMethod(
  401. smalltalk.method({
  402. selector: "toView:",
  403. category: 'data transformation',
  404. fn: function (aDataCarrier){
  405. var self=this;
  406. var frozen;
  407. return smalltalk.withContext(function($ctx1) {
  408. var $1,$2;
  409. frozen=_st(aDataCarrier)._copy();
  410. $ctx1.sendIdx["copy"]=1;
  411. _st(_st(frozen)._target())._trapIter_after_([],(function(html){
  412. return smalltalk.withContext(function($ctx2) {
  413. $1=_st(frozen)._copy();
  414. _st($1)._target_(_st(html)._root());
  415. $2=_st($1)._proceed();
  416. return $2;
  417. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  418. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier,frozen:frozen},smalltalk.TrappedProcessorLoopProc)})},
  419. args: ["aDataCarrier"],
  420. source: "toView: aDataCarrier\x0a\x09| frozen |\x0a\x09frozen := aDataCarrier copy.\x0a\x09frozen target trapIter: #() after: [ :html | frozen copy target: html root; proceed ]",
  421. messageSends: ["copy", "trapIter:after:", "target", "target:", "root", "proceed"],
  422. referencedClasses: []
  423. }),
  424. smalltalk.TrappedProcessorLoopProc);
  425. smalltalk.addClass('TrappedProcessorReplace', smalltalk.TrappedProcessor, ['left', 'right'], 'Trapped-Processors');
  426. 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";
  427. smalltalk.addMethod(
  428. smalltalk.method({
  429. selector: "left:",
  430. category: 'accessing',
  431. fn: function (aString){
  432. var self=this;
  433. return smalltalk.withContext(function($ctx1) {
  434. self["@left"]=aString;
  435. return self}, function($ctx1) {$ctx1.fill(self,"left:",{aString:aString},smalltalk.TrappedProcessorReplace)})},
  436. args: ["aString"],
  437. source: "left: aString\x0a\x09left := aString",
  438. messageSends: [],
  439. referencedClasses: []
  440. }),
  441. smalltalk.TrappedProcessorReplace);
  442. smalltalk.addMethod(
  443. smalltalk.method({
  444. selector: "right:",
  445. category: 'accessing',
  446. fn: function (aString){
  447. var self=this;
  448. return smalltalk.withContext(function($ctx1) {
  449. self["@right"]=aString;
  450. return self}, function($ctx1) {$ctx1.fill(self,"right:",{aString:aString},smalltalk.TrappedProcessorReplace)})},
  451. args: ["aString"],
  452. source: "right: aString\x0a\x09right := aString",
  453. messageSends: [],
  454. referencedClasses: []
  455. }),
  456. smalltalk.TrappedProcessorReplace);
  457. smalltalk.addMethod(
  458. smalltalk.method({
  459. selector: "toModel:",
  460. category: 'data transformation',
  461. fn: function (aDataCarrier){
  462. var self=this;
  463. var replacement,old;
  464. return smalltalk.withContext(function($ctx1) {
  465. var $1,$2;
  466. $1=_st(self["@left"])._replace_with_("^\x5c^","");
  467. $ctx1.sendIdx["replace:with:"]=2;
  468. replacement=_st($1)._replace_with_("\x5c$$","");
  469. $ctx1.sendIdx["replace:with:"]=1;
  470. old=_st(_st(aDataCarrier)._value())._asString();
  471. _st(aDataCarrier)._value_whenDifferentFrom_(_st(old)._replace_with_(self["@right"],replacement),old);
  472. $2=_st(aDataCarrier)._proceed();
  473. return self}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier,replacement:replacement,old:old},smalltalk.TrappedProcessorReplace)})},
  474. args: ["aDataCarrier"],
  475. 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",
  476. messageSends: ["replace:with:", "asString", "value", "value:whenDifferentFrom:", "proceed"],
  477. referencedClasses: []
  478. }),
  479. smalltalk.TrappedProcessorReplace);
  480. smalltalk.addMethod(
  481. smalltalk.method({
  482. selector: "toView:",
  483. category: 'data transformation',
  484. fn: function (aDataCarrier){
  485. var self=this;
  486. var replacement,old;
  487. return smalltalk.withContext(function($ctx1) {
  488. var $1,$2;
  489. $1=_st(self["@right"])._replace_with_("^\x5c^","");
  490. $ctx1.sendIdx["replace:with:"]=2;
  491. replacement=_st($1)._replace_with_("\x5c$$","");
  492. $ctx1.sendIdx["replace:with:"]=1;
  493. old=_st(_st(aDataCarrier)._value())._asString();
  494. _st(aDataCarrier)._value_whenDifferentFrom_(_st(old)._replace_with_(self["@left"],replacement),old);
  495. $2=_st(aDataCarrier)._proceed();
  496. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier,replacement:replacement,old:old},smalltalk.TrappedProcessorReplace)})},
  497. args: ["aDataCarrier"],
  498. 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",
  499. messageSends: ["replace:with:", "asString", "value", "value:whenDifferentFrom:", "proceed"],
  500. referencedClasses: []
  501. }),
  502. smalltalk.TrappedProcessorReplace);
  503. smalltalk.addMethod(
  504. smalltalk.method({
  505. selector: "new:with:",
  506. category: 'instance creation',
  507. fn: function (aString,anotherString){
  508. var self=this;
  509. return smalltalk.withContext(function($ctx1) {
  510. var $2,$3,$4,$5,$1;
  511. $2=self._new();
  512. $3=$2;
  513. $4=_st(aString)._asString();
  514. $ctx1.sendIdx["asString"]=1;
  515. _st($3)._left_($4);
  516. _st($2)._right_(_st(anotherString)._asString());
  517. $5=_st($2)._yourself();
  518. $1=$5;
  519. return $1;
  520. }, function($ctx1) {$ctx1.fill(self,"new:with:",{aString:aString,anotherString:anotherString},smalltalk.TrappedProcessorReplace.klass)})},
  521. args: ["aString", "anotherString"],
  522. source: "new: aString with: anotherString\x0a\x09^ self new\x0a\x09\x09left: aString asString;\x0a\x09\x09right: anotherString asString;\x0a\x09\x09yourself",
  523. messageSends: ["left:", "new", "asString", "right:", "yourself"],
  524. referencedClasses: []
  525. }),
  526. smalltalk.TrappedProcessorReplace.klass);
  527. smalltalk.addClass('TrappedProcessorSignal', smalltalk.TrappedProcessor, ['selector'], 'Trapped-Processors');
  528. smalltalk.TrappedProcessorSignal.comment="Instead of writing data directly to model,\x0aI instead modify it by sending a message specified when instantiating me.";
  529. smalltalk.addMethod(
  530. smalltalk.method({
  531. selector: "selector:",
  532. category: 'accessing',
  533. fn: function (aString){
  534. var self=this;
  535. return smalltalk.withContext(function($ctx1) {
  536. self["@selector"]=aString;
  537. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.TrappedProcessorSignal)})},
  538. args: ["aString"],
  539. source: "selector: aString\x0a\x09selector := aString",
  540. messageSends: [],
  541. referencedClasses: []
  542. }),
  543. smalltalk.TrappedProcessorSignal);
  544. smalltalk.addMethod(
  545. smalltalk.method({
  546. selector: "toModel:",
  547. category: 'data transformation',
  548. fn: function (aDataCarrier){
  549. var self=this;
  550. return smalltalk.withContext(function($ctx1) {
  551. _st(aDataCarrier)._modifyTargetByPerforming_(self["@selector"]);
  552. return self}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorSignal)})},
  553. args: ["aDataCarrier"],
  554. source: "toModel: aDataCarrier\x0a\x09aDataCarrier modifyTargetByPerforming: selector",
  555. messageSends: ["modifyTargetByPerforming:"],
  556. referencedClasses: []
  557. }),
  558. smalltalk.TrappedProcessorSignal);
  559. smalltalk.addMethod(
  560. smalltalk.method({
  561. selector: "toView:",
  562. category: 'data transformation',
  563. fn: function (aDataCarrier){
  564. var self=this;
  565. return smalltalk.withContext(function($ctx1) {
  566. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorSignal)})},
  567. args: ["aDataCarrier"],
  568. source: "toView: aDataCarrier\x0a\x09\x22stop\x22",
  569. messageSends: [],
  570. referencedClasses: []
  571. }),
  572. smalltalk.TrappedProcessorSignal);
  573. smalltalk.addMethod(
  574. smalltalk.method({
  575. selector: "new:",
  576. category: 'instance creation',
  577. fn: function (aString){
  578. var self=this;
  579. return smalltalk.withContext(function($ctx1) {
  580. var $2,$3,$1;
  581. $2=self._new();
  582. _st($2)._selector_(aString);
  583. $3=_st($2)._yourself();
  584. $1=$3;
  585. return $1;
  586. }, function($ctx1) {$ctx1.fill(self,"new:",{aString:aString},smalltalk.TrappedProcessorSignal.klass)})},
  587. args: ["aString"],
  588. source: "new: aString\x0a\x09^self new\x0a\x09\x09selector: aString;\x0a\x09\x09yourself",
  589. messageSends: ["selector:", "new", "yourself"],
  590. referencedClasses: []
  591. }),
  592. smalltalk.TrappedProcessorSignal.klass);
  593. smalltalk.addClass('TrappedProcessorToBlackboard', smalltalk.TrappedDataExpectingProcessor, [], 'Trapped-Processors');
  594. smalltalk.TrappedProcessorToBlackboard.comment="I save the data to blackboard in toModel:, to position specified by path.";
  595. smalltalk.addMethod(
  596. smalltalk.method({
  597. selector: "toModel:",
  598. category: 'data transformation',
  599. fn: function (aDataCarrier){
  600. var self=this;
  601. return smalltalk.withContext(function($ctx1) {
  602. _st(_st(aDataCarrier)._target())._modify_((function(){
  603. return smalltalk.withContext(function($ctx2) {
  604. return _st(aDataCarrier)._value();
  605. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  606. return self}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorToBlackboard)})},
  607. args: ["aDataCarrier"],
  608. source: "toModel: aDataCarrier\x0a\x09aDataCarrier target modify: [ aDataCarrier value ]",
  609. messageSends: ["modify:", "target", "value"],
  610. referencedClasses: []
  611. }),
  612. smalltalk.TrappedProcessorToBlackboard);
  613. smalltalk.addClass('TrappedProcessorWhenClicked', smalltalk.TrappedProcessor, [], 'Trapped-Processors');
  614. smalltalk.TrappedProcessorWhenClicked.comment="I bind to an element and send true to blackboard when clicked.";
  615. smalltalk.addMethod(
  616. smalltalk.method({
  617. selector: "installToView:toModel:",
  618. category: 'installation',
  619. fn: function (aDataCarrier,anotherDataCarrier){
  620. var self=this;
  621. return smalltalk.withContext(function($ctx1) {
  622. _st(_st(aDataCarrier)._target())._onClick_((function(){
  623. return smalltalk.withContext(function($ctx2) {
  624. _st(_st(anotherDataCarrier)._copy())._proceed();
  625. return false;
  626. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  627. return self}, function($ctx1) {$ctx1.fill(self,"installToView:toModel:",{aDataCarrier:aDataCarrier,anotherDataCarrier:anotherDataCarrier},smalltalk.TrappedProcessorWhenClicked)})},
  628. args: ["aDataCarrier", "anotherDataCarrier"],
  629. source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09aDataCarrier target onClick: [ anotherDataCarrier copy proceed. false ]",
  630. messageSends: ["onClick:", "target", "proceed", "copy"],
  631. referencedClasses: []
  632. }),
  633. smalltalk.TrappedProcessorWhenClicked);
  634. smalltalk.addClass('TrappedProcessorWhenSubmitted', smalltalk.TrappedProcessor, [], 'Trapped-Processors');
  635. smalltalk.TrappedProcessorWhenSubmitted.comment="I bind to a form and send true to blackboard when submitted.";
  636. smalltalk.addMethod(
  637. smalltalk.method({
  638. selector: "installToView:toModel:",
  639. category: 'installation',
  640. fn: function (aDataCarrier,anotherDataCarrier){
  641. var self=this;
  642. return smalltalk.withContext(function($ctx1) {
  643. _st(_st(aDataCarrier)._target())._onSubmit_((function(){
  644. return smalltalk.withContext(function($ctx2) {
  645. _st(_st(anotherDataCarrier)._copy())._proceed();
  646. return false;
  647. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  648. return self}, function($ctx1) {$ctx1.fill(self,"installToView:toModel:",{aDataCarrier:aDataCarrier,anotherDataCarrier:anotherDataCarrier},smalltalk.TrappedProcessorWhenSubmitted)})},
  649. args: ["aDataCarrier", "anotherDataCarrier"],
  650. source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09aDataCarrier target onSubmit: [ anotherDataCarrier copy proceed. false ]",
  651. messageSends: ["onSubmit:", "target", "proceed", "copy"],
  652. referencedClasses: []
  653. }),
  654. smalltalk.TrappedProcessorWhenSubmitted);
  655. smalltalk.addClass('TrappedProcessorWidget', smalltalk.TrappedProcessor, ['viewName'], 'Trapped-Processors');
  656. smalltalk.TrappedProcessorWidget.comment="I insert a widget instance of the class specified when creating me.";
  657. smalltalk.addMethod(
  658. smalltalk.method({
  659. selector: "toView:",
  660. category: 'data transformation',
  661. fn: function (aDataCarrier){
  662. var self=this;
  663. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  664. return smalltalk.withContext(function($ctx1) {
  665. _st(_st(aDataCarrier)._target())._with_(_st(_st(_st($Smalltalk())._current())._at_(self["@viewName"]))._new());
  666. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorWidget)})},
  667. args: ["aDataCarrier"],
  668. source: "toView: aDataCarrier\x0a\x09aDataCarrier target with: (Smalltalk current at: viewName) new",
  669. messageSends: ["with:", "target", "new", "at:", "current"],
  670. referencedClasses: ["Smalltalk"]
  671. }),
  672. smalltalk.TrappedProcessorWidget);
  673. smalltalk.addMethod(
  674. smalltalk.method({
  675. selector: "viewName:",
  676. category: 'accessing',
  677. fn: function (aString){
  678. var self=this;
  679. return smalltalk.withContext(function($ctx1) {
  680. self["@viewName"]=aString;
  681. return self}, function($ctx1) {$ctx1.fill(self,"viewName:",{aString:aString},smalltalk.TrappedProcessorWidget)})},
  682. args: ["aString"],
  683. source: "viewName: aString\x0a\x09viewName := aString",
  684. messageSends: [],
  685. referencedClasses: []
  686. }),
  687. smalltalk.TrappedProcessorWidget);
  688. smalltalk.addMethod(
  689. smalltalk.method({
  690. selector: "new:",
  691. category: 'instance creation',
  692. fn: function (aString){
  693. var self=this;
  694. return smalltalk.withContext(function($ctx1) {
  695. var $2,$3,$1;
  696. $2=self._new();
  697. _st($2)._viewName_(aString);
  698. $3=_st($2)._yourself();
  699. $1=$3;
  700. return $1;
  701. }, function($ctx1) {$ctx1.fill(self,"new:",{aString:aString},smalltalk.TrappedProcessorWidget.klass)})},
  702. args: ["aString"],
  703. source: "new: aString\x0a\x09^self new\x0a\x09\x09viewName: aString;\x0a\x09\x09yourself",
  704. messageSends: ["viewName:", "new", "yourself"],
  705. referencedClasses: []
  706. }),
  707. smalltalk.TrappedProcessorWidget.klass);
  708. smalltalk.addMethod(
  709. smalltalk.method({
  710. selector: "modifyTarget",
  711. category: '*Trapped-Processors',
  712. fn: function (){
  713. var self=this;
  714. return smalltalk.withContext(function($ctx1) {
  715. _st(self._target())._modify_((function(){
  716. return smalltalk.withContext(function($ctx2) {
  717. return self._value();
  718. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  719. return self}, function($ctx1) {$ctx1.fill(self,"modifyTarget",{},smalltalk.TrappedDataCarrier)})},
  720. args: [],
  721. source: "modifyTarget\x0a\x09self target modify: [ self value ]",
  722. messageSends: ["modify:", "target", "value"],
  723. referencedClasses: []
  724. }),
  725. smalltalk.TrappedDataCarrier);
  726. smalltalk.addMethod(
  727. smalltalk.method({
  728. selector: "modifyTargetByPerforming:",
  729. category: '*Trapped-Processors',
  730. fn: function (aString){
  731. var self=this;
  732. return smalltalk.withContext(function($ctx1) {
  733. _st(self._target())._modify_((function(m){
  734. return smalltalk.withContext(function($ctx2) {
  735. return _st(m)._perform_(aString);
  736. }, function($ctx2) {$ctx2.fillBlock({m:m},$ctx1,1)})}));
  737. return self}, function($ctx1) {$ctx1.fill(self,"modifyTargetByPerforming:",{aString:aString},smalltalk.TrappedDataCarrier)})},
  738. args: ["aString"],
  739. source: "modifyTargetByPerforming: aString\x0a\x09self target modify: [ :m | m perform: aString ]",
  740. messageSends: ["modify:", "target", "perform:"],
  741. referencedClasses: []
  742. }),
  743. smalltalk.TrappedDataCarrier);
  744. smalltalk.addMethod(
  745. smalltalk.method({
  746. selector: "toTargetAttr:",
  747. category: '*Trapped-Processors',
  748. fn: function (aString){
  749. var self=this;
  750. return smalltalk.withContext(function($ctx1) {
  751. var $1,$2,$3,$5,$4;
  752. $1=self._falseAsNilValue();
  753. if(($receiver = $1) == nil || $receiver == null){
  754. $2=self._target();
  755. $ctx1.sendIdx["target"]=1;
  756. _st($2)._removeAt_(aString);
  757. } else {
  758. var value;
  759. value=$receiver;
  760. $3=self._target();
  761. $5=_st(value).__eq(true);
  762. if(smalltalk.assert($5)){
  763. $4=aString;
  764. } else {
  765. $4=value;
  766. };
  767. _st($3)._at_put_(aString,$4);
  768. };
  769. return self}, function($ctx1) {$ctx1.fill(self,"toTargetAttr:",{aString:aString},smalltalk.TrappedDataCarrier)})},
  770. args: ["aString"],
  771. 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 ]) ]",
  772. messageSends: ["ifNil:ifNotNil:", "falseAsNilValue", "removeAt:", "target", "at:put:", "ifTrue:ifFalse:", "="],
  773. referencedClasses: []
  774. }),
  775. smalltalk.TrappedDataCarrier);
  776. smalltalk.addMethod(
  777. smalltalk.method({
  778. selector: "toTargetContents",
  779. category: '*Trapped-Processors',
  780. fn: function (){
  781. var self=this;
  782. return smalltalk.withContext(function($ctx1) {
  783. _st(self._target())._contents_(self._value());
  784. return self}, function($ctx1) {$ctx1.fill(self,"toTargetContents",{},smalltalk.TrappedDataCarrier)})},
  785. args: [],
  786. source: "toTargetContents\x0a\x09self target contents: self value",
  787. messageSends: ["contents:", "target", "value"],
  788. referencedClasses: []
  789. }),
  790. smalltalk.TrappedDataCarrier);
  791. smalltalk.addMethod(
  792. smalltalk.method({
  793. selector: "toTargetValue",
  794. category: '*Trapped-Processors',
  795. fn: function (){
  796. var self=this;
  797. return smalltalk.withContext(function($ctx1) {
  798. var $1,$3,$2;
  799. $1=_st(self._target())._asJQuery();
  800. $3=self._value();
  801. $ctx1.sendIdx["value"]=1;
  802. if(($receiver = $3) == nil || $receiver == null){
  803. $2=(function(){
  804. return smalltalk.withContext(function($ctx2) {
  805. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})});
  806. } else {
  807. var o;
  808. o=$receiver;
  809. $2=_st(o)._value();
  810. };
  811. _st($1)._val_($2);
  812. return self}, function($ctx1) {$ctx1.fill(self,"toTargetValue",{},smalltalk.TrappedDataCarrier)})},
  813. args: [],
  814. source: "toTargetValue\x0a\x09self target asJQuery val: (self value ifNotNil: [ :o | o value ] ifNil: [[]])",
  815. messageSends: ["val:", "asJQuery", "target", "ifNotNil:ifNil:", "value"],
  816. referencedClasses: []
  817. }),
  818. smalltalk.TrappedDataCarrier);
  819. smalltalk.addMethod(
  820. smalltalk.method({
  821. selector: "attr:",
  822. category: '*Trapped-Processors',
  823. fn: function (aString){
  824. var self=this;
  825. function $TrappedProcessorAttribute(){return smalltalk.TrappedProcessorAttribute||(typeof TrappedProcessorAttribute=="undefined"?nil:TrappedProcessorAttribute)}
  826. return smalltalk.withContext(function($ctx1) {
  827. var $1;
  828. $1=_st($TrappedProcessorAttribute())._new_(aString);
  829. return $1;
  830. }, function($ctx1) {$ctx1.fill(self,"attr:",{aString:aString},smalltalk.TrappedProcessor.klass)})},
  831. args: ["aString"],
  832. source: "attr: aString\x0a\x09^TrappedProcessorAttribute new: aString",
  833. messageSends: ["new:"],
  834. referencedClasses: ["TrappedProcessorAttribute"]
  835. }),
  836. smalltalk.TrappedProcessor.klass);
  837. smalltalk.addMethod(
  838. smalltalk.method({
  839. selector: "dataToView:",
  840. category: '*Trapped-Processors',
  841. fn: function (aBlock){
  842. var self=this;
  843. function $TrappedProcessorDataAdhoc(){return smalltalk.TrappedProcessorDataAdhoc||(typeof TrappedProcessorDataAdhoc=="undefined"?nil:TrappedProcessorDataAdhoc)}
  844. return smalltalk.withContext(function($ctx1) {
  845. var $1;
  846. $1=_st($TrappedProcessorDataAdhoc())._newToView_(aBlock);
  847. return $1;
  848. }, function($ctx1) {$ctx1.fill(self,"dataToView:",{aBlock:aBlock},smalltalk.TrappedProcessor.klass)})},
  849. args: ["aBlock"],
  850. source: "dataToView: aBlock\x0a\x09^TrappedProcessorDataAdhoc newToView: aBlock",
  851. messageSends: ["newToView:"],
  852. referencedClasses: ["TrappedProcessorDataAdhoc"]
  853. }),
  854. smalltalk.TrappedProcessor.klass);
  855. smalltalk.addMethod(
  856. smalltalk.method({
  857. selector: "guardContents:",
  858. category: '*Trapped-Processors',
  859. fn: function (anArray){
  860. var self=this;
  861. function $TrappedProcessorGuardContents(){return smalltalk.TrappedProcessorGuardContents||(typeof TrappedProcessorGuardContents=="undefined"?nil:TrappedProcessorGuardContents)}
  862. return smalltalk.withContext(function($ctx1) {
  863. var $1;
  864. $1=_st($TrappedProcessorGuardContents())._new_(anArray);
  865. return $1;
  866. }, function($ctx1) {$ctx1.fill(self,"guardContents:",{anArray:anArray},smalltalk.TrappedProcessor.klass)})},
  867. args: ["anArray"],
  868. source: "guardContents: anArray\x0a\x09^TrappedProcessorGuardContents new: anArray",
  869. messageSends: ["new:"],
  870. referencedClasses: ["TrappedProcessorGuardContents"]
  871. }),
  872. smalltalk.TrappedProcessor.klass);
  873. smalltalk.addMethod(
  874. smalltalk.method({
  875. selector: "guardProc:",
  876. category: '*Trapped-Processors',
  877. fn: function (anArray){
  878. var self=this;
  879. function $TrappedProcessorGuardProc(){return smalltalk.TrappedProcessorGuardProc||(typeof TrappedProcessorGuardProc=="undefined"?nil:TrappedProcessorGuardProc)}
  880. return smalltalk.withContext(function($ctx1) {
  881. var $1;
  882. $1=_st($TrappedProcessorGuardProc())._new_(anArray);
  883. return $1;
  884. }, function($ctx1) {$ctx1.fill(self,"guardProc:",{anArray:anArray},smalltalk.TrappedProcessor.klass)})},
  885. args: ["anArray"],
  886. source: "guardProc: anArray\x0a\x09^TrappedProcessorGuardProc new: anArray",
  887. messageSends: ["new:"],
  888. referencedClasses: ["TrappedProcessorGuardProc"]
  889. }),
  890. smalltalk.TrappedProcessor.klass);
  891. smalltalk.addMethod(
  892. smalltalk.method({
  893. selector: "inputChecked",
  894. category: '*Trapped-Processors',
  895. fn: function (){
  896. var self=this;
  897. function $TrappedProcessorInputChecked(){return smalltalk.TrappedProcessorInputChecked||(typeof TrappedProcessorInputChecked=="undefined"?nil:TrappedProcessorInputChecked)}
  898. return smalltalk.withContext(function($ctx1) {
  899. var $1;
  900. $1=_st($TrappedProcessorInputChecked())._new();
  901. return $1;
  902. }, function($ctx1) {$ctx1.fill(self,"inputChecked",{},smalltalk.TrappedProcessor.klass)})},
  903. args: [],
  904. source: "inputChecked\x0a\x09^TrappedProcessorInputChecked new",
  905. messageSends: ["new"],
  906. referencedClasses: ["TrappedProcessorInputChecked"]
  907. }),
  908. smalltalk.TrappedProcessor.klass);
  909. smalltalk.addMethod(
  910. smalltalk.method({
  911. selector: "inputValue",
  912. category: '*Trapped-Processors',
  913. fn: function (){
  914. var self=this;
  915. function $TrappedProcessorInputValue(){return smalltalk.TrappedProcessorInputValue||(typeof TrappedProcessorInputValue=="undefined"?nil:TrappedProcessorInputValue)}
  916. return smalltalk.withContext(function($ctx1) {
  917. var $1;
  918. $1=_st($TrappedProcessorInputValue())._new();
  919. return $1;
  920. }, function($ctx1) {$ctx1.fill(self,"inputValue",{},smalltalk.TrappedProcessor.klass)})},
  921. args: [],
  922. source: "inputValue\x0a\x09^TrappedProcessorInputValue new",
  923. messageSends: ["new"],
  924. referencedClasses: ["TrappedProcessorInputValue"]
  925. }),
  926. smalltalk.TrappedProcessor.klass);
  927. smalltalk.addMethod(
  928. smalltalk.method({
  929. selector: "loopContents",
  930. category: '*Trapped-Processors',
  931. fn: function (){
  932. var self=this;
  933. function $TrappedProcessorLoopContents(){return smalltalk.TrappedProcessorLoopContents||(typeof TrappedProcessorLoopContents=="undefined"?nil:TrappedProcessorLoopContents)}
  934. return smalltalk.withContext(function($ctx1) {
  935. var $1;
  936. $1=_st($TrappedProcessorLoopContents())._new();
  937. return $1;
  938. }, function($ctx1) {$ctx1.fill(self,"loopContents",{},smalltalk.TrappedProcessor.klass)})},
  939. args: [],
  940. source: "loopContents\x0a\x09^TrappedProcessorLoopContents new",
  941. messageSends: ["new"],
  942. referencedClasses: ["TrappedProcessorLoopContents"]
  943. }),
  944. smalltalk.TrappedProcessor.klass);
  945. smalltalk.addMethod(
  946. smalltalk.method({
  947. selector: "loopProc",
  948. category: '*Trapped-Processors',
  949. fn: function (){
  950. var self=this;
  951. function $TrappedProcessorLoopProc(){return smalltalk.TrappedProcessorLoopProc||(typeof TrappedProcessorLoopProc=="undefined"?nil:TrappedProcessorLoopProc)}
  952. return smalltalk.withContext(function($ctx1) {
  953. var $1;
  954. $1=_st($TrappedProcessorLoopProc())._new();
  955. return $1;
  956. }, function($ctx1) {$ctx1.fill(self,"loopProc",{},smalltalk.TrappedProcessor.klass)})},
  957. args: [],
  958. source: "loopProc\x0a\x09^TrappedProcessorLoopProc new",
  959. messageSends: ["new"],
  960. referencedClasses: ["TrappedProcessorLoopProc"]
  961. }),
  962. smalltalk.TrappedProcessor.klass);
  963. smalltalk.addMethod(
  964. smalltalk.method({
  965. selector: "path",
  966. category: '*Trapped-Processors',
  967. fn: function (){
  968. var self=this;
  969. function $TrappedProcessorDescend(){return smalltalk.TrappedProcessorDescend||(typeof TrappedProcessorDescend=="undefined"?nil:TrappedProcessorDescend)}
  970. return smalltalk.withContext(function($ctx1) {
  971. var $1;
  972. $1=_st($TrappedProcessorDescend())._new();
  973. return $1;
  974. }, function($ctx1) {$ctx1.fill(self,"path",{},smalltalk.TrappedProcessor.klass)})},
  975. args: [],
  976. source: "path\x0a\x09^TrappedProcessorDescend new",
  977. messageSends: ["new"],
  978. referencedClasses: ["TrappedProcessorDescend"]
  979. }),
  980. smalltalk.TrappedProcessor.klass);
  981. smalltalk.addMethod(
  982. smalltalk.method({
  983. selector: "replace:with:",
  984. category: '*Trapped-Processors',
  985. fn: function (aString,anotherString){
  986. var self=this;
  987. function $TrappedProcessorReplace(){return smalltalk.TrappedProcessorReplace||(typeof TrappedProcessorReplace=="undefined"?nil:TrappedProcessorReplace)}
  988. return smalltalk.withContext(function($ctx1) {
  989. var $1;
  990. $1=_st($TrappedProcessorReplace())._new_with_(aString,anotherString);
  991. return $1;
  992. }, function($ctx1) {$ctx1.fill(self,"replace:with:",{aString:aString,anotherString:anotherString},smalltalk.TrappedProcessor.klass)})},
  993. args: ["aString", "anotherString"],
  994. source: "replace: aString with: anotherString\x0a\x09^TrappedProcessorReplace new: aString with: anotherString",
  995. messageSends: ["new:with:"],
  996. referencedClasses: ["TrappedProcessorReplace"]
  997. }),
  998. smalltalk.TrappedProcessor.klass);
  999. smalltalk.addMethod(
  1000. smalltalk.method({
  1001. selector: "signal:",
  1002. category: '*Trapped-Processors',
  1003. fn: function (aString){
  1004. var self=this;
  1005. function $TrappedProcessorSignal(){return smalltalk.TrappedProcessorSignal||(typeof TrappedProcessorSignal=="undefined"?nil:TrappedProcessorSignal)}
  1006. return smalltalk.withContext(function($ctx1) {
  1007. var $1;
  1008. $1=_st($TrappedProcessorSignal())._new_(aString);
  1009. return $1;
  1010. }, function($ctx1) {$ctx1.fill(self,"signal:",{aString:aString},smalltalk.TrappedProcessor.klass)})},
  1011. args: ["aString"],
  1012. source: "signal: aString\x0a\x09^TrappedProcessorSignal new: aString",
  1013. messageSends: ["new:"],
  1014. referencedClasses: ["TrappedProcessorSignal"]
  1015. }),
  1016. smalltalk.TrappedProcessor.klass);
  1017. smalltalk.addMethod(
  1018. smalltalk.method({
  1019. selector: "toBlackboard",
  1020. category: '*Trapped-Processors',
  1021. fn: function (){
  1022. var self=this;
  1023. function $TrappedProcessorToBlackboard(){return smalltalk.TrappedProcessorToBlackboard||(typeof TrappedProcessorToBlackboard=="undefined"?nil:TrappedProcessorToBlackboard)}
  1024. return smalltalk.withContext(function($ctx1) {
  1025. var $1;
  1026. $1=_st($TrappedProcessorToBlackboard())._new();
  1027. return $1;
  1028. }, function($ctx1) {$ctx1.fill(self,"toBlackboard",{},smalltalk.TrappedProcessor.klass)})},
  1029. args: [],
  1030. source: "toBlackboard\x0a\x09^TrappedProcessorToBlackboard new",
  1031. messageSends: ["new"],
  1032. referencedClasses: ["TrappedProcessorToBlackboard"]
  1033. }),
  1034. smalltalk.TrappedProcessor.klass);
  1035. smalltalk.addMethod(
  1036. smalltalk.method({
  1037. selector: "whenClicked",
  1038. category: '*Trapped-Processors',
  1039. fn: function (){
  1040. var self=this;
  1041. function $TrappedProcessorWhenClicked(){return smalltalk.TrappedProcessorWhenClicked||(typeof TrappedProcessorWhenClicked=="undefined"?nil:TrappedProcessorWhenClicked)}
  1042. return smalltalk.withContext(function($ctx1) {
  1043. var $1;
  1044. $1=_st($TrappedProcessorWhenClicked())._new();
  1045. return $1;
  1046. }, function($ctx1) {$ctx1.fill(self,"whenClicked",{},smalltalk.TrappedProcessor.klass)})},
  1047. args: [],
  1048. source: "whenClicked\x0a\x09^TrappedProcessorWhenClicked new",
  1049. messageSends: ["new"],
  1050. referencedClasses: ["TrappedProcessorWhenClicked"]
  1051. }),
  1052. smalltalk.TrappedProcessor.klass);
  1053. smalltalk.addMethod(
  1054. smalltalk.method({
  1055. selector: "whenSubmitted",
  1056. category: '*Trapped-Processors',
  1057. fn: function (){
  1058. var self=this;
  1059. function $TrappedProcessorWhenSubmitted(){return smalltalk.TrappedProcessorWhenSubmitted||(typeof TrappedProcessorWhenSubmitted=="undefined"?nil:TrappedProcessorWhenSubmitted)}
  1060. return smalltalk.withContext(function($ctx1) {
  1061. var $1;
  1062. $1=_st($TrappedProcessorWhenSubmitted())._new();
  1063. return $1;
  1064. }, function($ctx1) {$ctx1.fill(self,"whenSubmitted",{},smalltalk.TrappedProcessor.klass)})},
  1065. args: [],
  1066. source: "whenSubmitted\x0a\x09^TrappedProcessorWhenSubmitted new",
  1067. messageSends: ["new"],
  1068. referencedClasses: ["TrappedProcessorWhenSubmitted"]
  1069. }),
  1070. smalltalk.TrappedProcessor.klass);
  1071. smalltalk.addMethod(
  1072. smalltalk.method({
  1073. selector: "widget:",
  1074. category: '*Trapped-Processors',
  1075. fn: function (aString){
  1076. var self=this;
  1077. function $TrappedProcessorWidget(){return smalltalk.TrappedProcessorWidget||(typeof TrappedProcessorWidget=="undefined"?nil:TrappedProcessorWidget)}
  1078. return smalltalk.withContext(function($ctx1) {
  1079. var $1;
  1080. $1=_st($TrappedProcessorWidget())._new_(aString);
  1081. return $1;
  1082. }, function($ctx1) {$ctx1.fill(self,"widget:",{aString:aString},smalltalk.TrappedProcessor.klass)})},
  1083. args: ["aString"],
  1084. source: "widget: aString\x0a\x09^TrappedProcessorWidget new: aString",
  1085. messageSends: ["new:"],
  1086. referencedClasses: ["TrappedProcessorWidget"]
  1087. }),
  1088. smalltalk.TrappedProcessor.klass);
  1089. });