JQuery.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. smalltalk.addClass('JQuery', smalltalk.Object, ['jquery'], 'JQuery');
  2. smalltalk.addMethod(
  3. '_removeAttribute_',
  4. smalltalk.method({
  5. selector: 'removeAttribute:',
  6. category: 'attributes',
  7. fn: function (aString) {
  8. var self = this;
  9. return self._call_withArgument_("removeAttribute", aString);
  10. return self;
  11. },
  12. source: unescape('removeAttribute%3A%20aString%0A%20%20%20%20%22Remove%20an%20attribute%20from%20each%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%5Eself%20call%3A%20%27removeAttribute%27%20withArgument%3A%20aString%0A')}),
  13. smalltalk.JQuery);
  14. smalltalk.addMethod(
  15. '_attr_',
  16. smalltalk.method({
  17. selector: 'attr:',
  18. category: 'attributes',
  19. fn: function (aString) {
  20. var self = this;
  21. return self._call_withArgument_("attr", aString);
  22. return self;
  23. },
  24. source: unescape('attr%3A%20aString%0A%20%20%20%20%22Get%20the%20value%20of%20an%20attribute%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%5Eself%20call%3A%20%27attr%27%20withArgument%3A%20aString%0A')}),
  25. smalltalk.JQuery);
  26. smalltalk.addMethod(
  27. '_val',
  28. smalltalk.method({
  29. selector: 'val',
  30. category: 'attributes',
  31. fn: function () {
  32. var self = this;
  33. return self._call_("val");
  34. return self;
  35. },
  36. source: unescape('val%0A%20%20%20%20%22Get%20the%20current%20value%20of%20the%20first%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%5Eself%20call%3A%20%27val%27%0A')}),
  37. smalltalk.JQuery);
  38. smalltalk.addMethod(
  39. '_val_',
  40. smalltalk.method({
  41. selector: 'val:',
  42. category: 'attributes',
  43. fn: function (aString) {
  44. var self = this;
  45. self._call_withArgument_("val", aString);
  46. return self;
  47. },
  48. source: unescape('val%3A%20aString%0A%20%20%20%20self%20call%3A%20%27val%27%20withArgument%3A%20aString%0A')}),
  49. smalltalk.JQuery);
  50. smalltalk.addMethod(
  51. '_cssAt_',
  52. smalltalk.method({
  53. selector: 'cssAt:',
  54. category: 'css',
  55. fn: function (aString) {
  56. var self = this;
  57. return function () {return self['@jquery'].css(aString);}();
  58. return self;
  59. },
  60. source: unescape('cssAt%3A%20aString%0A%20%20%20%20%5E%7B%27return%20self%5B%27%27@jquery%27%27%5D.css%28aString%29%27%7D%0A')}),
  61. smalltalk.JQuery);
  62. smalltalk.addMethod(
  63. '_cssAt_put_',
  64. smalltalk.method({
  65. selector: 'cssAt:put:',
  66. category: 'css',
  67. fn: function (aString, anotherString) {
  68. var self = this;
  69. (function () {self['@jquery'].css(aString, anotherString);}());
  70. return self;
  71. },
  72. source: unescape('cssAt%3A%20aString%20put%3A%20anotherString%0A%20%20%20%20%7B%27self%5B%27%27@jquery%27%27%5D.css%28aString%2C%20anotherString%29%27%7D%0A')}),
  73. smalltalk.JQuery);
  74. smalltalk.addMethod(
  75. '_addClass_',
  76. smalltalk.method({
  77. selector: 'addClass:',
  78. category: 'css',
  79. fn: function (aString) {
  80. var self = this;
  81. self._call_withArgument_("addClass", aString);
  82. return self;
  83. },
  84. source: unescape('addClass%3A%20aString%0A%20%20%20%20%22Adds%20the%20specified%20class%28es%29%20to%20each%20of%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20self%20call%3A%20%27addClass%27%20withArgument%3A%20aString%0A')}),
  85. smalltalk.JQuery);
  86. smalltalk.addMethod(
  87. '_removeClass_',
  88. smalltalk.method({
  89. selector: 'removeClass:',
  90. category: 'css',
  91. fn: function (aString) {
  92. var self = this;
  93. self._call_withArgument_("removeClass", aString);
  94. return self;
  95. },
  96. source: unescape('removeClass%3A%20aString%0A%20%20%20%20%22Remove%20a%20single%20class%2C%20multiple%20classes%2C%20or%20all%20classes%20from%20each%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20self%20call%3A%20%27removeClass%27%20withArgument%3A%20aString%0A')}),
  97. smalltalk.JQuery);
  98. smalltalk.addMethod(
  99. '_toggleClass_',
  100. smalltalk.method({
  101. selector: 'toggleClass:',
  102. category: 'css',
  103. fn: function (aString) {
  104. var self = this;
  105. self._call_withArgument_("toggleClass", aString);
  106. return self;
  107. },
  108. source: unescape('toggleClass%3A%20aString%0A%20%20%20%20%22Add%20or%20remove%20one%20or%20more%20classes%20from%20each%20element%20in%20the%20set%20of%20matched%20elements%2C%20depending%20on%20either%20the%20class%27s%20presence%20or%20the%20value%20of%20the%20switch%20argument.%22%0A%20%20%20%20self%20call%3A%20%27toggleClass%27%20withArgument%3A%20aString%0A')}),
  109. smalltalk.JQuery);
  110. smalltalk.addMethod(
  111. '_height',
  112. smalltalk.method({
  113. selector: 'height',
  114. category: 'css',
  115. fn: function () {
  116. var self = this;
  117. return self._call_("height");
  118. return self;
  119. },
  120. source: unescape('height%20%0A%20%20%20%20%22Get%20the%20current%20computed%20height%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%5Eself%20call%3A%20%27height%27%0A')}),
  121. smalltalk.JQuery);
  122. smalltalk.addMethod(
  123. '_height_',
  124. smalltalk.method({
  125. selector: 'height:',
  126. category: 'css',
  127. fn: function (anInteger) {
  128. var self = this;
  129. self._call_withArgument_("height", anInteger);
  130. return self;
  131. },
  132. source: unescape('height%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27height%27%20withArgument%3A%20anInteger%0A')}),
  133. smalltalk.JQuery);
  134. smalltalk.addMethod(
  135. '_width_',
  136. smalltalk.method({
  137. selector: 'width:',
  138. category: 'css',
  139. fn: function (anInteger) {
  140. var self = this;
  141. self._call_withArgument_("width", anInteger);
  142. return self;
  143. },
  144. source: unescape('width%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27width%27%20withArgument%3A%20anInteger%0A')}),
  145. smalltalk.JQuery);
  146. smalltalk.addMethod(
  147. '_width',
  148. smalltalk.method({
  149. selector: 'width',
  150. category: 'css',
  151. fn: function () {
  152. var self = this;
  153. return self._call_("width");
  154. return self;
  155. },
  156. source: unescape('width%0A%20%20%20%20%22Get%20the%20current%20computed%20width%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%5Eself%20call%3A%20%27width%27%0A')}),
  157. smalltalk.JQuery);
  158. smalltalk.addMethod(
  159. '_innerHeight',
  160. smalltalk.method({
  161. selector: 'innerHeight',
  162. category: 'css',
  163. fn: function () {
  164. var self = this;
  165. return self._call_("innerHeight");
  166. return self;
  167. },
  168. source: unescape('innerHeight%0A%20%20%20%20%22Get%20the%20current%20computed%20height%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20including%20padding%20but%20not%20border.%22%0A%20%20%20%20%5Eself%20call%3A%20%27innerHeight%27%0A')}),
  169. smalltalk.JQuery);
  170. smalltalk.addMethod(
  171. '_innerWidth',
  172. smalltalk.method({
  173. selector: 'innerWidth',
  174. category: 'css',
  175. fn: function () {
  176. var self = this;
  177. return self._call_("innerWidth");
  178. return self;
  179. },
  180. source: unescape('innerWidth%0A%20%20%20%20%22Get%20the%20current%20computed%20width%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20including%20padding%20but%20not%20border.%22%0A%20%20%20%20%5Eself%20call%3A%20%27innerWidth%27%0A')}),
  181. smalltalk.JQuery);
  182. smalltalk.addMethod(
  183. '_outerHeight',
  184. smalltalk.method({
  185. selector: 'outerHeight',
  186. category: 'css',
  187. fn: function () {
  188. var self = this;
  189. return self._call_("outerHeight");
  190. return self;
  191. },
  192. source: unescape('outerHeight%0A%20%20%20%20%22Get%20the%20current%20computed%20height%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20including%20padding%2C%20border%2C%20and%20optionally%20margin.%22%0A%20%20%20%20%5Eself%20call%3A%20%27outerHeight%27%0A')}),
  193. smalltalk.JQuery);
  194. smalltalk.addMethod(
  195. '_outerWidth',
  196. smalltalk.method({
  197. selector: 'outerWidth',
  198. category: 'css',
  199. fn: function () {
  200. var self = this;
  201. return self._call_("outerWidth");
  202. return self;
  203. },
  204. source: unescape('outerWidth%0A%20%20%20%20%22Get%20the%20current%20computed%20width%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20including%20padding%20and%20border.%22%0A%20%20%20%20%5Eself%20call%3A%20%27outerWidth%27%0A')}),
  205. smalltalk.JQuery);
  206. smalltalk.addMethod(
  207. '_top',
  208. smalltalk.method({
  209. selector: 'top',
  210. category: 'css',
  211. fn: function () {
  212. var self = this;
  213. return self._call_("position")._basicAt_("top");
  214. return self;
  215. },
  216. source: unescape('top%0A%20%20%20%20%22Get%20the%20current%20y%20coordinate%20of%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20relative%20to%20the%20offset%20parent.%22%0A%20%20%20%20%5E%28self%20call%3A%20%27position%27%29%20basicAt%3A%20%27top%27%0A')}),
  217. smalltalk.JQuery);
  218. smalltalk.addMethod(
  219. '_left',
  220. smalltalk.method({
  221. selector: 'left',
  222. category: 'css',
  223. fn: function () {
  224. var self = this;
  225. return self._call_("position")._basicAt_("left");
  226. return self;
  227. },
  228. source: unescape('left%0A%20%20%20%20%22Get%20the%20current%20x%20coordinate%20of%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20relative%20to%20the%20offset%20parent.%22%0A%20%20%20%20%5E%28self%20call%3A%20%27position%27%29%20basicAt%3A%20%27left%27%0A')}),
  229. smalltalk.JQuery);
  230. smalltalk.addMethod(
  231. '_offsetLeft',
  232. smalltalk.method({
  233. selector: 'offsetLeft',
  234. category: 'css',
  235. fn: function () {
  236. var self = this;
  237. return self._call_("offset")._basicAt_("left");
  238. return self;
  239. },
  240. source: unescape('offsetLeft%0A%20%20%20%20%22Get%20the%20current%20coordinates%20of%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20relative%20to%20the%20document.%22%0A%20%20%20%20%5E%28self%20call%3A%20%27offset%27%29%20basicAt%3A%20%27left%27%0A')}),
  241. smalltalk.JQuery);
  242. smalltalk.addMethod(
  243. '_offsetTop',
  244. smalltalk.method({
  245. selector: 'offsetTop',
  246. category: 'css',
  247. fn: function () {
  248. var self = this;
  249. return self._call_("offset")._basicAt_("top");
  250. return self;
  251. },
  252. source: unescape('offsetTop%0A%20%20%20%20%22Get%20the%20current%20coordinates%20of%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20relative%20to%20the%20document.%22%0A%20%20%20%20%5E%28self%20call%3A%20%27offset%27%29%20basicAt%3A%20%27top%27%0A')}),
  253. smalltalk.JQuery);
  254. smalltalk.addMethod(
  255. '_scrollLeft',
  256. smalltalk.method({
  257. selector: 'scrollLeft',
  258. category: 'css',
  259. fn: function () {
  260. var self = this;
  261. return self._call_("scrollLeft");
  262. return self;
  263. },
  264. source: unescape('scrollLeft%0A%20%20%20%20%22Get%20the%20current%20horizontal%20position%20of%20the%20scroll%20bar%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%5Eself%20call%3A%20%27scrollLeft%27%0A')}),
  265. smalltalk.JQuery);
  266. smalltalk.addMethod(
  267. '_scrollTop',
  268. smalltalk.method({
  269. selector: 'scrollTop',
  270. category: 'css',
  271. fn: function () {
  272. var self = this;
  273. return self._call_("scrollTop");
  274. return self;
  275. },
  276. source: unescape('scrollTop%0A%20%20%20%20%22Get%20the%20current%20vertical%20position%20of%20the%20scroll%20bar%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%5Eself%20call%3A%20%27scrollTop%27%0A')}),
  277. smalltalk.JQuery);
  278. smalltalk.addMethod(
  279. '_scrollLeft_',
  280. smalltalk.method({
  281. selector: 'scrollLeft:',
  282. category: 'css',
  283. fn: function (anInteger) {
  284. var self = this;
  285. self._call_withArgument_("scrollLeft", anInteger);
  286. return self;
  287. },
  288. source: unescape('scrollLeft%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27scrollLeft%27%20withArgument%3A%20anInteger%0A')}),
  289. smalltalk.JQuery);
  290. smalltalk.addMethod(
  291. '_scrollTop_',
  292. smalltalk.method({
  293. selector: 'scrollTop:',
  294. category: 'css',
  295. fn: function (anInteger) {
  296. var self = this;
  297. self._call_withArgument_("scrollTop", anInteger);
  298. return self;
  299. },
  300. source: unescape('scrollTop%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27scrollTop%27%20withArgument%3A%20anInteger%0A')}),
  301. smalltalk.JQuery);
  302. smalltalk.addMethod(
  303. '_focus',
  304. smalltalk.method({
  305. selector: 'focus',
  306. category: 'events',
  307. fn: function () {
  308. var self = this;
  309. self._call_("focus");
  310. return self;
  311. },
  312. source: unescape('focus%0A%20%20%20%20self%20call%3A%20%27focus%27%0A')}),
  313. smalltalk.JQuery);
  314. smalltalk.addMethod(
  315. '_show',
  316. smalltalk.method({
  317. selector: 'show',
  318. category: 'events',
  319. fn: function () {
  320. var self = this;
  321. self._call_("show");
  322. return self;
  323. },
  324. source: unescape('show%0A%20%20%20%20self%20call%3A%20%27show%27%0A')}),
  325. smalltalk.JQuery);
  326. smalltalk.addMethod(
  327. '_hide',
  328. smalltalk.method({
  329. selector: 'hide',
  330. category: 'events',
  331. fn: function () {
  332. var self = this;
  333. self._call_("hide");
  334. return self;
  335. },
  336. source: unescape('hide%0A%20%20%20%20self%20call%3A%20%27hide%27%0A')}),
  337. smalltalk.JQuery);
  338. smalltalk.addMethod(
  339. '_remove',
  340. smalltalk.method({
  341. selector: 'remove',
  342. category: 'events',
  343. fn: function () {
  344. var self = this;
  345. self._call_("remove");
  346. return self;
  347. },
  348. source: unescape('remove%0A%20%20%20%20self%20call%3A%20%27remove%27%0A')}),
  349. smalltalk.JQuery);
  350. smalltalk.addMethod(
  351. '_on_do_',
  352. smalltalk.method({
  353. selector: 'on:do:',
  354. category: 'events',
  355. fn: function (anEventString, aBlock) {
  356. var self = this;
  357. (function () {self['@jquery'].bind(anEventString, function (e) {aBlock(e, self);});}());
  358. return self;
  359. },
  360. source: unescape('on%3A%20anEventString%20do%3A%20aBlock%0A%20%20%20%20%22Attach%20aBlock%20for%20anEventString%20on%20the%20element%22%0A%20%20%20%20%7B%27self%5B%27%27@jquery%27%27%5D.bind%28anEventString%2C%20function%28e%29%7BaBlock%28e%2C%20self%29%7D%29%27%7D%0A')}),
  361. smalltalk.JQuery);
  362. smalltalk.addMethod(
  363. '_removeEvents_',
  364. smalltalk.method({
  365. selector: 'removeEvents:',
  366. category: 'events',
  367. fn: function (aString) {
  368. var self = this;
  369. self._call_withArgument_("unbind", aString);
  370. return self;
  371. },
  372. source: unescape('removeEvents%3A%20aString%0A%20%20%20%20%22Unbind%20all%20handlers%20attached%20to%20the%20event%20aString%22%0A%20%20%20%20self%20call%3A%20%27unbind%27%20withArgument%3A%20aString%0A')}),
  373. smalltalk.JQuery);
  374. smalltalk.addMethod(
  375. '_append_',
  376. smalltalk.method({
  377. selector: 'append:',
  378. category: 'DOM insertion',
  379. fn: function (anObject) {
  380. var self = this;
  381. anObject._appendToJQuery_(self);
  382. return self;
  383. },
  384. source: unescape('append%3A%20anObject%0A%20%20%20%20%22Append%20anObject%20at%20the%20end%20of%20the%20element.%22%0A%20%20%20%20anObject%20appendToJQuery%3A%20self%0A')}),
  385. smalltalk.JQuery);
  386. smalltalk.addMethod(
  387. '_appendElement_',
  388. smalltalk.method({
  389. selector: 'appendElement:',
  390. category: 'DOM insertion',
  391. fn: function (anElement) {
  392. var self = this;
  393. self._call_withArgument_("append", anElement);
  394. return self;
  395. },
  396. source: unescape('appendElement%3A%20anElement%0A%20%20%20%20%22Append%20anElement%20at%20the%20end%20of%20the%20element.%0A%20%20%20%20%20Dont%27t%20call%20this%20method%20directly%2C%20use%20%23append%3A%20instead%22%0A%20%20%20%20self%20call%3A%20%27append%27%20withArgument%3A%20anElement%0A')}),
  397. smalltalk.JQuery);
  398. smalltalk.addMethod(
  399. '_appendToJQuery_',
  400. smalltalk.method({
  401. selector: 'appendToJQuery:',
  402. category: 'DOM insertion',
  403. fn: function (aJQuery) {
  404. var self = this;
  405. aJQuery._appendElement_(self['@jquery']);
  406. return self;
  407. },
  408. source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20aJQuery%20appendElement%3A%20jquery%0A')}),
  409. smalltalk.JQuery);
  410. smalltalk.addMethod(
  411. '_contents_',
  412. smalltalk.method({
  413. selector: 'contents:',
  414. category: 'DOM insertion',
  415. fn: function (anObject) {
  416. var self = this;
  417. self._empty();
  418. self._append_(anObject);
  419. return self;
  420. },
  421. source: unescape('contents%3A%20anObject%0A%20%20%20%20self%20empty.%0A%20%20%20%20self%20append%3A%20anObject%0A')}),
  422. smalltalk.JQuery);
  423. smalltalk.addMethod(
  424. '_empty',
  425. smalltalk.method({
  426. selector: 'empty',
  427. category: 'DOM insertion',
  428. fn: function () {
  429. var self = this;
  430. self._call_("empty");
  431. return self;
  432. },
  433. source: unescape('empty%0A%20%20%20%20self%20call%3A%20%27empty%27%0A')}),
  434. smalltalk.JQuery);
  435. smalltalk.addMethod(
  436. '_initializeWithJQueryObject_',
  437. smalltalk.method({
  438. selector: 'initializeWithJQueryObject:',
  439. category: 'initialization',
  440. fn: function (anObject) {
  441. var self = this;
  442. self['@jquery'] = anObject;
  443. return self;
  444. },
  445. source: unescape('initializeWithJQueryObject%3A%20anObject%0A%20%20%20%20jquery%20%3A%3D%20anObject%0A')}),
  446. smalltalk.JQuery);
  447. smalltalk.addMethod(
  448. '_call_',
  449. smalltalk.method({
  450. selector: 'call:',
  451. category: 'private',
  452. fn: function (aString) {
  453. var self = this;
  454. return function () {return self['@jquery'][aString]();}();
  455. return self;
  456. },
  457. source: unescape('call%3A%20aString%0A%20%20%20%20%5E%7B%27return%20self%5B%27%27@jquery%27%27%5D%5BaString%5D%28%29%27%7D%0A')}),
  458. smalltalk.JQuery);
  459. smalltalk.addMethod(
  460. '_call_withArgument_',
  461. smalltalk.method({
  462. selector: 'call:withArgument:',
  463. category: 'private',
  464. fn: function (aString, anObject) {
  465. var self = this;
  466. return function () {return self['@jquery'][aString](anObject);}();
  467. return self;
  468. },
  469. source: unescape('call%3A%20aString%20withArgument%3A%20anObject%0A%20%20%20%20%5E%7B%27return%20self%5B%27%27@jquery%27%27%5D%5BaString%5D%28anObject%29%27%7D%0A')}),
  470. smalltalk.JQuery);
  471. smalltalk.addMethod(
  472. '_hasClass_',
  473. smalltalk.method({
  474. selector: 'hasClass:',
  475. category: 'testing',
  476. fn: function (aString) {
  477. var self = this;
  478. return self._call_withArgument_("hasClass", aString);
  479. return self;
  480. },
  481. source: unescape('hasClass%3A%20aString%0A%20%20%20%20%22Determine%20whether%20any%20of%20the%20matched%20elements%20are%20assigned%20the%20given%20class.%22%0A%20%20%20%20%5Eself%20call%3A%20%27hasClass%27%20withArgument%3A%20aString%0A')}),
  482. smalltalk.JQuery);
  483. smalltalk.addMethod(
  484. '_fromString_',
  485. smalltalk.method({
  486. selector: 'fromString:',
  487. category: 'instance creation',
  488. fn: function (aString) {
  489. var self = this;
  490. var newJQuery = nil;
  491. (function () {newJQuery = jQuery(String(aString));}());
  492. return self._from_(newJQuery);
  493. return self;
  494. },
  495. source: unescape('fromString%3A%20aString%0A%20%20%20%20%7C%20newJQuery%20%7C%0A%20%20%20%20%7B%27newJQuery%20%3D%20jQuery%28String%28aString%29%29%27%7D.%0A%20%20%20%20%5Eself%20from%3A%20newJQuery%0A')}),
  496. smalltalk.JQuery.klass);
  497. smalltalk.addMethod(
  498. '_from_',
  499. smalltalk.method({
  500. selector: 'from:',
  501. category: 'instance creation',
  502. fn: function (anObject) {
  503. var self = this;
  504. return function ($rec) {$rec._initializeWithJQueryObject_(anObject);return $rec._yourself();}(self._new());
  505. return self;
  506. },
  507. source: unescape('from%3A%20anObject%0A%20%20%20%20%5Eself%20new%0A%09initializeWithJQueryObject%3A%20anObject%3B%0A%09yourself%0A')}),
  508. smalltalk.JQuery.klass);
  509. smalltalk.addClass('Ajax', smalltalk.Object, ['settings'], 'JQuery');
  510. smalltalk.Ajax.comment=unescape('instance%20variable%20names%3A%0A-%20settings%20%20A%20set%20of%20key/value%20pairs%20that%20configure%20the%20Ajax%20request.%20All%20settings%20are%20optional.%0A%0AFull%20list%20of%20settings%20options%20at%20http%3A//api.jquery.com/jQuery.ajax/%0A')
  511. smalltalk.addMethod(
  512. '_initialize',
  513. smalltalk.method({
  514. selector: 'initialize',
  515. category: 'initialization',
  516. fn: function () {
  517. var self = this;
  518. self.klass.superclass.fn.prototype._initialize.apply(self, []);
  519. self['@settings'] = smalltalk.Dictionary._new();
  520. return self;
  521. },
  522. source: unescape('initialize%0A%20%20%20%20super%20initialize.%0A%20%20%20%20settings%20%3A%3D%20Dictionary%20new%0A')}),
  523. smalltalk.Ajax);
  524. smalltalk.addMethod(
  525. '_at_',
  526. smalltalk.method({
  527. selector: 'at:',
  528. category: 'accessing',
  529. fn: function (aKey) {
  530. var self = this;
  531. return self['@settings']._at_ifAbsent_(aKey, function () {return nil;});
  532. return self;
  533. },
  534. source: unescape('at%3A%20aKey%0A%20%20%20%20%5Esettings%20at%3A%20aKey%20ifAbsent%3A%20%5Bnil%5D%0A')}),
  535. smalltalk.Ajax);
  536. smalltalk.addMethod(
  537. '_at_put_',
  538. smalltalk.method({
  539. selector: 'at:put:',
  540. category: 'accessing',
  541. fn: function (aKey, aValue) {
  542. var self = this;
  543. self['@settings']._at_put_(aKey, aValue);
  544. return self;
  545. },
  546. source: unescape('at%3A%20aKey%20put%3A%20aValue%0A%20%20%20%20settings%20at%3A%20aKey%20put%3A%20aValue%0A')}),
  547. smalltalk.Ajax);
  548. smalltalk.addMethod(
  549. '_url',
  550. smalltalk.method({
  551. selector: 'url',
  552. category: 'accessing',
  553. fn: function () {
  554. var self = this;
  555. return self._at_("url");
  556. return self;
  557. },
  558. source: unescape('url%0A%20%20%20%20%5Eself%20at%3A%20%27url%27%0A')}),
  559. smalltalk.Ajax);
  560. smalltalk.addMethod(
  561. '_url_',
  562. smalltalk.method({
  563. selector: 'url:',
  564. category: 'accessing',
  565. fn: function (aString) {
  566. var self = this;
  567. self._at_put_("url", aString);
  568. return self;
  569. },
  570. source: unescape('url%3A%20aString%0A%20%20%20%20self%20at%3A%20%27url%27%20put%3A%20aString%0A')}),
  571. smalltalk.Ajax);
  572. smalltalk.addMethod(
  573. '_send',
  574. smalltalk.method({
  575. selector: 'send',
  576. category: 'actions',
  577. fn: function () {
  578. var self = this;
  579. (function () {jQuery.ajax(self['@settings']);}());
  580. return self;
  581. },
  582. source: unescape('send%0A%20%20%20%20%7B%27jQuery.ajax%28self%5B%27%27@settings%27%27%5D%29%27%7D%0A')}),
  583. smalltalk.Ajax);
  584. smalltalk.addMethod(
  585. '_url_',
  586. smalltalk.method({
  587. selector: 'url:',
  588. category: 'instance creation',
  589. fn: function (aString) {
  590. var self = this;
  591. return function ($rec) {$rec._url_(aString);return $rec._yourself();}(self._new());
  592. return self;
  593. },
  594. source: unescape('url%3A%20aString%0A%20%20%20%20%5Eself%20new%0A%09url%3A%20aString%3B%0A%09yourself%0A')}),
  595. smalltalk.Ajax.klass);