Browse Source

Merge pull request #17 from lolgzs/master

little enhancements, well, quite a few I would say. Better to make pull requests smaller, or perhaps Nicolas sets you up for push :)
Göran Krampe 13 years ago
parent
commit
2684634c63
23 changed files with 1096 additions and 15 deletions
  1. 75 0
      js/Canvas.deploy.js
  2. 75 0
      js/Canvas.js
  3. 3 4
      js/IDE.deploy.js
  4. 3 4
      js/IDE.js
  5. 51 0
      js/JQuery-Tests.deploy.js
  6. 51 0
      js/JQuery-Tests.js
  7. 105 0
      js/JQuery.deploy.js
  8. 105 0
      js/JQuery.js
  9. 67 0
      js/Kernel-Tests.deploy.js
  10. 67 0
      js/Kernel-Tests.js
  11. 117 0
      js/Kernel.deploy.js
  12. 117 0
      js/Kernel.js
  13. 15 0
      js/SUnit.deploy.js
  14. 15 0
      js/SUnit.js
  15. 3 1
      js/jtalk.js
  16. 15 0
      js/lib/jQuery/jquery-1.6.2.min.js
  17. 20 0
      st/Canvas.st
  18. 8 6
      st/IDE.st
  19. 34 0
      st/JQuery-Tests.st
  20. 40 0
      st/JQuery.st
  21. 38 0
      st/Kernel-Tests.st
  22. 68 0
      st/Kernel.st
  23. 4 0
      st/SUnit.st

+ 75 - 0
js/Canvas.deploy.js

@@ -753,6 +753,36 @@ referencedClasses: []
 }),
 smalltalk.HTMLCanvas);
 
+smalltalk.addMethod(
+'_script',
+smalltalk.method({
+selector: 'script',
+category: 'tags',
+fn: function (){
+var self=this;
+return smalltalk.send(self, "_tag_", ["script"]);
+return self;},
+source: unescape('script%0A%20%20%20%20%5Eself%20tag%3A%20%27script%27'),
+messageSends: ["tag:"],
+referencedClasses: []
+}),
+smalltalk.HTMLCanvas);
+
+smalltalk.addMethod(
+'_link',
+smalltalk.method({
+selector: 'link',
+category: 'tags',
+fn: function (){
+var self=this;
+return smalltalk.send(self, "_tag_", ["link"]);
+return self;},
+source: unescape('link%0A%20%20%20%20%5Eself%20tag%3A%20%27link%27'),
+messageSends: ["tag:"],
+referencedClasses: []
+}),
+smalltalk.HTMLCanvas);
+
 
 smalltalk.addMethod(
 '_onJQuery_',
@@ -1229,6 +1259,51 @@ referencedClasses: []
 }),
 smalltalk.TagBrush);
 
+smalltalk.addMethod(
+'_type_',
+smalltalk.method({
+selector: 'type:',
+category: 'attributes',
+fn: function (aString){
+var self=this;
+smalltalk.send(self, "_at_put_", ["type", aString]);
+return self;},
+source: unescape('type%3A%20aString%0A%20%20%20%20self%20at%3A%20%27type%27%20put%3A%20aString'),
+messageSends: ["at:put:"],
+referencedClasses: []
+}),
+smalltalk.TagBrush);
+
+smalltalk.addMethod(
+'_media_',
+smalltalk.method({
+selector: 'media:',
+category: 'attributes',
+fn: function (aString){
+var self=this;
+smalltalk.send(self, "_at_put_", ["media", aString]);
+return self;},
+source: unescape('media%3A%20aString%0A%20%20%20%20self%20at%3A%20%27media%27%20put%3A%20aString'),
+messageSends: ["at:put:"],
+referencedClasses: []
+}),
+smalltalk.TagBrush);
+
+smalltalk.addMethod(
+'_rel_',
+smalltalk.method({
+selector: 'rel:',
+category: 'attributes',
+fn: function (aString){
+var self=this;
+smalltalk.send(self, "_at_put_", ["rel", aString]);
+return self;},
+source: unescape('rel%3A%20aString%0A%20%20%20%20self%20%20at%3A%20%27rel%27%20put%3A%20aString'),
+messageSends: ["at:put:"],
+referencedClasses: []
+}),
+smalltalk.TagBrush);
+
 
 smalltalk.addMethod(
 '_fromString_canvas_',

+ 75 - 0
js/Canvas.js

@@ -753,6 +753,36 @@ referencedClasses: []
 }),
 smalltalk.HTMLCanvas);
 
+smalltalk.addMethod(
+'_script',
+smalltalk.method({
+selector: 'script',
+category: 'tags',
+fn: function (){
+var self=this;
+return smalltalk.send(self, "_tag_", ["script"]);
+return self;},
+source: unescape('script%0A%20%20%20%20%5Eself%20tag%3A%20%27script%27'),
+messageSends: ["tag:"],
+referencedClasses: []
+}),
+smalltalk.HTMLCanvas);
+
+smalltalk.addMethod(
+'_link',
+smalltalk.method({
+selector: 'link',
+category: 'tags',
+fn: function (){
+var self=this;
+return smalltalk.send(self, "_tag_", ["link"]);
+return self;},
+source: unescape('link%0A%20%20%20%20%5Eself%20tag%3A%20%27link%27'),
+messageSends: ["tag:"],
+referencedClasses: []
+}),
+smalltalk.HTMLCanvas);
+
 
 smalltalk.addMethod(
 '_onJQuery_',
@@ -1229,6 +1259,51 @@ referencedClasses: []
 }),
 smalltalk.TagBrush);
 
