Trapped-Processors.js 51 KB

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