2
0

Canvas.deploy.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161
  1. smalltalk.addClass('CanvasRenderingContext', smalltalk.Object, [], 'Canvas');
  2. smalltalk.addMethod(
  3. '_arcTo_radius_startAngle_endAngle_anticlockwise_',
  4. smalltalk.method({
  5. selector: 'arcTo:radius:startAngle:endAngle:anticlockwise:',
  6. fn: function (aPoint, aNumber, aNumber2, aNumber3, aBoolean){
  7. var self=this;
  8. self.arc(aPoint._x(), aPoint._y(), aNumber, aNumber2, aNumber3, aBoolean);
  9. return self;}
  10. }),
  11. smalltalk.CanvasRenderingContext);
  12. smalltalk.addMethod(
  13. '_arcTo_radius_',
  14. smalltalk.method({
  15. selector: 'arcTo:radius:',
  16. fn: function (aPoint, aNumber){
  17. var self=this;
  18. smalltalk.send(self, "_arcTo_radius_startAngle_endAngle_anticlockwise_", [aPoint, aNumber, (0), (($receiver = smalltalk.send((smalltalk.Number || Number), "_pi", [])).klass === smalltalk.Number) ? $receiver *(2) : smalltalk.send($receiver, "__star", [(2)]), false]);
  19. return self;}
  20. }),
  21. smalltalk.CanvasRenderingContext);
  22. smalltalk.addMethod(
  23. '_fillStyle_',
  24. smalltalk.method({
  25. selector: 'fillStyle:',
  26. fn: function (aString){
  27. var self=this;
  28. self.fillStyle = String(aString);
  29. return self;}
  30. }),
  31. smalltalk.CanvasRenderingContext);
  32. smalltalk.addMethod(
  33. '_beginPath',
  34. smalltalk.method({
  35. selector: 'beginPath',
  36. fn: function (){
  37. var self=this;
  38. self.beginPath();
  39. return self;}
  40. }),
  41. smalltalk.CanvasRenderingContext);
  42. smalltalk.addMethod(
  43. '_closePath',
  44. smalltalk.method({
  45. selector: 'closePath',
  46. fn: function (){
  47. var self=this;
  48. self.closePath();
  49. return self;}
  50. }),
  51. smalltalk.CanvasRenderingContext);
  52. smalltalk.addMethod(
  53. '_fill',
  54. smalltalk.method({
  55. selector: 'fill',
  56. fn: function (){
  57. var self=this;
  58. self.fill();
  59. return self;}
  60. }),
  61. smalltalk.CanvasRenderingContext);
  62. smalltalk.addMethod(
  63. '_stroke',
  64. smalltalk.method({
  65. selector: 'stroke',
  66. fn: function (){
  67. var self=this;
  68. self.stroke();
  69. return self;}
  70. }),
  71. smalltalk.CanvasRenderingContext);
  72. smalltalk.addMethod(
  73. '_moveTo_',
  74. smalltalk.method({
  75. selector: 'moveTo:',
  76. fn: function (aPoint){
  77. var self=this;
  78. self.moveTo(aPoint._x(), aPoint._y());
  79. return self;}
  80. }),
  81. smalltalk.CanvasRenderingContext);
  82. smalltalk.addMethod(
  83. '_lineTo_',
  84. smalltalk.method({
  85. selector: 'lineTo:',
  86. fn: function (aPoint){
  87. var self=this;
  88. self.lineTo(aPoint._x(), aPoint._y());
  89. return self;}
  90. }),
  91. smalltalk.CanvasRenderingContext);
  92. smalltalk.addMethod(
  93. '_strokeStyle_',
  94. smalltalk.method({
  95. selector: 'strokeStyle:',
  96. fn: function (aString){
  97. var self=this;
  98. self.strokeStyle = String(aString);
  99. return self;}
  100. }),
  101. smalltalk.CanvasRenderingContext);
  102. smalltalk.addMethod(
  103. '_lineWidth_',
  104. smalltalk.method({
  105. selector: 'lineWidth:',
  106. fn: function (aNumber){
  107. var self=this;
  108. self.lineWidth = aNumber;
  109. return self;}
  110. }),
  111. smalltalk.CanvasRenderingContext);
  112. smalltalk.addMethod(
  113. '_fillRectFrom_to_',
  114. smalltalk.method({
  115. selector: 'fillRectFrom:to:',
  116. fn: function (aPoint, anotherPoint){
  117. var self=this;
  118. self.fillRect(aPoint._x(), aPoint._y(), anotherPoint._x(), anotherPoint._y());
  119. return self;}
  120. }),
  121. smalltalk.CanvasRenderingContext);
  122. smalltalk.addMethod(
  123. '_strokeRectFrom_to_',
  124. smalltalk.method({
  125. selector: 'strokeRectFrom:to:',
  126. fn: function (aPoint, anotherPoint){
  127. var self=this;
  128. self.strokeRect(aPoint._x(), aPoint._y(), anotherPoint._x(), anotherPoint._y());
  129. return self;}
  130. }),
  131. smalltalk.CanvasRenderingContext);
  132. smalltalk.addMethod(
  133. '_clearRectFrom_to_',
  134. smalltalk.method({
  135. selector: 'clearRectFrom:to:',
  136. fn: function (aPoint, anotherPoint){
  137. var self=this;
  138. self.fillRect(aPoint._x(), aPoint._y(), anotherPoint._x(), anotherPoint._y());
  139. return self;}
  140. }),
  141. smalltalk.CanvasRenderingContext);
  142. smalltalk.addMethod(
  143. '_tagBrush_',
  144. smalltalk.method({
  145. selector: 'tagBrush:',
  146. fn: function (aTagBrush){
  147. var self=this;
  148. return aTagBrush._element().getContext('2d');
  149. return self;}
  150. }),
  151. smalltalk.CanvasRenderingContext.klass);
  152. smalltalk.addClass('HTMLCanvas', smalltalk.Object, ['root'], 'Canvas');
  153. smalltalk.addMethod(
  154. '_root_',
  155. smalltalk.method({
  156. selector: 'root:',
  157. fn: function (aTagBrush){
  158. var self=this;
  159. self['@root']=aTagBrush;
  160. return self;}
  161. }),
  162. smalltalk.HTMLCanvas);
  163. smalltalk.addMethod(
  164. '_root',
  165. smalltalk.method({
  166. selector: 'root',
  167. fn: function (){
  168. var self=this;
  169. return self['@root'];
  170. return self;}
  171. }),
  172. smalltalk.HTMLCanvas);
  173. smalltalk.addMethod(
  174. '_with_',
  175. smalltalk.method({
  176. selector: 'with:',
  177. fn: function (anObject){
  178. var self=this;
  179. return smalltalk.send(smalltalk.send(self, "_root", []), "_with_", [anObject]);
  180. return self;}
  181. }),
  182. smalltalk.HTMLCanvas);
  183. smalltalk.addMethod(
  184. '_initialize',
  185. smalltalk.method({
  186. selector: 'initialize',
  187. fn: function (){
  188. var self=this;
  189. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  190. (($receiver = self['@root']) == nil || $receiver == undefined) ? (function(){return self['@root']=smalltalk.send((smalltalk.TagBrush || TagBrush), "_fromString_canvas_", ["div", self]);})() : $receiver;
  191. return self;}
  192. }),
  193. smalltalk.HTMLCanvas);
  194. smalltalk.addMethod(
  195. '_initializeFromJQuery_',
  196. smalltalk.method({
  197. selector: 'initializeFromJQuery:',
  198. fn: function (aJQuery){
  199. var self=this;
  200. self['@root']=smalltalk.send((smalltalk.TagBrush || TagBrush), "_fromJQuery_canvas_", [aJQuery, self]);
  201. return self;}
  202. }),
  203. smalltalk.HTMLCanvas);
  204. smalltalk.addMethod(
  205. '_newTag_',
  206. smalltalk.method({
  207. selector: 'newTag:',
  208. fn: function (aString){
  209. var self=this;
  210. return smalltalk.send((smalltalk.TagBrush || TagBrush), "_fromString_canvas_", [aString, self]);
  211. return self;}
  212. }),
  213. smalltalk.HTMLCanvas);
  214. smalltalk.addMethod(
  215. '_tag_',
  216. smalltalk.method({
  217. selector: 'tag:',
  218. fn: function (aString){
  219. var self=this;
  220. return smalltalk.send(self['@root'], "_addBrush_", [smalltalk.send(self, "_newTag_", [aString])]);
  221. return self;}
  222. }),
  223. smalltalk.HTMLCanvas);
  224. smalltalk.addMethod(
  225. '_h1',
  226. smalltalk.method({
  227. selector: 'h1',
  228. fn: function (){
  229. var self=this;
  230. return smalltalk.send(self, "_tag_", ["h1"]);
  231. return self;}
  232. }),
  233. smalltalk.HTMLCanvas);
  234. smalltalk.addMethod(
  235. '_h2',
  236. smalltalk.method({
  237. selector: 'h2',
  238. fn: function (){
  239. var self=this;
  240. return smalltalk.send(self, "_tag_", ["h2"]);
  241. return self;}
  242. }),
  243. smalltalk.HTMLCanvas);
  244. smalltalk.addMethod(
  245. '_h3',
  246. smalltalk.method({
  247. selector: 'h3',
  248. fn: function (){
  249. var self=this;
  250. return smalltalk.send(self, "_tag_", ["h3"]);
  251. return self;}
  252. }),
  253. smalltalk.HTMLCanvas);
  254. smalltalk.addMethod(
  255. '_h4',
  256. smalltalk.method({
  257. selector: 'h4',
  258. fn: function (){
  259. var self=this;
  260. return smalltalk.send(self, "_tag_", ["h4"]);
  261. return self;}
  262. }),
  263. smalltalk.HTMLCanvas);
  264. smalltalk.addMethod(
  265. '_h5',
  266. smalltalk.method({
  267. selector: 'h5',
  268. fn: function (){
  269. var self=this;
  270. return smalltalk.send(self, "_tag_", ["h5"]);
  271. return self;}
  272. }),
  273. smalltalk.HTMLCanvas);
  274. smalltalk.addMethod(
  275. '_h6',
  276. smalltalk.method({
  277. selector: 'h6',
  278. fn: function (){
  279. var self=this;
  280. return smalltalk.send(self, "_tag_", ["h6"]);
  281. return self;}
  282. }),
  283. smalltalk.HTMLCanvas);
  284. smalltalk.addMethod(
  285. '_p',
  286. smalltalk.method({
  287. selector: 'p',
  288. fn: function (){
  289. var self=this;
  290. return smalltalk.send(self, "_tag_", ["p"]);
  291. return self;}
  292. }),
  293. smalltalk.HTMLCanvas);
  294. smalltalk.addMethod(
  295. '_div',
  296. smalltalk.method({
  297. selector: 'div',
  298. fn: function (){
  299. var self=this;
  300. return smalltalk.send(self, "_tag_", ["div"]);
  301. return self;}
  302. }),
  303. smalltalk.HTMLCanvas);
  304. smalltalk.addMethod(
  305. '_span',
  306. smalltalk.method({
  307. selector: 'span',
  308. fn: function (){
  309. var self=this;
  310. return smalltalk.send(self, "_tag_", ["span"]);
  311. return self;}
  312. }),
  313. smalltalk.HTMLCanvas);
  314. smalltalk.addMethod(
  315. '_img',
  316. smalltalk.method({
  317. selector: 'img',
  318. fn: function (){
  319. var self=this;
  320. return smalltalk.send(self, "_tag_", ["img"]);
  321. return self;}
  322. }),
  323. smalltalk.HTMLCanvas);
  324. smalltalk.addMethod(
  325. '_ul',
  326. smalltalk.method({
  327. selector: 'ul',
  328. fn: function (){
  329. var self=this;
  330. return smalltalk.send(self, "_tag_", ["ul"]);
  331. return self;}
  332. }),
  333. smalltalk.HTMLCanvas);
  334. smalltalk.addMethod(
  335. '_ol',
  336. smalltalk.method({
  337. selector: 'ol',
  338. fn: function (){
  339. var self=this;
  340. return smalltalk.send(self, "_tag_", ["ol"]);
  341. return self;}
  342. }),
  343. smalltalk.HTMLCanvas);
  344. smalltalk.addMethod(
  345. '_li',
  346. smalltalk.method({
  347. selector: 'li',
  348. fn: function (){
  349. var self=this;
  350. return smalltalk.send(self, "_tag_", ["li"]);
  351. return self;}
  352. }),
  353. smalltalk.HTMLCanvas);
  354. smalltalk.addMethod(
  355. '_table',
  356. smalltalk.method({
  357. selector: 'table',
  358. fn: function (){
  359. var self=this;
  360. return smalltalk.send(self, "_tag_", ["table"]);
  361. return self;}
  362. }),
  363. smalltalk.HTMLCanvas);
  364. smalltalk.addMethod(
  365. '_tr',
  366. smalltalk.method({
  367. selector: 'tr',
  368. fn: function (){
  369. var self=this;
  370. return smalltalk.send(self, "_tag_", ["tr"]);
  371. return self;}
  372. }),
  373. smalltalk.HTMLCanvas);
  374. smalltalk.addMethod(
  375. '_td',
  376. smalltalk.method({
  377. selector: 'td',
  378. fn: function (){
  379. var self=this;
  380. return smalltalk.send(self, "_tag_", ["td"]);
  381. return self;}
  382. }),
  383. smalltalk.HTMLCanvas);
  384. smalltalk.addMethod(
  385. '_th',
  386. smalltalk.method({
  387. selector: 'th',
  388. fn: function (){
  389. var self=this;
  390. return smalltalk.send(self, "_tag_", ["th"]);
  391. return self;}
  392. }),
  393. smalltalk.HTMLCanvas);
  394. smalltalk.addMethod(
  395. '_form',
  396. smalltalk.method({
  397. selector: 'form',
  398. fn: function (){
  399. var self=this;
  400. return smalltalk.send(self, "_tag_", ["form"]);
  401. return self;}
  402. }),
  403. smalltalk.HTMLCanvas);
  404. smalltalk.addMethod(
  405. '_input',
  406. smalltalk.method({
  407. selector: 'input',
  408. fn: function (){
  409. var self=this;
  410. return smalltalk.send(self, "_tag_", ["input"]);
  411. return self;}
  412. }),
  413. smalltalk.HTMLCanvas);
  414. smalltalk.addMethod(
  415. '_button',
  416. smalltalk.method({
  417. selector: 'button',
  418. fn: function (){
  419. var self=this;
  420. return smalltalk.send(self, "_tag_", ["button"]);
  421. return self;}
  422. }),
  423. smalltalk.HTMLCanvas);
  424. smalltalk.addMethod(
  425. '_select',
  426. smalltalk.method({
  427. selector: 'select',
  428. fn: function (){
  429. var self=this;
  430. return smalltalk.send(self, "_tag_", ["select"]);
  431. return self;}
  432. }),
  433. smalltalk.HTMLCanvas);
  434. smalltalk.addMethod(
  435. '_option',
  436. smalltalk.method({
  437. selector: 'option',
  438. fn: function (){
  439. var self=this;
  440. return smalltalk.send(self, "_tag_", ["option"]);
  441. return self;}
  442. }),
  443. smalltalk.HTMLCanvas);
  444. smalltalk.addMethod(
  445. '_textarea',
  446. smalltalk.method({
  447. selector: 'textarea',
  448. fn: function (){
  449. var self=this;
  450. return smalltalk.send(self, "_tag_", ["textarea"]);
  451. return self;}
  452. }),
  453. smalltalk.HTMLCanvas);
  454. smalltalk.addMethod(
  455. '_a',
  456. smalltalk.method({
  457. selector: 'a',
  458. fn: function (){
  459. var self=this;
  460. return smalltalk.send(self, "_tag_", ["a"]);
  461. return self;}
  462. }),
  463. smalltalk.HTMLCanvas);
  464. smalltalk.addMethod(
  465. '_canvas',
  466. smalltalk.method({
  467. selector: 'canvas',
  468. fn: function (){
  469. var self=this;
  470. return smalltalk.send(self, "_tag_", ["canvas"]);
  471. return self;}
  472. }),
  473. smalltalk.HTMLCanvas);
  474. smalltalk.addMethod(
  475. '_pre',
  476. smalltalk.method({
  477. selector: 'pre',
  478. fn: function (){
  479. var self=this;
  480. return smalltalk.send(self, "_tag_", ["pre"]);
  481. return self;}
  482. }),
  483. smalltalk.HTMLCanvas);
  484. smalltalk.addMethod(
  485. '_code',
  486. smalltalk.method({
  487. selector: 'code',
  488. fn: function (){
  489. var self=this;
  490. return smalltalk.send(self, "_tag_", ["code"]);
  491. return self;}
  492. }),
  493. smalltalk.HTMLCanvas);
  494. smalltalk.addMethod(
  495. '_br',
  496. smalltalk.method({
  497. selector: 'br',
  498. fn: function (){
  499. var self=this;
  500. return smalltalk.send(self, "_tag_", ["br"]);
  501. return self;}
  502. }),
  503. smalltalk.HTMLCanvas);
  504. smalltalk.addMethod(
  505. '_script',
  506. smalltalk.method({
  507. selector: 'script',
  508. fn: function (){
  509. var self=this;
  510. return smalltalk.send(self, "_tag_", ["script"]);
  511. return self;}
  512. }),
  513. smalltalk.HTMLCanvas);
  514. smalltalk.addMethod(
  515. '_link',
  516. smalltalk.method({
  517. selector: 'link',
  518. fn: function (){
  519. var self=this;
  520. return smalltalk.send(self, "_tag_", ["link"]);
  521. return self;}
  522. }),
  523. smalltalk.HTMLCanvas);
  524. smalltalk.addMethod(
  525. '_style',
  526. smalltalk.method({
  527. selector: 'style',
  528. fn: function (){
  529. var self=this;
  530. return smalltalk.send(self, "_tag_", ["style"]);
  531. return self;}
  532. }),
  533. smalltalk.HTMLCanvas);
  534. smalltalk.addMethod(
  535. '_onJQuery_',
  536. smalltalk.method({
  537. selector: 'onJQuery:',
  538. fn: function (aJQuery){
  539. var self=this;
  540. return (function($rec){smalltalk.send($rec, "_initializeFromJQuery_", [aJQuery]);smalltalk.send($rec, "_initialize", []);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_basicNew", []));
  541. return self;}
  542. }),
  543. smalltalk.HTMLCanvas.klass);
  544. smalltalk.addClass('TagBrush', smalltalk.Object, ['canvas', 'element'], 'Canvas');
  545. smalltalk.addMethod(
  546. '_element',
  547. smalltalk.method({
  548. selector: 'element',
  549. fn: function (){
  550. var self=this;
  551. return self['@element'];
  552. return self;}
  553. }),
  554. smalltalk.TagBrush);
  555. smalltalk.addMethod(
  556. '_contents_',
  557. smalltalk.method({
  558. selector: 'contents:',
  559. fn: function (anObject){
  560. var self=this;
  561. (function($rec){smalltalk.send($rec, "_empty", []);return smalltalk.send($rec, "_append_", [anObject]);})(self);
  562. return self;}
  563. }),
  564. smalltalk.TagBrush);
  565. smalltalk.addMethod(
  566. '_addBrush_',
  567. smalltalk.method({
  568. selector: 'addBrush:',
  569. fn: function (aTagBrush){
  570. var self=this;
  571. smalltalk.send(self, "_appendChild_", [smalltalk.send(aTagBrush, "_element", [])]);
  572. return aTagBrush;
  573. return self;}
  574. }),
  575. smalltalk.TagBrush);
  576. smalltalk.addMethod(
  577. '_with_',
  578. smalltalk.method({
  579. selector: 'with:',
  580. fn: function (anObject){
  581. var self=this;
  582. smalltalk.send(self, "_append_", [anObject]);
  583. return self;}
  584. }),
  585. smalltalk.TagBrush);
  586. smalltalk.addMethod(
  587. '_append_',
  588. smalltalk.method({
  589. selector: 'append:',
  590. fn: function (anObject){
  591. var self=this;
  592. smalltalk.send(anObject, "_appendToBrush_", [self]);
  593. return self;}
  594. }),
  595. smalltalk.TagBrush);
  596. smalltalk.addMethod(
  597. '_appendToBrush_',
  598. smalltalk.method({
  599. selector: 'appendToBrush:',
  600. fn: function (aTagBrush){
  601. var self=this;
  602. smalltalk.send(aTagBrush, "_addBrush_", [self]);
  603. return self;}
  604. }),
  605. smalltalk.TagBrush);
  606. smalltalk.addMethod(
  607. '_appendBlock_',
  608. smalltalk.method({
  609. selector: 'appendBlock:',
  610. fn: function (aBlock){
  611. var self=this;
  612. var root=nil;
  613. root=smalltalk.send(self['@canvas'], "_root", []);
  614. smalltalk.send(self['@canvas'], "_root_", [self]);
  615. smalltalk.send(aBlock, "_value_", [self['@canvas']]);
  616. smalltalk.send(self['@canvas'], "_root_", [root]);
  617. return self;}
  618. }),
  619. smalltalk.TagBrush);
  620. smalltalk.addMethod(
  621. '_appendChild_',
  622. smalltalk.method({
  623. selector: 'appendChild:',
  624. fn: function (anElement){
  625. var self=this;
  626. var element=self['@element'];
  627. if (null == element.canHaveChildren || element.canHaveChildren) {
  628. element.appendChild(anElement);
  629. } else {
  630. element.text = String(element.text) + anElement.innerHTML;
  631. } ;
  632. return self;}
  633. }),
  634. smalltalk.TagBrush);
  635. smalltalk.addMethod(
  636. '_appendString_',
  637. smalltalk.method({
  638. selector: 'appendString:',
  639. fn: function (aString){
  640. var self=this;
  641. smalltalk.send(self, "_appendChild_", [smalltalk.send(self, "_createTextNodeFor_", [aString])]);
  642. return self;}
  643. }),
  644. smalltalk.TagBrush);
  645. smalltalk.addMethod(
  646. '_at_put_',
  647. smalltalk.method({
  648. selector: 'at:put:',
  649. fn: function (aString, aValue){
  650. var self=this;
  651. self['@element'].setAttribute(aString, aValue);
  652. return self;}
  653. }),
  654. smalltalk.TagBrush);
  655. smalltalk.addMethod(
  656. '_removeAt_',
  657. smalltalk.method({
  658. selector: 'removeAt:',
  659. fn: function (aString){
  660. var self=this;
  661. self['@element'].removeAttribute(aString);
  662. return self;}
  663. }),
  664. smalltalk.TagBrush);
  665. smalltalk.addMethod(
  666. '_class_',
  667. smalltalk.method({
  668. selector: 'class:',
  669. fn: function (aString){
  670. var self=this;
  671. smalltalk.send(self, "_at_put_", ["class", aString]);
  672. return self;}
  673. }),
  674. smalltalk.TagBrush);
  675. smalltalk.addMethod(
  676. '_id_',
  677. smalltalk.method({
  678. selector: 'id:',
  679. fn: function (aString){
  680. var self=this;
  681. smalltalk.send(self, "_at_put_", ["id", aString]);
  682. return self;}
  683. }),
  684. smalltalk.TagBrush);
  685. smalltalk.addMethod(
  686. '_src_',
  687. smalltalk.method({
  688. selector: 'src:',
  689. fn: function (aString){
  690. var self=this;
  691. smalltalk.send(self, "_at_put_", ["src", aString]);
  692. return self;}
  693. }),
  694. smalltalk.TagBrush);
  695. smalltalk.addMethod(
  696. '_href_',
  697. smalltalk.method({
  698. selector: 'href:',
  699. fn: function (aString){
  700. var self=this;
  701. smalltalk.send(self, "_at_put_", ["href", aString]);
  702. return self;}
  703. }),
  704. smalltalk.TagBrush);
  705. smalltalk.addMethod(
  706. '_title_',
  707. smalltalk.method({
  708. selector: 'title:',
  709. fn: function (aString){
  710. var self=this;
  711. smalltalk.send(self, "_at_put_", ["title", aString]);
  712. return self;}
  713. }),
  714. smalltalk.TagBrush);
  715. smalltalk.addMethod(
  716. '_style_',
  717. smalltalk.method({
  718. selector: 'style:',
  719. fn: function (aString){
  720. var self=this;
  721. smalltalk.send(self, "_at_put_", ["style", aString]);
  722. return self;}
  723. }),
  724. smalltalk.TagBrush);
  725. smalltalk.addMethod(
  726. '_type_',
  727. smalltalk.method({
  728. selector: 'type:',
  729. fn: function (aString){
  730. var self=this;
  731. smalltalk.send(self, "_at_put_", ["type", aString]);
  732. return self;}
  733. }),
  734. smalltalk.TagBrush);
  735. smalltalk.addMethod(
  736. '_media_',
  737. smalltalk.method({
  738. selector: 'media:',
  739. fn: function (aString){
  740. var self=this;
  741. smalltalk.send(self, "_at_put_", ["media", aString]);
  742. return self;}
  743. }),
  744. smalltalk.TagBrush);
  745. smalltalk.addMethod(
  746. '_rel_',
  747. smalltalk.method({
  748. selector: 'rel:',
  749. fn: function (aString){
  750. var self=this;
  751. smalltalk.send(self, "_at_put_", ["rel", aString]);
  752. return self;}
  753. }),
  754. smalltalk.TagBrush);
  755. smalltalk.addMethod(
  756. '_asJQuery',
  757. smalltalk.method({
  758. selector: 'asJQuery',
  759. fn: function (){
  760. var self=this;
  761. return smalltalk.JQuery._from_(jQuery(self['@element']));
  762. return self;}
  763. }),
  764. smalltalk.TagBrush);
  765. smalltalk.addMethod(
  766. '_asJQueryDo_',
  767. smalltalk.method({
  768. selector: 'asJQueryDo:',
  769. fn: function (aBlock){
  770. var self=this;
  771. smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_asJQuery", [])]);
  772. return self;}
  773. }),
  774. smalltalk.TagBrush);
  775. smalltalk.addMethod(
  776. '_onKeyDown_',
  777. smalltalk.method({
  778. selector: 'onKeyDown:',
  779. fn: function (aBlock){
  780. var self=this;
  781. smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_on_do_", ["keydown", aBlock]);
  782. return self;}
  783. }),
  784. smalltalk.TagBrush);
  785. smalltalk.addMethod(
  786. '_onKeyPress_',
  787. smalltalk.method({
  788. selector: 'onKeyPress:',
  789. fn: function (aBlock){
  790. var self=this;
  791. smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_on_do_", ["keypress", aBlock]);
  792. return self;}
  793. }),
  794. smalltalk.TagBrush);
  795. smalltalk.addMethod(
  796. '_onKeyUp_',
  797. smalltalk.method({
  798. selector: 'onKeyUp:',
  799. fn: function (aBlock){
  800. var self=this;
  801. smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_on_do_", ["keyup", aBlock]);
  802. return self;}
  803. }),
  804. smalltalk.TagBrush);
  805. smalltalk.addMethod(
  806. '_onFocus_',
  807. smalltalk.method({
  808. selector: 'onFocus:',
  809. fn: function (aBlock){
  810. var self=this;
  811. smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_on_do_", ["focus", aBlock]);
  812. return self;}
  813. }),
  814. smalltalk.TagBrush);
  815. smalltalk.addMethod(
  816. '_onBlur_',
  817. smalltalk.method({
  818. selector: 'onBlur:',
  819. fn: function (aBlock){
  820. var self=this;
  821. smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_on_do_", ["blur", aBlock]);
  822. return self;}
  823. }),
  824. smalltalk.TagBrush);
  825. smalltalk.addMethod(
  826. '_onChange_',
  827. smalltalk.method({
  828. selector: 'onChange:',
  829. fn: function (aBlock){
  830. var self=this;
  831. smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_on_do_", ["change", aBlock]);
  832. return self;}
  833. }),
  834. smalltalk.TagBrush);
  835. smalltalk.addMethod(
  836. '_onClick_',
  837. smalltalk.method({
  838. selector: 'onClick:',
  839. fn: function (aBlock){
  840. var self=this;
  841. smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_on_do_", ["click", aBlock]);
  842. return self;}
  843. }),
  844. smalltalk.TagBrush);
  845. smalltalk.addMethod(
  846. '_initializeFromString_canvas_',
  847. smalltalk.method({
  848. selector: 'initializeFromString:canvas:',
  849. fn: function (aString, aCanvas){
  850. var self=this;
  851. self['@element']=smalltalk.send(self, "_createElementFor_", [aString]);
  852. self['@canvas']=aCanvas;
  853. return self;}
  854. }),
  855. smalltalk.TagBrush);
  856. smalltalk.addMethod(
  857. '_initializeFromJQuery_canvas_',
  858. smalltalk.method({
  859. selector: 'initializeFromJQuery:canvas:',
  860. fn: function (aJQuery, aCanvas){
  861. var self=this;
  862. self['@element']=smalltalk.send(smalltalk.send(aJQuery, "_jquery", []), "_get_", [(0)]);
  863. self['@canvas']=aCanvas;
  864. return self;}
  865. }),
  866. smalltalk.TagBrush);
  867. smalltalk.addMethod(
  868. '_createElementFor_',
  869. smalltalk.method({
  870. selector: 'createElementFor:',
  871. fn: function (aString){
  872. var self=this;
  873. return document.createElement(String(aString));
  874. return self;}
  875. }),
  876. smalltalk.TagBrush);
  877. smalltalk.addMethod(
  878. '_createTextNodeFor_',
  879. smalltalk.method({
  880. selector: 'createTextNodeFor:',
  881. fn: function (aString){
  882. var self=this;
  883. return document.createTextNode(String(aString));
  884. return self;}
  885. }),
  886. smalltalk.TagBrush);
  887. smalltalk.addMethod(
  888. '_empty',
  889. smalltalk.method({
  890. selector: 'empty',
  891. fn: function (){
  892. var self=this;
  893. smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_empty", []);
  894. return self;}
  895. }),
  896. smalltalk.TagBrush);
  897. smalltalk.addMethod(
  898. '_fromString_canvas_',
  899. smalltalk.method({
  900. selector: 'fromString:canvas:',
  901. fn: function (aString, aCanvas){
  902. var self=this;
  903. return (function($rec){smalltalk.send($rec, "_initializeFromString_canvas_", [aString, aCanvas]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  904. return self;}
  905. }),
  906. smalltalk.TagBrush.klass);
  907. smalltalk.addMethod(
  908. '_fromJQuery_canvas_',
  909. smalltalk.method({
  910. selector: 'fromJQuery:canvas:',
  911. fn: function (aJQuery, aCanvas){
  912. var self=this;
  913. return (function($rec){smalltalk.send($rec, "_initializeFromJQuery_canvas_", [aJQuery, aCanvas]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  914. return self;}
  915. }),
  916. smalltalk.TagBrush.klass);
  917. smalltalk.addClass('Widget', smalltalk.Object, [], 'Canvas');
  918. smalltalk.addMethod(
  919. '_alert_',
  920. smalltalk.method({
  921. selector: 'alert:',
  922. fn: function (aString){
  923. var self=this;
  924. alert(aString);
  925. return self;}
  926. }),
  927. smalltalk.Widget);
  928. smalltalk.addMethod(
  929. '_confirm_',
  930. smalltalk.method({
  931. selector: 'confirm:',
  932. fn: function (aString){
  933. var self=this;
  934. return window.confirm(aString);
  935. return self;}
  936. }),
  937. smalltalk.Widget);
  938. smalltalk.addMethod(
  939. '_prompt_',
  940. smalltalk.method({
  941. selector: 'prompt:',
  942. fn: function (aString){
  943. var self=this;
  944. return smalltalk.send(self, "_prompt_default_", [aString, ""]);
  945. return self;}
  946. }),
  947. smalltalk.Widget);
  948. smalltalk.addMethod(
  949. '_prompt_default_',
  950. smalltalk.method({
  951. selector: 'prompt:default:',
  952. fn: function (aString, anotherString){
  953. var self=this;
  954. return window.prompt(aString, anotherString);
  955. return self;}
  956. }),
  957. smalltalk.Widget);
  958. smalltalk.addMethod(
  959. '_appendToBrush_',
  960. smalltalk.method({
  961. selector: 'appendToBrush:',
  962. fn: function (aTagBrush){
  963. var self=this;
  964. smalltalk.send(self, "_appendToJQuery_", [smalltalk.send(aTagBrush, "_asJQuery", [])]);
  965. return self;}
  966. }),
  967. smalltalk.Widget);
  968. smalltalk.addMethod(
  969. '_appendToJQuery_',
  970. smalltalk.method({
  971. selector: 'appendToJQuery:',
  972. fn: function (aJQuery){
  973. var self=this;
  974. smalltalk.send(self, "_renderOn_", [smalltalk.send((smalltalk.HTMLCanvas || HTMLCanvas), "_onJQuery_", [aJQuery])]);
  975. return self;}
  976. }),
  977. smalltalk.Widget);
  978. smalltalk.addMethod(
  979. '_renderOn_',
  980. smalltalk.method({
  981. selector: 'renderOn:',
  982. fn: function (html){
  983. var self=this;
  984. self;
  985. return self;}
  986. }),
  987. smalltalk.Widget);
  988. smalltalk.addClass('CanvasBrush', smalltalk.TagBrush, [], 'Canvas');
  989. smalltalk.addMethod(
  990. '_initializeWithCanvas_',
  991. smalltalk.method({
  992. selector: 'initializeWithCanvas:',
  993. fn: function (aCanvas){
  994. var self=this;
  995. self['@canvas']=aCanvas;
  996. return self;}
  997. }),
  998. smalltalk.CanvasBrush);
  999. smalltalk.addMethod(
  1000. '_createElement',
  1001. smalltalk.method({
  1002. selector: 'createElement',
  1003. fn: function (){
  1004. var self=this;
  1005. return document.createElement('canvas');
  1006. return self;}
  1007. }),
  1008. smalltalk.CanvasBrush);
  1009. smalltalk.addMethod(
  1010. '_canvas_',
  1011. smalltalk.method({
  1012. selector: 'canvas:',
  1013. fn: function (aCanvas){
  1014. var self=this;
  1015. return (function($rec){smalltalk.send($rec, "_initializeWithCanvas_", [aCanvas]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  1016. return self;}
  1017. }),
  1018. smalltalk.CanvasBrush.klass);
  1019. smalltalk.addMethod(
  1020. '_appendToBrush_',
  1021. smalltalk.method({
  1022. selector: 'appendToBrush:',
  1023. fn: function (aTagBrush){
  1024. var self=this;
  1025. smalltalk.send(aTagBrush, "_append_", [smalltalk.send(self, "_asString", [])]);
  1026. return self;}
  1027. }),
  1028. smalltalk.Object);
  1029. smalltalk.addMethod(
  1030. '_appendToBrush_',
  1031. smalltalk.method({
  1032. selector: 'appendToBrush:',
  1033. fn: function (aTagBrush){
  1034. var self=this;
  1035. smalltalk.send(aTagBrush, "_appendBlock_", [self]);
  1036. return self;}
  1037. }),
  1038. smalltalk.BlockClosure);
  1039. smalltalk.addMethod(
  1040. '_appendToBrush_',
  1041. smalltalk.method({
  1042. selector: 'appendToBrush:',
  1043. fn: function (aTagBrush){
  1044. var self=this;
  1045. smalltalk.send(aTagBrush, "_appendString_", [self]);
  1046. return self;}
  1047. }),
  1048. smalltalk.String);