+smalltalk.addMethod(
+'_type_',
+smalltalk.method({
+selector: 'type:',
+category: 'attributes',
+fn: function (aString){
+var self=this;
+smalltalk.send(self, "_at_put_", ["type", aString]);
+return self;},
+source: unescape('type%3A%20aString%0A%20%20%20%20self%20at%3A%20%27type%27%20put%3A%20aString'),
+messageSends: ["at:put:"],
+referencedClasses: []
+}),
+smalltalk.TagBrush);
+
+smalltalk.addMethod(
+'_media_',
+smalltalk.method({
+selector: 'media:',
+category: 'attributes',
+fn: function (aString){
+var self=this;
+smalltalk.send(self, "_at_put_", ["media", aString]);
+return self;},
+source: unescape('media%3A%20aString%0A%20%20%20%20self%20at%3A%20%27media%27%20put%3A%20aString'),
+messageSends: ["at:put:"],
+referencedClasses: []
+}),
+smalltalk.TagBrush);
+
+smalltalk.addMethod(
+'_rel_',
+smalltalk.method({
+selector: 'rel:',
+category: 'attributes',
+fn: function (aString){
+var self=this;
+smalltalk.send(self, "_at_put_", ["rel", aString]);
+return self;},
+source: unescape('rel%3A%20aString%0A%20%20%20%20self%20%20at%3A%20%27rel%27%20put%3A%20aString'),
+messageSends: ["at:put:"],
+referencedClasses: []
+}),
+smalltalk.TagBrush);
+
 
 smalltalk.addMethod(
 '_fromString_canvas_',

+ 3 - 4
js/IDE.deploy.js

@@ -1121,11 +1121,10 @@ category: 'actions',
 fn: function (){
 var self=this;
 smalltalk.send(self, "_disableSaveButton", []);
-smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", ["comment"]), "_ifTrue_", [(function(){return smalltalk.send(self['@selectedClass'], "_ifNotNil_", [(function(){return smalltalk.send(self, "_compileClassComment", []);})]);})]);
-smalltalk.send(smalltalk.send(smalltalk.send(self['@selectedProtocol'], "_notNil", []), "_or_", [(function(){return smalltalk.send(self['@selectedMethod'], "_notNil", []);})]), "_ifFalse_ifTrue_", [(function(){return smalltalk.send(self, "_compileDefinition", []);}), (function(){return smalltalk.send(self, "_compileMethodDefinition", []);})]);
+smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", ["comment"]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@selectedClass'], "_ifNotNil_", [(function(){return smalltalk.send(self, "_compileClassComment", []);})]);}), (function(){return smalltalk.send(smalltalk.send(smalltalk.send(self['@selectedProtocol'], "_notNil", []), "_or_", [(function(){return smalltalk.send(self['@selectedMethod'], "_notNil", []);})]), "_ifFalse_ifTrue_", [(function(){return smalltalk.send(self, "_compileDefinition", []);}), (function(){return smalltalk.send(self, "_compileMethodDefinition", []);})]);})]);
 return self;},
-source: unescape('compile%0A%20%20%20%20self%20disableSaveButton.%0A%20%20%20%20selectedTab%20%3D%20%23comment%20ifTrue%3A%20%5B%0A%09selectedClass%20ifNotNil%3A%20%5B%0A%09%20%20%20%20self%20compileClassComment%5D%5D.%0A%20%20%20%20%28selectedProtocol%20notNil%20or%3A%20%5BselectedMethod%20notNil%5D%29%0A%09ifFalse%3A%20%5Bself%20compileDefinition%5D%0A%09ifTrue%3A%20%5Bself%20compileMethodDefinition%5D'),
-messageSends: ["disableSaveButton", "ifTrue:", unescape("%3D"), "ifNotNil:", "compileClassComment", "ifFalse:ifTrue:", "or:", "notNil", "compileDefinition", "compileMethodDefinition"],
+source: unescape('compile%0A%20%20%20%20self%20disableSaveButton.%0A%20%20%20%20selectedTab%20%3D%20%23comment%0A%09ifTrue%3A%20%5B%0A%09%09selectedClass%20ifNotNil%3A%20%5B%0A%09%20%20%20%20%09%09self%20compileClassComment%5D%5D%0A%09ifFalse%3A%20%5B%20%0A%20%20%09%09%20%20%28selectedProtocol%20notNil%20or%3A%20%5BselectedMethod%20notNil%5D%29%0A%09%09%09ifFalse%3A%20%5Bself%20compileDefinition%5D%0A%09%09%09ifTrue%3A%20%5Bself%20compileMethodDefinition%5D%5D.'),
+messageSends: ["disableSaveButton", "ifTrue:ifFalse:", unescape("%3D"), "ifNotNil:", "compileClassComment", "ifFalse:ifTrue:", "or:", "notNil", "compileDefinition", "compileMethodDefinition"],
 referencedClasses: []
 }),
 smalltalk.Browser);

+ 3 - 4
js/IDE.js

@@ -1121,11 +1121,10 @@ category: 'actions',
 fn: function (){
 var self=this;
 smalltalk.send(self, "_disableSaveButton", []);
-smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", ["comment"]), "_ifTrue_", [(function(){return smalltalk.send(self['@selectedClass'], "_ifNotNil_", [(function(){return smalltalk.send(self, "_compileClassComment", []);})]);})]);
-smalltalk.send(smalltalk.send(smalltalk.send(self['@selectedProtocol'], "_notNil", []), "_or_", [(function(){return smalltalk.send(self['@selectedMethod'], "_notNil", []);})]), "_ifFalse_ifTrue_", [(function(){return smalltalk.send(self, "_compileDefinition", []);}), (function(){return smalltalk.send(self, "_compileMethodDefinition", []);})]);
+smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", ["comment"]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@selectedClass'], "_ifNotNil_", [(function(){return smalltalk.send(self, "_compileClassComment", []);})]);}), (function(){return smalltalk.send(smalltalk.send(smalltalk.send(self['@selectedProtocol'], "_notNil", []), "_or_", [(function(){return smalltalk.send(self['@selectedMethod'], "_notNil", []);})]), "_ifFalse_ifTrue_", [(function(){return smalltalk.send(self, "_compileDefinition", []);}), (function(){return smalltalk.send(self, "_compileMethodDefinition", []);})]);})]);
 return self;},
-source: unescape('compile%0A%20%20%20%20self%20disableSaveButton.%0A%20%20%20%20selectedTab%20%3D%20%23comment%20ifTrue%3A%20%5B%0A%09selectedClass%20ifNotNil%3A%20%5B%0A%09%20%20%20%20self%20compileClassComment%5D%5D.%0A%20%20%20%20%28selectedProtocol%20notNil%20or%3A%20%5BselectedMethod%20notNil%5D%29%0A%09ifFalse%3A%20%5Bself%20compileDefinition%5D%0A%09ifTrue%3A%20%5Bself%20compileMethodDefinition%5D'),
-messageSends: ["disableSaveButton", "ifTrue:", unescape("%3D"), "ifNotNil:", "compileClassComment", "ifFalse:ifTrue:", "or:", "notNil", "compileDefinition", "compileMethodDefinition"],
+source: unescape('compile%0A%20%20%20%20self%20disableSaveButton.%0A%20%20%20%20selectedTab%20%3D%20%23comment%0A%09ifTrue%3A%20%5B%0A%09%09selectedClass%20ifNotNil%3A%20%5B%0A%09%20%20%20%20%09%09self%20compileClassComment%5D%5D%0A%09ifFalse%3A%20%5B%20%0A%20%20%09%09%20%20%28selectedProtocol%20notNil%20or%3A%20%5BselectedMethod%20notNil%5D%29%0A%09%09%09ifFalse%3A%20%5Bself%20compileDefinition%5D%0A%09%09%09ifTrue%3A%20%5Bself%20compileMethodDefinition%5D%5D.'),
+messageSends: ["disableSaveButton", "ifTrue:ifFalse:", unescape("%3D"), "ifNotNil:", "compileClassComment", "ifFalse:ifTrue:", "or:", "notNil", "compileDefinition", "compileMethodDefinition"],
 referencedClasses: []
 }),
 smalltalk.Browser);

