Canvas.deploy.js 23 KB

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