Wrappers-JQuery.js 7.6 KB

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