Browse Source

Merge remote branch 'upstream/master'

Göran Krampe 12 years ago
parent
commit
ece83be2a2

+ 3 - 0
.gitignore

@@ -4,3 +4,6 @@ examples/webos/**/*.js
 
 # Ignoring compiled files in st
 st/*.js
+
+# In case amber is also saved in a local Subversion
+.svn

+ 18 - 17
examples/presentation/js/Presentation.deploy.js

@@ -226,6 +226,17 @@ return self;}
 }),
 smalltalk.Presentation);
 
+smalltalk.addMethod(
+'_style',
+smalltalk.method({
+selector: 'style',
+fn: function (){
+var self=this;
+return "";
+return self;}
+}),
+smalltalk.Presentation);
+
 smalltalk.addMethod(
 '_reload',
 smalltalk.method({
@@ -234,7 +245,8 @@ fn: function (){
 var self=this;
 smalltalk.send(smalltalk.send(unescape("%23slides"), "_asJQuery", []), "_remove", []);
 smalltalk.send(smalltalk.send(unescape("%23tools"), "_asJQuery", []), "_remove", []);
-smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_append_", [self]);
+smalltalk.send(self, "_initSlides", []);
+smalltalk.send(self, "_appendToJQuery_", [smalltalk.send("body", "_asJQuery", [])]);
 smalltalk.send(self, "_checkHash", []);
 return self;}
 }),
@@ -259,7 +271,7 @@ selector: 'nextSlide',
 fn: function (){
 var self=this;
 var next=nil;
-(($receiver = smalltalk.send(self, "_currentSlide", [])) != nil && $receiver != undefined) ? (function(){next=smalltalk.send(smalltalk.send(self, "_slides", []), "_at_ifAbsent_", [(($receiver = smalltalk.send(smalltalk.send(self, "_slides", []), "_indexOf_", [smalltalk.send(self, "_currentSlide", [])])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]), (function(){return nil;})]);return (($receiver = next) != nil && $receiver != undefined) ? (function(){self['@currentSlide']=next;return smalltalk.send(next, "_show", []);})() : nil;})() : nil;
+(($receiver = smalltalk.send(self, "_currentSlide", [])) != nil && $receiver != undefined) ? (function(){next=smalltalk.send(smalltalk.send(self, "_slides", []), "_at_ifAbsent_", [((($receiver = smalltalk.send(smalltalk.send(self, "_slides", []), "_indexOf_", [smalltalk.send(self, "_currentSlide", [])])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])), (function(){return nil;})]);return (($receiver = next) != nil && $receiver != undefined) ? (function(){self['@currentSlide']=next;return smalltalk.send(next, "_show", []);})() : nil;})() : nil;
 return self;}
 }),
 smalltalk.Presentation);
@@ -270,7 +282,7 @@ smalltalk.method({
 selector: 'showCurrentSlide',
 fn: function (){
 var self=this;
-(($receiver = smalltalk.send(self, "_currentSlide", [])) != nil && $receiver != undefined) ? (function(){smalltalk.send(smalltalk.send(".slide", "_asJQuery", []), "_hide", []);return smalltalk.send(smalltalk.send(smalltalk.send(unescape("%23"), "__comma", [smalltalk.send(smalltalk.send(self, "_currentSlide", []), "_id", [])]), "_asJQuery", []), "_show", []);})() : nil;
+(($receiver = smalltalk.send(self, "_currentSlide", [])) != nil && $receiver != undefined) ? (function(){smalltalk.send(smalltalk.send(".slide", "_asJQuery", []), "_hide", []);smalltalk.send(smalltalk.send(smalltalk.send(unescape("%23"), "__comma", [smalltalk.send(smalltalk.send(self, "_currentSlide", []), "_id", [])]), "_asJQuery", []), "_show", []);return smalltalk.send(smalltalk.send("title", "_asJQuery", []), "_text_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_title", []), "__comma", [unescape("%20-%20")]), "__comma", [smalltalk.send(smalltalk.send(self, "_currentSlide", []), "_id", [])])]);})() : nil;
 return self;}
 }),
 smalltalk.Presentation);
@@ -282,7 +294,7 @@ selector: 'previousSlide',
 fn: function (){
 var self=this;
 var next=nil;
-(($receiver = smalltalk.send(self, "_currentSlide", [])) != nil && $receiver != undefined) ? (function(){next=smalltalk.send(smalltalk.send(self, "_slides", []), "_at_ifAbsent_", [(($receiver = smalltalk.send(smalltalk.send(self, "_slides", []), "_indexOf_", [smalltalk.send(self, "_currentSlide", [])])).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]), (function(){return nil;})]);return (($receiver = next) != nil && $receiver != undefined) ? (function(){self['@currentSlide']=next;return smalltalk.send(next, "_show", []);})() : nil;})() : nil;
+(($receiver = smalltalk.send(self, "_currentSlide", [])) != nil && $receiver != undefined) ? (function(){next=smalltalk.send(smalltalk.send(self, "_slides", []), "_at_ifAbsent_", [((($receiver = smalltalk.send(smalltalk.send(self, "_slides", []), "_indexOf_", [smalltalk.send(self, "_currentSlide", [])])).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), (function(){return nil;})]);return (($receiver = next) != nil && $receiver != undefined) ? (function(){self['@currentSlide']=next;return smalltalk.send(next, "_show", []);})() : nil;})() : nil;
 return self;}
 }),
 smalltalk.Presentation);
@@ -320,7 +332,7 @@ var hash=nil;
 var slide=nil;
 hash=smalltalk.send(smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash", []), "_replace_with_", [unescape("%5E%23"), ""]);
 slide=smalltalk.send(smalltalk.send(self, "_slides", []), "_detect_ifNone_", [(function(each){return smalltalk.send(smalltalk.send(each, "_id", []), "__eq", [hash]);}), (function(){return nil;})]);
-(($receiver = slide) != nil && $receiver != undefined) ? (function(){return (($receiver = smalltalk.send(smalltalk.send(self, "_currentSlide", []), "__eq", [slide])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){smalltalk.send(self, "_currentSlide_", [slide]);return smalltalk.send(slide, "_show", []);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){smalltalk.send(self, "_currentSlide_", [slide]);return smalltalk.send(slide, "_show", []);})]);})() : nil;
+(($receiver = slide) != nil && $receiver != undefined) ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_currentSlide", []), "__eq", [slide])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){smalltalk.send(self, "_currentSlide_", [slide]);return smalltalk.send(slide, "_show", []);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){smalltalk.send(self, "_currentSlide_", [slide]);return smalltalk.send(slide, "_show", []);})]));})() : nil;
 return self;}
 }),
 smalltalk.Presentation);
@@ -376,17 +388,6 @@ return self;}
 }),
 smalltalk.Presentation);
 
-smalltalk.addMethod(
-'_style',
-smalltalk.method({
-selector: 'style',
-fn: function (){
-var self=this;
-return "";
-return self;}
-}),
-smalltalk.Presentation);
-
 
 smalltalk.Presentation.klass.iVarNames = ['current'];
 smalltalk.addMethod(
@@ -395,7 +396,7 @@ smalltalk.method({
 selector: 'initialize',
 fn: function (){
 var self=this;
-(($receiver = smalltalk.send(self, "_isConcrete", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_setup", []);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self, "_setup", []);})]);
+((($receiver = smalltalk.send(self, "_isConcrete", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_setup", []);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self, "_setup", []);})]));
 return self;}
 }),
 smalltalk.Presentation.klass);

+ 27 - 26
examples/presentation/js/Presentation.js

@@ -326,6 +326,22 @@ referencedClasses: []
 }),
 smalltalk.Presentation);
 
+smalltalk.addMethod(
+unescape('_style'),
+smalltalk.method({
+selector: unescape('style'),
+category: 'accessing',
+fn: function (){
+var self=this;
+return "";
+return self;},
+args: [],
+source: unescape('style%0A%09%22Should%20return%20a%20CSS%20style%22%0A%09%5E%20%27%27'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.Presentation);
+
 smalltalk.addMethod(
 unescape('_reload'),
 smalltalk.method({
@@ -335,12 +351,13 @@ fn: function (){
 var self=this;
 smalltalk.send(smalltalk.send(unescape("%23slides"), "_asJQuery", []), "_remove", []);
 smalltalk.send(smalltalk.send(unescape("%23tools"), "_asJQuery", []), "_remove", []);
-smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_append_", [self]);
+smalltalk.send(self, "_initSlides", []);
+smalltalk.send(self, "_appendToJQuery_", [smalltalk.send("body", "_asJQuery", [])]);
 smalltalk.send(self, "_checkHash", []);
 return self;},
 args: [],
-source: unescape('reload%0A%09%27%23slides%27%20asJQuery%20remove.%0A%09%27%23tools%27%20asJQuery%20remove.%0A%09%27body%27%20asJQuery%20append%3A%20self.%0A%09self%20checkHash'),
-messageSends: ["remove", "asJQuery", "append:", "checkHash"],
+source: unescape('reload%0A%09%27%23slides%27%20asJQuery%20remove.%0A%09%27%23tools%27%20asJQuery%20remove.%0A%09self%20initSlides.%0A%09self%20appendToJQuery%3A%20%27body%27%20asJQuery.%0A%09self%20checkHash'),
+messageSends: ["remove", "asJQuery", "initSlides", "appendToJQuery:", "checkHash"],
 referencedClasses: []
 }),
 smalltalk.Presentation);
@@ -370,7 +387,7 @@ category: 'actions',
 fn: function (){
 var self=this;
 var next=nil;
-(($receiver = smalltalk.send(self, "_currentSlide", [])) != nil && $receiver != undefined) ? (function(){next=smalltalk.send(smalltalk.send(self, "_slides", []), "_at_ifAbsent_", [(($receiver = smalltalk.send(smalltalk.send(self, "_slides", []), "_indexOf_", [smalltalk.send(self, "_currentSlide", [])])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]), (function(){return nil;})]);return (($receiver = next) != nil && $receiver != undefined) ? (function(){self['@currentSlide']=next;return smalltalk.send(next, "_show", []);})() : nil;})() : nil;
+(($receiver = smalltalk.send(self, "_currentSlide", [])) != nil && $receiver != undefined) ? (function(){next=smalltalk.send(smalltalk.send(self, "_slides", []), "_at_ifAbsent_", [((($receiver = smalltalk.send(smalltalk.send(self, "_slides", []), "_indexOf_", [smalltalk.send(self, "_currentSlide", [])])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])), (function(){return nil;})]);return (($receiver = next) != nil && $receiver != undefined) ? (function(){self['@currentSlide']=next;return smalltalk.send(next, "_show", []);})() : nil;})() : nil;
 return self;},
 args: [],
 source: unescape('nextSlide%0A%09%7C%20next%20%7C%0A%09self%20currentSlide%20ifNotNil%3A%20%5B%0A%09%09next%20%3A%3D%20self%20slides%20%0A%09%09%09at%3A%20%28self%20slides%20indexOf%3A%20self%20currentSlide%29%20+%201%0A%09%09%09ifAbsent%3A%20%5Bnil%5D.%0A%09%09next%20ifNotNil%3A%20%5BcurrentSlide%20%3A%3D%20next.%20next%20show%5D%5D'),
@@ -386,11 +403,11 @@ selector: unescape('showCurrentSlide'),
 category: 'actions',
 fn: function (){
 var self=this;
-(($receiver = smalltalk.send(self, "_currentSlide", [])) != nil && $receiver != undefined) ? (function(){smalltalk.send(smalltalk.send(".slide", "_asJQuery", []), "_hide", []);return smalltalk.send(smalltalk.send(smalltalk.send(unescape("%23"), "__comma", [smalltalk.send(smalltalk.send(self, "_currentSlide", []), "_id", [])]), "_asJQuery", []), "_show", []);})() : nil;
+(($receiver = smalltalk.send(self, "_currentSlide", [])) != nil && $receiver != undefined) ? (function(){smalltalk.send(smalltalk.send(".slide", "_asJQuery", []), "_hide", []);smalltalk.send(smalltalk.send(smalltalk.send(unescape("%23"), "__comma", [smalltalk.send(smalltalk.send(self, "_currentSlide", []), "_id", [])]), "_asJQuery", []), "_show", []);return smalltalk.send(smalltalk.send("title", "_asJQuery", []), "_text_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_title", []), "__comma", [unescape("%20-%20")]), "__comma", [smalltalk.send(smalltalk.send(self, "_currentSlide", []), "_id", [])])]);})() : nil;
 return self;},
 args: [],
-source: unescape('showCurrentSlide%0A%09self%20currentSlide%20ifNotNil%3A%20%5B%0A%09%09%27.slide%27%20asJQuery%20hide.%0A%09%09%28%27%23%27%2C%20self%20currentSlide%20id%29%20asJQuery%20show%5D'),
-messageSends: ["ifNotNil:", "currentSlide", "hide", "asJQuery", "show", unescape("%2C"), "id"],
+source: unescape('showCurrentSlide%0A%09self%20currentSlide%20ifNotNil%3A%20%5B%0A%09%09%27.slide%27%20asJQuery%20hide.%0A%09%09%28%27%23%27%2C%20self%20currentSlide%20id%29%20asJQuery%20show.%0A%20%20%20%20%20%20%20%20%20%20%09%27title%27%20asJQuery%20text%3A%20self%20title%2C%20%27%20-%20%27%2C%20self%20currentSlide%20id.%0A%20%20%20%20%20%20%20%20%5D'),
+messageSends: ["ifNotNil:", "currentSlide", "hide", "asJQuery", "show", unescape("%2C"), "id", "text:", "title"],
 referencedClasses: []
 }),
 smalltalk.Presentation);
@@ -403,7 +420,7 @@ category: 'actions',
 fn: function (){
 var self=this;
 var next=nil;
-(($receiver = smalltalk.send(self, "_currentSlide", [])) != nil && $receiver != undefined) ? (function(){next=smalltalk.send(smalltalk.send(self, "_slides", []), "_at_ifAbsent_", [(($receiver = smalltalk.send(smalltalk.send(self, "_slides", []), "_indexOf_", [smalltalk.send(self, "_currentSlide", [])])).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]), (function(){return nil;})]);return (($receiver = next) != nil && $receiver != undefined) ? (function(){self['@currentSlide']=next;return smalltalk.send(next, "_show", []);})() : nil;})() : nil;
+(($receiver = smalltalk.send(self, "_currentSlide", [])) != nil && $receiver != undefined) ? (function(){next=smalltalk.send(smalltalk.send(self, "_slides", []), "_at_ifAbsent_", [((($receiver = smalltalk.send(smalltalk.send(self, "_slides", []), "_indexOf_", [smalltalk.send(self, "_currentSlide", [])])).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), (function(){return nil;})]);return (($receiver = next) != nil && $receiver != undefined) ? (function(){self['@currentSlide']=next;return smalltalk.send(next, "_show", []);})() : nil;})() : nil;
 return self;},
 args: [],
 source: unescape('previousSlide%0A%09%7C%20next%20%7C%0A%09self%20currentSlide%20ifNotNil%3A%20%5B%0A%09%09next%20%3A%3D%20self%20slides%20%0A%09%09%09at%3A%20%28self%20slides%20indexOf%3A%20self%20currentSlide%29%20-%201%0A%09%09%09ifAbsent%3A%20%5Bnil%5D.%0A%09%09next%20ifNotNil%3A%20%5BcurrentSlide%20%3A%3D%20next.%20next%20show%5D%5D'),
@@ -456,7 +473,7 @@ var hash=nil;
 var slide=nil;
 hash=smalltalk.send(smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash", []), "_replace_with_", [unescape("%5E%23"), ""]);
 slide=smalltalk.send(smalltalk.send(self, "_slides", []), "_detect_ifNone_", [(function(each){return smalltalk.send(smalltalk.send(each, "_id", []), "__eq", [hash]);}), (function(){return nil;})]);
-(($receiver = slide) != nil && $receiver != undefined) ? (function(){return (($receiver = smalltalk.send(smalltalk.send(self, "_currentSlide", []), "__eq", [slide])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){smalltalk.send(self, "_currentSlide_", [slide]);return smalltalk.send(slide, "_show", []);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){smalltalk.send(self, "_currentSlide_", [slide]);return smalltalk.send(slide, "_show", []);})]);})() : nil;
+(($receiver = slide) != nil && $receiver != undefined) ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_currentSlide", []), "__eq", [slide])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){smalltalk.send(self, "_currentSlide_", [slide]);return smalltalk.send(slide, "_show", []);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){smalltalk.send(self, "_currentSlide_", [slide]);return smalltalk.send(slide, "_show", []);})]));})() : nil;
 return self;},
 args: [],
 source: unescape('checkHash%0A%09%7C%20hash%20slide%20%7C%0A%09hash%20%3A%3D%20document%20location%20hash%20%20replace%3A%20%27%5E%23%27%20with%3A%20%27%27.%0A%09slide%20%3A%3D%20self%20slides%20detect%3A%20%20%5B%3Aeach%20%7C%20each%20id%20%3D%20hash%5D%20ifNone%3A%20%5Bnil%5D.%0A%09slide%20ifNotNil%3A%20%5B%0A%09%09self%20currentSlide%20%3D%20slide%20ifFalse%3A%20%5B%0A%09%09%09self%20currentSlide%3A%20slide.%0A%09%09%09slide%20show%5D%5D'),
@@ -536,22 +553,6 @@ referencedClasses: []
 }),
 smalltalk.Presentation);
 
-smalltalk.addMethod(
-unescape('_style'),
-smalltalk.method({
-selector: unescape('style'),
-category: 'accessing',
-fn: function (){
-var self=this;
-return "";
-return self;},
-args: [],
-source: unescape('style%0A%09%22Should%20return%20a%20CSS%20style%22%0A%09%5E%20%27%27'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.Presentation);
-
 
 smalltalk.Presentation.klass.iVarNames = ['current'];
 smalltalk.addMethod(
@@ -561,7 +562,7 @@ selector: unescape('initialize'),
 category: 'initialization',
 fn: function (){
 var self=this;
-(($receiver = smalltalk.send(self, "_isConcrete", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_setup", []);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self, "_setup", []);})]);
+((($receiver = smalltalk.send(self, "_isConcrete", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_setup", []);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self, "_setup", []);})]));
 return self;},
 args: [],
 source: unescape('initialize%0A%09self%20isConcrete%20ifTrue%3A%20%5Bself%20setup%5D'),

+ 5 - 2
examples/presentation/st/Presentation.st

@@ -120,7 +120,8 @@ style
 reload
 	'#slides' asJQuery remove.
 	'#tools' asJQuery remove.
-	'body' asJQuery append: self.
+	self initSlides.
+	self appendToJQuery: 'body' asJQuery.
 	self checkHash
 !
 
@@ -146,7 +147,9 @@ nextSlide
 showCurrentSlide
 	self currentSlide ifNotNil: [
 		'.slide' asJQuery hide.
-		('#', self currentSlide id) asJQuery show]
+		('#', self currentSlide id) asJQuery show.
+          	'title' asJQuery text: self title, ' - ', self currentSlide id.
+        ]
 !
 
 previousSlide

+ 165 - 0
js/Canvas.deploy.js

@@ -418,6 +418,149 @@ return self;}
 }),
 smalltalk.HTMLCanvas);
 
+smalltalk.addMethod(
+'_p_',
+smalltalk.method({
+selector: 'p:',
+fn: function (anObject){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_p", []), "_with_", [anObject]);
+return self;}
+}),
+smalltalk.HTMLCanvas);
+
+smalltalk.addMethod(
+'_h1_',
+smalltalk.method({
+selector: 'h1:',
+fn: function (anObject){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_h1", []), "_with_", [anObject]);
+return self;}
+}),
+smalltalk.HTMLCanvas);
+
+smalltalk.addMethod(
+'_iframe',
+smalltalk.method({
+selector: 'iframe',
+fn: function (){
+var self=this;
+return smalltalk.send(self, "_tag_", ["iframe"]);
+return self;}
+}),
+smalltalk.HTMLCanvas);
+
+smalltalk.addMethod(
+'_iframe_',
+smalltalk.method({
+selector: 'iframe:',
+fn: function (aString){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_iframe", []), "_src_", [aString]);
+return self;}
+}),
+smalltalk.HTMLCanvas);
+
+smalltalk.addMethod(
+'_h2_',
+smalltalk.method({
+selector: 'h2:',
+fn: function (anObject){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_h2", []), "_with_", [anObject]);
+return self;}
+}),
+smalltalk.HTMLCanvas);
+
+smalltalk.addMethod(
+'_h3_',
+smalltalk.method({
+selector: 'h3:',
+fn: function (anObject){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_h3", []), "_with_", [anObject]);
+return self;}
+}),
+smalltalk.HTMLCanvas);
+
+smalltalk.addMethod(
+'_h4_',
+smalltalk.method({
+selector: 'h4:',
+fn: function (anObject){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_h4", []), "_with_", [anObject]);
+return self;}
+}),
+smalltalk.HTMLCanvas);
+
+smalltalk.addMethod(
+'_h5_',
+smalltalk.method({
+selector: 'h5:',
+fn: function (anObject){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_h5", []), "_with_", [anObject]);
+return self;}
+}),
+smalltalk.HTMLCanvas);
+
+smalltalk.addMethod(
+'_h6_',
+smalltalk.method({
+selector: 'h6:',
+fn: function (anObject){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_h6", []), "_with_", [anObject]);
+return self;}
+}),
+smalltalk.HTMLCanvas);
+
+smalltalk.addMethod(
+'_img_',
+smalltalk.method({
+selector: 'img:',
+fn: function (aString){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_img", []), "_src_", [aString]);
+return self;}
+}),
+smalltalk.HTMLCanvas);
+
+smalltalk.addMethod(
+'_ol_',
+smalltalk.method({
+selector: 'ol:',
+fn: function (anObject){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_ol", []), "_with_", [anObject]);
+return self;}
+}),
+smalltalk.HTMLCanvas);
+
+smalltalk.addMethod(
+'_li_',
+smalltalk.method({
+selector: 'li:',
+fn: function (anObject){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_li", []), "_with_", [anObject]);
+return self;}
+}),
+smalltalk.HTMLCanvas);
+
+smalltalk.addMethod(
+'_ul_',
+smalltalk.method({
+selector: 'ul:',
+fn: function (anObject){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_ul", []), "_with_", [anObject]);
+return self;}
+}),
+smalltalk.HTMLCanvas);
+
 
 smalltalk.addMethod(
 '_onJQuery_',
@@ -807,6 +950,28 @@ return self;}
 }),
 smalltalk.TagBrush);
 
+smalltalk.addMethod(
+'_width_',
+smalltalk.method({
+selector: 'width:',
+fn: function (aString){
+var self=this;
+smalltalk.send(self, "_at_put_", ["width", aString]);
+return self;}
+}),
+smalltalk.TagBrush);
+
+smalltalk.addMethod(
+'_height_',
+smalltalk.method({
+selector: 'height:',
+fn: function (aString){
+var self=this;
+smalltalk.send(self, "_at_put_", ["height", aString]);
+return self;}
+}),
+smalltalk.TagBrush);
+
 
 smalltalk.addMethod(
 '_fromString_canvas_',

+ 240 - 0
js/Canvas.js

@@ -608,6 +608,214 @@ referencedClasses: []
 }),
 smalltalk.HTMLCanvas);
 
+smalltalk.addMethod(
+unescape('_p_'),
+smalltalk.method({
+selector: unescape('p%3A'),
+category: 'tags',
+fn: function (anObject){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_p", []), "_with_", [anObject]);
+return self;},
+args: ["anObject"],
+source: unescape('p%3A%20anObject%0A%20%20%20%20%5Eself%20p%20with%3A%20anObject'),
+messageSends: ["with:", "p"],
+referencedClasses: []
+}),
+smalltalk.HTMLCanvas);
+
+smalltalk.addMethod(
+unescape('_h1_'),
+smalltalk.method({
+selector: unescape('h1%3A'),
+category: 'tags',
+fn: function (anObject){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_h1", []), "_with_", [anObject]);
+return self;},
+args: ["anObject"],
+source: unescape('h1%3A%20anObject%0A%20%20%20%20%5Eself%20h1%20with%3A%20anObject'),
+messageSends: ["with:", "h1"],
+referencedClasses: []
+}),
+smalltalk.HTMLCanvas);
+
+smalltalk.addMethod(
+unescape('_iframe'),
+smalltalk.method({
+selector: unescape('iframe'),
+category: 'tags',
+fn: function (){
+var self=this;
+return smalltalk.send(self, "_tag_", ["iframe"]);
+return self;},
+args: [],
+source: unescape('iframe%0A%20%20%20%20%5Eself%20tag%3A%20%27iframe%27'),
+messageSends: ["tag:"],
+referencedClasses: []
+}),
+smalltalk.HTMLCanvas);
+
+smalltalk.addMethod(
+unescape('_iframe_'),
+smalltalk.method({
+selector: unescape('iframe%3A'),
+category: 'tags',
+fn: function (aString){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_iframe", []), "_src_", [aString]);
+return self;},
+args: ["aString"],
+source: unescape('iframe%3A%20aString%0A%20%20%20%20%5Eself%20iframe%20src%3A%20aString'),
+messageSends: ["src:", "iframe"],
+referencedClasses: []
+}),
+smalltalk.HTMLCanvas);
+
+smalltalk.addMethod(
+unescape('_h2_'),
+smalltalk.method({
+selector: unescape('h2%3A'),
+category: 'tags',
+fn: function (anObject){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_h2", []), "_with_", [anObject]);
+return self;},
+args: ["anObject"],
+source: unescape('h2%3A%20anObject%0A%20%20%20%20%5E%20self%20h2%20with%3A%20anObject'),
+messageSends: ["with:", "h2"],
+referencedClasses: []
+}),
+smalltalk.HTMLCanvas);
+
+smalltalk.addMethod(
+unescape('_h3_'),
+smalltalk.method({
+selector: unescape('h3%3A'),
+category: 'tags',
+fn: function (anObject){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_h3", []), "_with_", [anObject]);
+return self;},
+args: ["anObject"],
+source: unescape('h3%3A%20anObject%0A%20%20%20%20%5Eself%20h3%20with%3A%20anObject'),
+messageSends: ["with:", "h3"],
+referencedClasses: []
+}),
+smalltalk.HTMLCanvas);
+
+smalltalk.addMethod(
+unescape('_h4_'),
+smalltalk.method({
+selector: unescape('h4%3A'),
+category: 'tags',
+fn: function (anObject){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_h4", []), "_with_", [anObject]);
+return self;},
+args: ["anObject"],
+source: unescape('h4%3A%20anObject%0A%20%20%20%20%5Eself%20h4%20with%3A%20anObject'),
+messageSends: ["with:", "h4"],
+referencedClasses: []
+}),
+smalltalk.HTMLCanvas);
+
+smalltalk.addMethod(
+unescape('_h5_'),
+smalltalk.method({
+selector: unescape('h5%3A'),
+category: 'tags',
+fn: function (anObject){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_h5", []), "_with_", [anObject]);
+return self;},
+args: ["anObject"],
+source: unescape('h5%3A%20anObject%0A%20%20%20%20%5Eself%20h5%20with%3A%20anObject'),
+messageSends: ["with:", "h5"],
+referencedClasses: []
+}),
+smalltalk.HTMLCanvas);
+
+smalltalk.addMethod(
+unescape('_h6_'),
+smalltalk.method({
+selector: unescape('h6%3A'),
+category: 'tags',
+fn: function (anObject){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_h6", []), "_with_", [anObject]);
+return self;},
+args: ["anObject"],
+source: unescape('h6%3A%20anObject%0A%20%20%20%20%5Eself%20h6%20with%3A%20anObject'),
+messageSends: ["with:", "h6"],
+referencedClasses: []
+}),
+smalltalk.HTMLCanvas);
+
+smalltalk.addMethod(
+unescape('_img_'),
+smalltalk.method({
+selector: unescape('img%3A'),
+category: 'tags',
+fn: function (aString){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_img", []), "_src_", [aString]);
+return self;},
+args: ["aString"],
+source: unescape('img%3A%20aString%0A%20%20%20%20%5Eself%20img%20src%3A%20aString'),
+messageSends: ["src:", "img"],
+referencedClasses: []
+}),
+smalltalk.HTMLCanvas);
+
+smalltalk.addMethod(
+unescape('_ol_'),
+smalltalk.method({
+selector: unescape('ol%3A'),
+category: 'tags',
+fn: function (anObject){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_ol", []), "_with_", [anObject]);
+return self;},
+args: ["anObject"],
+source: unescape('ol%3A%20anObject%0A%20%20%20%20%5Eself%20ol%20with%3A%20anObject'),
+messageSends: ["with:", "ol"],
+referencedClasses: []
+}),
+smalltalk.HTMLCanvas);
+
+smalltalk.addMethod(
+unescape('_li_'),
+smalltalk.method({
+selector: unescape('li%3A'),
+category: 'tags',
+fn: function (anObject){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_li", []), "_with_", [anObject]);
+return self;},
+args: ["anObject"],
+source: unescape('li%3A%20anObject%0A%20%20%20%20%5Eself%20li%20with%3A%20anObject'),
+messageSends: ["with:", "li"],
+referencedClasses: []
+}),
+smalltalk.HTMLCanvas);
+
+smalltalk.addMethod(
+unescape('_ul_'),
+smalltalk.method({
+selector: unescape('ul%3A'),
+category: 'tags',
+fn: function (anObject){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_ul", []), "_with_", [anObject]);
+return self;},
+args: ["anObject"],
+source: unescape('ul%3A%20anObject%0A%20%20%20%20%5Eself%20ul%20with%3A%20anObject'),
+messageSends: ["with:", "ul"],
+referencedClasses: []
+}),
+smalltalk.HTMLCanvas);
+
 
 smalltalk.addMethod(
 unescape('_onJQuery_'),
@@ -1167,6 +1375,38 @@ referencedClasses: []
 }),
 smalltalk.TagBrush);
 
+smalltalk.addMethod(
+unescape('_width_'),
+smalltalk.method({
+selector: unescape('width%3A'),
+category: 'attributes',
+fn: function (aString){
+var self=this;
+smalltalk.send(self, "_at_put_", ["width", aString]);
+return self;},
+args: ["aString"],
+source: unescape('width%3A%20aString%0A%20%20%20%20self%20%20at%3A%20%27width%27%20put%3A%20aString'),
+messageSends: ["at:put:"],
+referencedClasses: []
+}),
+smalltalk.TagBrush);
+
+smalltalk.addMethod(
+unescape('_height_'),
+smalltalk.method({
+selector: unescape('height%3A'),
+category: 'attributes',
+fn: function (aString){
+var self=this;
+smalltalk.send(self, "_at_put_", ["height", aString]);
+return self;},
+args: ["aString"],
+source: unescape('height%3A%20aString%0A%20%20%20%20self%20%20at%3A%20%27height%27%20put%3A%20aString'),
+messageSends: ["at:put:"],
+referencedClasses: []
+}),
+smalltalk.TagBrush);
+
 
 smalltalk.addMethod(
 unescape('_fromString_canvas_'),

+ 0 - 0
js/Compiler.js


+ 0 - 0
js/IDE.js


+ 74 - 16
js/Kernel-Tests.deploy.js

@@ -48,6 +48,17 @@ return self;}
 }),
 smalltalk.StringTest);
 
+smalltalk.addMethod(
+'_testCopyWithoutAll',
+smalltalk.method({
+selector: 'testCopyWithoutAll',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", ["hello world", smalltalk.send(unescape("*hello*%20*world*"), "_copyWithoutAll_", [unescape("*")])]);
+return self;}
+}),
+smalltalk.StringTest);
+
 
 
 smalltalk.addClass('DictionaryTest', smalltalk.TestCase, [], 'Kernel-Tests');
@@ -167,6 +178,29 @@ smalltalk.BooleanTest);
 
 
 smalltalk.addClass('NumberTest', smalltalk.TestCase, [], 'Kernel-Tests');
+smalltalk.addMethod(
+'_testPrintShowingDecimalPlaces',
+smalltalk.method({
+selector: 'testPrintShowingDecimalPlaces',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", ["23.00", smalltalk.send((23), "_printShowingDecimalPlaces_", [(2)])]);
+smalltalk.send(self, "_assert_equals_", ["23.57", smalltalk.send((23.5698), "_printShowingDecimalPlaces_", [(2)])]);
+smalltalk.send(self, "_assert_equals_", [unescape("-234.56700"), smalltalk.send(smalltalk.send((234.567), "_negated", []), "_printShowingDecimalPlaces_", [(5)])]);
+smalltalk.send(self, "_assert_equals_", ["23", smalltalk.send((23.4567), "_printShowingDecimalPlaces_", [(0)])]);
+smalltalk.send(self, "_assert_equals_", ["24", smalltalk.send((23.5567), "_printShowingDecimalPlaces_", [(0)])]);
+smalltalk.send(self, "_assert_equals_", [unescape("-23"), smalltalk.send(smalltalk.send((23.4567), "_negated", []), "_printShowingDecimalPlaces_", [(0)])]);
+smalltalk.send(self, "_assert_equals_", [unescape("-24"), smalltalk.send(smalltalk.send((23.5567), "_negated", []), "_printShowingDecimalPlaces_", [(0)])]);
+smalltalk.send(self, "_assert_equals_", ["100000000.0", smalltalk.send((100000000), "_printShowingDecimalPlaces_", [(1)])]);
+smalltalk.send(self, "_assert_equals_", ["0.98000", smalltalk.send((0.98), "_printShowingDecimalPlaces_", [(5)])]);
+smalltalk.send(self, "_assert_equals_", [unescape("-0.98"), smalltalk.send(smalltalk.send((0.98), "_negated", []), "_printShowingDecimalPlaces_", [(2)])]);
+smalltalk.send(self, "_assert_equals_", ["2.57", smalltalk.send((2.567), "_printShowingDecimalPlaces_", [(2)])]);
+smalltalk.send(self, "_assert_equals_", [unescape("-2.57"), smalltalk.send((-2.567), "_printShowingDecimalPlaces_", [(2)])]);
+smalltalk.send(self, "_assert_equals_", ["0.00", smalltalk.send((0), "_printShowingDecimalPlaces_", [(2)])]);
+return self;}
+}),
+smalltalk.NumberTest);
+
 smalltalk.addMethod(
 '_testEquality',
 smalltalk.method({
@@ -260,28 +294,52 @@ return self;}
 }),
 smalltalk.NumberTest);
 
+
+
+smalltalk.addClass('JSObjectProxyTest', smalltalk.TestCase, [], 'Kernel-Tests');
 smalltalk.addMethod(
-'_testPrintShowingDecimalPlaces',
+'_testMethodWithArguments',
 smalltalk.method({
-selector: 'testPrintShowingDecimalPlaces',
+selector: 'testMethodWithArguments',
 fn: function (){
 var self=this;
-smalltalk.send(self, "_assert_equals_", ["23.00", smalltalk.send((23), "_printShowingDecimalPlaces_", [(2)])]);
-smalltalk.send(self, "_assert_equals_", ["23.57", smalltalk.send((23.5698), "_printShowingDecimalPlaces_", [(2)])]);
-smalltalk.send(self, "_assert_equals_", [unescape("-234.56700"), smalltalk.send(smalltalk.send((234.567), "_negated", []), "_printShowingDecimalPlaces_", [(5)])]);
-smalltalk.send(self, "_assert_equals_", ["23", smalltalk.send((23.4567), "_printShowingDecimalPlaces_", [(0)])]);
-smalltalk.send(self, "_assert_equals_", ["24", smalltalk.send((23.5567), "_printShowingDecimalPlaces_", [(0)])]);
-smalltalk.send(self, "_assert_equals_", [unescape("-23"), smalltalk.send(smalltalk.send((23.4567), "_negated", []), "_printShowingDecimalPlaces_", [(0)])]);
-smalltalk.send(self, "_assert_equals_", [unescape("-24"), smalltalk.send(smalltalk.send((23.5567), "_negated", []), "_printShowingDecimalPlaces_", [(0)])]);
-smalltalk.send(self, "_assert_equals_", ["100000000.0", smalltalk.send((100000000), "_printShowingDecimalPlaces_", [(1)])]);
-smalltalk.send(self, "_assert_equals_", ["0.98000", smalltalk.send((0.98), "_printShowingDecimalPlaces_", [(5)])]);
-smalltalk.send(self, "_assert_equals_", [unescape("-0.98"), smalltalk.send(smalltalk.send((0.98), "_negated", []), "_printShowingDecimalPlaces_", [(2)])]);
-smalltalk.send(self, "_assert_equals_", ["2.57", smalltalk.send((2.567), "_printShowingDecimalPlaces_", [(2)])]);
-smalltalk.send(self, "_assert_equals_", [unescape("-2.57"), smalltalk.send((-2.567), "_printShowingDecimalPlaces_", [(2)])]);
-smalltalk.send(self, "_assert_equals_", ["0.00", smalltalk.send((0), "_printShowingDecimalPlaces_", [(2)])]);
+smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_hasClass_", ["amber"])]);
+smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_addClass_", ["amber"]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_hasClass_", ["amber"])]);
+smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_removeClass_", ["amber"]);
+smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_hasClass_", ["amber"])]);
 return self;}
 }),
-smalltalk.NumberTest);
+smalltalk.JSObjectProxyTest);
+
+smalltalk.addMethod(
+'_testYourself',
+smalltalk.method({
+selector: 'testYourself',
+fn: function (){
+var self=this;
+var body=nil;
+body=(function($rec){smalltalk.send($rec, "_addClass_", ["amber"]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send("body", "_asJQuery", []));
+smalltalk.send(self, "_assert_", [smalltalk.send(body, "_hasClass_", ["amber"])]);
+smalltalk.send(body, "_removeClass_", ["amber"]);
+smalltalk.send(self, "_deny_", [smalltalk.send(body, "_hasClass_", ["amber"])]);
+return self;}
+}),
+smalltalk.JSObjectProxyTest);
+
+smalltalk.addMethod(
+'_testPropertyThatReturnsEmptyString',
+smalltalk.method({
+selector: 'testPropertyThatReturnsEmptyString',
+fn: function (){
+var self=this;
+document.location.hash = '';
+smalltalk.send(self, "_assert_equals_", ["", smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash", [])]);
+smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash_", ["test"]);
+smalltalk.send(self, "_assert_equals_", [unescape("%23test"), smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash", [])]);
+return self;}
+}),
+smalltalk.JSObjectProxyTest);
 
 
 

+ 97 - 19
js/Kernel-Tests.js

@@ -68,6 +68,22 @@ referencedClasses: []
 }),
 smalltalk.StringTest);
 
+smalltalk.addMethod(
+unescape('_testCopyWithoutAll'),
+smalltalk.method({
+selector: unescape('testCopyWithoutAll'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", ["hello world", smalltalk.send(unescape("*hello*%20*world*"), "_copyWithoutAll_", [unescape("*")])]);
+return self;},
+args: [],
+source: unescape('testCopyWithoutAll%0A%09self%20%0A%09%09assert%3A%20%27hello%20world%27%20%0A%09%09equals%3A%20%28%27*hello*%20*world*%27%20copyWithoutAll%3A%20%27*%27%29'),
+messageSends: ["assert:equals:", "copyWithoutAll:"],
+referencedClasses: []
+}),
+smalltalk.StringTest);
+
 
 
 smalltalk.addClass('DictionaryTest', smalltalk.TestCase, [], 'Kernel-Tests');
@@ -222,6 +238,34 @@ smalltalk.BooleanTest);
 
 
 smalltalk.addClass('NumberTest', smalltalk.TestCase, [], 'Kernel-Tests');
+smalltalk.addMethod(
+unescape('_testPrintShowingDecimalPlaces'),
+smalltalk.method({
+selector: unescape('testPrintShowingDecimalPlaces'),
+category: 'not yet classified',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", ["23.00", smalltalk.send((23), "_printShowingDecimalPlaces_", [(2)])]);
+smalltalk.send(self, "_assert_equals_", ["23.57", smalltalk.send((23.5698), "_printShowingDecimalPlaces_", [(2)])]);
+smalltalk.send(self, "_assert_equals_", [unescape("-234.56700"), smalltalk.send(smalltalk.send((234.567), "_negated", []), "_printShowingDecimalPlaces_", [(5)])]);
+smalltalk.send(self, "_assert_equals_", ["23", smalltalk.send((23.4567), "_printShowingDecimalPlaces_", [(0)])]);
+smalltalk.send(self, "_assert_equals_", ["24", smalltalk.send((23.5567), "_printShowingDecimalPlaces_", [(0)])]);
+smalltalk.send(self, "_assert_equals_", [unescape("-23"), smalltalk.send(smalltalk.send((23.4567), "_negated", []), "_printShowingDecimalPlaces_", [(0)])]);
+smalltalk.send(self, "_assert_equals_", [unescape("-24"), smalltalk.send(smalltalk.send((23.5567), "_negated", []), "_printShowingDecimalPlaces_", [(0)])]);
+smalltalk.send(self, "_assert_equals_", ["100000000.0", smalltalk.send((100000000), "_printShowingDecimalPlaces_", [(1)])]);
+smalltalk.send(self, "_assert_equals_", ["0.98000", smalltalk.send((0.98), "_printShowingDecimalPlaces_", [(5)])]);
+smalltalk.send(self, "_assert_equals_", [unescape("-0.98"), smalltalk.send(smalltalk.send((0.98), "_negated", []), "_printShowingDecimalPlaces_", [(2)])]);
+smalltalk.send(self, "_assert_equals_", ["2.57", smalltalk.send((2.567), "_printShowingDecimalPlaces_", [(2)])]);
+smalltalk.send(self, "_assert_equals_", [unescape("-2.57"), smalltalk.send((-2.567), "_printShowingDecimalPlaces_", [(2)])]);
+smalltalk.send(self, "_assert_equals_", ["0.00", smalltalk.send((0), "_printShowingDecimalPlaces_", [(2)])]);
+return self;},
+args: [],
+source: unescape('testPrintShowingDecimalPlaces%0A%09self%20assert%3A%20%2723.00%27%20equals%3A%20%2823%20printShowingDecimalPlaces%3A%202%29.%0A%09self%20assert%3A%20%2723.57%27%20equals%3A%20%2823.5698%20printShowingDecimalPlaces%3A%202%29.%0A%09self%20assert%3A%20%27-234.56700%27%20equals%3A%28%20234.567%20negated%20printShowingDecimalPlaces%3A%205%29.%0A%09self%20assert%3A%20%2723%27%20equals%3A%20%2823.4567%20printShowingDecimalPlaces%3A%200%29.%0A%09self%20assert%3A%20%2724%27%20equals%3A%20%2823.5567%20printShowingDecimalPlaces%3A%200%29.%0A%09self%20assert%3A%20%27-23%27%20equals%3A%20%2823.4567%20negated%20printShowingDecimalPlaces%3A%200%29.%0A%09self%20assert%3A%20%27-24%27%20equals%3A%20%2823.5567%20negated%20printShowingDecimalPlaces%3A%200%29.%0A%09self%20assert%3A%20%27100000000.0%27%20equals%3A%20%28100000000%20printShowingDecimalPlaces%3A%201%29.%0A%09self%20assert%3A%20%270.98000%27%20equals%3A%20%280.98%20printShowingDecimalPlaces%3A%205%29.%0A%09self%20assert%3A%20%27-0.98%27%20equals%3A%20%280.98%20negated%20printShowingDecimalPlaces%3A%202%29.%0A%09self%20assert%3A%20%272.57%27%20equals%3A%20%282.567%20printShowingDecimalPlaces%3A%202%29.%0A%09self%20assert%3A%20%27-2.57%27%20equals%3A%20%28-2.567%20printShowingDecimalPlaces%3A%202%29.%0A%09self%20assert%3A%20%270.00%27%20equals%3A%20%280%20printShowingDecimalPlaces%3A%202%29.'),
+messageSends: ["assert:equals:", "printShowingDecimalPlaces:", "negated"],
+referencedClasses: []
+}),
+smalltalk.NumberTest);
+
 smalltalk.addMethod(
 unescape('_testEquality'),
 smalltalk.method({
@@ -345,33 +389,67 @@ referencedClasses: []
 }),
 smalltalk.NumberTest);
 
+
+
+smalltalk.addClass('JSObjectProxyTest', smalltalk.TestCase, [], 'Kernel-Tests');
 smalltalk.addMethod(
-unescape('_testPrintShowingDecimalPlaces'),
+unescape('_testMethodWithArguments'),
 smalltalk.method({
-selector: unescape('testPrintShowingDecimalPlaces'),
-category: 'not yet classified',
+selector: unescape('testMethodWithArguments'),
+category: 'tests',
 fn: function (){
 var self=this;
-smalltalk.send(self, "_assert_equals_", ["23.00", smalltalk.send((23), "_printShowingDecimalPlaces_", [(2)])]);
-smalltalk.send(self, "_assert_equals_", ["23.57", smalltalk.send((23.5698), "_printShowingDecimalPlaces_", [(2)])]);
-smalltalk.send(self, "_assert_equals_", [unescape("-234.56700"), smalltalk.send(smalltalk.send((234.567), "_negated", []), "_printShowingDecimalPlaces_", [(5)])]);
-smalltalk.send(self, "_assert_equals_", ["23", smalltalk.send((23.4567), "_printShowingDecimalPlaces_", [(0)])]);
-smalltalk.send(self, "_assert_equals_", ["24", smalltalk.send((23.5567), "_printShowingDecimalPlaces_", [(0)])]);
-smalltalk.send(self, "_assert_equals_", [unescape("-23"), smalltalk.send(smalltalk.send((23.4567), "_negated", []), "_printShowingDecimalPlaces_", [(0)])]);
-smalltalk.send(self, "_assert_equals_", [unescape("-24"), smalltalk.send(smalltalk.send((23.5567), "_negated", []), "_printShowingDecimalPlaces_", [(0)])]);
-smalltalk.send(self, "_assert_equals_", ["100000000.0", smalltalk.send((100000000), "_printShowingDecimalPlaces_", [(1)])]);
-smalltalk.send(self, "_assert_equals_", ["0.98000", smalltalk.send((0.98), "_printShowingDecimalPlaces_", [(5)])]);
-smalltalk.send(self, "_assert_equals_", [unescape("-0.98"), smalltalk.send(smalltalk.send((0.98), "_negated", []), "_printShowingDecimalPlaces_", [(2)])]);
-smalltalk.send(self, "_assert_equals_", ["2.57", smalltalk.send((2.567), "_printShowingDecimalPlaces_", [(2)])]);
-smalltalk.send(self, "_assert_equals_", [unescape("-2.57"), smalltalk.send((-2.567), "_printShowingDecimalPlaces_", [(2)])]);
-smalltalk.send(self, "_assert_equals_", ["0.00", smalltalk.send((0), "_printShowingDecimalPlaces_", [(2)])]);
+smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_hasClass_", ["amber"])]);
+smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_addClass_", ["amber"]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_hasClass_", ["amber"])]);
+smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_removeClass_", ["amber"]);
+smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_hasClass_", ["amber"])]);
 return self;},
 args: [],
-source: unescape('testPrintShowingDecimalPlaces%0A%09self%20assert%3A%20%2723.00%27%20equals%3A%20%2823%20printShowingDecimalPlaces%3A%202%29.%0A%09self%20assert%3A%20%2723.57%27%20equals%3A%20%2823.5698%20printShowingDecimalPlaces%3A%202%29.%0A%09self%20assert%3A%20%27-234.56700%27%20equals%3A%28%20234.567%20negated%20printShowingDecimalPlaces%3A%205%29.%0A%09self%20assert%3A%20%2723%27%20equals%3A%20%2823.4567%20printShowingDecimalPlaces%3A%200%29.%0A%09self%20assert%3A%20%2724%27%20equals%3A%20%2823.5567%20printShowingDecimalPlaces%3A%200%29.%0A%09self%20assert%3A%20%27-23%27%20equals%3A%20%2823.4567%20negated%20printShowingDecimalPlaces%3A%200%29.%0A%09self%20assert%3A%20%27-24%27%20equals%3A%20%2823.5567%20negated%20printShowingDecimalPlaces%3A%200%29.%0A%09self%20assert%3A%20%27100000000.0%27%20equals%3A%20%28100000000%20printShowingDecimalPlaces%3A%201%29.%0A%09self%20assert%3A%20%270.98000%27%20equals%3A%20%280.98%20printShowingDecimalPlaces%3A%205%29.%0A%09self%20assert%3A%20%27-0.98%27%20equals%3A%20%280.98%20negated%20printShowingDecimalPlaces%3A%202%29.%0A%09self%20assert%3A%20%272.57%27%20equals%3A%20%282.567%20printShowingDecimalPlaces%3A%202%29.%0A%09self%20assert%3A%20%27-2.57%27%20equals%3A%20%28-2.567%20printShowingDecimalPlaces%3A%202%29.%0A%09self%20assert%3A%20%270.00%27%20equals%3A%20%280%20printShowingDecimalPlaces%3A%202%29.'),
-messageSends: ["assert:equals:", "printShowingDecimalPlaces:", "negated"],
+source: unescape('testMethodWithArguments%0A%09self%20deny%3A%20%28%27body%27%20asJQuery%20hasClass%3A%20%27amber%27%29.%0A%0A%09%27body%27%20asJQuery%20addClass%3A%20%27amber%27.%0A%09self%20assert%3A%20%28%27body%27%20asJQuery%20hasClass%3A%20%27amber%27%29.%0A%0A%09%27body%27%20asJQuery%20removeClass%3A%20%27amber%27.%0A%09self%20deny%3A%20%28%27body%27%20asJQuery%20hasClass%3A%20%27amber%27%29.'),
+messageSends: ["deny:", "hasClass:", "asJQuery", "addClass:", "assert:", "removeClass:"],
 referencedClasses: []
 }),
-smalltalk.NumberTest);
+smalltalk.JSObjectProxyTest);
+
+smalltalk.addMethod(
+unescape('_testYourself'),
+smalltalk.method({
+selector: unescape('testYourself'),
+category: 'tests',
+fn: function (){
+var self=this;
+var body=nil;
+body=(function($rec){smalltalk.send($rec, "_addClass_", ["amber"]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send("body", "_asJQuery", []));
+smalltalk.send(self, "_assert_", [smalltalk.send(body, "_hasClass_", ["amber"])]);
+smalltalk.send(body, "_removeClass_", ["amber"]);
+smalltalk.send(self, "_deny_", [smalltalk.send(body, "_hasClass_", ["amber"])]);
+return self;},
+args: [],
+source: unescape('testYourself%0A%09%7Cbody%7C%0A%09body%20%3A%3D%20%27body%27%20asJQuery%0A%09%09%09%09addClass%3A%20%27amber%27%3B%0A%09%09%09%09yourself.%0A%0A%09self%20assert%3A%20%28body%20hasClass%3A%20%27amber%27%29.%0A%0A%09body%20removeClass%3A%20%27amber%27.%0A%09self%20deny%3A%20%28body%20hasClass%3A%20%27amber%27%29.'),
+messageSends: ["addClass:", "yourself", "asJQuery", "assert:", "hasClass:", "removeClass:", "deny:"],
+referencedClasses: []
+}),
+smalltalk.JSObjectProxyTest);
+
+smalltalk.addMethod(
+unescape('_testPropertyThatReturnsEmptyString'),
+smalltalk.method({
+selector: unescape('testPropertyThatReturnsEmptyString'),
+category: 'tests',
+fn: function (){
+var self=this;
+document.location.hash = '';
+smalltalk.send(self, "_assert_equals_", ["", smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash", [])]);
+smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash_", ["test"]);
+smalltalk.send(self, "_assert_equals_", [unescape("%23test"), smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash", [])]);
+return self;},
+args: [],
+source: unescape('testPropertyThatReturnsEmptyString%0A%09%3Cdocument.location.hash%20%3D%20%27%27%3E.%0A%09self%20assert%3A%20%27%27%20equals%3A%20document%20location%20hash.%0A%0A%09document%20location%20hash%3A%20%27test%27.%0A%09self%20assert%3A%20%27%23test%27%20equals%3A%20document%20location%20hash.'),
+messageSends: ["assert:equals:", "hash", "location", "hash:"],
+referencedClasses: []
+}),
+smalltalk.JSObjectProxyTest);
 
 
 

+ 23 - 1
js/Kernel.deploy.js

@@ -3144,6 +3144,17 @@ return self;}
 }),
 smalltalk.Collection);
 
+smalltalk.addMethod(
+'_copyWithoutAll_',
+smalltalk.method({
+selector: 'copyWithoutAll:',
+fn: function (aCollection){
+var self=this;
+return smalltalk.send(self, "_reject_", [(function(each){return smalltalk.send(aCollection, "_includes_", [each]);})]);
+return self;}
+}),
+smalltalk.Collection);
+
 
 smalltalk.addMethod(
 '_streamClass',
@@ -5711,6 +5722,17 @@ return self;}
 }),
 smalltalk.Message);
 
+smalltalk.addMethod(
+'_printString',
+smalltalk.method({
+selector: 'printString',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(aStream){return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_printString", [], smalltalk.Object)]);smalltalk.send($rec, "_nextPutAll_", [unescape("%28")]);smalltalk.send($rec, "_nextPutAll_", [self['@selector']]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%29")]);})(aStream);})]);
+return self;}
+}),
+smalltalk.Message);
+
 
 smalltalk.addMethod(
 '_selector_arguments_',
@@ -5953,7 +5975,7 @@ obj=smalltalk.send(self, "_jsObject", []);
 selector=smalltalk.send(aMessage, "_selector", []);
 jsSelector=smalltalk.send(selector, "_asJavaScriptSelector", []);
 arguments=smalltalk.send(aMessage, "_arguments", []);
-if(obj[jsSelector]) {return smalltalk.send(obj, jsSelector, arguments)};
+if(obj[jsSelector] != undefined) {return smalltalk.send(obj, jsSelector, arguments)};
 smalltalk.send(self, "_doesNotUnderstand_", [aMessage], smalltalk.Object);
 return self;}
 }),

+ 37 - 5
js/Kernel.js

@@ -4491,6 +4491,22 @@ referencedClasses: []
 }),
 smalltalk.Collection);
 
+smalltalk.addMethod(
+unescape('_copyWithoutAll_'),
+smalltalk.method({
+selector: unescape('copyWithoutAll%3A'),
+category: 'copying',
+fn: function (aCollection){
+var self=this;
+return smalltalk.send(self, "_reject_", [(function(each){return smalltalk.send(aCollection, "_includes_", [each]);})]);
+return self;},
+args: ["aCollection"],
+source: unescape('copyWithoutAll%3A%20aCollection%0A%09%22Answer%20a%20copy%20of%20the%20receiver%20that%20does%20not%20contain%20any%20elements%20%0A%09equal%20to%20those%20in%20aCollection.%22%0A%0A%09%5E%20self%20reject%3A%20%5B%3Aeach%20%7C%20aCollection%20includes%3A%20each%5D'),
+messageSends: ["reject:", "includes:"],
+referencedClasses: []
+}),
+smalltalk.Collection);
+
 
 smalltalk.addMethod(
 unescape('_streamClass'),
@@ -5691,11 +5707,11 @@ selector: unescape('asJavaScriptSelector'),
 category: 'converting',
 fn: function (){
 var self=this;
-return String(self.replace(/^_/, '').replace(/_.*/, ''));
+return smalltalk.send(smalltalk.send(smalltalk.send(self, "_asSelector", []), "_replace_with_", [unescape("%5E_"), ""]), "_replace_with_", [unescape("_.*"), ""]);
 return self;},
 args: [],
