1
0

JQuery.js 20 KB

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