Trapped-Processors.js 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287
  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())._injectToChildren_(_st(_st(aDataCarrier)._target())._element());
  119. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorDescend)})},
  120. args: ["aDataCarrier"],
  121. source: "toView: aDataCarrier\x0a\x09Trapped current injectToChildren: aDataCarrier target element",
  122. messageSends: ["injectToChildren:", "current", "element", "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('TrappedProcessorGuard', smalltalk.TrappedProcessorGuardBase, [], 'Trapped-Processors');
  193. smalltalk.TrappedProcessorGuard.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,";
  194. smalltalk.addMethod(
  195. smalltalk.method({
  196. selector: "toView:",
  197. category: 'data transformation',
  198. fn: function (aDataCarrier){
  199. var self=this;
  200. var frozen,xon;
  201. return smalltalk.withContext(function($ctx1) {
  202. var $1,$2;
  203. frozen=_st(aDataCarrier)._copy();
  204. $ctx1.sendIdx["copy"]=1;
  205. xon=_st(frozen)._xontent();
  206. _st(_st(frozen)._target())._trapGuard_contents_(self["@guardPath"],(function(html){
  207. return smalltalk.withContext(function($ctx2) {
  208. $1=_st(frozen)._copy();
  209. _st($1)._target_(_st(html)._root());
  210. _st($1)._xontent_(xon);
  211. $2=_st($1)._proceed();
  212. return $2;
  213. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  214. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier,frozen:frozen,xon:xon},smalltalk.TrappedProcessorGuard)})},
  215. args: ["aDataCarrier"],
  216. source: "toView: aDataCarrier\x0a\x09| frozen xon |\x0a\x09frozen := aDataCarrier copy.\x0a\x09xon := frozen xontent.\x0a\x09frozen target trapGuard: guardPath contents: [ :html | frozen copy target: html root; xontent: xon; proceed ]",
  217. messageSends: ["copy", "xontent", "trapGuard:contents:", "target", "target:", "root", "xontent:", "proceed"],
  218. referencedClasses: []
  219. }),
  220. smalltalk.TrappedProcessorGuard);
  221. smalltalk.addClass('TrappedProcessorInputChecked', smalltalk.TrappedDataExpectingProcessor, [], 'Trapped-Processors');
  222. smalltalk.TrappedProcessorInputChecked.comment="I bind to checkbox checked state.";
  223. smalltalk.addMethod(
  224. smalltalk.method({
  225. selector: "installToView:toModel:",
  226. category: 'installation',
  227. fn: function (aDataCarrier,anotherDataCarrier){
  228. var self=this;
  229. var brush;
  230. return smalltalk.withContext(function($ctx1) {
  231. var $1,$2;
  232. brush=_st(aDataCarrier)._target();
  233. _st(brush)._onChange_((function(){
  234. return smalltalk.withContext(function($ctx2) {
  235. $1=_st(anotherDataCarrier)._copy();
  236. _st($1)._value_(_st(_st(brush)._asJQuery())._prop_("checked"));
  237. $2=_st($1)._proceed();
  238. return $2;
  239. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  240. return self}, function($ctx1) {$ctx1.fill(self,"installToView:toModel:",{aDataCarrier:aDataCarrier,anotherDataCarrier:anotherDataCarrier,brush:brush},smalltalk.TrappedProcessorInputChecked)})},
  241. args: ["aDataCarrier", "anotherDataCarrier"],
  242. source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09| brush |\x0a\x09brush := aDataCarrier target.\x0a\x09brush onChange: [ anotherDataCarrier copy value: (brush asJQuery prop: 'checked'); proceed ]",
  243. messageSends: ["target", "onChange:", "value:", "copy", "prop:", "asJQuery", "proceed"],
  244. referencedClasses: []
  245. }),
  246. smalltalk.TrappedProcessorInputChecked);
  247. smalltalk.addMethod(
  248. smalltalk.method({
  249. selector: "toView:",
  250. category: 'data transformation',
  251. fn: function (aDataCarrier){
  252. var self=this;
  253. return smalltalk.withContext(function($ctx1) {
  254. _st(aDataCarrier)._toTargetProp_("checked");
  255. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorInputChecked)})},
  256. args: ["aDataCarrier"],
  257. source: "toView: aDataCarrier\x0a\x09aDataCarrier toTargetProp: 'checked'",
  258. messageSends: ["toTargetProp:"],
  259. referencedClasses: []
  260. }),
  261. smalltalk.TrappedProcessorInputChecked);
  262. smalltalk.addClass('TrappedProcessorInputValue', smalltalk.TrappedDataExpectingProcessor, [], 'Trapped-Processors');
  263. smalltalk.TrappedProcessorInputValue.comment="I bind to input value.";
  264. smalltalk.addMethod(
  265. smalltalk.method({
  266. selector: "installToView:toModel:",
  267. category: 'installation',
  268. fn: function (aDataCarrier,anotherDataCarrier){
  269. var self=this;
  270. var brush;
  271. return smalltalk.withContext(function($ctx1) {
  272. var $1,$2;
  273. brush=_st(aDataCarrier)._target();
  274. _st(brush)._onChange_((function(){
  275. return smalltalk.withContext(function($ctx2) {
  276. $1=_st(anotherDataCarrier)._copy();
  277. _st($1)._value_(_st(_st(brush)._asJQuery())._val());
  278. $2=_st($1)._proceed();
  279. return $2;
  280. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  281. return self}, function($ctx1) {$ctx1.fill(self,"installToView:toModel:",{aDataCarrier:aDataCarrier,anotherDataCarrier:anotherDataCarrier,brush:brush},smalltalk.TrappedProcessorInputValue)})},
  282. args: ["aDataCarrier", "anotherDataCarrier"],
  283. source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09| brush |\x0a\x09brush := aDataCarrier target.\x0a\x09brush onChange: [ anotherDataCarrier copy value: brush asJQuery val; proceed ]",
  284. messageSends: ["target", "onChange:", "value:", "copy", "val", "asJQuery", "proceed"],
  285. referencedClasses: []
  286. }),
  287. smalltalk.TrappedProcessorInputValue);
  288. smalltalk.addMethod(
  289. smalltalk.method({
  290. selector: "toView:",
  291. category: 'data transformation',
  292. fn: function (aDataCarrier){
  293. var self=this;
  294. return smalltalk.withContext(function($ctx1) {
  295. _st(aDataCarrier)._toTargetValue();
  296. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorInputValue)})},
  297. args: ["aDataCarrier"],
  298. source: "toView: aDataCarrier\x0a\x09aDataCarrier toTargetValue",
  299. messageSends: ["toTargetValue"],
  300. referencedClasses: []
  301. }),
  302. smalltalk.TrappedProcessorInputValue);
  303. smalltalk.addClass('TrappedProcessorLoopBase', smalltalk.TrappedProcessor, [], 'Trapped-Processors');
  304. 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.";
  305. smalltalk.addMethod(
  306. smalltalk.method({
  307. selector: "toModel:",
  308. category: 'data transformation',
  309. fn: function (aDataCarrier){
  310. var self=this;
  311. return smalltalk.withContext(function($ctx1) {
  312. return self}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorLoopBase)})},
  313. args: ["aDataCarrier"],
  314. source: "toModel: aDataCarrier\x0a\x09\x22stop\x22",
  315. messageSends: [],
  316. referencedClasses: []
  317. }),
  318. smalltalk.TrappedProcessorLoopBase);
  319. smalltalk.addMethod(
  320. smalltalk.method({
  321. selector: "toView:",
  322. category: 'data transformation',
  323. fn: function (aDataCarrier){
  324. var self=this;
  325. return smalltalk.withContext(function($ctx1) {
  326. self._subclassResponsibility();
  327. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorLoopBase)})},
  328. args: ["aDataCarrier"],
  329. source: "toView: aDataCarrier\x0a\x09self subclassResponsibility",
  330. messageSends: ["subclassResponsibility"],
  331. referencedClasses: []
  332. }),
  333. smalltalk.TrappedProcessorLoopBase);
  334. smalltalk.addClass('TrappedProcessorLoopZ', smalltalk.TrappedProcessorLoopBase, [], 'Trapped-Processors');
  335. smalltalk.TrappedProcessorLoopZ.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\x0ascript type=application/x-beacon, noscript, ins or del).";
  336. smalltalk.addMethod(
  337. smalltalk.method({
  338. selector: "toView:",
  339. category: 'data transformation',
  340. fn: function (aDataCarrier){
  341. var self=this;
  342. var frozen,xon;
  343. return smalltalk.withContext(function($ctx1) {
  344. var $1,$2;
  345. frozen=_st(aDataCarrier)._copy();
  346. $ctx1.sendIdx["copy"]=1;
  347. xon=_st(frozen)._xontent();
  348. _st(_st(frozen)._target())._trapIter_after_([],(function(html){
  349. return smalltalk.withContext(function($ctx2) {
  350. $1=_st(frozen)._copy();
  351. _st($1)._target_(_st(html)._root());
  352. _st($1)._xontent_(xon);
  353. $2=_st($1)._proceed();
  354. return $2;
  355. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  356. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier,frozen:frozen,xon:xon},smalltalk.TrappedProcessorLoopZ)})},
  357. args: ["aDataCarrier"],
  358. source: "toView: aDataCarrier\x0a\x09| frozen xon |\x0a\x09frozen := aDataCarrier copy.\x0a\x09xon := frozen xontent.\x0a\x09frozen target trapIter: #() after: [ :html | frozen copy target: html root; xontent: xon; proceed ]",
  359. messageSends: ["copy", "xontent", "trapIter:after:", "target", "target:", "root", "xontent:", "proceed"],
  360. referencedClasses: []
  361. }),
  362. smalltalk.TrappedProcessorLoopZ);
  363. smalltalk.addClass('TrappedProcessorReplace', smalltalk.TrappedProcessor, ['left', 'right'], 'Trapped-Processors');
  364. 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";
  365. smalltalk.addMethod(
  366. smalltalk.method({
  367. selector: "left:",
  368. category: 'accessing',
  369. fn: function (aString){
  370. var self=this;
  371. return smalltalk.withContext(function($ctx1) {
  372. self["@left"]=aString;
  373. return self}, function($ctx1) {$ctx1.fill(self,"left:",{aString:aString},smalltalk.TrappedProcessorReplace)})},
  374. args: ["aString"],
  375. source: "left: aString\x0a\x09left := aString",
  376. messageSends: [],
  377. referencedClasses: []
  378. }),
  379. smalltalk.TrappedProcessorReplace);
  380. smalltalk.addMethod(
  381. smalltalk.method({
  382. selector: "right:",
  383. category: 'accessing',
  384. fn: function (aString){
  385. var self=this;
  386. return smalltalk.withContext(function($ctx1) {
  387. self["@right"]=aString;
  388. return self}, function($ctx1) {$ctx1.fill(self,"right:",{aString:aString},smalltalk.TrappedProcessorReplace)})},
  389. args: ["aString"],
  390. source: "right: aString\x0a\x09right := aString",
  391. messageSends: [],
  392. referencedClasses: []
  393. }),
  394. smalltalk.TrappedProcessorReplace);
  395. smalltalk.addMethod(
  396. smalltalk.method({
  397. selector: "toModel:",
  398. category: 'data transformation',
  399. fn: function (aDataCarrier){
  400. var self=this;
  401. var replacement,old;
  402. return smalltalk.withContext(function($ctx1) {
  403. var $1,$2;
  404. $1=_st(self["@left"])._replace_with_("^\x5c^","");
  405. $ctx1.sendIdx["replace:with:"]=2;
  406. replacement=_st($1)._replace_with_("\x5c$$","");
  407. $ctx1.sendIdx["replace:with:"]=1;
  408. old=_st(_st(aDataCarrier)._value())._asString();
  409. _st(aDataCarrier)._value_whenDifferentFrom_(_st(old)._replace_with_(self["@right"],replacement),old);
  410. $2=_st(aDataCarrier)._proceed();
  411. return self}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier,replacement:replacement,old:old},smalltalk.TrappedProcessorReplace)})},
  412. args: ["aDataCarrier"],
  413. 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",
  414. messageSends: ["replace:with:", "asString", "value", "value:whenDifferentFrom:", "proceed"],
  415. referencedClasses: []
  416. }),
  417. smalltalk.TrappedProcessorReplace);
  418. smalltalk.addMethod(
  419. smalltalk.method({
  420. selector: "toView:",
  421. category: 'data transformation',
  422. fn: function (aDataCarrier){
  423. var self=this;
  424. var replacement,old;
  425. return smalltalk.withContext(function($ctx1) {
  426. var $1,$2;
  427. $1=_st(self["@right"])._replace_with_("^\x5c^","");
  428. $ctx1.sendIdx["replace:with:"]=2;
  429. replacement=_st($1)._replace_with_("\x5c$$","");
  430. $ctx1.sendIdx["replace:with:"]=1;
  431. old=_st(_st(aDataCarrier)._value())._asString();
  432. _st(aDataCarrier)._value_whenDifferentFrom_(_st(old)._replace_with_(self["@left"],replacement),old);
  433. $2=_st(aDataCarrier)._proceed();
  434. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier,replacement:replacement,old:old},smalltalk.TrappedProcessorReplace)})},
  435. args: ["aDataCarrier"],
  436. 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",
  437. messageSends: ["replace:with:", "asString", "value", "value:whenDifferentFrom:", "proceed"],
  438. referencedClasses: []
  439. }),
  440. smalltalk.TrappedProcessorReplace);
  441. smalltalk.addMethod(
  442. smalltalk.method({
  443. selector: "new:with:",
  444. category: 'instance creation',
  445. fn: function (aString,anotherString){
  446. var self=this;
  447. return smalltalk.withContext(function($ctx1) {
  448. var $2,$3,$4,$5,$1;
  449. $2=self._new();
  450. $3=$2;
  451. $4=_st(aString)._asString();
  452. $ctx1.sendIdx["asString"]=1;
  453. _st($3)._left_($4);
  454. _st($2)._right_(_st(anotherString)._asString());
  455. $5=_st($2)._yourself();
  456. $1=$5;
  457. return $1;
  458. }, function($ctx1) {$ctx1.fill(self,"new:with:",{aString:aString,anotherString:anotherString},smalltalk.TrappedProcessorReplace.klass)})},
  459. args: ["aString", "anotherString"],
  460. source: "new: aString with: anotherString\x0a\x09^ self new\x0a\x09\x09left: aString asString;\x0a\x09\x09right: anotherString asString;\x0a\x09\x09yourself",
  461. messageSends: ["left:", "new", "asString", "right:", "yourself"],
  462. referencedClasses: []
  463. }),
  464. smalltalk.TrappedProcessorReplace.klass);
  465. smalltalk.addClass('TrappedProcessorSignal', smalltalk.TrappedProcessor, ['selector'], 'Trapped-Processors');
  466. smalltalk.TrappedProcessorSignal.comment="Instead of writing data directly to model,\x0aI instead modify it by sending a message specified when instantiating me.";
  467. smalltalk.addMethod(
  468. smalltalk.method({
  469. selector: "selector:",
  470. category: 'accessing',
  471. fn: function (aString){
  472. var self=this;
  473. return smalltalk.withContext(function($ctx1) {
  474. self["@selector"]=aString;
  475. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.TrappedProcessorSignal)})},
  476. args: ["aString"],
  477. source: "selector: aString\x0a\x09selector := aString",
  478. messageSends: [],
  479. referencedClasses: []
  480. }),
  481. smalltalk.TrappedProcessorSignal);
  482. smalltalk.addMethod(
  483. smalltalk.method({
  484. selector: "toModel:",
  485. category: 'data transformation',
  486. fn: function (aDataCarrier){
  487. var self=this;
  488. return smalltalk.withContext(function($ctx1) {
  489. _st(aDataCarrier)._modifyTargetByPerforming_(self["@selector"]);
  490. return self}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorSignal)})},
  491. args: ["aDataCarrier"],
  492. source: "toModel: aDataCarrier\x0a\x09aDataCarrier modifyTargetByPerforming: selector",
  493. messageSends: ["modifyTargetByPerforming:"],
  494. referencedClasses: []
  495. }),
  496. smalltalk.TrappedProcessorSignal);
  497. smalltalk.addMethod(
  498. smalltalk.method({
  499. selector: "toView:",
  500. category: 'data transformation',
  501. fn: function (aDataCarrier){
  502. var self=this;
  503. return smalltalk.withContext(function($ctx1) {
  504. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorSignal)})},
  505. args: ["aDataCarrier"],
  506. source: "toView: aDataCarrier\x0a\x09\x22stop\x22",
  507. messageSends: [],
  508. referencedClasses: []
  509. }),
  510. smalltalk.TrappedProcessorSignal);
  511. smalltalk.addMethod(
  512. smalltalk.method({
  513. selector: "new:",
  514. category: 'instance creation',
  515. fn: function (aString){
  516. var self=this;
  517. return smalltalk.withContext(function($ctx1) {
  518. var $2,$3,$1;
  519. $2=self._new();
  520. _st($2)._selector_(aString);
  521. $3=_st($2)._yourself();
  522. $1=$3;
  523. return $1;
  524. }, function($ctx1) {$ctx1.fill(self,"new:",{aString:aString},smalltalk.TrappedProcessorSignal.klass)})},
  525. args: ["aString"],
  526. source: "new: aString\x0a\x09^self new\x0a\x09\x09selector: aString;\x0a\x09\x09yourself",
  527. messageSends: ["selector:", "new", "yourself"],
  528. referencedClasses: []
  529. }),
  530. smalltalk.TrappedProcessorSignal.klass);
  531. smalltalk.addClass('TrappedProcessorToBlackboard', smalltalk.TrappedDataExpectingProcessor, [], 'Trapped-Processors');
  532. smalltalk.TrappedProcessorToBlackboard.comment="I save the data to blackboard in toModel:, to position specified by path.";
  533. smalltalk.addMethod(
  534. smalltalk.method({
  535. selector: "toModel:",
  536. category: 'data transformation',
  537. fn: function (aDataCarrier){
  538. var self=this;
  539. return smalltalk.withContext(function($ctx1) {
  540. _st(_st(aDataCarrier)._target())._modify_((function(){
  541. return smalltalk.withContext(function($ctx2) {
  542. return _st(aDataCarrier)._value();
  543. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  544. return self}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorToBlackboard)})},
  545. args: ["aDataCarrier"],
  546. source: "toModel: aDataCarrier\x0a\x09aDataCarrier target modify: [ aDataCarrier value ]",
  547. messageSends: ["modify:", "target", "value"],
  548. referencedClasses: []
  549. }),
  550. smalltalk.TrappedProcessorToBlackboard);
  551. smalltalk.addClass('TrappedProcessorUriComponentDecode', smalltalk.TrappedProcessor, [], 'Trapped-Processors');
  552. smalltalk.TrappedProcessorUriComponentDecode.comment="I uriComponentDecode in toView:\x0aand encode in toModel:";
  553. smalltalk.addMethod(
  554. smalltalk.method({
  555. selector: "toModel:",
  556. category: 'data transformation',
  557. fn: function (aDataCarrier){
  558. var self=this;
  559. return smalltalk.withContext(function($ctx1) {
  560. var $1;
  561. _st(aDataCarrier)._value_(_st(_st(aDataCarrier)._value())._uriComponentEncoded());
  562. $1=_st(aDataCarrier)._proceed();
  563. return self}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorUriComponentDecode)})},
  564. args: ["aDataCarrier"],
  565. source: "toModel: aDataCarrier\x0a\x09aDataCarrier\x0a\x09\x09value: aDataCarrier value uriComponentEncoded;\x0a\x09\x09proceed",
  566. messageSends: ["value:", "uriComponentEncoded", "value", "proceed"],
  567. referencedClasses: []
  568. }),
  569. smalltalk.TrappedProcessorUriComponentDecode);
  570. smalltalk.addMethod(
  571. smalltalk.method({
  572. selector: "toView:",
  573. category: 'data transformation',
  574. fn: function (aDataCarrier){
  575. var self=this;
  576. return smalltalk.withContext(function($ctx1) {
  577. var $1;
  578. _st(aDataCarrier)._value_(_st(_st(aDataCarrier)._value())._uriComponentDecoded());
  579. $1=_st(aDataCarrier)._proceed();
  580. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorUriComponentDecode)})},
  581. args: ["aDataCarrier"],
  582. source: "toView: aDataCarrier\x0a\x09aDataCarrier\x0a\x09\x09value: aDataCarrier value uriComponentDecoded;\x0a\x09\x09proceed",
  583. messageSends: ["value:", "uriComponentDecoded", "value", "proceed"],
  584. referencedClasses: []
  585. }),
  586. smalltalk.TrappedProcessorUriComponentDecode);
  587. smalltalk.addClass('TrappedProcessorUriComponentEncode', smalltalk.TrappedProcessor, [], 'Trapped-Processors');
  588. smalltalk.TrappedProcessorUriComponentEncode.comment="I uriComponentEncode in toView:\x0aand decode in toModel:";
  589. smalltalk.addMethod(
  590. smalltalk.method({
  591. selector: "toModel:",
  592. category: 'data transformation',
  593. fn: function (aDataCarrier){
  594. var self=this;
  595. return smalltalk.withContext(function($ctx1) {
  596. var $1;
  597. _st(aDataCarrier)._value_(_st(_st(aDataCarrier)._value())._uriComponentDecoded());
  598. $1=_st(aDataCarrier)._proceed();
  599. return self}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorUriComponentEncode)})},
  600. args: ["aDataCarrier"],
  601. source: "toModel: aDataCarrier\x0a\x09aDataCarrier\x0a\x09\x09value: aDataCarrier value uriComponentDecoded;\x0a\x09\x09proceed",
  602. messageSends: ["value:", "uriComponentDecoded", "value", "proceed"],
  603. referencedClasses: []
  604. }),
  605. smalltalk.TrappedProcessorUriComponentEncode);
  606. smalltalk.addMethod(
  607. smalltalk.method({
  608. selector: "toView:",
  609. category: 'data transformation',
  610. fn: function (aDataCarrier){
  611. var self=this;
  612. return smalltalk.withContext(function($ctx1) {
  613. var $1;
  614. _st(aDataCarrier)._value_(_st(_st(aDataCarrier)._value())._uriComponentEncoded());
  615. $1=_st(aDataCarrier)._proceed();
  616. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorUriComponentEncode)})},
  617. args: ["aDataCarrier"],
  618. source: "toView: aDataCarrier\x0a\x09aDataCarrier\x0a\x09\x09value: aDataCarrier value uriComponentEncoded;\x0a\x09\x09proceed",
  619. messageSends: ["value:", "uriComponentEncoded", "value", "proceed"],
  620. referencedClasses: []
  621. }),
  622. smalltalk.TrappedProcessorUriComponentEncode);
  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.addClass('TrappedProcessorXontent', smalltalk.TrappedProcessor, [], 'Trapped-Processors');
  719. smalltalk.TrappedProcessorXontent.comment="I am used to show xontent of the brush I am installed on\x0a(see jQuery plugin Xontent for details).\x0a\x0aI clone xontent of the brush, put it into HTML\x0aand interpret all contained data-trap attributes.";
  720. smalltalk.addMethod(
  721. smalltalk.method({
  722. selector: "toView:",
  723. category: 'data transformation',
  724. fn: function (aDataCarrier){
  725. var self=this;
  726. function $Trapped(){return smalltalk.Trapped||(typeof Trapped=="undefined"?nil:Trapped)}
  727. return smalltalk.withContext(function($ctx1) {
  728. _st(_st(_st(aDataCarrier)._target())._asJQuery())._append_(_st(_st($Trapped())._current())._cloneAndInject_(_st(_st(aDataCarrier)._xontent())._get_((0))));
  729. _st(aDataCarrier)._proceed();
  730. return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorXontent)})},
  731. args: ["aDataCarrier"],
  732. source: "toView: aDataCarrier\x0a\x09aDataCarrier target asJQuery append: (Trapped current cloneAndInject: (aDataCarrier xontent get: 0)).\x0a\x09aDataCarrier proceed",
  733. messageSends: ["append:", "asJQuery", "target", "cloneAndInject:", "current", "get:", "xontent", "proceed"],
  734. referencedClasses: ["Trapped"]
  735. }),
  736. smalltalk.TrappedProcessorXontent);
  737. smalltalk.addMethod(
  738. smalltalk.method({
  739. selector: "modifyTarget",
  740. category: '*Trapped-Processors',
  741. fn: function (){
  742. var self=this;
  743. return smalltalk.withContext(function($ctx1) {
  744. _st(self._target())._modify_((function(){
  745. return smalltalk.withContext(function($ctx2) {
  746. return self._value();
  747. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  748. return self}, function($ctx1) {$ctx1.fill(self,"modifyTarget",{},smalltalk.TrappedDataCarrier)})},
  749. args: [],
  750. source: "modifyTarget\x0a\x09self target modify: [ self value ]",
  751. messageSends: ["modify:", "target", "value"],
  752. referencedClasses: []
  753. }),
  754. smalltalk.TrappedDataCarrier);
  755. smalltalk.addMethod(
  756. smalltalk.method({
  757. selector: "modifyTargetByPerforming:",
  758. category: '*Trapped-Processors',
  759. fn: function (aString){
  760. var self=this;
  761. return smalltalk.withContext(function($ctx1) {
  762. _st(self._target())._modify_((function(m){
  763. return smalltalk.withContext(function($ctx2) {
  764. return _st(m)._perform_(aString);
  765. }, function($ctx2) {$ctx2.fillBlock({m:m},$ctx1,1)})}));
  766. return self}, function($ctx1) {$ctx1.fill(self,"modifyTargetByPerforming:",{aString:aString},smalltalk.TrappedDataCarrier)})},
  767. args: ["aString"],
  768. source: "modifyTargetByPerforming: aString\x0a\x09self target modify: [ :m | m perform: aString ]",
  769. messageSends: ["modify:", "target", "perform:"],
  770. referencedClasses: []
  771. }),
  772. smalltalk.TrappedDataCarrier);
  773. smalltalk.addMethod(
  774. smalltalk.method({
  775. selector: "primitive:",
  776. category: '*Trapped-Processors',
  777. fn: function (anObject){
  778. var self=this;
  779. return smalltalk.withContext(function($ctx1) {
  780. return anObject === nil ? null : anObject.valueOf();
  781. return self}, function($ctx1) {$ctx1.fill(self,"primitive:",{anObject:anObject},smalltalk.TrappedDataCarrier)})},
  782. args: ["anObject"],
  783. source: "primitive: anObject\x0a\x09<return anObject === nil ? null : anObject.valueOf()>",
  784. messageSends: [],
  785. referencedClasses: []
  786. }),
  787. smalltalk.TrappedDataCarrier);
  788. smalltalk.addMethod(
  789. smalltalk.method({
  790. selector: "toTargetAttr:",
  791. category: '*Trapped-Processors',
  792. fn: function (aString){
  793. var self=this;
  794. return smalltalk.withContext(function($ctx1) {
  795. var $1,$2,$3,$5,$4;
  796. $1=self._falseAsNilValue();
  797. if(($receiver = $1) == nil || $receiver == null){
  798. $2=self._target();
  799. $ctx1.sendIdx["target"]=1;
  800. _st($2)._removeAt_(aString);
  801. } else {
  802. var value,bvalue;
  803. bvalue=$receiver;
  804. value=self._primitive_(bvalue);
  805. value;
  806. $3=self._target();
  807. $5=_st(value).__eq(true);
  808. if(smalltalk.assert($5)){
  809. $4=aString;
  810. } else {
  811. $4=value;
  812. };
  813. _st($3)._at_put_(aString,$4);
  814. };
  815. return self}, function($ctx1) {$ctx1.fill(self,"toTargetAttr:",{aString:aString},smalltalk.TrappedDataCarrier)})},
  816. args: ["aString"],
  817. source: "toTargetAttr: aString\x0a\x09self falseAsNilValue\x0a\x09\x09ifNil: [ self target removeAt: aString ]\x0a\x09\x09ifNotNil: [ :bvalue |\x0a\x09\x09\x09| value |\x0a\x09\x09\x09value := self primitive: bvalue.\x0a\x09\x09\x09self target at: aString put: (value = true ifTrue: [ aString ] ifFalse: [ value ]) ]",
  818. messageSends: ["ifNil:ifNotNil:", "falseAsNilValue", "removeAt:", "target", "primitive:", "at:put:", "ifTrue:ifFalse:", "="],
  819. referencedClasses: []
  820. }),
  821. smalltalk.TrappedDataCarrier);
  822. smalltalk.addMethod(
  823. smalltalk.method({
  824. selector: "toTargetContents",
  825. category: '*Trapped-Processors',
  826. fn: function (){
  827. var self=this;
  828. return smalltalk.withContext(function($ctx1) {
  829. _st(self._target())._contents_(self._primitive_(self._value()));
  830. return self}, function($ctx1) {$ctx1.fill(self,"toTargetContents",{},smalltalk.TrappedDataCarrier)})},
  831. args: [],
  832. source: "toTargetContents\x0a\x09self target contents: (self primitive: self value)",
  833. messageSends: ["contents:", "target", "primitive:", "value"],
  834. referencedClasses: []
  835. }),
  836. smalltalk.TrappedDataCarrier);
  837. smalltalk.addMethod(
  838. smalltalk.method({
  839. selector: "toTargetProp:",
  840. category: '*Trapped-Processors',
  841. fn: function (aString){
  842. var self=this;
  843. return smalltalk.withContext(function($ctx1) {
  844. _st(_st(self._target())._element())._at_put_(aString,self._primitive_(self._value()));
  845. return self}, function($ctx1) {$ctx1.fill(self,"toTargetProp:",{aString:aString},smalltalk.TrappedDataCarrier)})},
  846. args: ["aString"],
  847. source: "toTargetProp: aString\x0a\x09self target element at: aString put: (self primitive: self value)",
  848. messageSends: ["at:put:", "element", "target", "primitive:", "value"],
  849. referencedClasses: []
  850. }),
  851. smalltalk.TrappedDataCarrier);
  852. smalltalk.addMethod(
  853. smalltalk.method({
  854. selector: "toTargetValue",
  855. category: '*Trapped-Processors',
  856. fn: function (){
  857. var self=this;
  858. return smalltalk.withContext(function($ctx1) {
  859. _st(_st(self._target())._asJQuery())._val_(self._primitive_(self._value()));
  860. return self}, function($ctx1) {$ctx1.fill(self,"toTargetValue",{},smalltalk.TrappedDataCarrier)})},
  861. args: [],
  862. source: "toTargetValue\x0a\x09self target asJQuery val: (self primitive: self value)",
  863. messageSends: ["val:", "asJQuery", "target", "primitive:", "value"],
  864. referencedClasses: []
  865. }),
  866. smalltalk.TrappedDataCarrier);
  867. smalltalk.addMethod(
  868. smalltalk.method({
  869. selector: "xontent",
  870. category: '*Trapped-Processors',
  871. fn: function (){
  872. var self=this;
  873. return smalltalk.withContext(function($ctx1) {
  874. var $1;
  875. $1=_st(_st(self._target())._asJQuery())._xontent();
  876. return $1;
  877. }, function($ctx1) {$ctx1.fill(self,"xontent",{},smalltalk.TrappedDataCarrier)})},
  878. args: [],
  879. source: "xontent\x0a\x09^self target asJQuery xontent",
  880. messageSends: ["xontent", "asJQuery", "target"],
  881. referencedClasses: []
  882. }),
  883. smalltalk.TrappedDataCarrier);
  884. smalltalk.addMethod(
  885. smalltalk.method({
  886. selector: "xontent:",
  887. category: '*Trapped-Processors',
  888. fn: function (anObject){
  889. var self=this;
  890. return smalltalk.withContext(function($ctx1) {
  891. _st(_st(self._target())._asJQuery())._xontent_data_("set",anObject);
  892. return self}, function($ctx1) {$ctx1.fill(self,"xontent:",{anObject:anObject},smalltalk.TrappedDataCarrier)})},
  893. args: ["anObject"],
  894. source: "xontent: anObject\x0a\x09self target asJQuery xontent: 'set' data: anObject",
  895. messageSends: ["xontent:data:", "asJQuery", "target"],
  896. referencedClasses: []
  897. }),
  898. smalltalk.TrappedDataCarrier);
  899. smalltalk.addMethod(
  900. smalltalk.method({
  901. selector: "attr:",
  902. category: '*Trapped-Processors',
  903. fn: function (aString){
  904. var self=this;
  905. function $TrappedProcessorAttribute(){return smalltalk.TrappedProcessorAttribute||(typeof TrappedProcessorAttribute=="undefined"?nil:TrappedProcessorAttribute)}
  906. return smalltalk.withContext(function($ctx1) {
  907. var $1;
  908. $1=_st($TrappedProcessorAttribute())._new_(aString);
  909. return $1;
  910. }, function($ctx1) {$ctx1.fill(self,"attr:",{aString:aString},smalltalk.TrappedProcessor.klass)})},
  911. args: ["aString"],
  912. source: "attr: aString\x0a\x09^TrappedProcessorAttribute new: aString",
  913. messageSends: ["new:"],
  914. referencedClasses: ["TrappedProcessorAttribute"]
  915. }),
  916. smalltalk.TrappedProcessor.klass);
  917. smalltalk.addMethod(
  918. smalltalk.method({
  919. selector: "dataToView:",
  920. category: '*Trapped-Processors',
  921. fn: function (aBlock){
  922. var self=this;
  923. function $TrappedProcessorDataAdhoc(){return smalltalk.TrappedProcessorDataAdhoc||(typeof TrappedProcessorDataAdhoc=="undefined"?nil:TrappedProcessorDataAdhoc)}
  924. return smalltalk.withContext(function($ctx1) {
  925. var $1;
  926. $1=_st($TrappedProcessorDataAdhoc())._newToView_(aBlock);
  927. return $1;
  928. }, function($ctx1) {$ctx1.fill(self,"dataToView:",{aBlock:aBlock},smalltalk.TrappedProcessor.klass)})},
  929. args: ["aBlock"],
  930. source: "dataToView: aBlock\x0a\x09^TrappedProcessorDataAdhoc newToView: aBlock",
  931. messageSends: ["newToView:"],
  932. referencedClasses: ["TrappedProcessorDataAdhoc"]
  933. }),
  934. smalltalk.TrappedProcessor.klass);
  935. smalltalk.addMethod(
  936. smalltalk.method({
  937. selector: "deuric",
  938. category: '*Trapped-Processors',
  939. fn: function (){
  940. var self=this;
  941. function $TrappedProcessorUriComponentDecode(){return smalltalk.TrappedProcessorUriComponentDecode||(typeof TrappedProcessorUriComponentDecode=="undefined"?nil:TrappedProcessorUriComponentDecode)}
  942. return smalltalk.withContext(function($ctx1) {
  943. var $1;
  944. $1=_st($TrappedProcessorUriComponentDecode())._new();
  945. return $1;
  946. }, function($ctx1) {$ctx1.fill(self,"deuric",{},smalltalk.TrappedProcessor.klass)})},
  947. args: [],
  948. source: "deuric\x0a\x09^TrappedProcessorUriComponentDecode new",
  949. messageSends: ["new"],
  950. referencedClasses: ["TrappedProcessorUriComponentDecode"]
  951. }),
  952. smalltalk.TrappedProcessor.klass);
  953. smalltalk.addMethod(
  954. smalltalk.method({
  955. selector: "guard:",
  956. category: '*Trapped-Processors',
  957. fn: function (anArray){
  958. var self=this;
  959. function $TrappedProcessorGuard(){return smalltalk.TrappedProcessorGuard||(typeof TrappedProcessorGuard=="undefined"?nil:TrappedProcessorGuard)}
  960. return smalltalk.withContext(function($ctx1) {
  961. var $1;
  962. $1=_st($TrappedProcessorGuard())._new_(anArray);
  963. return $1;
  964. }, function($ctx1) {$ctx1.fill(self,"guard:",{anArray:anArray},smalltalk.TrappedProcessor.klass)})},
  965. args: ["anArray"],
  966. source: "guard: anArray\x0a\x09^TrappedProcessorGuard new: anArray",
  967. messageSends: ["new:"],
  968. referencedClasses: ["TrappedProcessorGuard"]
  969. }),
  970. smalltalk.TrappedProcessor.klass);
  971. smalltalk.addMethod(
  972. smalltalk.method({
  973. selector: "inputChecked",
  974. category: '*Trapped-Processors',
  975. fn: function (){
  976. var self=this;
  977. function $TrappedProcessorInputChecked(){return smalltalk.TrappedProcessorInputChecked||(typeof TrappedProcessorInputChecked=="undefined"?nil:TrappedProcessorInputChecked)}
  978. return smalltalk.withContext(function($ctx1) {
  979. var $1;
  980. $1=_st($TrappedProcessorInputChecked())._new();
  981. return $1;
  982. }, function($ctx1) {$ctx1.fill(self,"inputChecked",{},smalltalk.TrappedProcessor.klass)})},
  983. args: [],
  984. source: "inputChecked\x0a\x09^TrappedProcessorInputChecked new",
  985. messageSends: ["new"],
  986. referencedClasses: ["TrappedProcessorInputChecked"]
  987. }),
  988. smalltalk.TrappedProcessor.klass);
  989. smalltalk.addMethod(
  990. smalltalk.method({
  991. selector: "inputValue",
  992. category: '*Trapped-Processors',
  993. fn: function (){
  994. var self=this;
  995. function $TrappedProcessorInputValue(){return smalltalk.TrappedProcessorInputValue||(typeof TrappedProcessorInputValue=="undefined"?nil:TrappedProcessorInputValue)}
  996. return smalltalk.withContext(function($ctx1) {
  997. var $1;
  998. $1=_st($TrappedProcessorInputValue())._new();
  999. return $1;
  1000. }, function($ctx1) {$ctx1.fill(self,"inputValue",{},smalltalk.TrappedProcessor.klass)})},
  1001. args: [],
  1002. source: "inputValue\x0a\x09^TrappedProcessorInputValue new",
  1003. messageSends: ["new"],
  1004. referencedClasses: ["TrappedProcessorInputValue"]
  1005. }),
  1006. smalltalk.TrappedProcessor.klass);
  1007. smalltalk.addMethod(
  1008. smalltalk.method({
  1009. selector: "loopZ",
  1010. category: '*Trapped-Processors',
  1011. fn: function (){
  1012. var self=this;
  1013. function $TrappedProcessorLoopZ(){return smalltalk.TrappedProcessorLoopZ||(typeof TrappedProcessorLoopZ=="undefined"?nil:TrappedProcessorLoopZ)}
  1014. return smalltalk.withContext(function($ctx1) {
  1015. var $1;
  1016. $1=_st($TrappedProcessorLoopZ())._new();
  1017. return $1;
  1018. }, function($ctx1) {$ctx1.fill(self,"loopZ",{},smalltalk.TrappedProcessor.klass)})},
  1019. args: [],
  1020. source: "loopZ\x0a\x09^TrappedProcessorLoopZ new",
  1021. messageSends: ["new"],
  1022. referencedClasses: ["TrappedProcessorLoopZ"]
  1023. }),
  1024. smalltalk.TrappedProcessor.klass);
  1025. smalltalk.addMethod(
  1026. smalltalk.method({
  1027. selector: "path",
  1028. category: '*Trapped-Processors',
  1029. fn: function (){
  1030. var self=this;
  1031. function $TrappedProcessorDescend(){return smalltalk.TrappedProcessorDescend||(typeof TrappedProcessorDescend=="undefined"?nil:TrappedProcessorDescend)}
  1032. return smalltalk.withContext(function($ctx1) {
  1033. var $1;
  1034. $1=_st($TrappedProcessorDescend())._new();
  1035. return $1;
  1036. }, function($ctx1) {$ctx1.fill(self,"path",{},smalltalk.TrappedProcessor.klass)})},
  1037. args: [],
  1038. source: "path\x0a\x09^TrappedProcessorDescend new",
  1039. messageSends: ["new"],
  1040. referencedClasses: ["TrappedProcessorDescend"]
  1041. }),
  1042. smalltalk.TrappedProcessor.klass);
  1043. smalltalk.addMethod(
  1044. smalltalk.method({
  1045. selector: "replace:with:",
  1046. category: '*Trapped-Processors',
  1047. fn: function (aString,anotherString){
  1048. var self=this;
  1049. function $TrappedProcessorReplace(){return smalltalk.TrappedProcessorReplace||(typeof TrappedProcessorReplace=="undefined"?nil:TrappedProcessorReplace)}
  1050. return smalltalk.withContext(function($ctx1) {
  1051. var $1;
  1052. $1=_st($TrappedProcessorReplace())._new_with_(aString,anotherString);
  1053. return $1;
  1054. }, function($ctx1) {$ctx1.fill(self,"replace:with:",{aString:aString,anotherString:anotherString},smalltalk.TrappedProcessor.klass)})},
  1055. args: ["aString", "anotherString"],
  1056. source: "replace: aString with: anotherString\x0a\x09^TrappedProcessorReplace new: aString with: anotherString",
  1057. messageSends: ["new:with:"],
  1058. referencedClasses: ["TrappedProcessorReplace"]
  1059. }),
  1060. smalltalk.TrappedProcessor.klass);
  1061. smalltalk.addMethod(
  1062. smalltalk.method({
  1063. selector: "signal:",
  1064. category: '*Trapped-Processors',
  1065. fn: function (aString){
  1066. var self=this;
  1067. function $TrappedProcessorSignal(){return smalltalk.TrappedProcessorSignal||(typeof TrappedProcessorSignal=="undefined"?nil:TrappedProcessorSignal)}
  1068. return smalltalk.withContext(function($ctx1) {
  1069. var $1;
  1070. $1=_st($TrappedProcessorSignal())._new_(aString);
  1071. return $1;
  1072. }, function($ctx1) {$ctx1.fill(self,"signal:",{aString:aString},smalltalk.TrappedProcessor.klass)})},
  1073. args: ["aString"],
  1074. source: "signal: aString\x0a\x09^TrappedProcessorSignal new: aString",
  1075. messageSends: ["new:"],
  1076. referencedClasses: ["TrappedProcessorSignal"]
  1077. }),
  1078. smalltalk.TrappedProcessor.klass);
  1079. smalltalk.addMethod(
  1080. smalltalk.method({
  1081. selector: "toBlackboard",
  1082. category: '*Trapped-Processors',
  1083. fn: function (){
  1084. var self=this;
  1085. function $TrappedProcessorToBlackboard(){return smalltalk.TrappedProcessorToBlackboard||(typeof TrappedProcessorToBlackboard=="undefined"?nil:TrappedProcessorToBlackboard)}
  1086. return smalltalk.withContext(function($ctx1) {
  1087. var $1;
  1088. $1=_st($TrappedProcessorToBlackboard())._new();
  1089. return $1;
  1090. }, function($ctx1) {$ctx1.fill(self,"toBlackboard",{},smalltalk.TrappedProcessor.klass)})},
  1091. args: [],
  1092. source: "toBlackboard\x0a\x09^TrappedProcessorToBlackboard new",
  1093. messageSends: ["new"],
  1094. referencedClasses: ["TrappedProcessorToBlackboard"]
  1095. }),
  1096. smalltalk.TrappedProcessor.klass);
  1097. smalltalk.addMethod(
  1098. smalltalk.method({
  1099. selector: "uric",
  1100. category: '*Trapped-Processors',
  1101. fn: function (){
  1102. var self=this;
  1103. function $TrappedProcessorUriComponentEncode(){return smalltalk.TrappedProcessorUriComponentEncode||(typeof TrappedProcessorUriComponentEncode=="undefined"?nil:TrappedProcessorUriComponentEncode)}
  1104. return smalltalk.withContext(function($ctx1) {
  1105. var $1;
  1106. $1=_st($TrappedProcessorUriComponentEncode())._new();
  1107. return $1;
  1108. }, function($ctx1) {$ctx1.fill(self,"uric",{},smalltalk.TrappedProcessor.klass)})},
  1109. args: [],
  1110. source: "uric\x0a\x09^TrappedProcessorUriComponentEncode new",
  1111. messageSends: ["new"],
  1112. referencedClasses: ["TrappedProcessorUriComponentEncode"]
  1113. }),
  1114. smalltalk.TrappedProcessor.klass);
  1115. smalltalk.addMethod(
  1116. smalltalk.method({
  1117. selector: "whenClicked",
  1118. category: '*Trapped-Processors',
  1119. fn: function (){
  1120. var self=this;
  1121. function $TrappedProcessorWhenClicked(){return smalltalk.TrappedProcessorWhenClicked||(typeof TrappedProcessorWhenClicked=="undefined"?nil:TrappedProcessorWhenClicked)}
  1122. return smalltalk.withContext(function($ctx1) {
  1123. var $1;
  1124. $1=_st($TrappedProcessorWhenClicked())._new();
  1125. return $1;
  1126. }, function($ctx1) {$ctx1.fill(self,"whenClicked",{},smalltalk.TrappedProcessor.klass)})},
  1127. args: [],
  1128. source: "whenClicked\x0a\x09^TrappedProcessorWhenClicked new",
  1129. messageSends: ["new"],
  1130. referencedClasses: ["TrappedProcessorWhenClicked"]
  1131. }),
  1132. smalltalk.TrappedProcessor.klass);
  1133. smalltalk.addMethod(
  1134. smalltalk.method({
  1135. selector: "whenSubmitted",
  1136. category: '*Trapped-Processors',
  1137. fn: function (){
  1138. var self=this;
  1139. function $TrappedProcessorWhenSubmitted(){return smalltalk.TrappedProcessorWhenSubmitted||(typeof TrappedProcessorWhenSubmitted=="undefined"?nil:TrappedProcessorWhenSubmitted)}
  1140. return smalltalk.withContext(function($ctx1) {
  1141. var $1;
  1142. $1=_st($TrappedProcessorWhenSubmitted())._new();
  1143. return $1;
  1144. }, function($ctx1) {$ctx1.fill(self,"whenSubmitted",{},smalltalk.TrappedProcessor.klass)})},
  1145. args: [],
  1146. source: "whenSubmitted\x0a\x09^TrappedProcessorWhenSubmitted new",
  1147. messageSends: ["new"],
  1148. referencedClasses: ["TrappedProcessorWhenSubmitted"]
  1149. }),
  1150. smalltalk.TrappedProcessor.klass);
  1151. smalltalk.addMethod(
  1152. smalltalk.method({
  1153. selector: "widget:",
  1154. category: '*Trapped-Processors',
  1155. fn: function (aString){
  1156. var self=this;
  1157. function $TrappedProcessorWidget(){return smalltalk.TrappedProcessorWidget||(typeof TrappedProcessorWidget=="undefined"?nil:TrappedProcessorWidget)}
  1158. return smalltalk.withContext(function($ctx1) {
  1159. var $1;
  1160. $1=_st($TrappedProcessorWidget())._new_(aString);
  1161. return $1;
  1162. }, function($ctx1) {$ctx1.fill(self,"widget:",{aString:aString},smalltalk.TrappedProcessor.klass)})},
  1163. args: ["aString"],
  1164. source: "widget: aString\x0a\x09^TrappedProcessorWidget new: aString",
  1165. messageSends: ["new:"],
  1166. referencedClasses: ["TrappedProcessorWidget"]
  1167. }),
  1168. smalltalk.TrappedProcessor.klass);
  1169. smalltalk.addMethod(
  1170. smalltalk.method({
  1171. selector: "xontent",
  1172. category: '*Trapped-Processors',
  1173. fn: function (){
  1174. var self=this;
  1175. function $TrappedProcessorXontent(){return smalltalk.TrappedProcessorXontent||(typeof TrappedProcessorXontent=="undefined"?nil:TrappedProcessorXontent)}
  1176. return smalltalk.withContext(function($ctx1) {
  1177. var $1;
  1178. $1=_st($TrappedProcessorXontent())._new();
  1179. return $1;
  1180. }, function($ctx1) {$ctx1.fill(self,"xontent",{},smalltalk.TrappedProcessor.klass)})},
  1181. args: [],
  1182. source: "xontent\x0a\x09^TrappedProcessorXontent new",
  1183. messageSends: ["new"],
  1184. referencedClasses: ["TrappedProcessorXontent"]
  1185. }),
  1186. smalltalk.TrappedProcessor.klass);
  1187. });