+ 51 - 0
js/JQuery-Tests.deploy.js

@@ -0,0 +1,51 @@
+smalltalk.addClass('JQueryTest', smalltalk.TestCase, ['document'], 'JQuery-Tests');
+smalltalk.addMethod(
+'_testFind',
+smalltalk.method({
+selector: 'testFind',
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", ["James", smalltalk.send(smalltalk.send(smalltalk.send(self['@document'], "_asJQuery", []), "_find_", ["li.firstname"]), "_html", [])]);
+return self;},
+source: unescape('testFind%0A%09self%20%0A%09%09assert%3A%20%27James%27%20%0A%09%09equals%3A%20%28document%20asJQuery%20find%3A%20%27li.firstname%27%29%20html.%20'),
+messageSends: ["assert:equals:", "html", "find:", "asJQuery"],
+referencedClasses: []
+}),
+smalltalk.JQueryTest);
+
+smalltalk.addMethod(
+'_setUp',
+smalltalk.method({
+selector: 'setUp',
+category: 'running',
+fn: function (){
+var self=this;
+self['@document']=unescape("%3Cdiv%20class%3D%22person%22%3E%0A%09%09%09%09%3Cul%3E%0A%09%09%09%09%09%3Cli%20class%3D%22firstname%22%3EJames%3C/li%3E%0A%09%09%09%09%09%3Cli%20class%3D%22lastname%22%3EBond%3C/li%3E%0A%09%09%09%09%3C/ul%3E%0A%09%09%09%3C/div%3E");
+return self;},
+source: unescape('setUp%0A%09document%20%3A%3D%20%27%3Cdiv%20class%3D%22person%22%3E%0A%09%09%09%09%3Cul%3E%0A%09%09%09%09%09%3Cli%20class%3D%22firstname%22%3EJames%3C/li%3E%0A%09%09%09%09%09%3Cli%20class%3D%22lastname%22%3EBond%3C/li%3E%0A%09%09%09%09%3C/ul%3E%0A%09%09%09%3C/div%3E%27.'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.JQueryTest);
+
+smalltalk.addMethod(
+'_testEach',
+smalltalk.method({
+selector: 'testEach',
+category: 'tests',
+fn: function (){
+var self=this;
+var classes=nil;
+classes=smalltalk.send(smalltalk.Array, "_new", []);
+smalltalk.send(smalltalk.send(smalltalk.send(self['@document'], "_asJQuery", []), "_find_", ["li"]), "_each_", [(function(index, element){return smalltalk.send(classes, "_add_", [smalltalk.send(smalltalk.send(smalltalk.JQuery, "_fromElement_", [element]), "_attr_", ["class"])]);})]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(["firstname", "lastname"], "_printString", []), smalltalk.send(classes, "_printString", [])]);
+return self;},
+source: unescape('testEach%0A%09%7Cclasses%7C%0A%09classes%20%3A%3D%20Array%20new.%0A%0A%09%28document%20asJQuery%20find%3A%20%27li%27%29%20each%3A%20%5B%3Aindex%20%3Aelement%7C%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%20%20%09classes%20add%3A%20%28%28JQuery%20fromElement%3Aelement%29%20attr%3A%20%27class%27%29%5D.%0A%09self%20%0A%09%09assert%3A%20%23%28%27firstname%27%20%27lastname%27%29%20printString%0A%09%09equals%3A%20classes%20printString'),
+messageSends: ["new", "each:", "find:", "asJQuery", "add:", "attr:", "fromElement:", "assert:equals:", "printString"],
+referencedClasses: [smalltalk.Array,smalltalk.JQuery]
+}),
+smalltalk.JQueryTest);
+
+
+

+ 51 - 0
js/JQuery-Tests.js

@@ -0,0 +1,51 @@
+smalltalk.addClass('JQueryTest', smalltalk.TestCase, ['document'], 'JQuery-Tests');
+smalltalk.addMethod(
+'_testFind',
+smalltalk.method({
+selector: 'testFind',
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", ["James", smalltalk.send(smalltalk.send(smalltalk.send(self['@document'], "_asJQuery", []), "_find_", ["li.firstname"]), "_html", [])]);
+return self;},
+source: unescape('testFind%0A%09self%20%0A%09%09assert%3A%20%27James%27%20%0A%09%09equals%3A%20%28document%20asJQuery%20find%3A%20%27li.firstname%27%29%20html.%20'),
+messageSends: ["assert:equals:", "html", "find:", "asJQuery"],
+referencedClasses: []
+}),
+smalltalk.JQueryTest);
+
+smalltalk.addMethod(
+'_setUp',
+smalltalk.method({
+selector: 'setUp',
+category: 'running',
+fn: function (){
+var self=this;
+self['@document']=unescape("%3Cdiv%20class%3D%22person%22%3E%0A%09%09%09%09%3Cul%3E%0A%09%09%09%09%09%3Cli%20class%3D%22firstname%22%3EJames%3C/li%3E%0A%09%09%09%09%09%3Cli%20class%3D%22lastname%22%3EBond%3C/li%3E%0A%09%09%09%09%3C/ul%3E%0A%09%09%09%3C/div%3E");
+return self;},
+source: unescape('setUp%0A%09document%20%3A%3D%20%27%3Cdiv%20class%3D%22person%22%3E%0A%09%09%09%09%3Cul%3E%0A%09%09%09%09%09%3Cli%20class%3D%22firstname%22%3EJames%3C/li%3E%0A%09%09%09%09%09%3Cli%20class%3D%22lastname%22%3EBond%3C/li%3E%0A%09%09%09%09%3C/ul%3E%0A%09%09%09%3C/div%3E%27.'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.JQueryTest);
+
+smalltalk.addMethod(
+'_testEach',
+smalltalk.method({
+selector: 'testEach',
+category: 'tests',
+fn: function (){
+var self=this;
+var classes=nil;
+classes=smalltalk.send(smalltalk.Array, "_new", []);
+smalltalk.send(smalltalk.send(smalltalk.send(self['@document'], "_asJQuery", []), "_find_", ["li"]), "_each_", [(function(index, element){return smalltalk.send(classes, "_add_", [smalltalk.send(smalltalk.send(smalltalk.JQuery, "_fromElement_", [element]), "_attr_", ["class"])]);})]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(["firstname", "lastname"], "_printString", []), smalltalk.send(classes, "_printString", [])]);
+return self;},
+source: unescape('testEach%0A%09%7Cclasses%7C%0A%09classes%20%3A%3D%20Array%20new.%0A%0A%09%28document%20asJQuery%20find%3A%20%27li%27%29%20each%3A%20%5B%3Aindex%20%3Aelement%7C%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%20%20%09classes%20add%3A%20%28%28JQuery%20fromElement%3Aelement%29%20attr%3A%20%27class%27%29%5D.%0A%09self%20%0A%09%09assert%3A%20%23%28%27firstname%27%20%27lastname%27%29%20printString%0A%09%09equals%3A%20classes%20printString'),
+messageSends: ["new", "each:", "find:", "asJQuery", "add:", "attr:", "fromElement:", "assert:equals:", "printString"],
+referencedClasses: [smalltalk.Array,smalltalk.JQuery]
+}),
+smalltalk.JQueryTest);
+
+
+

+ 105 - 0
js/JQuery.deploy.js

@@ -615,6 +615,66 @@ referencedClasses: []
 }),
 smalltalk.JQuery);
 