-source: unescape('asJavaScriptSelector%0A%09%3Creturn%20String%28self.replace%28/%5E_/%2C%20%27%27%29.replace%28/_.*/%2C%20%27%27%29%29%3E'),
-messageSends: [],
+source: unescape('asJavaScriptSelector%0A%09%5E%28self%20asSelector%20replace%3A%20%27%5E_%27%20with%3A%20%27%27%29%20replace%3A%20%27_.*%27%20with%3A%20%27%27.'),
+messageSends: ["replace:with:", "asSelector"],
 referencedClasses: []
 }),
 smalltalk.String);
@@ -8138,6 +8154,22 @@ referencedClasses: []
 }),
 smalltalk.Message);
 
+smalltalk.addMethod(
+unescape('_printString'),
+smalltalk.method({
+selector: unescape('printString'),
+category: 'printing',
+fn: function (){
+var self=this;
+return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(aStream){return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_printString", [], smalltalk.Object)]);smalltalk.send($rec, "_nextPutAll_", [unescape("%28")]);smalltalk.send($rec, "_nextPutAll_", [self['@selector']]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%29")]);})(aStream);})]);
+return self;},
+args: [],
+source: unescape('printString%0A%09%5E%20String%20streamContents%3A%20%5B%3AaStream%7C%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%09%09%09%09aStream%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%09%09%09%09%09nextPutAll%3A%20super%20printString%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%20%20%20%20%20%20%20%20%20%20%09%09%09%09%09nextPutAll%3A%20%27%28%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%20%20%20%20%20%20%20%20%20%20%09%09%09%09%09nextPutAll%3A%20selector%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%20%20%20%20%20%20%20%20%20%20%09%09%09%09%09nextPutAll%3A%20%27%29%27%20%09%09%09%09%5D'),
+messageSends: ["streamContents:", "nextPutAll:", "printString"],
+referencedClasses: [smalltalk.String]
+}),
+smalltalk.Message);
+
 
 smalltalk.addMethod(
 unescape('_selector_arguments_'),
@@ -8476,11 +8508,11 @@ obj=smalltalk.send(self, "_jsObject", []);
 selector=smalltalk.send(aMessage, "_selector", []);
 jsSelector=smalltalk.send(selector, "_asJavaScriptSelector", []);
 arguments=smalltalk.send(aMessage, "_arguments", []);
-if(obj[jsSelector]) {return smalltalk.send(obj, jsSelector, arguments)};
+if(obj[jsSelector] != undefined) {return smalltalk.send(obj, jsSelector, arguments)};
 smalltalk.send(self, "_doesNotUnderstand_", [aMessage], smalltalk.Object);
 return self;},
 args: ["aMessage"],
