Browse Source

added additional jQuery constructor

http://api.jquery.com/jquery/#jQuery1

It is now possible to add a specified context as parameter to the jQuery
constructor.
Sebastian Heidbrink 10 years ago
parent
commit
c31c1ba671
2 changed files with 62 additions and 0 deletions
  1. 50 0
      js/Canvas.js
  2. 12 0
      st/Canvas.st

+ 50 - 0
js/Canvas.js

@@ -2672,6 +2672,24 @@ referencedClasses: []
 }),
 globals.TagBrush);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "asJQueryWithContext:",
+protocol: 'converting',
+fn: function (aContext){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st(self._element())._asJQueryWithContext_(aContext);
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"asJQueryWithContext:",{aContext:aContext},globals.TagBrush)})},
+args: ["aContext"],
+source: "asJQueryWithContext: aContext\x0a\x09^ self element asJQueryWithContext: aContext",
+messageSends: ["asJQueryWithContext:", "element"],
+referencedClasses: []
+}),
+globals.TagBrush);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "at:",
@@ -3788,6 +3806,22 @@ referencedClasses: []
 }),
 globals.JSObjectProxy);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "asJQueryWithContext:",
+protocol: '*Canvas',
+fn: function (aContext){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return jQuery(self['@jsObject'], aContext);
+return self}, function($ctx1) {$ctx1.fill(self,"asJQueryWithContext:",{aContext:aContext},globals.JSObjectProxy)})},
+args: ["aContext"],
+source: "asJQueryWithContext: aContext\x0a\x09<return jQuery(self['@jsObject'], aContext)>",
+messageSends: [],
+referencedClasses: []
+}),
+globals.JSObjectProxy);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "appendToBrush:",
@@ -3868,4 +3902,20 @@ referencedClasses: []
 }),
 globals.String);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "asJQueryWithContext:",
+protocol: '*Canvas',
+fn: function (aContext){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return jQuery(String(self), aContext);
+return self}, function($ctx1) {$ctx1.fill(self,"asJQueryWithContext:",{aContext:aContext},globals.String)})},
+args: ["aContext"],
+source: "asJQueryWithContext: aContext\x0a\x09<return jQuery(String(self), aContext)>",
+messageSends: [],
+referencedClasses: []
+}),
+globals.String);
+
 });

+ 12 - 0
st/Canvas.st

@@ -927,6 +927,10 @@ width: aString
 
 asJQuery
 	^ self element asJQuery
+!
+
+asJQueryWithContext: aContext
+	^ self element asJQueryWithContext: aContext
 ! !
 
 !TagBrush methodsFor: 'events'!
@@ -1113,6 +1117,10 @@ asSnippet
 
 asJQuery
 	<return jQuery(self['@jsObject'])>
+!
+
+asJQueryWithContext: aContext
+	<return jQuery(self['@jsObject'], aContext)>
 ! !
 
 !Object methodsFor: '*Canvas'!
@@ -1137,5 +1145,9 @@ appendToJQuery: aJQuery
 
 asJQuery
 	<return jQuery(String(self))>
+!
+
+asJQueryWithContext: aContext
+	<return jQuery(String(self), aContext)>
 ! !