+smalltalk.addMethod(
+'_do_',
+smalltalk.method({
+selector: 'do:',
+category: 'enumerating',
+fn: function (aBlock){
+var self=this;
+smalltalk.send(self, "_elementsDo_", [(function(anElement){return smalltalk.send(aBlock, "_value_", [smalltalk.send(smalltalk.JQuery, "_fromElement_", [anElement])]);})]);
+return self;},
+source: unescape('do%3A%20aBlock%0A%20%20%20%20self%20elementsDo%3A%20%5B%3AanElement%7C%20%20aBlock%20value%3A%20%28JQuery%20fromElement%3A%20anElement%29%5D'),
+messageSends: ["elementsDo:", "value:", "fromElement:"],
+referencedClasses: [smalltalk.JQuery]
+}),
+smalltalk.JQuery);
+
+smalltalk.addMethod(
+'_elementsDo_',
+smalltalk.method({
+selector: 'elementsDo:',
+category: 'private',
+fn: function (aBlock){
+var self=this;
+self['@jquery'].each(function(index, element){aBlock(element, self)});
+return self;},
+source: unescape('elementsDo%3A%20aBlock%0A%20%20%20%20%22Iterate%20over%20a%20jQuery%20object%2C%20executing%20a%20function%20for%20each%20matched%20element.%22%0A%20%20%20%20%3Cself%5B%27@jquery%27%5D.each%28function%28index%2C%20element%29%7BaBlock%28element%2C%20self%29%7D%29%3E'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.JQuery);
+
+smalltalk.addMethod(
+'_attrAt_put_',
+smalltalk.method({
+selector: 'attrAt:put:',
+category: 'attributes',
+fn: function (aString, anotherString){
+var self=this;
+self['@jquery'].attr(aString, anotherString);
+return self;},
+source: unescape('attrAt%3A%20aString%20put%3A%20anotherString%0A%20%20%20%20%22Set%20the%20value%20of%20an%20attribute%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%3Cself%5B%27@jquery%27%5D.attr%28aString%2C%20anotherString%29%3E'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.JQuery);
+
+smalltalk.addMethod(
+'_find_',
+smalltalk.method({
+selector: 'find:',
+category: 'traversing',
+fn: function (aSelector){
+var self=this;
+return smalltalk.send(self, "_call_withArgument_", ["find", aSelector]);
+return self;},
+source: unescape('find%3A%20aSelector%0A%20%20%20%20%22Get%20the%20descendants%20of%20each%20element%20in%20the%20current%20set%20of%20matched%20elements%2C%20filtered%20by%20a%20selector%2C%20jQuery%20object%2C%20or%20element.%22%0A%20%20%20%20%5E%20self%20call%3A%20%27find%27%20withArgument%3A%20aSelector'),
+messageSends: ["call:withArgument:"],
+referencedClasses: []
+}),
+smalltalk.JQuery);
+
 
 smalltalk.addMethod(
 '_fromString_',
@@ -819,6 +879,51 @@ referencedClasses: [smalltalk.Dictionary]
 }),
 smalltalk.Ajax);
 
+smalltalk.addMethod(
+'_onSuccessDo_',
+smalltalk.method({
+selector: 'onSuccessDo:',
+category: 'callbacks',
+fn: function (aBlock){
+var self=this;
+smalltalk.send(self, "_at_put_", ["success", aBlock]);
+return self;},
+source: unescape('onSuccessDo%3A%20aBlock%0A%09%22Set%20action%20to%20execute%20when%20Ajax%20request%20is%20successful.%20Pass%20received%20data%20as%20block%20argument.%20Block%20arguments%3A%20data%2C%20textStatus%2C%20jqXHR%22%0A%09self%20at%3A%20%27success%27%20put%3A%20aBlock'),
+messageSends: ["at:put:"],
+referencedClasses: []
+}),
+smalltalk.Ajax);
+
+smalltalk.addMethod(
+'_onCompleteDo_',
+smalltalk.method({
+selector: 'onCompleteDo:',
+category: 'callbacks',
+fn: function (aBlock){
+var self=this;
+smalltalk.send(self, "_at_put_", ["complete", aBlock]);
+return self;},
+source: unescape('onCompleteDo%3A%20aBlock%0A%09%22A%20block%20to%20be%20called%20when%20the%20request%20finishes%20%28after%20success%20and%20error%20callbacks%20are%20executed%29.%20Block%20arguments%3A%20jqXHR%2C%20textStatus%22%0A%09self%20at%3A%20%27complete%27%20put%3A%20aBlock'),
+messageSends: ["at:put:"],
+referencedClasses: []
+}),
+smalltalk.Ajax);
+
+smalltalk.addMethod(
+'_onErrorDo_',
+smalltalk.method({
+selector: 'onErrorDo:',
+category: 'callbacks',
+fn: function (aBlock){
+var self=this;
+smalltalk.send(self, "_at_put_", ["error", aBlock]);
+return self;},
+source: unescape('onErrorDo%3A%20aBlock%0A%09%22A%20block%20to%20be%20called%20if%20the%20request%20fails.Block%20arguments%3A%20jqXHR%2C%20textStatus%2C%20errorThrown%22%0A%09self%20at%3A%20%27error%27%20put%3A%20aBlock'),
+messageSends: ["at:put:"],
+referencedClasses: []
+}),
+smalltalk.Ajax);
+
 
 smalltalk.addMethod(
 '_url_',

+ 105 - 0
js/JQuery.js

@@ -615,6 +615,66 @@ referencedClasses: []
 }),
 smalltalk.JQuery);
 
+smalltalk.addMethod(
+'_do_',
+smalltalk.method({
+selector: 'do:',
+category: 'enumerating',
+fn: function (aBlock){
+var self=this;
+smalltalk.send(self, "_elementsDo_", [(function(anElement){return smalltalk.send(aBlock, "_value_", [smalltalk.send(smalltalk.JQuery, "_fromElement_", [anElement])]);})]);
+return self;},
+source: unescape('do%3A%20aBlock%0A%20%20%20%20self%20elementsDo%3A%20%5B%3AanElement%7C%20%20aBlock%20value%3A%20%28JQuery%20fromElement%3A%20anElement%29%5D'),
+messageSends: ["elementsDo:", "value:", "fromElement:"],
+referencedClasses: [smalltalk.JQuery]
+}),
+smalltalk.JQuery);
+
+smalltalk.addMethod(
+'_elementsDo_',
+smalltalk.method({
+selector: 'elementsDo:',
+category: 'private',
+fn: function (aBlock){
+var self=this;
+self['@jquery'].each(function(index, element){aBlock(element, self)});
+return self;},
+source: unescape('elementsDo%3A%20aBlock%0A%20%20%20%20%22Iterate%20over%20a%20jQuery%20object%2C%20executing%20a%20function%20for%20each%20matched%20element.%22%0A%20%20%20%20%3Cself%5B%27@jquery%27%5D.each%28function%28index%2C%20element%29%7BaBlock%28element%2C%20self%29%7D%29%3E'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.JQuery);
+
+smalltalk.addMethod(
+'_attrAt_put_',
+smalltalk.method({
+selector: 'attrAt:put:',
+category: 'attributes',
+fn: function (aString, anotherString){
+var self=this;
+self['@jquery'].attr(aString, anotherString);
+return self;},
+source: unescape('attrAt%3A%20aString%20put%3A%20anotherString%0A%20%20%20%20%22Set%20the%20value%20of%20an%20attribute%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%3Cself%5B%27@jquery%27%5D.attr%28aString%2C%20anotherString%29%3E'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.JQuery);
+
+smalltalk.addMethod(
+'_find_',
+smalltalk.method({
+selector: 'find:',
+category: 'traversing',
+fn: function (aSelector){
+var self=this;
+return smalltalk.send(self, "_call_withArgument_", ["find", aSelector]);
+return self;},
+source: unescape('find%3A%20aSelector%0A%20%20%20%20%22Get%20the%20descendants%20of%20each%20element%20in%20the%20current%20set%20of%20matched%20elements%2C%20filtered%20by%20a%20selector%2C%20jQuery%20object%2C%20or%20element.%22%0A%20%20%20%20%5E%20self%20call%3A%20%27find%27%20withArgument%3A%20aSelector'),
+messageSends: ["call:withArgument:"],
+referencedClasses: []
+}),
+smalltalk.JQuery);
+
 
 smalltalk.addMethod(
 '_fromString_',
@@ -819,6 +879,51 @@ referencedClasses: [smalltalk.Dictionary]
 }),
 smalltalk.Ajax);
 
+smalltalk.addMethod(
+'_onSuccessDo_',
+smalltalk.method({
+selector: 'onSuccessDo:',
+category: 'callbacks',
+fn: function (aBlock){
+var self=this;
+smalltalk.send(self, "_at_put_", ["success", aBlock]);
+return self;},
+source: unescape('onSuccessDo%3A%20aBlock%0A%09%22Set%20action%20to%20execute%20when%20Ajax%20request%20is%20successful.%20Pass%20received%20data%20as%20block%20argument.%20Block%20arguments%3A%20data%2C%20textStatus%2C%20jqXHR%22%0A%09self%20at%3A%20%27success%27%20put%3A%20aBlock'),
+messageSends: ["at:put:"],
+referencedClasses: []
+}),
+smalltalk.Ajax);
+
+smalltalk.addMethod(
+'_onCompleteDo_',
+smalltalk.method({
+selector: 'onCompleteDo:',
+category: 'callbacks',
+fn: function (aBlock){
+var self=this;
+smalltalk.send(self, "_at_put_", ["complete", aBlock]);
+return self;},
+source: unescape('onCompleteDo%3A%20aBlock%0A%09%22A%20block%20to%20be%20called%20when%20the%20request%20finishes%20%28after%20success%20and%20error%20callbacks%20are%20executed%29.%20Block%20arguments%3A%20jqXHR%2C%20textStatus%22%0A%09self%20at%3A%20%27complete%27%20put%3A%20aBlock'),
+messageSends: ["at:put:"],
+referencedClasses: []
+}),
+smalltalk.Ajax);
+
+smalltalk.addMethod(
+'_onErrorDo_',
+smalltalk.method({
+selector: 'onErrorDo:',
+category: 'callbacks',
+fn: function (aBlock){
+var self=this;
+smalltalk.send(self, "_at_put_", ["error", aBlock]);
+return self;},
+source: unescape('onErrorDo%3A%20aBlock%0A%09%22A%20block%20to%20be%20called%20if%20the%20request%20fails.Block%20arguments%3A%20jqXHR%2C%20textStatus%2C%20errorThrown%22%0A%09self%20at%3A%20%27error%27%20put%3A%20aBlock'),
+messageSends: ["at:put:"],
+referencedClasses: []
+}),
+smalltalk.Ajax);
+
 
 smalltalk.addMethod(
 '_url_',

+ 67 - 0
js/Kernel-Tests.deploy.js

@@ -0,0 +1,67 @@
+smalltalk.addClass('StringTest', smalltalk.TestCase, [], 'Kernel-Tests');
+smalltalk.addMethod(
+'_testJoin',
+smalltalk.method({
+selector: 'testJoin',
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", [unescape("hello%2Cworld"), smalltalk.send(unescape("%2C"), "_join_", [["hello", "world"]])]);
+return self;},
+source: unescape('testJoin%0A%09self%20assert%3A%20%27hello%2Cworld%27%20equals%3A%20%28%27%2C%27%20join%3A%20%23%28%27hello%27%20%27world%27%29%29'),
+messageSends: ["assert:equals:", "join:"],
+referencedClasses: []
+}),
+smalltalk.StringTest);
+
+smalltalk.addMethod(
+'_testStreamContents',
+smalltalk.method({
+selector: 'testStreamContents',
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", ["hello world", smalltalk.send(smalltalk.String, "_streamContents_", [(function(aStream){return (function($rec){smalltalk.send($rec, "_nextPutAll_", ["hello"]);smalltalk.send($rec, "_space", []);return smalltalk.send($rec, "_nextPutAll_", ["world"]);})(aStream);})])]);
+return self;},
+source: unescape('testStreamContents%0A%09self%20%0A%09%09assert%3A%20%27hello%20world%27%20%0A%09%09equals%3A%20%28String%20streamContents%3A%20%5B%3AaStream%7C%20aStream%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09%09%09nextPutAll%3A%20%27hello%27%3B%20space%3B%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09%09%09nextPutAll%3A%20%27world%27%5D%29%20'),
+messageSends: ["assert:equals:", "streamContents:", "nextPutAll:", "space"],
+referencedClasses: [smalltalk.String]
+}),
+smalltalk.StringTest);
+
+smalltalk.addMethod(
+'_testIncludesSubString',
+smalltalk.method({
+selector: 'testIncludesSubString',
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send("jtalk", "_includesSubString_", ["alk"])]);
+smalltalk.send(self, "_deny_", [smalltalk.send("jtalk", "_includesSubString_", ["zork"])]);
+return self;},
+source: unescape('testIncludesSubString%0A%09self%20assert%3A%20%28%27jtalk%27%20includesSubString%3A%20%27alk%27%29.%0A%09self%20deny%3A%20%28%27jtalk%27%20includesSubString%3A%20%27zork%27%29.'),
+messageSends: ["assert:", "includesSubString:", "deny:"],
+referencedClasses: []
+}),
+smalltalk.StringTest);
+
+
+
+smalltalk.addClass('DictionaryTest', smalltalk.TestCase, [], 'Kernel-Tests');
+smalltalk.addMethod(
+'_testPrintString',
+smalltalk.method({
+selector: 'testPrintString',
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", [unescape("a%20Dictionary%28%27firstname%27%20-%3E%20%27James%27%20%2C%20%27lastname%27%20-%3E%20%27Bond%27%29"), (function($rec){smalltalk.send($rec, "_at_put_", ["firstname", "James"]);smalltalk.send($rec, "_at_put_", ["lastname", "Bond"]);return smalltalk.send($rec, "_printString", []);})(smalltalk.send(smalltalk.Dictionary, "_new", []))]);
+return self;},
+source: unescape('testPrintString%0A%09self%20%0A%09%09assert%3A%20%27a%20Dictionary%28%27%27firstname%27%27%20-%3E%20%27%27James%27%27%20%2C%20%27%27lastname%27%27%20-%3E%20%27%27Bond%27%27%29%27%20%0A%09%09equals%3A%20%28Dictionary%20new%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09at%3A%27firstname%27%20put%3A%20%27James%27%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09at%3A%27lastname%27%20put%3A%20%27Bond%27%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09printString%29'),
+messageSends: ["assert:equals:", "at:put:", "printString", "new"],
+referencedClasses: [smalltalk.Dictionary]
+}),
+smalltalk.DictionaryTest);
+
+
+

+ 67 - 0
js/Kernel-Tests.js

@@ -0,0 +1,67 @@
+smalltalk.addClass('StringTest', smalltalk.TestCase, [], 'Kernel-Tests');
+smalltalk.addMethod(
+'_testJoin',
+smalltalk.method({
+selector: 'testJoin',
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", [unescape("hello%2Cworld"), smalltalk.send(unescape("%2C"), "_join_", [["hello", "world"]])]);
+return self;},
+source: unescape('testJoin%0A%09self%20assert%3A%20%27hello%2Cworld%27%20equals%3A%20%28%27%2C%27%20join%3A%20%23%28%27hello%27%20%27world%27%29%29'),
+messageSends: ["assert:equals:", "join:"],
+referencedClasses: []
+}),
+smalltalk.StringTest);
+
+smalltalk.addMethod(
+'_testStreamContents',
+smalltalk.method({
+selector: 'testStreamContents',
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", ["hello world", smalltalk.send(smalltalk.String, "_streamContents_", [(function(aStream){return (function($rec){smalltalk.send($rec, "_nextPutAll_", ["hello"]);smalltalk.send($rec, "_space", []);return smalltalk.send($rec, "_nextPutAll_", ["world"]);})(aStream);})])]);
+return self;},
+source: unescape('testStreamContents%0A%09self%20%0A%09%09assert%3A%20%27hello%20world%27%20%0A%09%09equals%3A%20%28String%20streamContents%3A%20%5B%3AaStream%7C%20aStream%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09%09%09nextPutAll%3A%20%27hello%27%3B%20space%3B%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09%09%09nextPutAll%3A%20%27world%27%5D%29%20'),
+messageSends: ["assert:equals:", "streamContents:", "nextPutAll:", "space"],
+referencedClasses: [smalltalk.String]
+}),
+smalltalk.StringTest);
+
+smalltalk.addMethod(
+'_testIncludesSubString',
+smalltalk.method({
+selector: 'testIncludesSubString',
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send("jtalk", "_includesSubString_", ["alk"])]);
+smalltalk.send(self, "_deny_", [smalltalk.send("jtalk", "_includesSubString_", ["zork"])]);
+return self;},
+source: unescape('testIncludesSubString%0A%09self%20assert%3A%20%28%27jtalk%27%20includesSubString%3A%20%27alk%27%29.%0A%09self%20deny%3A%20%28%27jtalk%27%20includesSubString%3A%20%27zork%27%29.'),
+messageSends: ["assert:", "includesSubString:", "deny:"],
+referencedClasses: []
+}),
+smalltalk.StringTest);
+
+
+
+smalltalk.addClass('DictionaryTest', smalltalk.TestCase, [], 'Kernel-Tests');
+smalltalk.addMethod(
+'_testPrintString',
+smalltalk.method({
+selector: 'testPrintString',
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", [unescape("a%20Dictionary%28%27firstname%27%20-%3E%20%27James%27%20%2C%20%27lastname%27%20-%3E%20%27Bond%27%29"), (function($rec){smalltalk.send($rec, "_at_put_", ["firstname", "James"]);smalltalk.send($rec, "_at_put_", ["lastname", "Bond"]);return smalltalk.send($rec, "_printString", []);})(smalltalk.send(smalltalk.Dictionary, "_new", []))]);
+return self;},
+source: unescape('testPrintString%0A%09self%20%0A%09%09assert%3A%20%27a%20Dictionary%28%27%27firstname%27%27%20-%3E%20%27%27James%27%27%20%2C%20%27%27lastname%27%27%20-%3E%20%27%27Bond%27%27%29%27%20%0A%09%09equals%3A%20%28Dictionary%20new%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09at%3A%27firstname%27%20put%3A%20%27James%27%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09at%3A%27lastname%27%20put%3A%20%27Bond%27%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09printString%29'),
+messageSends: ["assert:equals:", "at:put:", "printString", "new"],
+referencedClasses: [smalltalk.Dictionary]
+}),
+smalltalk.DictionaryTest);
+
+
+