-source: unescape('doesNotUnderstand%3A%20aMessage%0A%09%7C%20obj%20selector%20jsSelector%20arguments%20%7C%0A%09obj%20%3A%3D%20self%20jsObject.%0A%09selector%20%3A%3D%20aMessage%20selector.%0A%09jsSelector%20%3A%3D%20selector%20asJavaScriptSelector.%0A%09arguments%20%3A%3D%20aMessage%20arguments.%0A%09%3Cif%28obj%5BjsSelector%5D%29%20%7Breturn%20smalltalk.send%28obj%2C%20jsSelector%2C%20arguments%29%7D%3E.%0A%09super%20doesNotUnderstand%3A%20aMessage'),
+source: unescape('doesNotUnderstand%3A%20aMessage%0A%09%7C%20obj%20selector%20jsSelector%20arguments%20%7C%0A%09obj%20%3A%3D%20self%20jsObject.%0A%09selector%20%3A%3D%20aMessage%20selector.%0A%09jsSelector%20%3A%3D%20selector%20asJavaScriptSelector.%0A%09arguments%20%3A%3D%20aMessage%20arguments.%0A%09%3Cif%28obj%5BjsSelector%5D%20%21%3D%20undefined%29%20%7Breturn%20smalltalk.send%28obj%2C%20jsSelector%2C%20arguments%29%7D%3E.%0A%09super%20doesNotUnderstand%3A%20aMessage'),
 messageSends: ["jsObject", "selector", "asJavaScriptSelector", "arguments", "doesNotUnderstand:"],
 referencedClasses: []
 }),

