Canvas.deploy.js 19 KB

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