File diff suppressed because it is too large
+ 117 - 0
js/Kernel.deploy.js


File diff suppressed because it is too large
+ 117 - 0
js/Kernel.js


+ 15 - 0
js/SUnit.deploy.js

@@ -166,6 +166,21 @@ referencedClasses: []
 }),
 smalltalk.TestCase);
 
+smalltalk.addMethod(
+'_assert_equals_',
+smalltalk.method({
+selector: 'assert:equals:',
+category: 'testing',
+fn: function (expected, actual){
+var self=this;
+return smalltalk.send(self, "_assert_", [smalltalk.send(expected, "__eq", [actual])]);
+return self;},
+source: unescape('assert%3A%20expected%20equals%3A%20actual%0A%09%5E%20self%20assert%3A%20%28expected%20%3D%20actual%29'),
+messageSends: ["assert:", unescape("%3D")],
+referencedClasses: []
+}),
+smalltalk.TestCase);
+
 
 
 smalltalk.addClass('ExampleTest', smalltalk.TestCase, ['test'], 'SUnit');

+ 15 - 0
js/SUnit.js

@@ -166,6 +166,21 @@ referencedClasses: []
 }),
 smalltalk.TestCase);
 
+smalltalk.addMethod(
+'_assert_equals_',
+smalltalk.method({
+selector: 'assert:equals:',
+category: 'testing',
+fn: function (expected, actual){
+var self=this;
+return smalltalk.send(self, "_assert_", [smalltalk.send(expected, "__eq", [actual])]);
+return self;},
+source: unescape('assert%3A%20expected%20equals%3A%20actual%0A%09%5E%20self%20assert%3A%20%28expected%20%3D%20actual%29'),
+messageSends: ["assert:", unescape("%3D")],
+referencedClasses: []
+}),
+smalltalk.TestCase);
+
 
 
 smalltalk.addClass('ExampleTest', smalltalk.TestCase, ['test'], 'SUnit');