+ 0 - 0
js/SUnit.js


+ 1 - 1
js/amber.js

@@ -30,7 +30,7 @@
     }
 
     function loadDependencies() {
-	loadJS('lib/jQuery/jquery-1.6.2.min.js');
+	loadJS('lib/jQuery/jquery-1.6.4.min.js');
 	loadJS('lib/jQuery/jquery-ui-1.8.9.custom.min.js');
     }
 

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


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


+ 61 - 0
st/Canvas.st

@@ -161,6 +161,58 @@ link
 
 style
 	^self tag: 'style'
+!
+
+p: anObject
+    ^self p with: anObject
+!
+
+h1: anObject
+    ^self h1 with: anObject
+!
+
+iframe
+    ^self tag: 'iframe'
+!
+
+iframe: aString
+    ^self iframe src: aString
+!
+
+h2: anObject
+    ^ self h2 with: anObject
+!
+
+h3: anObject
+    ^self h3 with: anObject
+!
+
+h4: anObject
+    ^self h4 with: anObject
+!
+
+h5: anObject
+    ^self h5 with: anObject
+!
+
+h6: anObject
+    ^self h6 with: anObject
+!
+
+img: aString
+    ^self img src: aString
+!
+
+ol: anObject
+    ^self ol with: anObject
+!
+
+li: anObject
+    ^self li with: anObject
+!
+
+ul: anObject
+    ^self ul with: anObject
 ! !
 
 !HTMLCanvas class methodsFor: 'instance creation'!
