Trapped-Processors.js 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338
  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. var contents,tag,holder;
  765. return smalltalk.withContext(function($ctx1) {
  766. var $1,$2,$4,$5,$3,$6,$7,$8,$9,$10;
  767. contents=nil;
  768. holder=_st(self._target())._asJQuery();
  769. $ctx1.sendIdx["asJQuery"]=1;
  770. $1=_st(holder)._prop_("tagName");
  771. $ctx1.sendIdx["prop:"]=1;
  772. tag=_st($1)._asLowercase();
  773. $ctx1.sendIdx["asLowercase"]=1;
  774. $2=_st(tag).__eq("script");
  775. $ctx1.sendIdx["="]=1;
  776. if(smalltalk.assert($2)){
  777. $4=_st(holder)._attr_("data-content");
  778. if(($receiver = $4) == nil || $receiver == null){
  779. $5=self._error_("<script> need data-content");
  780. return $5;
  781. } else {
  782. $3=$4;
  783. };
  784. holder=_st($3)._asJQuery();
  785. $ctx1.sendIdx["asJQuery"]=2;
  786. holder;
  787. $6=_st(holder)._prop_("tagName");
  788. $ctx1.sendIdx["prop:"]=2;
  789. tag=_st($6)._asLowercase();
  790. tag;
  791. };
  792. $7=_st(tag).__eq("template");
  793. if(smalltalk.assert($7)){
  794. $8=_st(holder)._prop_("content");
  795. if(($receiver = $8) == nil || $receiver == null){
  796. contents=$8;
  797. } else {
  798. var content;
  799. content=$receiver;
  800. contents=_st(content)._asJQuery();
  801. };
  802. contents;
  803. };
  804. $9=contents;
  805. if(($receiver = $9) == nil || $receiver == null){
  806. contents=_st(_st(holder)._contents())._detach();
  807. contents;
  808. } else {
  809. $9;
  810. };
  811. $10=contents;
  812. return $10;
  813. }, function($ctx1) {$ctx1.fill(self,"contents",{contents:contents,tag:tag,holder:holder},smalltalk.TrappedDataCarrier)})},
  814. args: [],
  815. source: "contents\x0a\x09| contents tag holder |\x0a\x09contents := nil.\x0a\x09holder := self target asJQuery.\x0a\x09tag := (holder prop: 'tagName') asLowercase.\x0a\x09tag = 'script' ifTrue: [\x0a\x09\x09holder := ((holder attr: 'data-content') ifNil: [ ^self error: '<script> need data-content' ]) asJQuery.\x0a\x09\x09tag := (holder prop: 'tagName') asLowercase ].\x0a\x09tag = 'template' ifTrue: [\x0a\x09\x09contents := (holder prop: 'content') ifNotNil: [ :content | content asJQuery ] ].\x0a\x09contents ifNil: [ contents := holder contents detach ].\x0a\x09^contents",
  816. messageSends: ["asJQuery", "target", "asLowercase", "prop:", "ifTrue:", "=", "ifNil:", "attr:", "error:", "ifNotNil:", "detach", "contents"],
  817. referencedClasses: []
  818. }),
  819. smalltalk.TrappedDataCarrier);
  820. smalltalk.addMethod(
  821. smalltalk.method({
  822. selector: "modifyTarget",
  823. category: '*Trapped-Processors',
  824. fn: function (){
  825. var self=this;
  826. return smalltalk.withContext(function($ctx1) {
  827. _st(self._target())._modify_((function(){
  828. return smalltalk.withContext(function($ctx2) {
  829. return self._value();
  830. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  831. return self}, function($ctx1) {$ctx1.fill(self,"modifyTarget",{},smalltalk.TrappedDataCarrier)})},
  832. args: [],
  833. source: "modifyTarget\x0a\x09self target modify: [ self value ]",
  834. messageSends: ["modify:", "target", "value"],
  835. referencedClasses: []
  836. }),
  837. smalltalk.TrappedDataCarrier);
  838. smalltalk.addMethod(
  839. smalltalk.method({
  840. selector: "modifyTargetByPerforming:",
  841. category: '*Trapped-Processors',
  842. fn: function (aString){
  843. var self=this;
  844. return smalltalk.withContext(function($ctx1) {
  845. _st(self._target())._modify_((function(m){
  846. return smalltalk.withContext(function($ctx2) {
  847. return _st(m)._perform_(aString);
  848. }, function($ctx2) {$ctx2.fillBlock({m:m},$ctx1,1)})}));
  849. return self}, function($ctx1) {$ctx1.fill(self,"modifyTargetByPerforming:",{aString:aString},smalltalk.TrappedDataCarrier)})},
  850. args: ["aString"],
  851. source: "modifyTargetByPerforming: aString\x0a\x09self target modify: [ :m | m perform: aString ]",
  852. messageSends: ["modify:", "target", "perform:"],
  853. referencedClasses: []
  854. }),
  855. smalltalk.TrappedDataCarrier);
  856. smalltalk.addMethod(
  857. smalltalk.method({
  858. selector: "toTargetAttr:",
  859. category: '*Trapped-Processors',
  860. fn: function (aString){
  861. var self=this;
  862. return smalltalk.withContext(function($ctx1) {
  863. var $1,$2,$3,$5,$4;
  864. $1=self._falseAsNilValue();
  865. if(($receiver = $1) == nil || $receiver == null){
  866. $2=self._target();
  867. $ctx1.sendIdx["target"]=1;
  868. _st($2)._removeAt_(aString);
  869. } else {
  870. var value;
  871. value=$receiver;
  872. $3=self._target();
  873. $5=_st(value).__eq(true);
  874. if(smalltalk.assert($5)){
  875. $4=aString;
  876. } else {
  877. $4=value;
  878. };
  879. _st($3)._at_put_(aString,$4);
  880. };
  881. return self}, function($ctx1) {$ctx1.fill(self,"toTargetAttr:",{aString:aString},smalltalk.TrappedDataCarrier)})},
  882. args: ["aString"],
  883. 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 ]) ]",
  884. messageSends: ["ifNil:ifNotNil:", "falseAsNilValue", "removeAt:", "target", "at:put:", "ifTrue:ifFalse:", "="],
  885. referencedClasses: []
  886. }),
  887. smalltalk.TrappedDataCarrier);
  888. smalltalk.addMethod(
  889. smalltalk.method({
  890. selector: "toTargetContents",
  891. category: '*Trapped-Processors',
  892. fn: function (){
  893. var self=this;
  894. return smalltalk.withContext(function($ctx1) {
  895. _st(self._target())._contents_(self._value());
  896. return self}, function($ctx1) {$ctx1.fill(self,"toTargetContents",{},smalltalk.TrappedDataCarrier)})},
  897. args: [],
  898. source: "toTargetContents\x0a\x09self target contents: self value",
  899. messageSends: ["contents:", "target", "value"],
  900. referencedClasses: []
  901. }),
  902. smalltalk.TrappedDataCarrier);
  903. smalltalk.addMethod(
  904. smalltalk.method({
  905. selector: "toTargetValue",
  906. category: '*Trapped-Processors',
  907. fn: function (){
  908. var self=this;
  909. return smalltalk.withContext(function($ctx1) {
  910. var $1,$3,$2;
  911. $1=_st(self._target())._asJQuery();
  912. $3=self._value();
  913. $ctx1.sendIdx["value"]=1;
  914. if(($receiver = $3) == nil || $receiver == null){
  915. $2=(function(){
  916. return smalltalk.withContext(function($ctx2) {
  917. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})});
  918. } else {
  919. var o;
  920. o=$receiver;
  921. $2=_st(o)._value();
  922. };
  923. _st($1)._val_($2);
  924. return self}, function($ctx1) {$ctx1.fill(self,"toTargetValue",{},smalltalk.TrappedDataCarrier)})},
  925. args: [],
  926. source: "toTargetValue\x0a\x09self target asJQuery val: (self value ifNotNil: [ :o | o value ] ifNil: [[]])",
  927. messageSends: ["val:", "asJQuery", "target", "ifNotNil:ifNil:", "value"],
  928. referencedClasses: []
  929. }),
  930. smalltalk.TrappedDataCarrier);
  931. smalltalk.addMethod(
  932. smalltalk.method({
  933. selector: "attr:",
  934. category: '*Trapped-Processors',
  935. fn: function (aString){
  936. var self=this;
  937. function $TrappedProcessorAttribute(){return smalltalk.TrappedProcessorAttribute||(typeof TrappedProcessorAttribute=="undefined"?nil:TrappedProcessorAttribute)}
  938. return smalltalk.withContext(function($ctx1) {
  939. var $1;
  940. $1=_st($TrappedProcessorAttribute())._new_(aString);
  941. return $1;
  942. }, function($ctx1) {$ctx1.fill(self,"attr:",{aString:aString},smalltalk.TrappedProcessor.klass)})},
  943. args: ["aString"],
  944. source: "attr: aString\x0a\x09^TrappedProcessorAttribute new: aString",
  945. messageSends: ["new:"],
  946. referencedClasses: ["TrappedProcessorAttribute"]
  947. }),
  948. smalltalk.TrappedProcessor.klass);
  949. smalltalk.addMethod(
  950. smalltalk.method({
  951. selector: "dataToView:",
  952. category: '*Trapped-Processors',
  953. fn: function (aBlock){
  954. var self=this;
  955. function $TrappedProcessorDataAdhoc(){return smalltalk.TrappedProcessorDataAdhoc||(typeof TrappedProcessorDataAdhoc=="undefined"?nil:TrappedProcessorDataAdhoc)}
  956. return smalltalk.withContext(function($ctx1) {
  957. var $1;
  958. $1=_st($TrappedProcessorDataAdhoc())._newToView_(aBlock);
  959. return $1;
  960. }, function($ctx1) {$ctx1.fill(self,"dataToView:",{aBlock:aBlock},smalltalk.TrappedProcessor.klass)})},
  961. args: ["aBlock"],
  962. source: "dataToView: aBlock\x0a\x09^TrappedProcessorDataAdhoc newToView: aBlock",
  963. messageSends: ["newToView:"],
  964. referencedClasses: ["TrappedProcessorDataAdhoc"]
  965. }),
  966. smalltalk.TrappedProcessor.klass);
  967. smalltalk.addMethod(
  968. smalltalk.method({
  969. selector: "deuric",
  970. category: '*Trapped-Processors',
  971. fn: function (){
  972. var self=this;
  973. function $TrappedProcessorUriComponentDecoded(){return smalltalk.TrappedProcessorUriComponentDecoded||(typeof TrappedProcessorUriComponentDecoded=="undefined"?nil:TrappedProcessorUriComponentDecoded)}
  974. return smalltalk.withContext(function($ctx1) {
  975. var $1;
  976. $1=_st($TrappedProcessorUriComponentDecoded())._new();
  977. return $1;
  978. }, function($ctx1) {$ctx1.fill(self,"deuric",{},smalltalk.TrappedProcessor.klass)})},
  979. args: [],
  980. source: "deuric\x0a\x09^TrappedProcessorUriComponentDecoded new",
  981. messageSends: ["new"],
  982. referencedClasses: ["TrappedProcessorUriComponentDecoded"]
  983. }),
  984. smalltalk.TrappedProcessor.klass);
  985. smalltalk.addMethod(
  986. smalltalk.method({
  987. selector: "guardContents:",
  988. category: '*Trapped-Processors',
  989. fn: function (anArray){
  990. var self=this;
  991. function $TrappedProcessorGuardContents(){return smalltalk.TrappedProcessorGuardContents||(typeof TrappedProcessorGuardContents=="undefined"?nil:TrappedProcessorGuardContents)}
  992. return smalltalk.withContext(function($ctx1) {
  993. var $1;
  994. $1=_st($TrappedProcessorGuardContents())._new_(anArray);
  995. return $1;
  996. }, function($ctx1) {$ctx1.fill(self,"guardContents:",{anArray:anArray},smalltalk.TrappedProcessor.klass)})},
  997. args: ["anArray"],
  998. source: "guardContents: anArray\x0a\x09^TrappedProcessorGuardContents new: anArray",
  999. messageSends: ["new:"],
  1000. referencedClasses: ["TrappedProcessorGuardContents"]
  1001. }),
  1002. smalltalk.TrappedProcessor.klass);
  1003. smalltalk.addMethod(
  1004. smalltalk.method({
  1005. selector: "guardProc:",
  1006. category: '*Trapped-Processors',
  1007. fn: function (anArray){
  1008. var self=this;
  1009. function $TrappedProcessorGuardProc(){return smalltalk.TrappedProcessorGuardProc||(typeof TrappedProcessorGuardProc=="undefined"?nil:TrappedProcessorGuardProc)}
  1010. return smalltalk.withContext(function($ctx1) {
  1011. var $1;
  1012. $1=_st($TrappedProcessorGuardProc())._new_(anArray);
  1013. return $1;
  1014. }, function($ctx1) {$ctx1.fill(self,"guardProc:",{anArray:anArray},smalltalk.TrappedProcessor.klass)})},
  1015. args: ["anArray"],
  1016. source: "guardProc: anArray\x0a\x09^TrappedProcessorGuardProc new: anArray",
  1017. messageSends: ["new:"],
  1018. referencedClasses: ["TrappedProcessorGuardProc"]
  1019. }),
  1020. smalltalk.TrappedProcessor.klass);
  1021. smalltalk.addMethod(
  1022. smalltalk.method({
  1023. selector: "inputChecked",
  1024. category: '*Trapped-Processors',
  1025. fn: function (){
  1026. var self=this;
  1027. function $TrappedProcessorInputChecked(){return smalltalk.TrappedProcessorInputChecked||(typeof TrappedProcessorInputChecked=="undefined"?nil:TrappedProcessorInputChecked)}
  1028. return smalltalk.withContext(function($ctx1) {
  1029. var $1;
  1030. $1=_st($TrappedProcessorInputChecked())._new();
  1031. return $1;
  1032. }, function($ctx1) {$ctx1.fill(self,"inputChecked",{},smalltalk.TrappedProcessor.klass)})},
  1033. args: [],
  1034. source: "inputChecked\x0a\x09^TrappedProcessorInputChecked new",
  1035. messageSends: ["new"],
  1036. referencedClasses: ["TrappedProcessorInputChecked"]
  1037. }),
  1038. smalltalk.TrappedProcessor.klass);
  1039. smalltalk.addMethod(
  1040. smalltalk.method({
  1041. selector: "inputValue",
  1042. category: '*Trapped-Processors',
  1043. fn: function (){
  1044. var self=this;
  1045. function $TrappedProcessorInputValue(){return smalltalk.TrappedProcessorInputValue||(typeof TrappedProcessorInputValue=="undefined"?nil:TrappedProcessorInputValue)}
  1046. return smalltalk.withContext(function($ctx1) {
  1047. var $1;
  1048. $1=_st($TrappedProcessorInputValue())._new();
  1049. return $1;
  1050. }, function($ctx1) {$ctx1.fill(self,"inputValue",{},smalltalk.TrappedProcessor.klass)})},
  1051. args: [],
  1052. source: "inputValue\x0a\x09^TrappedProcessorInputValue new",
  1053. messageSends: ["new"],
  1054. referencedClasses: ["TrappedProcessorInputValue"]
  1055. }),
  1056. smalltalk.TrappedProcessor.klass);
  1057. smalltalk.addMethod(
  1058. smalltalk.method({
  1059. selector: "loopContents",
  1060. category: '*Trapped-Processors',
  1061. fn: function (){
  1062. var self=this;
  1063. function $TrappedProcessorLoopContents(){return smalltalk.TrappedProcessorLoopContents||(typeof TrappedProcessorLoopContents=="undefined"?nil:TrappedProcessorLoopContents)}
  1064. return smalltalk.withContext(function($ctx1) {
  1065. var $1;
  1066. $1=_st($TrappedProcessorLoopContents())._new();
  1067. return $1;
  1068. }, function($ctx1) {$ctx1.fill(self,"loopContents",{},smalltalk.TrappedProcessor.klass)})},
  1069. args: [],
  1070. source: "loopContents\x0a\x09^TrappedProcessorLoopContents new",
  1071. messageSends: ["new"],
  1072. referencedClasses: ["TrappedProcessorLoopContents"]
  1073. }),
  1074. smalltalk.TrappedProcessor.klass);
  1075. smalltalk.addMethod(
  1076. smalltalk.method({
  1077. selector: "loopProc",
  1078. category: '*Trapped-Processors',
  1079. fn: function (){
  1080. var self=this;
  1081. function $TrappedProcessorLoopProc(){return smalltalk.TrappedProcessorLoopProc||(typeof TrappedProcessorLoopProc=="undefined"?nil:TrappedProcessorLoopProc)}
  1082. return smalltalk.withContext(function($ctx1) {
  1083. var $1;
  1084. $1=_st($TrappedProcessorLoopProc())._new();
  1085. return $1;
  1086. }, function($ctx1) {$ctx1.fill(self,"loopProc",{},smalltalk.TrappedProcessor.klass)})},
  1087. args: [],
  1088. source: "loopProc\x0a\x09^TrappedProcessorLoopProc new",
  1089. messageSends: ["new"],
  1090. referencedClasses: ["TrappedProcessorLoopProc"]
  1091. }),
  1092. smalltalk.TrappedProcessor.klass);
  1093. smalltalk.addMethod(
  1094. smalltalk.method({
  1095. selector: "path",
  1096. category: '*Trapped-Processors',
  1097. fn: function (){
  1098. var self=this;
  1099. function $TrappedProcessorDescend(){return smalltalk.TrappedProcessorDescend||(typeof TrappedProcessorDescend=="undefined"?nil:TrappedProcessorDescend)}
  1100. return smalltalk.withContext(function($ctx1) {
  1101. var $1;
  1102. $1=_st($TrappedProcessorDescend())._new();
  1103. return $1;
  1104. }, function($ctx1) {$ctx1.fill(self,"path",{},smalltalk.TrappedProcessor.klass)})},
  1105. args: [],
  1106. source: "path\x0a\x09^TrappedProcessorDescend new",
  1107. messageSends: ["new"],
  1108. referencedClasses: ["TrappedProcessorDescend"]
  1109. }),
  1110. smalltalk.TrappedProcessor.klass);
  1111. smalltalk.addMethod(
  1112. smalltalk.method({
  1113. selector: "replace:with:",
  1114. category: '*Trapped-Processors',
  1115. fn: function (aString,anotherString){
  1116. var self=this;
  1117. function $TrappedProcessorReplace(){return smalltalk.TrappedProcessorReplace||(typeof TrappedProcessorReplace=="undefined"?nil:TrappedProcessorReplace)}
  1118. return smalltalk.withContext(function($ctx1) {
  1119. var $1;
  1120. $1=_st($TrappedProcessorReplace())._new_with_(aString,anotherString);
  1121. return $1;
  1122. }, function($ctx1) {$ctx1.fill(self,"replace:with:",{aString:aString,anotherString:anotherString},smalltalk.TrappedProcessor.klass)})},
  1123. args: ["aString", "anotherString"],
  1124. source: "replace: aString with: anotherString\x0a\x09^TrappedProcessorReplace new: aString with: anotherString",
  1125. messageSends: ["new:with:"],
  1126. referencedClasses: ["TrappedProcessorReplace"]
  1127. }),
  1128. smalltalk.TrappedProcessor.klass);
  1129. smalltalk.addMethod(
  1130. smalltalk.method({
  1131. selector: "signal:",
  1132. category: '*Trapped-Processors',
  1133. fn: function (aString){
  1134. var self=this;
  1135. function $TrappedProcessorSignal(){return smalltalk.TrappedProcessorSignal||(typeof TrappedProcessorSignal=="undefined"?nil:TrappedProcessorSignal)}
  1136. return smalltalk.withContext(function($ctx1) {
  1137. var $1;
  1138. $1=_st($TrappedProcessorSignal())._new_(aString);
  1139. return $1;
  1140. }, function($ctx1) {$ctx1.fill(self,"signal:",{aString:aString},smalltalk.TrappedProcessor.klass)})},
  1141. args: ["aString"],
  1142. source: "signal: aString\x0a\x09^TrappedProcessorSignal new: aString",
  1143. messageSends: ["new:"],
  1144. referencedClasses: ["TrappedProcessorSignal"]
  1145. }),
  1146. smalltalk.TrappedProcessor.klass);
  1147. smalltalk.addMethod(
  1148. smalltalk.method({
  1149. selector: "toBlackboard",
  1150. category: '*Trapped-Processors',
  1151. fn: function (){
  1152. var self=this;
  1153. function $TrappedProcessorToBlackboard(){return smalltalk.TrappedProcessorToBlackboard||(typeof TrappedProcessorToBlackboard=="undefined"?nil:TrappedProcessorToBlackboard)}
  1154. return smalltalk.withContext(function($ctx1) {
  1155. var $1;
  1156. $1=_st($TrappedProcessorToBlackboard())._new();
  1157. return $1;
  1158. }, function($ctx1) {$ctx1.fill(self,"toBlackboard",{},smalltalk.TrappedProcessor.klass)})},
  1159. args: [],
  1160. source: "toBlackboard\x0a\x09^TrappedProcessorToBlackboard new",
  1161. messageSends: ["new"],
  1162. referencedClasses: ["TrappedProcessorToBlackboard"]
  1163. }),
  1164. smalltalk.TrappedProcessor.klass);
  1165. smalltalk.addMethod(
  1166. smalltalk.method({
  1167. selector: "uric",
  1168. category: '*Trapped-Processors',
  1169. fn: function (){
  1170. var self=this;
  1171. function $TrappedProcessorUriComponentEncoded(){return smalltalk.TrappedProcessorUriComponentEncoded||(typeof TrappedProcessorUriComponentEncoded=="undefined"?nil:TrappedProcessorUriComponentEncoded)}
  1172. return smalltalk.withContext(function($ctx1) {
  1173. var $1;
  1174. $1=_st($TrappedProcessorUriComponentEncoded())._new();
  1175. return $1;
  1176. }, function($ctx1) {$ctx1.fill(self,"uric",{},smalltalk.TrappedProcessor.klass)})},
  1177. args: [],
  1178. source: "uric\x0a\x09^TrappedProcessorUriComponentEncoded new",
  1179. messageSends: ["new"],
  1180. referencedClasses: ["TrappedProcessorUriComponentEncoded"]
  1181. }),
  1182. smalltalk.TrappedProcessor.klass);
  1183. smalltalk.addMethod(
  1184. smalltalk.method({
  1185. selector: "whenClicked",
  1186. category: '*Trapped-Processors',
  1187. fn: function (){
  1188. var self=this;
  1189. function $TrappedProcessorWhenClicked(){return smalltalk.TrappedProcessorWhenClicked||(typeof TrappedProcessorWhenClicked=="undefined"?nil:TrappedProcessorWhenClicked)}
  1190. return smalltalk.withContext(function($ctx1) {
  1191. var $1;
  1192. $1=_st($TrappedProcessorWhenClicked())._new();
  1193. return $1;
  1194. }, function($ctx1) {$ctx1.fill(self,"whenClicked",{},smalltalk.TrappedProcessor.klass)})},
  1195. args: [],
  1196. source: "whenClicked\x0a\x09^TrappedProcessorWhenClicked new",
  1197. messageSends: ["new"],
  1198. referencedClasses: ["TrappedProcessorWhenClicked"]
  1199. }),
  1200. smalltalk.TrappedProcessor.klass);
  1201. smalltalk.addMethod(
  1202. smalltalk.method({
  1203. selector: "whenSubmitted",
  1204. category: '*Trapped-Processors',
  1205. fn: function (){
  1206. var self=this;
  1207. function $TrappedProcessorWhenSubmitted(){return smalltalk.TrappedProcessorWhenSubmitted||(typeof TrappedProcessorWhenSubmitted=="undefined"?nil:TrappedProcessorWhenSubmitted)}
  1208. return smalltalk.withContext(function($ctx1) {
  1209. var $1;
  1210. $1=_st($TrappedProcessorWhenSubmitted())._new();
  1211. return $1;
  1212. }, function($ctx1) {$ctx1.fill(self,"whenSubmitted",{},smalltalk.TrappedProcessor.klass)})},
  1213. args: [],
  1214. source: "whenSubmitted\x0a\x09^TrappedProcessorWhenSubmitted new",
  1215. messageSends: ["new"],
  1216. referencedClasses: ["TrappedProcessorWhenSubmitted"]
  1217. }),
  1218. smalltalk.TrappedProcessor.klass);
  1219. smalltalk.addMethod(
  1220. smalltalk.method({
  1221. selector: "widget:",
  1222. category: '*Trapped-Processors',
  1223. fn: function (aString){
  1224. var self=this;
  1225. function $TrappedProcessorWidget(){return smalltalk.TrappedProcessorWidget||(typeof TrappedProcessorWidget=="undefined"?nil:TrappedProcessorWidget)}
  1226. return smalltalk.withContext(function($ctx1) {
  1227. var $1;
  1228. $1=_st($TrappedProcessorWidget())._new_(aString);
  1229. return $1;
  1230. }, function($ctx1) {$ctx1.fill(self,"widget:",{aString:aString},smalltalk.TrappedProcessor.klass)})},
  1231. args: ["aString"],
  1232. source: "widget: aString\x0a\x09^TrappedProcessorWidget new: aString",
  1233. messageSends: ["new:"],
  1234. referencedClasses: ["TrappedProcessorWidget"]
  1235. }),
  1236. smalltalk.TrappedProcessor.klass);
  1237. });