Trapped-Processors.js 46 KB

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