+ 3 - 1
js/jtalk.js

@@ -20,7 +20,7 @@
     }
 
     function loadDependencies() {
-	loadJS('lib/jQuery/jquery-1.4.4.min.js');
+	loadJS('lib/jQuery/jquery-1.6.2.min.js');
 	loadJS('lib/jQuery/jquery-ui-1.8.9.custom.min.js');
     }
 
@@ -47,6 +47,8 @@
 	loadJS("SUnit.js");
 	loadJS("Examples.js");
 	loadJS("Benchfib.js");
+	loadJS("Kernel-Tests.js");
+	loadJS("JQuery-Tests.js");
 
 	if(files) {
 	    for(var i=0; i < files.length; i++) {

File diff suppressed because it is too large
+ 15 - 0
js/lib/jQuery/jquery-1.6.2.min.js


+ 20 - 0
st/Canvas.st

@@ -221,6 +221,14 @@ code
 
 br
     ^self tag: 'br'
+!
+
+script
+    ^self tag: 'script'
+!
+
+link
+    ^self tag: 'link'
 ! !
 
 !HTMLCanvas class methodsFor: 'instance creation'!
@@ -314,6 +322,18 @@ title: aString
 
 style: aString
     self at: 'style' put: aString
+!
+
+type: aString
+    self at: 'type' put: aString
+!
+
+media: aString
+    self at: 'media' put: aString
+!
+
+rel: aString
+    self  at: 'rel' put: aString
 ! !
 
 !TagBrush methodsFor: 'converting'!

+ 8 - 6
st/IDE.st

@@ -517,12 +517,14 @@ showMethodButtons
 
 compile
     self disableSaveButton.
-    selectedTab = #comment ifTrue: [
-	selectedClass ifNotNil: [
-	    self compileClassComment]].
-    (selectedProtocol notNil or: [selectedMethod notNil])
-	ifFalse: [self compileDefinition]
-	ifTrue: [self compileMethodDefinition]
+    selectedTab = #comment
+	ifTrue: [
+		selectedClass ifNotNil: [
+	    		self compileClassComment]]
+	ifFalse: [ 
+  		  (selectedProtocol notNil or: [selectedMethod notNil])
+			ifFalse: [self compileDefinition]
+			ifTrue: [self compileMethodDefinition]].
 !
 
 compileClassComment

+ 34 - 0
st/JQuery-Tests.st

@@ -0,0 +1,34 @@
+TestCase subclass: #JQueryTest
+	instanceVariableNames: 'document'
+	category: 'JQuery-Tests'!
+
+!JQueryTest methodsFor: 'running'!
+
+setUp
+	document := '<div class="person">
+				<ul>
+					<li class="firstname">James</li>
+					<li class="lastname">Bond</li>
+				</ul>
+			</div>'.
+! !
+
+!JQueryTest methodsFor: 'tests'!
+
+testFind
+	self 
+		assert: 'James' 
+		equals: (document asJQuery find: 'li.firstname') html.
+!
+
+testEach
+	|classes|
+	classes := Array new.
+
+	(document asJQuery find: 'li') each: [:index :element|   
+                                              		  	classes add: ((JQuery fromElement:element) attr: 'class')].
+	self 
+		assert: #('firstname' 'lastname') printString
+		equals: classes printString
+! !
+

+ 40 - 0
st/JQuery.st

@@ -53,6 +53,11 @@ val
 
 val: aString
     self call: 'val' withArgument: aString
+!
+
+attrAt: aString put: anotherString
+    "Set the value of an attribute for the first element in the set of matched elements."
+    <self['@jquery'].attr(aString, anotherString)>
 ! !
 
 !JQuery methodsFor: 'css'!
@@ -156,6 +161,12 @@ scrollTop: anInteger
     self call: 'scrollTop' withArgument: anInteger
 ! !
 
+!JQuery methodsFor: 'enumerating'!
+
+do: aBlock
+    self elementsDo: [:anElement|  aBlock value: (JQuery fromElement: anElement)]
+! !
+
 !JQuery methodsFor: 'events'!
 
 focus
@@ -198,6 +209,11 @@ call: aString
 
 call: aString withArgument: anObject
     <return self['@jquery'][aString](anObject)>
+!
+
+elementsDo: aBlock
+    "Iterate over a jQuery object, executing a function for each matched element."
+    <self['@jquery'].each(function(index, element){aBlock(element, self)})>
 ! !
 
 !JQuery methodsFor: 'testing'!
@@ -207,6 +223,13 @@ hasClass: aString
     ^self call: 'hasClass' withArgument: aString
 ! !
 
+!JQuery methodsFor: 'traversing'!
+
+find: aSelector
+    "Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element."
+    ^ self call: 'find' withArgument: aSelector
+! !
+
 !JQuery class methodsFor: 'instance creation'!
 
 fromString: aString
@@ -276,6 +299,23 @@ send
     <jQuery.ajax(self['@settings'])>
 ! !
 
+!Ajax methodsFor: 'callbacks'!
+
+onSuccessDo: aBlock
+	"Set action to execute when Ajax request is successful. Pass received data as block argument. Block arguments: data, textStatus, jqXHR"
+	self at: 'success' put: aBlock
+!
+
+onCompleteDo: aBlock
+	"A block to be called when the request finishes (after success and error callbacks are executed). Block arguments: jqXHR, textStatus"
+	self at: 'complete' put: aBlock
+!
+
+onErrorDo: aBlock
+	"A block to be called if the request fails.Block arguments: jqXHR, textStatus, errorThrown"
+	self at: 'error' put: aBlock
+! !
+
 !Ajax methodsFor: 'initialization'!
 
 initialize

+ 38 - 0
st/Kernel-Tests.st

@@ -0,0 +1,38 @@
+TestCase subclass: #StringTest
+	instanceVariableNames: ''
+	category: 'Kernel-Tests'!
+
+!StringTest methodsFor: 'tests'!
+
+testJoin
+	self assert: 'hello,world' equals: (',' join: #('hello' 'world'))
+!
+
+testStreamContents
+	self 
+		assert: 'hello world' 
+		equals: (String streamContents: [:aStream| aStream 
+                                                 					nextPutAll: 'hello'; space; 
+                                                 					nextPutAll: 'world'])
+!
+
+testIncludesSubString
+	self assert: ('jtalk' includesSubString: 'alk').
+	self deny: ('jtalk' includesSubString: 'zork').
+! !
+
+TestCase subclass: #DictionaryTest
+	instanceVariableNames: ''
+	category: 'Kernel-Tests'!
+
+!DictionaryTest methodsFor: 'tests'!
+
+testPrintString
+	self 
+		assert: 'a Dictionary(''firstname'' -> ''James'' , ''lastname'' -> ''Bond'')' 
+		equals: (Dictionary new 
+                         	at:'firstname' put: 'James';
+                        	at:'lastname' put: 'Bond';
+                        	printString)
+! !
+

+ 68 - 0
st/Kernel.st

@@ -541,6 +541,10 @@ max: aNumber
 
 min: aNumber
 	<return Math.min(self, aNumber);>
+!
+
+modulo: aNumber
+	<return self % aNumber>
 ! !
 
 !Number methodsFor: 'comparing'!
@@ -638,6 +642,14 @@ printString
 
 isNumber
 	^true
+!
+
+even
+	^ 0 = (self modulo: 2)
+!
+
+odd
+	^ self even not
 ! !
 
 !Number methodsFor: 'timeouts/intervals'!
@@ -707,6 +719,19 @@ valueWithPossibleArguments: aCollection
 	<return self.apply(null, aCollection);>
 ! !
 
+!BlockClosure methodsFor: 'printing'!
+
+printString
+	^ String streamContents: [:aStream| 
+                                  aStream 
+                                  	nextPutAll: super printString;
+                                  	nextPutAll: '(';
+                                  	nextPutAll: self compiledSource;
+                                  	nextPutAll: ')';
+                                  	cr.
+           ]
+! !
+
 !BlockClosure methodsFor: 'timeout/interval'!
 
 valueWithTimeout: aNumber
@@ -1509,10 +1534,23 @@ trimBoth: separators
     	^(self trimLeft: separators) trimRight: separators
 ! !
 
+!String methodsFor: 'split join'!
+
+join: aCollection 
+	^ String
+		streamContents: [:stream | aCollection
+				do: [:each | stream nextPutAll: each asString] 
+				separatedBy: [stream nextPutAll: self]]
+! !
+
 !String methodsFor: 'testing'!
 
 isString
     	^true
+!
+
+includesSubString: subString
+	< return self.indexOf(subString) !!= -1 >
 ! !
 
 !String class methodsFor: 'accessing'!
@@ -1545,6 +1583,13 @@ crlf
 
 fromString: aString
 	    <return new self.fn(aString)>
+!
+
+streamContents: blockWithArg
+	|stream|
+	stream := (self streamClass on: String new).
+	blockWithArg value: stream.
+	^ stream contents
 ! !
 
 SequenceableCollection subclass: #Array
@@ -1952,6 +1997,25 @@ initialize
     	keys := #()
 ! !
 
+!Dictionary methodsFor: 'printing'!
+
+printString
+	^ String streamContents: [:aStream|  
+                                  		aStream 
+                                  			nextPutAll: super printString;
+                                  			nextPutAll: '('.
+                                  		self associations 
+                                  			do: [:anAssociation|  
+                                                                      	aStream 
+                                                                      		nextPutAll: anAssociation key printString;
+                                                                      		nextPutAll: ' -> ';
+                                                                      		nextPutAll: anAssociation value printString]
+                                  
+                                 			separatedBy: [aStream nextPutAll: ' , '].
+                                  		aStream nextPutAll: ')'.
+                                 ]
+! !
+
 Object subclass: #ClassBuilder
 	instanceVariableNames: ''
 	category: 'Kernel'!
@@ -2197,6 +2261,10 @@ crlf
 
 lf
 	^self nextPutAll: String lf
+!
+
+space
+	self nextPut: ' '
 ! !
 
 Object subclass: #ClassCommentReader

+ 4 - 0
st/SUnit.st

@@ -66,6 +66,10 @@ assert: aBoolean
 
 deny: aBoolean
 	self assert: aBoolean not
+!
+
+assert: expected equals: actual
+	^ self assert: (expected = actual)
 ! !
 
 TestCase subclass: #ExampleTest

Some files were not shown because too many files changed in this diff