@@ -277,6 +329,14 @@ media: aString
 
 rel: aString
     self  at: 'rel' put: aString
+!
+
+width: aString
+    self  at: 'width' put: aString
+!
+
+height: aString
+    self  at: 'height' put: aString
 ! !
 
 !TagBrush methodsFor: 'converting'!
@@ -422,3 +482,4 @@ appendToJQuery: aJQuery
 appendToBrush: aTagBrush
     aTagBrush appendString: self
 ! !
+

+ 0 - 0
st/Compiler.st


+ 0 - 0
st/IDE.st


+ 55 - 17
st/Kernel-Tests.st

@@ -30,6 +30,12 @@ testEquality
 
 	"test JS falsy value"
 	self deny: '' = 0
+!
+
+testCopyWithoutAll
+	self 
+		assert: 'hello world' 
+		equals: ('*hello* *world*' copyWithoutAll: '*')
 ! !
 
 TestCase subclass: #DictionaryTest
@@ -148,6 +154,24 @@ TestCase subclass: #NumberTest
 	instanceVariableNames: ''
 	category: 'Kernel-Tests'!
 
+!NumberTest methodsFor: 'not yet classified'!
+
+testPrintShowingDecimalPlaces
+	self assert: '23.00' equals: (23 printShowingDecimalPlaces: 2).
+	self assert: '23.57' equals: (23.5698 printShowingDecimalPlaces: 2).
+	self assert: '-234.56700' equals:( 234.567 negated printShowingDecimalPlaces: 5).
+	self assert: '23' equals: (23.4567 printShowingDecimalPlaces: 0).
+	self assert: '24' equals: (23.5567 printShowingDecimalPlaces: 0).
+	self assert: '-23' equals: (23.4567 negated printShowingDecimalPlaces: 0).
+	self assert: '-24' equals: (23.5567 negated printShowingDecimalPlaces: 0).
+	self assert: '100000000.0' equals: (100000000 printShowingDecimalPlaces: 1).
+	self assert: '0.98000' equals: (0.98 printShowingDecimalPlaces: 5).
+	self assert: '-0.98' equals: (0.98 negated printShowingDecimalPlaces: 2).
+	self assert: '2.57' equals: (2.567 printShowingDecimalPlaces: 2).
+	self assert: '-2.57' equals: (-2.567 printShowingDecimalPlaces: 2).
+	self assert: '0.00' equals: (0 printShowingDecimalPlaces: 2).
+! !
+
 !NumberTest methodsFor: 'tests'!
 
 testEquality
