Wrappers-JQuery.js 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. define(["amber/boot"
  2. //>>excludeStart("imports", pragmas.excludeImports);
  3. , "jquery"
  4. //>>excludeEnd("imports");
  5. , "amber_core/Kernel-Collections", "amber_core/Kernel-Infrastructure", "amber_core/Kernel-Methods", "amber_core/Kernel-Objects"], function($boot
  6. //>>excludeStart("imports", pragmas.excludeImports);
  7. ,jQuery
  8. //>>excludeEnd("imports");
  9. ){"use strict";
  10. if(!$boot.nilAsReceiver)$boot.nilAsReceiver=$boot.nil;
  11. var $core=$boot.api,nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;
  12. if(!$boot.nilAsClass)$boot.nilAsClass=$boot.dnu;
  13. $core.addPackage("Wrappers-JQuery");
  14. $core.packages["Wrappers-JQuery"].innerEval = function (expr) { return eval(expr); };
  15. $core.packages["Wrappers-JQuery"].imports = ["jQuery=jquery"];
  16. $core.packages["Wrappers-JQuery"].transport = {"type":"amd","amdNamespace":"amber/jquery"};
  17. $core.addClass("JQuery", $globals.Object, [], "Wrappers-JQuery");
  18. $core.addMethod(
  19. $core.method({
  20. selector: "current",
  21. protocol: "initialization",
  22. fn: function (){
  23. var self=this;
  24. return jQuery;
  25. },
  26. //>>excludeStart("ide", pragmas.excludeIdeData);
  27. args: [],
  28. source: "current\x0a\x09^ jQuery",
  29. referencedClasses: [],
  30. //>>excludeEnd("ide");
  31. messageSends: []
  32. }),
  33. $globals.JQuery.klass);
  34. $core.addMethod(
  35. $core.method({
  36. selector: "initialize",
  37. protocol: "initialization",
  38. fn: function (){
  39. var self=this;
  40. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  41. return $core.withContext(function($ctx1) {
  42. //>>excludeEnd("ctx");
  43. $recv($globals.Smalltalk)._optOut_(jQuery);
  44. return self;
  45. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  46. }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.JQuery.klass)});
  47. //>>excludeEnd("ctx");
  48. },
  49. //>>excludeStart("ide", pragmas.excludeIdeData);
  50. args: [],
  51. source: "initialize\x0a\x09\x22Allow JS method calls for the jQuery object.\x0a\x09See boot.js DNU handling.\x22\x0a\x09\x0a\x09Smalltalk optOut: jQuery",
  52. referencedClasses: ["Smalltalk"],
  53. //>>excludeEnd("ide");
  54. messageSends: ["optOut:"]
  55. }),
  56. $globals.JQuery.klass);
  57. $core.addMethod(
  58. $core.method({
  59. selector: "asJQuery",
  60. protocol: "*Wrappers-JQuery",
  61. fn: function (){
  62. var self=this;
  63. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  64. return $core.withContext(function($ctx1) {
  65. //>>excludeEnd("ctx");
  66. return $recv([self])._asJQuery();
  67. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  68. }, function($ctx1) {$ctx1.fill(self,"asJQuery",{},$globals.BlockClosure)});
  69. //>>excludeEnd("ctx");
  70. },
  71. //>>excludeStart("ide", pragmas.excludeIdeData);
  72. args: [],
  73. source: "asJQuery\x0a\x09^ {self} asJQuery",
  74. referencedClasses: [],
  75. //>>excludeEnd("ide");
  76. messageSends: ["asJQuery"]
  77. }),
  78. $globals.BlockClosure);
  79. $core.addMethod(
  80. $core.method({
  81. selector: "asJQueryInContext:",
  82. protocol: "*Wrappers-JQuery",
  83. fn: function (aContext){
  84. var self=this;
  85. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  86. return $core.withContext(function($ctx1) {
  87. //>>excludeEnd("ctx");
  88. return $recv([self])._asJQueryInContext_(aContext);
  89. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  90. }, function($ctx1) {$ctx1.fill(self,"asJQueryInContext:",{aContext:aContext},$globals.BlockClosure)});
  91. //>>excludeEnd("ctx");
  92. },
  93. //>>excludeStart("ide", pragmas.excludeIdeData);
  94. args: ["aContext"],
  95. source: "asJQueryInContext: aContext\x0a\x09^ {self} asJQueryInContext: aContext",
  96. referencedClasses: [],
  97. //>>excludeEnd("ide");
  98. messageSends: ["asJQueryInContext:"]
  99. }),
  100. $globals.BlockClosure);
  101. $core.addMethod(
  102. $core.method({
  103. selector: "asJQuery",
  104. protocol: "*Wrappers-JQuery",
  105. fn: function (){
  106. var self=this;
  107. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  108. return $core.withContext(function($ctx1) {
  109. //>>excludeEnd("ctx");
  110. return jQuery(self['@jsObject']);
  111. return self;
  112. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  113. }, function($ctx1) {$ctx1.fill(self,"asJQuery",{},$globals.JSObjectProxy)});
  114. //>>excludeEnd("ctx");
  115. },
  116. //>>excludeStart("ide", pragmas.excludeIdeData);
  117. args: [],
  118. source: "asJQuery\x0a\x09<inlineJS: 'return jQuery(self[''@jsObject''])'>",
  119. referencedClasses: [],
  120. //>>excludeEnd("ide");
  121. messageSends: []
  122. }),
  123. $globals.JSObjectProxy);
  124. $core.addMethod(
  125. $core.method({
  126. selector: "asJQueryInContext:",
  127. protocol: "*Wrappers-JQuery",
  128. fn: function (aContext){
  129. var self=this;
  130. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  131. return $core.withContext(function($ctx1) {
  132. //>>excludeEnd("ctx");
  133. return jQuery(self['@jsObject'], aContext);
  134. return self;
  135. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  136. }, function($ctx1) {$ctx1.fill(self,"asJQueryInContext:",{aContext:aContext},$globals.JSObjectProxy)});
  137. //>>excludeEnd("ctx");
  138. },
  139. //>>excludeStart("ide", pragmas.excludeIdeData);
  140. args: ["aContext"],
  141. source: "asJQueryInContext: aContext\x0a\x09<inlineJS: 'return jQuery(self[''@jsObject''], aContext)'>",
  142. referencedClasses: [],
  143. //>>excludeEnd("ide");
  144. messageSends: []
  145. }),
  146. $globals.JSObjectProxy);
  147. $core.addMethod(
  148. $core.method({
  149. selector: "asJQuery",
  150. protocol: "*Wrappers-JQuery",
  151. fn: function (){
  152. var self=this;
  153. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  154. return $core.withContext(function($ctx1) {
  155. //>>excludeEnd("ctx");
  156. return jQuery(self);
  157. return self;
  158. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  159. }, function($ctx1) {$ctx1.fill(self,"asJQuery",{},$globals.Object)});
  160. //>>excludeEnd("ctx");
  161. },
  162. //>>excludeStart("ide", pragmas.excludeIdeData);
  163. args: [],
  164. source: "asJQuery\x0a\x09<inlineJS: 'return jQuery(self)'>",
  165. referencedClasses: [],
  166. //>>excludeEnd("ide");
  167. messageSends: []
  168. }),
  169. $globals.Object);
  170. $core.addMethod(
  171. $core.method({
  172. selector: "asJQueryInContext:",
  173. protocol: "*Wrappers-JQuery",
  174. fn: function (aContext){
  175. var self=this;
  176. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  177. return $core.withContext(function($ctx1) {
  178. //>>excludeEnd("ctx");
  179. return jQuery(self, aContext);
  180. return self;
  181. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  182. }, function($ctx1) {$ctx1.fill(self,"asJQueryInContext:",{aContext:aContext},$globals.Object)});
  183. //>>excludeEnd("ctx");
  184. },
  185. //>>excludeStart("ide", pragmas.excludeIdeData);
  186. args: ["aContext"],
  187. source: "asJQueryInContext: aContext\x0a\x09<inlineJS: 'return jQuery(self, aContext)'>",
  188. referencedClasses: [],
  189. //>>excludeEnd("ide");
  190. messageSends: []
  191. }),
  192. $globals.Object);
  193. $core.addMethod(
  194. $core.method({
  195. selector: "asJQuery",
  196. protocol: "*Wrappers-JQuery",
  197. fn: function (){
  198. var self=this;
  199. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  200. return $core.withContext(function($ctx1) {
  201. //>>excludeEnd("ctx");
  202. return jQuery(String(self));
  203. return self;
  204. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  205. }, function($ctx1) {$ctx1.fill(self,"asJQuery",{},$globals.String)});
  206. //>>excludeEnd("ctx");
  207. },
  208. //>>excludeStart("ide", pragmas.excludeIdeData);
  209. args: [],
  210. source: "asJQuery\x0a\x09<inlineJS: 'return jQuery(String(self))'>",
  211. referencedClasses: [],
  212. //>>excludeEnd("ide");
  213. messageSends: []
  214. }),
  215. $globals.String);
  216. $core.addMethod(
  217. $core.method({
  218. selector: "asJQueryInContext:",
  219. protocol: "*Wrappers-JQuery",
  220. fn: function (aContext){
  221. var self=this;
  222. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  223. return $core.withContext(function($ctx1) {
  224. //>>excludeEnd("ctx");
  225. return jQuery(String(self), aContext);
  226. return self;
  227. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  228. }, function($ctx1) {$ctx1.fill(self,"asJQueryInContext:",{aContext:aContext},$globals.String)});
  229. //>>excludeEnd("ctx");
  230. },
  231. //>>excludeStart("ide", pragmas.excludeIdeData);
  232. args: ["aContext"],
  233. source: "asJQueryInContext: aContext\x0a\x09<inlineJS: 'return jQuery(String(self), aContext)'>",
  234. referencedClasses: [],
  235. //>>excludeEnd("ide");
  236. messageSends: []
  237. }),
  238. $globals.String);
  239. });