@@ -215,25 +239,39 @@ testTruncated
 	self assert: 3.51 truncated = 3
 ! !
 
-TestCase subclass: #NumberTest
+TestCase subclass: #JSObjectProxyTest
 	instanceVariableNames: ''
 	category: 'Kernel-Tests'!
 
-!NumberTest methodsFor: 'not yet classified'!
+!JSObjectProxyTest methodsFor: 'tests'!
 
-testPrintShowingDecimalPlaces
-	self assert: '23.00' equals: (23 printShowingDecimalPlaces: 2).
-	self assert: '23.57' equals: (23.5698 printShowingDecimalPlaces: 2).
-	self assert: '-234.56700' equals:( 234.567 negated printShowingDecimalPlaces: 5).
-	self assert: '23' equals: (23.4567 printShowingDecimalPlaces: 0).
-	self assert: '24' equals: (23.5567 printShowingDecimalPlaces: 0).
-	self assert: '-23' equals: (23.4567 negated printShowingDecimalPlaces: 0).
-	self assert: '-24' equals: (23.5567 negated printShowingDecimalPlaces: 0).
-	self assert: '100000000.0' equals: (100000000 printShowingDecimalPlaces: 1).
-	self assert: '0.98000' equals: (0.98 printShowingDecimalPlaces: 5).
-	self assert: '-0.98' equals: (0.98 negated printShowingDecimalPlaces: 2).
-	self assert: '2.57' equals: (2.567 printShowingDecimalPlaces: 2).
-	self assert: '-2.57' equals: (-2.567 printShowingDecimalPlaces: 2).
-	self assert: '0.00' equals: (0 printShowingDecimalPlaces: 2).
-! !
+testMethodWithArguments
+	self deny: ('body' asJQuery hasClass: 'amber').
+
+	'body' asJQuery addClass: 'amber'.
+	self assert: ('body' asJQuery hasClass: 'amber').
+
+	'body' asJQuery removeClass: 'amber'.
+	self deny: ('body' asJQuery hasClass: 'amber').
+!
+
+testYourself
+	|body|
+	body := 'body' asJQuery
+				addClass: 'amber';
+				yourself.
+
+	self assert: (body hasClass: 'amber').
+
+	body removeClass: 'amber'.
+	self deny: (body hasClass: 'amber').
+!
+
+testPropertyThatReturnsEmptyString
+	<document.location.hash = ''>.
+	self assert: '' equals: document location hash.
+
+	document location hash: 'test'.
+	self assert: '#test' equals: document location hash.
 
+! !

+ 20 - 2
st/Kernel.st

@@ -1430,6 +1430,13 @@ copyWith: anObject
 
 copyWithAll: aCollection
 	^self copy addAll: aCollection; yourself
+!
+
+copyWithoutAll: aCollection
+	"Answer a copy of the receiver that does not contain any elements 
+	equal to those in aCollection."
+
+	^ self reject: [:each | aCollection includes: each]
 ! !
 
 !Collection methodsFor: 'enumerating'!
@@ -1793,7 +1800,7 @@ reversed
 !
 
 asJavaScriptSelector
-	<return String(self.replace(/^_/, '').replace(/_.*/, ''))>
+	^(self asSelector replace: '^_' with: '') replace: '_.*' with: ''.
 ! !
 
 !String methodsFor: 'copying'!
@@ -2838,6 +2845,17 @@ arguments
 	^arguments
 ! !
 
+!Message methodsFor: 'printing'!
+
+printString
+	^ String streamContents: [:aStream|  
+                                  				aStream 
+                                  					nextPutAll: super printString;
+                                  					nextPutAll: '(';
+                                  					nextPutAll: selector;
+                                  					nextPutAll: ')' 				]
+! !
+
 !Message class methodsFor: 'instance creation'!
 
 selector: aString arguments: anArray
@@ -2973,7 +2991,7 @@ doesNotUnderstand: aMessage
 	selector := aMessage selector.
 	jsSelector := selector asJavaScriptSelector.
 	arguments := aMessage arguments.
-	<if(obj[jsSelector]) {return smalltalk.send(obj, jsSelector, arguments)}>.
+	<if(obj[jsSelector] !!= undefined) {return smalltalk.send(obj, jsSelector, arguments)}>.
 	super doesNotUnderstand: aMessage
 ! !
 

+ 0 - 958
st/TrySmalltalk.st

@@ -1,958 +0,0 @@
-Widget subclass: #TrySmalltalkWidget
-	instanceVariableNames: 'workspace contents header'
-	category: 'TrySmalltalk'!
-
-!TrySmalltalkWidget methodsFor: 'accessing'!
-
-workspace
-	^ workspace ifNil: [
-          	workspace := SourceArea new]
-!
-
-contents: aString
-	self workspace val: aString
-!
-
-contents
-	^self workspace val
-!
-
-setTitle: aString
-	header contents: [:html | html with: aString]
-! !
-
-!TrySmalltalkWidget methodsFor: 'rendering'!
-
-renderOn: html
-	html div 
-		class: 'profStef'; 
-		with: [header := html h2];
-		with: [self workspace renderOn: html];
-		with: [self renderButtonsOn: html].
-          ProfStef default 
-		widget: self;
-		showCurrentLesson
-!
-
-renderButtonsOn: html
-    html button
-	with: 'DoIt';
-	title: 'ctrl+d';
-	onClick: [self workspace doIt].
-    html button
-	with: 'PrintIt';
-	title: 'ctrl+p';
-	onClick: [self workspace printIt].
-    html button
-	with: 'InspectIt';
-	title: 'ctrl+i';
-	onClick: [self workspace inspectIt]
-! !
-
-Object subclass: #AbstractTutorial
-	instanceVariableNames: ''
-	category: 'TrySmalltalk'!
-!AbstractTutorial commentStamp!
-Parent class of all ProfStef tutorials.
-
-To create your own tutorial:
-- subclass AbstractTutorial
-- implement a few methods which returns a Lesson instance
-- implement tutorial which returns a Collection of selectors to the methods you've created.!
-
-!AbstractTutorial methodsFor: 'accessing'!
-
-indexOfLesson: aSelector
-	^self tableOfContents indexOf: aSelector.
-!
-
-tableOfContents
-^ #(
-  'welcome'
-  'testLesson'
-  'theEnd'
-)
-!
-
-lessonAt: anInteger
-	| lessonSelector |
-	lessonSelector := self tableOfContents at: anInteger.
-	^ self perform: lessonSelector.
-!
-
-size
-	^ self tableOfContents size
-! !
-
-!AbstractTutorial methodsFor: 'pages'!
-
-welcome
-	^ Lesson
-		title: 'Welcome' 
-		contents: '"Hi, this is a test tutorial."'
-!
-
-testLesson
-	^ Lesson
-		title: 'Test Lesson' 
-		contents: '"This lesson is a test"'
-!
-
-theEnd
-	^ Lesson
-		title: 'The End' 
-		contents: '"And that''d be pretty much it :)"'
-! !
-
-Object subclass: #Lesson
-	instanceVariableNames: 'title contents'
-	category: 'TrySmalltalk'!
-
-!Lesson methodsFor: 'accessing'!
-
-contents
-	^ contents ifNil: [contents := '']
-!
-
-contents: aString
-	contents := aString
-!
-
-title: aString
-	title := aString
-!
-
-title
-	^ title ifNil: [title := '']
-! !
-
-!Lesson class methodsFor: 'instance creation'!
-
-title: aTitle contents: someContents
-	^ (self new)
-		title: aTitle;
-		contents: someContents
-! !
-
-Object subclass: #TutorialPlayer
-	instanceVariableNames: 'tutorialPosition tutorial'
-	category: 'TrySmalltalk'!
-!TutorialPlayer commentStamp!
-I can navigate through an AbstractTutorial subclass. With #next and #previous you can go forward and backward through the tutorial.!
-
-!TutorialPlayer methodsFor: 'accessing'!
-
-currentLesson
-	^ self tutorial lessonAt: self tutorialPosition.
-!
-
-size
-	^ self tutorial size
-!
-
-tutorial
-	^ tutorial  ifNil: [tutorial := SmalltalkSyntaxTutorial new]
-!
-
-tutorial: aTutorial
-	tutorial := aTutorial
-!
-
-tutorialPosition 
-	^ tutorialPosition  ifNil: [
-		self rewind.
-		tutorialPosition.
-	].
-!
-
-tutorialPosition: aTutorialPosition 
-	tutorialPosition := aTutorialPosition
-! !
-
-!TutorialPlayer methodsFor: 'navigation'!
-
-first
-	self rewind.
-	^ self currentLesson
-!
-
-last
-	tutorialPosition := self size.
-	^ self currentLesson
-!
-
-next
-	self tutorialPosition < self size
-		ifTrue: [tutorialPosition := tutorialPosition + 1].
-	^ self currentLesson
-!
-
-previous
-	tutorialPosition >  1 ifTrue: [tutorialPosition := tutorialPosition  - 1].
-	^ self currentLesson
-!
-
-rewind
-	tutorialPosition := 1.
-! !
-
-Object subclass: #ProfStef
-	instanceVariableNames: 'tutorialPlayer widget'
-	category: 'TrySmalltalk'!
-!ProfStef commentStamp!
-A ProfStef is the Smalltalk teacher. To start the tutorial, evaluate:
-ProfStef go.
-
-To go to the next lesson evaluate:
-ProfStef next.
-
-To execute your own tutorial:
-ProfStef goOn: MyOwnTutorial
-
-To see a table of contents with all defined tutorials:
-ProfStef contents!
-
-!ProfStef methodsFor: 'accessing'!
-
-tutorialPlayer
-	^ tutorialPlayer ifNil: [tutorialPlayer := TutorialPlayer new]
-!
-
-progress
-	^ '(', self tutorialPositionString, '/', self tutorialSizeString, ')'.
-!
-
-tutorialPositionString
-	^ self tutorialPlayer tutorialPosition asString.
-!
-
-tutorialSizeString
-	^ self tutorialPlayer size asString
-!
-
-widget: aWidget
-	widget := aWidget
-!
-
-showCurrentLesson
-	| lesson |
-	lesson := self tutorialPlayer currentLesson.
-	widget contents: lesson contents.
-	widget setTitle: lesson title , ' ' , self progress.
-! !
-
-!ProfStef methodsFor: 'navigation'!
-
-first
-	self tutorialPlayer first.
-	^ self showCurrentLesson.
-!
-
-next
-	self tutorialPlayer next.
-	^ self showCurrentLesson.
-!
-
-previous
-	self tutorialPlayer previous.
-	^ self showCurrentLesson.
-! !
-
-ProfStef class instanceVariableNames: 'instance'!
-
-!ProfStef class methodsFor: 'initialize'!
-
-default 
-	^ instance ifNil: [instance := self new]
-! !
-
-!ProfStef class methodsFor: 'navigation'!
-
-first
-	^ self default first.
-!
-
-previous
-	^ self default previous.
-!
-
-next
-	^ self default next.
-!
-
-go
-	self first.
-! !
-
-AbstractTutorial subclass: #SmalltalkSyntaxTutorial
-	instanceVariableNames: ''
-	category: 'TrySmalltalk'!
-!SmalltalkSyntaxTutorial commentStamp!
-The default ProfStef tutorial to learn Smalltalk syntax!
-
-!SmalltalkSyntaxTutorial methodsFor: 'contents'!
-
-tableOfContents
-^ #(	'welcome'
-	'doingVSPrinting'
-	'printing'
-
-	'basicTypesNumbers'
-	"'basicTypesCharacters'"
-	'basicTypesString'
-	"'basicTypesSymbol'"
-	'basicTypesArray'
-	'basicTypesDynamicArray'
-
-	'messageSyntaxUnary'
-	'messageSyntaxBinary'
-	'messageSyntaxKeyword'
-	'messageSyntaxExecutionOrder'
-	'messageSyntaxExecutionOrderParentheses'
-	'mathematicalPrecedence'
-	'messageSyntaxCascade'
-	'messageSyntaxCascadeShouldNotBeHere'
-
-	'blocks'
-	'blocksAssignation'
-	'conditionals'
-	'loops'
-	'iterators'
-
-	'instanciation'
-
-	'reflection'
-	'reflectionContinued'
-	"'pharoEnvironment'"
-
-	"'debugger'"
-	'theEnd' )
-! !
-
-!SmalltalkSyntaxTutorial methodsFor: 'pages'!
-
-basicTypesArray
-	^ Lesson
-title: 'Basic types: Array' 
-contents: 
-'"Literal arrays are created at parse time:"
-
-#(1 2 3).
-
-#( 1 2 3 #(4 5 6)) size.
-
-#(1 2 4) isEmpty.
-
-#(1 2 3) first.
-
-#(''hello'' ''Javascript'') at: 2 put: ''Smalltalk''; yourself.
-
-ProfStef next.'
-!
-
-basicTypesCharacters
-	^ Lesson
-title: 'Basic types: Characters' 
-contents: 
-'"A Character can be instantiated using $ operator:"
-
-$A.
-
-$A class.
-
-$B charCode.
-
-Character cr.
-
-Character space.
-
-"You can print all 256 characters of the ASCII extended set:"
-
-Character allByteCharacters.
-
-ProfStef next.'
-!
-
-basicTypesDynamicArray
-	^ Lesson
-title: 'Basic types: Dynamic Array' 
-contents: 
-'"Dynamic Arrays are created at execution time:"
-
-{ (2+3) . (6*6) }.
-
-{ (2+3) . (6*6) . ''hello'', '' Stef''} size.
-
-
-{ ProfStef } first next.'
-!
-
-basicTypesNumbers
-	^ Lesson
-title: 'Basic types: Numbers' 
-contents: 
-'"You now know how to execute Smalltalk code. 
-
-Now let''s talk about basic objects.
-
-1, 2, 100, 2/3 ... are Numbers, and respond to many messages evaluating mathematical expressions.
-Evaluate these ones:"
-
-2.
-
-(1/3).
-
-(1/3) + (4/5).
-
-(18/5) rounded.
-
-1 class.
-
-1 negated.
-
-1 negated negated.
-
-(1 + 3) odd.
-
-ProfStef next.'
-!
-
-basicTypesString
-	^ Lesson
-title: 'Basic types: Strings' 
-contents: 
-'"A String is a collection of characters. Use single quotes to create a String object. Print these expressions:"
-
-''ProfStef''.
-
-''ProfStef'' size.
-
-''abc'' asUppercase.
-
-''Hello World'' reversed. 
-
-"You can access each character using at: message"
-
-''ProfStef'' at: 1.
-
-"String concatenation uses the comma operator:"
-
-''ProfStef'', '' is cool''.
-
-ProfStef next.'
-!
-
-basicTypesSymbol
-	^ Lesson
-title: 'Basic types: Symbols' 
-contents: 
-'"A Symbol is a String which is guaranteed to be globally unique. 
-
-There is one and only one Symbol #ProfStef. There may be several ''ProfStef'' String objects.
-
-(Message == returns true if the two objects are the SAME)"
-
-''ProfStef'' asSymbol.
-
-#ProfStef asString.
-
-(2 asString) == (2 asString).
-
-(2 asString) asSymbol == (2 asString) asSymbol.
-
-
-(Smalltalk at: #ProfStef) next.'
-!
-
-blocks
-	^ Lesson
-title: 'Blocks' 
-contents: 
-'"Cascade is cool !! Let''s talk about blocks.
-
-Blocks are anonymous methods that can be stored into variables and executed on demand.
-
-Blocks are delimited by square brackets: []"
-
-[Transcript open].
-
-"does not open a Transcript because the block is not executed.
-
-Here is a block that adds 2 to its argument (its argument is named x):"
-
-[:x | x+2].
-
-"We can execute a block by sending it value messages."
-
-[:x | x+2] value: 5.
-
-[Transcript open] value.
-
-[:x | x+2] value: 10.
-
-[:x :y| x + y] value:3 value:5.
-
-[ProfStef next] value.'
-!
-
-blocksAssignation
-	^ Lesson
-title: 'Block assignation' 
-contents: 
-'"Blocks can be assigned to a variable then executed later.
-
-Note that |b| is the declaration of a variable named ''b'' and that '':='' assigns a value to a variable.
-
-Select the three lines then Print It:"
-
-|b|
-b := [:x | x+2].
-b value: 12.
-
-
-ProfStef next.'
-!
-
-conditionals
-	^ Lesson
-title: 'Conditionals' 
-contents: 
-'"Conditionals are just messages sent to Boolean objects"
-
-1 < 2
-  ifTrue: [100]
-  ifFalse: [42].
-
-"Here the message is ifTrue:ifFalse
-
-Try this:"
-
-Transcript open.
-
-3 > 10 
-	ifTrue: [Transcript show: ''maybe there''''s a bug ....'']
-	ifFalse: [Transcript show: ''No : 3 is less than 10''].
-
-3 = 3 ifTrue: [ProfStef next].'.
-!
-
-debugger
-	^ Lesson
-title: 'Debugger' 
-contents: '"The Debugger may be the most famous tool of Smalltalk environments. It will open as soon as an unmanaged Exception occurs. 
-
-The following code will open the debugger.
-
-***This should be rethought completely***"
-
-
- '
-!
-
-doingVSPrinting 
-	^ Lesson
-title: 'Doing VS Printing: Doing' 
-contents: 
-'"Cool !! (I like to say Cooool :) ). You''ve just executed a Smalltalk expression. More precisely, you sent the message ''next'' to
-ProfStef class (it''s me !!).
-
-Note you can run this tutorial again by evaluating: ''ProfStef go''. 
-''ProfStef previous'' returns to the previous lesson.
-
-You can also Do It using the keyboard shortcut ''CTRL d''
-
-Try to evaluate this expression:"
-
-window alert: ''hello world!!''.
-
-"Then go to the next lesson:"
-
-ProfStef next.'
-!
-
-instanciation
-	^ Lesson
-title: 'Instanciation' 
-contents: 
-'"Objects are instances of their class. Usually, we send the message #new to a class for creating an instance of this class.
-
-For example, let''s create an instance of the class Array:"
-
-Array new
-	add: ''Some text'';
-	add: 3.;
-	yourself.
-
-"See the array we''ve created? Actually, #(''Some text'' 3) is just a shorthand for instantiating arrays."
-
-"If we use a variable to keep track of this object, we''ll be able to do stuff with it."
-
-"The following code must be ran all at one, as the ''anArray'' variable will cease to exist once the execution finishes:"
-
-|anArray|
-
-anArray := Array new
-	add: ''Some text'';
-	add: 3;
-	yourself;
-
-Transcript show: anArray; cr.
-
-anArray remove: 3.
-
-Transcript show: anArray; cr.
-
-anArray add: ''Some more text!!''.
-
-Transcript show: anArray; cr.
-	
-"I''ll put myself in an instance of a class named Dictionary and go to the next lesson:"
-
-((Dictionary new add: (''move on!!'' -> ProfStef)) at: ''move on!!'') next'
-!
-
-iterators
-	^ Lesson
-title: 'Iterators' 
-contents: 
-'"The message do: is sent to a collection of objects (Array, Dictionary, String, etc), evaluating the block for each element.
-
-Here we want to print all the numbers on the Transcript (a console)"
-
-#(11 38 3 -2 10) do: [:each |
-     Transcript show: each printString; cr].
-
-"Some other really nice iterators"
-
-#(11 38 3 -2 10) collect: [:each | each negated].
-
-#(11 38 3 -2 10) collect: [:each | each odd].
-
-#(11 38 3 -2 10) select: [:each | each odd].
-
-#(11 38 3 -2 10) select: [:each | each > 10].
-
-#(11 38 3 -2 10) reject: [:each | each > 10].
-
-#(11 38 3 -2 10) 
-     do: [:each | Transcript show: each printString]
-     separatedBy: [Transcript show: ''.''].
-
-
-(Smalltalk current classes select: [:eachClass | eachClass name = ''ProfStef'']) do: [:eachProfstef | eachProfstef next].'
-!
-
-loops
-	^ Lesson
-title: 'Loops' 
-contents: 
-'"Loops are high-level collection iterators, implemented as regular methods."
-
-"Basic loops:
-  to:do:
-  to:by:do"
-
-1 to: 100 do:
-  [:i | Transcript show: i asString; cr ].
-
-1 to: 100 by: 3 do: [:i | Transcript show: i asString; cr].
-
-100 to: 0 by: -2 do: 
-    [:i | Transcript show: i asString; cr].
-
-1 to: 1 do: [:i | ProfStef next].'
-!
-
-mathematicalPrecedence
-	^ Lesson
-title: 'Mathematical precedence'
-contents: 
-'"Traditional precedence rules from mathematics do not follow in Smalltalk."
-
-2 * 10 + 2.
-
-"Here the message * is sent to 2, which answers 20, then 20 receive the message +
-
-Remember that all messages always follow a simple left-to-right precedence rule, * without exceptions *."
-
-2 + 2 * 10.
-
-2 + (2 * 10).
-
-8 - 5 / 2.
-
-(8 - 5) / 2.
-
-8 - (5 / 2).
-
-ProfStef next.'
-!
-
-messageSyntaxBinary
-	^ Lesson
-title: 'Message syntax: Binary messages' 
-contents: 
-'"Binary messages have the following form:
-    anObject + anotherObject"
-
-3 * 2.
-
-Date today year = 2011.
-
-false | false.
-
-true & true.
-
-true & false.
-
-10 @ 100.
-
-10 <= 12.
-
-''ab'', ''cd''.
-
-ProfStef next.'
-!
-
-messageSyntaxCascade
-	^ Lesson
-title: 'Message syntax: Cascade' 
-contents: 
-'"; is the cascade operator. It''s useful to send message to the SAME receiver
-Open a Transcript (console):"
-
-Transcript open.
-
-"Then:"
-
-Transcript show: ''hello''.
-Transcript show: ''Smalltalk''.
-Transcript cr.
-
-"is equivalent to:"
-
-Transcript 
-	   show: ''hello'';
-	   show: ''Smalltalk'' ;
-	   cr.
-
-"You can close the development tools by clicking on the red circle with a cross at the bottom left of the website.
-Try to go to the next lesson with a cascade of two ''next'' messages:"
-
-ProfStef'.
-!
-
-messageSyntaxCascadeShouldNotBeHere
-	^ Lesson
-title: 'Lost ?' 
-contents: 
-'"Hey, you should not be here !!!! 
-
-Go back and use a cascade !!"
-
-ProfStef previous.'.
-!
-
-messageSyntaxExecutionOrder
-	^ Lesson
-title: 'Message syntax: Execution order' 
-contents: 
-'"Unary messages are executed first, then binary messages and finally keyword messages:
-    Unary > Binary > Keywords"
-
-2.5 + 3.8 rounded.
-
-3 max: 2 + 2.
-  
-(0@0) class.
-
-0@0 x: 100.
-
-(0@0 x: 100) class.
-
-"Between messages of similar precedence, expressions are executed from left to right"
-
--12345 negated asString reversed.
-
-ProfStef next.'
-!
-
-messageSyntaxExecutionOrderParentheses
-	^ Lesson
-title: 'Message syntax: Parentheses'
-contents: 
-'"Use parentheses to change order of evaluation"
-
-(2.5 + 3.8) rounded.
-
-(3 max: 2) + 2.
-
-ProfStef next.'
-!
-
-messageSyntaxKeyword
-	^ Lesson
-title: 'Message syntax: Keyword messages' 
-contents: 
-'"Keyword Messages are messages with arguments. They have the following form:
-    anObject akey: anotherObject akey2: anotherObject2"
-
-''Web development is a good deal of pain'' copyFrom: 1 to: 30
-
-"The message is copyFrom:to: sent to the String ''Web development is a good deal of pain''"
-
-1 max: 3.
-
-Array with: ''hello'' with: 2 with: Smalltalk.
-
-"The message is with:with:with: implemented on class Array. Note you can also write"
-
-Array
-	with: ''Hi there!!''
-	with: 2
-	with: Smalltalk.
-	
-ProfStef perform: ''next''.'
-!
-
-messageSyntaxUnary
-	^ Lesson
-title: 'Message syntax: Unary messages' 
-contents: 
-'"Messages are sent to objects. There are three types of message: Unary, Binary and Keyword.
-
-Unary messages have the following form:
-    anObject aMessage 
-
-You''ve already sent unary messages. For example:"
-
-1 class.
-
-false not.
-
-Date today.
-
-Number pi.
-
-"And of course: "
-
-ProfStef next.'
-!
-
-pharoEnvironment
-	^ Lesson
-title: 'Pharo environment' 
-contents: 
-'"Every Smalltalk system is full of objects. There are windows, text, numbers, dates, colors, points and much more. You can interact with objects in a much more direct way than is possible with other programming languages.
-
-Every object understands the message ''explore''. As a result, you get an Explorer window that shows details about the object."
-
-Date today explore.
-
-"This shows that the date object consists of a point in time (start) and a duration (one day long)."
-
-ProfStef explore.
-
-"You see, ProfStef class has a lot of objects. Let''s take a look at my code:"
-
-ProfStef browse.
-
-ProfStef next.'
-!
-
-printing 
-	^ Lesson
-title: 'Doing VS Printing: Printing' 
-contents: 
-'"Now you''re a Do It master !! Let''s talk about printing. It''s a Do It which prints the result next to the expression you''ve selected.
-For example, select the text below, and click on ''PrintIt'':"
-
-1 + 2.
-
-"As with ''DoIt'', there is also a shortcut to execute this command.
-
-Try CTRL-p on the following expressions:"
-
-Date today.
-
-"The result is selected, so you can erase it using the backspace key. Try it !!"
-
-Date today asDateString.
-
-Date today asTimeString.
-
-ProfStef next.'
-!
-
-reflection
-	^ Lesson
-title: 'Reflection' 
-contents: 
-'"You can inspect and change the system at runtime.
-
-Take a look at the source code of the method #and: of the class Boolean:"
-
-(Boolean methodDictionary at: ''and:'') source.
-
-"Or all the methods it sends:"
-
-(Boolean methodDictionary at: ''and:'') messageSends.
-
-"Here''s all the methods I implement:"
-
-ProfStef methodDictionary.
-
-"Let''s create a new method to go to the next lesson:"
-
-|newMethod|
-newMethod := Compiler new load: ''goToNextLesson ProfStef next.'' forClass: ProfStef.
-ProfStef class addCompiledMethod: newMethod
-
-"Wow!! I can''t wait to use my new method!!"
-
-ProfStef goToNextLesson.'
-!
-
-reflectionContinued
-	^ Lesson
-title: 'Reflection continued' 
-contents: 
-'"So cool, isn''t it ?  Before going further, let''s remove this method:"
-
-ProfStef class methodAt: #goToNextLesson.
-
-ProfStef class removeCompiledMethod: (ProfStef class methodAt: #goToNextLesson).
-
-ProfStef class methodAt: #goToNextLesson.
-
-
-"Then move forward:"
-
-ProfStef perform:#next'
-!
-
-theEnd
-	^ Lesson
-title: 'Tutorial done !!' 
-contents: 
-'"This tutorial is done. Enjoy programming Smalltalk with JTalk. 
-
-You can run this tutorial again by evaluating: ProfStef go.
-
-See you soon !!"
-'
-!
-
-welcome
-	^ Lesson
-title: 'Welcome' 
-contents: 
-' "Hello!! I''m Professor Stef. 
-
-You must want me to help you learn Smalltalk.
-
-So let''s go to the first lesson.  Select the text below and click on the ''DoIt'' button"
-
-ProfStef next.'
-! !
-

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