Browse Source

merge upstream + add tests

Laurent Laffont 12 years ago
parent
commit
88162e6b73
54 changed files with 1452 additions and 3295 deletions
  1. 1 1
      bin/nodecompile.js
  2. 2 1
      bin/server
  3. 1 1
      css/amber.css
  4. 295 0
      css/style.css
  5. 16 0
      examples/myproject/index.html
  6. 4 4
      examples/webos/helloamber/EnyoAmber.st
  7. 11 11
      examples/webos/helloamber/HelloAmber.st
  8. 0 0
      examples/webos/helloamber/Makefile
  9. 0 0
      examples/webos/helloamber/README
  10. 2 2
      examples/webos/helloamber/appinfo.json
  11. 3 0
      examples/webos/helloamber/depends.js
  12. 2 2
      examples/webos/helloamber/index.html
  13. 0 0
      examples/webos/hellojtalk/HelloJtalk.css
  14. 0 4
      examples/webos/hellojtalk/depends.js
  15. BIN
      images/amber.png
  16. BIN
      images/background_box.png
  17. BIN
      images/background_header.png
  18. BIN
      images/balloon_header.png
  19. 96 78
      index.html
  20. 8 8
      js/Benchfib.deploy.js
  21. 8 8
      js/Benchfib.js
  22. 53 20
      js/Canvas.deploy.js
  23. 91 43
      js/Canvas.js
  24. 16 16
      js/Compiler.deploy.js
  25. 23 23
      js/Compiler.js
  26. 18 16
      js/Examples.deploy.js
  27. 30 28
      js/Examples.js
  28. 26 26
      js/IDE.deploy.js
  29. 34 34
      js/IDE.js
  30. 0 39
      js/JQuery-Tests.deploy.js
  31. 0 54
      js/JQuery-Tests.js
  32. 0 826
      js/JQuery.deploy.js
  33. 0 1197
      js/JQuery.js
  34. 40 11
      js/Kernel-Tests.deploy.js
  35. 51 12
      js/Kernel-Tests.js
  36. 48 26
      js/Kernel.deploy.js
  37. 76 44
      js/Kernel.js
  38. 4 4
      js/SUnit.deploy.js
  39. 4 4
      js/SUnit.js
  40. 0 3
      js/amber.js
  41. 16 2
      js/boot.js
  42. 0 10
      scripts/compile.js
  43. 0 27
      scripts/jtalk
  44. 46 46
      server/FileServer.js
  45. 269 165
      server/server.js
  46. 25 14
      st/Canvas.st
  47. 22 12
      st/Compiler.st
  48. 11 9
      st/Examples.st
  49. 34 27
      st/IDE.st
  50. 0 34
      st/JQuery-Tests.st
  51. 0 390
      st/JQuery.st
  52. 24 2
      st/Kernel-Tests.st
  53. 36 0
      st/Kernel.st
  54. 6 11
      st/Makefile

+ 1 - 1
bin/nodecompile.js

@@ -1,4 +1,4 @@
-// NOTE: This code is called using the jtalkc bash script - do not use directly.
+// NOTE: This code is called using the amberc bash script - do not use directly.
 // The arguments variable is a series of .st filenames and category names.
 // If it is a .st file we import it, if it is a category name we export it
 // as aCategoryName.js.

+ 2 - 1
bin/server

@@ -1,2 +1,3 @@
 #!/bin/bash
-node server/server.js
+cd `dirname $0`/..
+node ./server/server.js

+ 1 - 1
css/amber.css

@@ -459,7 +459,7 @@ body.jtalkBody {
 
 /* SUnit TestRunner  */
 
-.jtalkTool .jt_column.sunit.categories,
+.jtalkTool .jt_column.sunit.packages,
 .jtalkTool .jt_column.sunit.classes {
 	height: 100%
 }

+ 295 - 0
css/style.css

@@ -0,0 +1,295 @@
+/* CSS Reset */
+
+html,body {
+	margin: 0;
+	padding: 0;
+	font: 14px "Helvetica Neue", "Lucida Grande", "Lucida Sans Unicode", Helvetica, Arial, sans-serif;
+	line-height: 1.5;
+	color: #444;
+}
+
+/* Layout */
+
+.clear {clear:both}
+
+#header {
+    margin: 60px auto;
+    margin-bottom: 20px;
+}
+
+#header .main {
+    text-align: center;
+}
+
+.teaser {
+    background: #eee;
+    border: 3px solid #ccc;
+    border-left: 0;
+    border-right: 0;
+    padding: 20px;
+    margin-bottom: 50px;
+}
+
+#tabs {
+    list-type: none;
+    position: absolute;
+    top: 0;
+    right: 0;
+    padding-right: 20px;
+}
+
+#tabs li {
+    margin: 0 5px;
+    display: inline;
+}
+
+a {
+    text-decoration: none;
+    color: #613823;
+}
+
+a:hover {
+    text-decoration: underline;
+}
+
+a.selected {
+    text-decoration: underline;
+    color: #444;
+}
+
+	
+.main {
+	width: 900px;
+	margin: 0 auto;
+}
+
+
+.column {
+    float: left;
+    width: 440px;
+    margin-right: 10px;
+}
+
+
+/* Fonts */
+
+h1, h2, h3 {
+    font-family: 'Istok Web';
+    font-weight: normal;
+    color: #442905;
+    line-height: 1.2;
+}
+
+h1 {
+    font-weight: bold;
+    color: #333;
+    text-shadow: 0px 1px 1px #FFF;
+}
+
+.teaser h1 {
+    text-align: center;
+}
+
+.box {
+    margin: 40px 0;
+    color: #777;
+}
+
+.box.doc {
+    margin-top: 70px;
+    position: relative;
+    width: 630px;
+}
+
+.box .content .warning,
+.box .content .information {
+    position: absolute;
+    right: -250px;
+    margin-top: 20px;
+    width: 200px;
+    font-size: 14px;
+    color: #222;
+    font-family: arial,helevetica,sans;
+    padding: 10px;
+    opacity: 0.7;
+    -moz-transition: opacity 0.3s;
+    -webkit-transition: opacity 0.3s;
+    -o-transition: opacity 0.3s;
+}
+
+.box .content .warning:hover,
+.box .content .information:hover {
+    opacity: 1;
+}
+
+.box .content .information:before,
+.box .content .warning:before {
+    font-family: Georgia, sans-serif;
+    font-size: 28px;
+    font-style: italic;
+    position: absolute;
+    right: 0;
+    top: -21px;
+    opacity: 0.5;
+}
+
+.box .content .information:before {
+    content: "Info";
+    color: #a6b1f3;
+}
+
+.box .content .warning:before {
+    content: "Warning";
+    color: #e869e7;
+}
+
+.box .content .information {
+    background-color: #e4e8ff;
+}    
+
+.box .content .warning {
+    background-color: #f8ccf8;
+}
+
+.box .content .code {
+	background: #565656;
+	border-radius: 10px;
+	-moz-border-radius: 10px;
+	-webkit-border-radius: 10px;
+	padding: 7px;
+}
+
+.box .content .code p {
+	color: white;
+}
+
+.box.first .content .left ul {
+	padding-left: 10px;
+}
+
+.box.last .content .right {
+    width: 300px;
+}
+
+.doc .box.first .content .right {
+	float: right;
+	width: 230px;
+	margin-top: 20px;
+	padding: 10px;
+	background-color: #ececec;
+	border: 1px solid #e1e1e1;
+	border-radius: 10px;
+	-moz-border-radius: 10px;
+	-webkit-border-radius: 10px;
+}
+
+.doc .box.first .content .right ol, 
+.doc .box.first .content .right ol a {
+	color: #03388a;
+}
+
+.doc .box.first .content .right ol {
+	padding: 0 0 7px 35px;
+}
+
+.doc .box.first .content .right ol li{
+	padding: 7px 0 7px 0; 
+}
+
+.doc .box.first .content .right ul a {
+	font: 15px Helvetica, Arial, sans;
+	color: black;
+}
+
+.doc .box.first .content .right ul li {
+	list-style-type: none;
+	padding: 2px 0 2px 0;
+}
+
+.trysmalltalk {
+    text-align: right;
+    padding: 10px;
+}
+
+.trysmalltalk textarea {
+    width: 850px;
+    height: 300px;
+    padding: 20px;
+    background-color: #eaeaea;
+    border: 1px solid #d3d3d3;
+    border-radius: 10px;
+    -moz-border-radius: 10px;
+    -webkit-border-radius: 10px;
+    font: 16px monaco, courier, monospace;
+    color: 434343;
+    line-height: 1.6em;
+}
+
+.trysmalltalk button {
+    margin: 20px 0 0 5px;
+    padding: 4px;
+    background: #75aef5;
+    border: 1px solid #7caeed;
+    border-radius: 8px;
+    -moz-border-radius: 8px;
+    -webkit-border-radius: 8px;
+    color: white;
+    cursor: pointer;
+}
+
+.trysmalltalk .print-it {
+	background: #bebebe;
+	border: 1px solid #b2b2b2;
+}
+
+.trysmalltalk button:hover {
+	background: #3180e1;
+	border: 1px solid #518cd6; 
+}
+
+#counters {
+    border: 2px dashed;
+    text-align: center;
+    padding: 10px;
+    margin: 10px;
+    background: #ffffcc;
+    font-family: arial,helvetica,sans;
+}
+
+#counters h1 {
+    margin: 10px;
+    color: #333;
+}
+
+
+.trysmalltalk .print-it:hover {
+	background: #898989;
+	border: 1px solid #919293; 
+}
+
+#footer {
+	height: 200px;
+	border: 1px solid #ccc;
+	background: #f3f3f3 url('../images/mosquito.png') 50px 20px no-repeat;
+	margin: 0 auto;
+}
+
+#footer .main {
+	padding-top: 10px;
+}
+
+#footer p {
+	text-align: center;
+	line-height: 1em;
+	color: #aaa;
+}
+
+#footer a {
+	color: #3faae1;
+	text-decoration: none;
+}
+
+#footer a:hover {
+	text-decoration: underline;
+}
+

+ 16 - 0
examples/myproject/index.html

@@ -0,0 +1,16 @@
+<html>
+<head>
+<title>My Project</title>
+<script src="../../js/amber.js" type="text/javascript"></script>
+</head>
+<body>
+<script type="text/javascript"> 
+	loadAmber({
+		files: ['Banana.js'],
+		prefix: 'examples/myproject/js',
+		ready: function() {
+			smalltalk.Browser._open();
+		}}); 
+</script>
+</body>
+</html>

+ 4 - 4
examples/webos/hellojtalk/EnyoJtalk.st → examples/webos/helloamber/EnyoAmber.st

@@ -1,11 +1,11 @@
-"This is a base class for Jtalk Enyo UI classes. We keep track of an optional sister kind
+"This is a base class for Amber Enyo UI classes. We keep track of an optional sister kind
 in Enyo and typically an instance of it, or an instance without a kind, called ui.
 
 NOTE: Inheritance of ivars seems broken, I need to use #ui: in subclass to set it"
 
 Object subclass: #EnyoFriend
         instanceVariableNames: 'ui kind'
-        category: 'EnyoJtalk'!
+        category: 'EnyoAmber'!
 
 !EnyoFriend methodsFor: 'accessing'!
 
@@ -28,9 +28,9 @@ kind
 
 !EnyoFriend methodsFor: 'initializing'!
 initialize
-	"We make sure our JS functions can be used transparently from Jtalk,
+	"We make sure our JS functions can be used transparently from Amber,
 	at this moment we do not use it - trying to create Enyo kinds that are
-	at the same time Jtalk classes failed for me."
+	at the same time Amber classes failed for me."
 	super initialize.
 	<this.allowJavaScriptCalls = true>
 ! !

+ 11 - 11
examples/webos/hellojtalk/HelloJtalk.st → examples/webos/helloamber/HelloAmber.st

@@ -1,13 +1,13 @@
-EnyoFriend subclass: #HelloJtalk
+EnyoFriend subclass: #HelloAmber
         instanceVariableNames: 'count popup'
-        category: 'HelloJtalk'!
+        category: 'HelloAmber'!
 
-!HelloJtalk methodsFor: 'accessing'!
+!HelloAmber methodsFor: 'accessing'!
 count
 	^count
 ! !
 
-!HelloJtalk methodsFor: 'actions'!
+!HelloAmber methodsFor: 'actions'!
 buttonClicked
 	count := count + 1.
 	self dollar input setValue: (self dollar input getValue, 'You clicked the button ', count asString, ' times so far').
@@ -21,7 +21,7 @@ popupSelected: value
 	self dollar input setValue: (self dollar input getValue, ' ', value)
 ! !
 
-!HelloJtalk methodsFor: 'initialization'!
+!HelloAmber methodsFor: 'initialization'!
 initialize
 	"Create Enyo stuff and hook in callback blocks calling our action methods,
 	very similar to how Seaside does it.
@@ -32,11 +32,11 @@ initialize
 
 		this['@ivarname']
 
-	We can not easily mix in arbitrary Jtalk expressions in the js code, thus
+	We can not easily mix in arbitrary Amber expressions in the js code, thus
 	we use method temps for holding the blocks instead of embedding the blocks
 	directly. Blocks are js functions which is really neat. And we can use:
 
-		this._jtalkMessage()
+		this._amberMessage()
 
 	to send messages to self for embedding the result."
 
@@ -53,7 +53,7 @@ initialize
 	<props = {
 		kind: 'VFlexBox',
 		components: [
-			{kind: 'PageHeader', content: 'Jtalk Live'},
+			{kind: 'PageHeader', content: 'Amber Live'},
  			{kind: "RowGroup", caption: "Rock on", components: [
 				{kind: 'Input', components: [
 					{kind: 'Button', caption: 'Click me', onclick: 'ablock'}]
@@ -62,10 +62,10 @@ initialize
 		ablock: block}>.
 	self ui: (enyo create: props).
 
-	"If we like we can create a kind for the UI (then the props need a name EnyoHelloJtalk),
+	"If we like we can create a kind for the UI (then the props need a name EnyoHelloAmber),
 	but we do not have to in this case so this is commented out."
 	"self kind: (enyo kind: props).
-	<this['@ui'] = new EnyoHelloJtalk()>"
+	<this['@ui'] = new EnyoHelloAmber()>"
 
 	"This Enyo popup instance is created and held in an ivar for later use."
 	block2 := [:sender :value :old | self popupSelected: value].
@@ -79,7 +79,7 @@ initialize
 	
 ! !
 
-!HelloJtalk class methodsFor: 'initialization'!
+!HelloAmber class methodsFor: 'initialization'!
 initialize
 
 	enyo log: 'Class initialized'

+ 0 - 0
examples/webos/hellojtalk/Makefile → examples/webos/helloamber/Makefile


+ 0 - 0
examples/webos/hellojtalk/README → examples/webos/helloamber/README


+ 2 - 2
examples/webos/hellojtalk/appinfo.json → examples/webos/helloamber/appinfo.json

@@ -1,10 +1,10 @@
 {
-	"id": "jtalk.hellojtalk",
+	"id": "jtalk.helloamber",
 	"version": "1.0.0",
 	"vendor": "Krampe Dynamic Development",
 	"type": "web",
 	"main": "index.html",
-	"title": "Enyo Hello Jtalk",
+	"title": "Enyo Hello Amber",
 	"icon": "icon.png",
 	"uiRevision": 2
 }

+ 3 - 0
examples/webos/helloamber/depends.js

@@ -0,0 +1,3 @@
+enyo.depends(
+	"Program.js"
+);

+ 2 - 2
examples/webos/hellojtalk/index.html → examples/webos/helloamber/index.html

@@ -1,12 +1,12 @@
 <!doctype html>
 <html>
 <head>
-	<title>Enyo Jtalk HelloWorld</title>
+	<title>Enyo Amber HelloWorld</title>
 	<script src="../../../../enyo/1.0/framework/enyo.js" type="text/javascript"></script>
 </head>
 <body>
 <script type="text/javascript">
-	smalltalk.HelloJtalk._new()._ui().renderInto(document.body);
+	smalltalk.HelloAmber._new()._ui().renderInto(document.body);
 </script>
 </body>
 </html>

+ 0 - 0
examples/webos/hellojtalk/HelloJtalk.css


+ 0 - 4
examples/webos/hellojtalk/depends.js

@@ -1,4 +0,0 @@
-enyo.depends(
-	"Program.js",
-	"HelloJtalk.css"
-);

BIN
images/amber.png


BIN
images/background_box.png


BIN
images/background_header.png


BIN
images/balloon_header.png


+ 96 - 78
index.html

@@ -1,83 +1,101 @@
-<!DOCTYPE html>
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-    <title>Amber Smalltalk</title>
-    
-    <meta name="author" content="Nicolas Petton">
-    <link rel="stylesheet" type="text/css" href="./ide/style.css">
-    <script type="text/javascript" src="./js/amber.js"></script>
-  </head>
-  <body>
-    <script type="text/javascript">
-      loadAmber();
-    </script>
-    <script type="text/javascript">
-      jQuery(window).scroll(function() {
-      	if(jQuery(window).scrollTop() > 210) {
-		jQuery('#menu')
-      			.css('position', 'fixed')
-			.css('top', '0px')
-	} else {
-      		jQuery('#menu')
-			.css('position', 'absolute')
-      			.css('top', '210px')
-      	}
-      });
-    </script>
 
+<!DOCTYPE html> 
+<html> 
+  <head> 
+    <title>Amber Smalltalk</title> 
+    <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
+    <meta name="author" content="Nicolas Petton" /> 
+    <link rel="stylesheet" type="text/css" href='css/style.css' /> 
+    <link type="image/x-icon" rel="shortcut icon" href="/favicon.ico"/> 
+    <link href='http://fonts.googleapis.com/css?family=Istok+Web' rel='stylesheet' type='text/css'> 
+    <script type='text/javascript' src='js/amber.js'></script> 
+  </head> 
+  <body> 
+    
     <a href="http://github.com/NicolasPetton/amber"><img style="position: absolute; top: 0; lef
-t: 0; border: 0;" src="./ide/fork_me.png" alt="Fork me on GitHub"></a>
-
-    <div id="wrapper">
-      <div id="header">
-	<div class="main">
-	  <img alt="Jtalk, the Smalltalk for web developers" src="./ide/text_header.png">
-	</div>
-      </div>
-      
-      <div id="menu">
-	<div class="main">
-	  <ul>
-	    <li><a href="http://jtalk-project.org/index.html">Overview</a></li> · 
-	    <li><a href="http://jtalk-project.org/index.html#download">Download</a></li> · 
-	    <li><a id="doc_link" href="http://jtalk-project.org/documentation.html">Documentation</a></li> ·
-	    <li><a target="_blank" href="https://github.com/NicolasPetton/jtalk">Source</a></li> 
-	  </ul>
-	</div>
-      </div>
-
-      <div id="content">
-	<div class="main">
-	  <div class="box first">
-  <div class="content">
-    <h1><img alt="Jtalk is an implementation of the Smalltalk language that runs on the JavaScript runtime." src="./ide/title_container1.png"></h1>
-    <div class="left">
-      <p>Jtalk is an implementation of the  <a href="http://en.wikipedia.org/wiki/Smalltalk">Smalltalk</a> language that runs on top of the <a href="http://en.wikipedia.org/wiki/Javascript">JavaScript</a> runtime. It is designed to make client-side development faster and easier.</p>
-      <p>Jtalk is written in itself, including the parser and compiler. Jtalk compiles into efficient JavaScript, mapping one-to-one with the equivalent JavaScript. There is no interpretation at runtime.</p>
-      <p>Try a <button onclick="smalltalk.Browser._open()"> Class browser</button> right now!</p>
-			<p>You may want to look at sample applications:
-			<ul>
-			  <li><a href="examples/trysmalltalk/index.html">Try Smalltalk in your web browser</a></li>
-				<li><a href="examples/presentation/index.html">JTalk slides</a></li>
-			</ul>
-			</p>
-    </div>
-    <div class="right"><img src="./ide/screen2.png"></div>
-    <div class="clear"></div>
-  </div>
-</div>
-
-	</div>
-      </div>
+								t: 0; border: 0;" src="https://assets.github.com/img/bec6c51521dcc8148146135149fe06a9cc737577?repo=&url=http%3A%2F%2Fs3.amazonaws.com%2Fgithub%2Fribbons%2Fforkme_left_darkblue_121621.png&path=" alt="Fork me on GitHub"></a> 
     
-    <div id="footer">
-      <div class="main">
-	<p>Copyright © 2011 <a href="http://www.nicolas-petton.fr/">Nicolas Petton</a>. The content of this website in licensed under <a href="http://creativecommons.org/licenses/by-nc/3.0/">CC-BY-NC 3.0</a>.</p>
-	<p>Jtalk is an opensource project sponsored by <a href="http://www.objectfusion.fr/">objectfusion</a>.</p>
-	<p>The design of this website was provided by <a href="mailto:neomie.thirion@gmail.com">Noémie Thirion</a>.</p>
+    <div id="wrapper"> 
+      
+      <div id="header"> 
+	<div class="main"> 
+	  <div class="logo"> 
+	    <img src="images/amber.png"/> 
+	  </div> 
+	  
+	  <ul id="tabs"> 
+	    <li><a target="_blank" href="http://amber-lang.net/index.html">Overview</a></li> · 
+	    <li><a target="_blank" href="http://amber-lang.net/index.html#download">Download</a></li> · 
+	    <li><a target="_blank" href="http://amber-lang.net/learn.html">Learn</a></li> ·
+	    <li><a target="_blank" href="http://amber-lang.net/documentation.html">Documentation</a></li> ·
+	    <li><a target="_blank" target="_blank" href="https://github.com/NicolasPetton/amber">Source</a></li> 
+	  </ul> 
+	  
+	  <div class="clear"></div> 
+	  
+	</div> 
       </div> 
-    </div>
+      
+      <div class="teaser"> 
+	<div class="main"> 
+	  <h1>Welcome aboard!</h1> 
+	  <div class="column">
+	    <h2>What is Amber?</h2>
+	    <p>Amber, formerly known as Jtalk, is an implementation of the Smalltalk-80 language. It is designed to make client-side development faster and easier. It allows developers to write client-side heavy web applications in Smalltalk. </p> 
+	    <p>Amber includes an integrated development environment with a class browser, workspace, transcript, object inspector and debugger.</p> 
+	    <p>Amber is written in itself, including the compiler, and compiles into efficient JavaScript, mapping one-to-one with the JS equivalent.</p> 
+	    <h2>Give it a try!</h2>
+	    <p><b>Try a <button onClick="smalltalk.Browser._open()"> Class browser</button> right now!</b></p> 
+	  </div> 
+	  <div class="column">
+	    <h2>Don't know Smalltalk yet?</h2>
+	    <p>No problem! You can learn it online with <a href="http://amber-lang.net/learn.html">ProfStef</a></p>
+	    <h2>Join the community</h2>
+	    <ul>
+	      <li><a href="http://amber-lang.net">Amber's website</a></li>
+	      <li><a href="https://github.com/NicolasPetton/amber/wiki">Wiki on GitHub</a></li>
+	      <li><a href="http://groups.google.com/group/amber-lang">Mailing list</a></li>
+	      <li>Join us on IRC at #amber-lang on Freenode</li>
+	    </ul>
+	  </div>
+	  <div class="clear"></div> 
+	</div> 
+	
+	
+      </div> 
+      
+      <div id="content"> 
+	<div class="main"> 
+	  <div class="box"> 
+	    <h2>Client-side usage</h2> 
+	    <div class="content"> 
+	      <p>Load the full Amber Smalltalk environment with the IDE in your page:</p> 
+	      
+	      <code><pre>&lt;script src="js/amber.js" type="text/javascript"&gt;&lt;/script&gt;
+&lt;script type="text/javascript"&gt; loadAmber()&lt;/script&gt;</pre></code>
+	    </div> 
+	    
+	    
+	    <p>Or the deployment JavaScript file only (without the Smalltalk sources, parser, compiler and IDE):</p>
+	    <code><pre>&lt;script src="js/amber.js" type="text/javascript"&gt;&lt;/script&gt;
+&lt;script type="text/javascript"&gt; loadAmber({deploy: true})&lt;/script&gt;</pre></code>
+	  </div> 
+	  
+	  <div class="box last"> 
+	    <h2 id="download">Examples</h2> 
+	    <div class="content"> 
+	      <ul>
+		<li><a href="examples/trysmalltalk/index.html">ProfStef tutorial</a></li>
+		<li><a href="examples/presentation/index.html">Presentation at ESUG 2011</a></li>
+	      </ul>
+	    </div> 
+	  </div> 
+	  
+	</div> 
+      </div> 
+    </div> 
     
-  
-
-
-</div></body></html>
+    <script type='text/javascript'> loadAmber() </script> 
+    
+  </body> 
+</html> 

+ 8 - 8
js/Benchfib.deploy.js

@@ -20,7 +20,7 @@ smalltalk.method({
 selector: 'benchFib',
 fn: function (){
 var self=this;
-return (($receiver = self < (2)).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (1);})() : (function(){return (($receiver = (($receiver = smalltalk.send(self - (1), "_benchFib", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(self - (2), "_benchFib", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(self - (2), "_benchFib", [])])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (1);}), (function(){return (($receiver = (($receiver = smalltalk.send(self - (1), "_benchFib", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(self - (2), "_benchFib", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(self - (2), "_benchFib", [])])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})]);
+return ((($receiver = self < (2)).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (1);})() : (function(){return ((($receiver = ((($receiver = smalltalk.send(self - (1), "_benchFib", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(self - (2), "_benchFib", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(self - (2), "_benchFib", [])]))).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (1);}), (function(){return ((($receiver = ((($receiver = smalltalk.send(self - (1), "_benchFib", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(self - (2), "_benchFib", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(self - (2), "_benchFib", [])]))).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));})]));
 return self;}
 }),
 smalltalk.Number);
@@ -37,7 +37,7 @@ var prime=nil;
 var k=nil;
 var count=nil;
 size=(8190);
-smalltalk.send((1), "_to_do_", [self, (function(iter){count=(0);flags=smalltalk.send((smalltalk.Array || Array), "_new", []);smalltalk.send(size, "_timesRepeat_", [(function(){return smalltalk.send(flags, "_add_", [true]);})]);return smalltalk.send((1), "_to_do_", [size, (function(i){return (($receiver = smalltalk.send(flags, "_at_", [i])).klass === smalltalk.Boolean) ? ($receiver ? (function(){prime=(($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);k=(($receiver = i).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]);(function(){while((function(){return (($receiver = k).klass === smalltalk.Number) ? $receiver <=size : smalltalk.send($receiver, "__lt_eq", [size]);})()) {(function(){smalltalk.send(flags, "_at_put_", [k, false]);return k=(($receiver = k).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]);})()}})();return count=(($receiver = count).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){prime=(($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);k=(($receiver = i).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]);(function(){while((function(){return (($receiver = k).klass === smalltalk.Number) ? $receiver <=size : smalltalk.send($receiver, "__lt_eq", [size]);})()) {(function(){smalltalk.send(flags, "_at_put_", [k, false]);return k=(($receiver = k).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]);})()}})();return count=(($receiver = count).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})]);})]);})]);
+smalltalk.send((1), "_to_do_", [self, (function(iter){count=(0);flags=smalltalk.send((smalltalk.Array || Array), "_new", []);smalltalk.send(size, "_timesRepeat_", [(function(){return smalltalk.send(flags, "_add_", [true]);})]);return smalltalk.send((1), "_to_do_", [size, (function(i){return ((($receiver = smalltalk.send(flags, "_at_", [i])).klass === smalltalk.Boolean) ? ($receiver ? (function(){prime=((($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));k=((($receiver = i).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]));(function(){while((function(){return ((($receiver = k).klass === smalltalk.Number) ? $receiver <=size : smalltalk.send($receiver, "__lt_eq", [size]));})()) {(function(){smalltalk.send(flags, "_at_put_", [k, false]);return k=((($receiver = k).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]));})()}})();return count=((($receiver = count).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){prime=((($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));k=((($receiver = i).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]));(function(){while((function(){return ((($receiver = k).klass === smalltalk.Number) ? $receiver <=size : smalltalk.send($receiver, "__lt_eq", [size]));})()) {(function(){smalltalk.send(flags, "_at_put_", [k, false]);return k=((($receiver = k).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]));})()}})();return count=((($receiver = count).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));})]));})]);})]);
 return count;
 return self;}
 }),
@@ -55,10 +55,10 @@ var r=nil;
 var n1=nil;
 var n2=nil;
 n1=(1);
-(function(){while((function(){t1=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return smalltalk.send(n1, "_benchmark", []);})]);return (($receiver = t1).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]);})()) {(function(){return n1=(($receiver = n1).klass === smalltalk.Number) ? $receiver *(2) : smalltalk.send($receiver, "__star", [(2)]);})()}})();
+(function(){while((function(){t1=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return smalltalk.send(n1, "_benchmark", []);})]);return ((($receiver = t1).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]));})()) {(function(){return n1=((($receiver = n1).klass === smalltalk.Number) ? $receiver *(2) : smalltalk.send($receiver, "__star", [(2)]));})()}})();
 n2=(16);
-(function(){while((function(){t2=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return r=smalltalk.send(n2, "_benchFib", []);})]);return (($receiver = t2).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]);})()) {(function(){return n2=(($receiver = n2).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})()}})();
-return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send((($receiver = (($receiver = (($receiver = n1).klass === smalltalk.Number) ? $receiver *(500000) : smalltalk.send($receiver, "__star", [(500000)])).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)])).klass === smalltalk.Number) ? $receiver /t1 : smalltalk.send($receiver, "__slash", [t1]), "_printString", []), "__comma", [unescape("%20bytecodes/sec%3B%20")]), "__comma", [smalltalk.send((($receiver = (($receiver = r).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)])).klass === smalltalk.Number) ? $receiver /t2 : smalltalk.send($receiver, "__slash", [t2]), "_printString", [])]), "__comma", [unescape("%20sends/sec")]);
+(function(){while((function(){t2=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return r=smalltalk.send(n2, "_benchFib", []);})]);return ((($receiver = t2).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]));})()) {(function(){return n2=((($receiver = n2).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));})()}})();
+return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(((($receiver = ((($receiver = ((($receiver = n1).klass === smalltalk.Number) ? $receiver *(500000) : smalltalk.send($receiver, "__star", [(500000)]))).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)]))).klass === smalltalk.Number) ? $receiver /t1 : smalltalk.send($receiver, "__slash", [t1])), "_printString", []), "__comma", [unescape("%20bytecodes/sec%3B%20")]), "__comma", [smalltalk.send(((($receiver = ((($receiver = r).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)]))).klass === smalltalk.Number) ? $receiver /t2 : smalltalk.send($receiver, "__slash", [t2])), "_printString", [])]), "__comma", [unescape("%20sends/sec")]);
 return self;}
 }),
 smalltalk.Number);
@@ -121,10 +121,10 @@ var r=nil;
 var n1=nil;
 var n2=nil;
 n1=(1);
-(function(){while((function(){t1=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return smalltalk.send(n1, "_jsbenchmark", []);})]);return (($receiver = t1).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]);})()) {(function(){return n1=(($receiver = n1).klass === smalltalk.Number) ? $receiver *(2) : smalltalk.send($receiver, "__star", [(2)]);})()}})();
+(function(){while((function(){t1=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return smalltalk.send(n1, "_jsbenchmark", []);})]);return ((($receiver = t1).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]));})()) {(function(){return n1=((($receiver = n1).klass === smalltalk.Number) ? $receiver *(2) : smalltalk.send($receiver, "__star", [(2)]));})()}})();
 n2=(28);
-(function(){while((function(){t2=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return r=smalltalk.send(n2, "_jsbenchFib", []);})]);return (($receiver = t2).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]);})()) {(function(){return n2=(($receiver = n2).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})()}})();
-return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send((($receiver = (($receiver = (($receiver = n1).klass === smalltalk.Number) ? $receiver *(500000) : smalltalk.send($receiver, "__star", [(500000)])).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)])).klass === smalltalk.Number) ? $receiver /t1 : smalltalk.send($receiver, "__slash", [t1]), "_printString", []), "__comma", [unescape("%20bytecodes/sec%3B%20")]), "__comma", [smalltalk.send((($receiver = (($receiver = r).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)])).klass === smalltalk.Number) ? $receiver /t2 : smalltalk.send($receiver, "__slash", [t2]), "_printString", [])]), "__comma", [unescape("%20sends/sec")]);
+(function(){while((function(){t2=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return r=smalltalk.send(n2, "_jsbenchFib", []);})]);return ((($receiver = t2).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]));})()) {(function(){return n2=((($receiver = n2).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));})()}})();
+return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(((($receiver = ((($receiver = ((($receiver = n1).klass === smalltalk.Number) ? $receiver *(500000) : smalltalk.send($receiver, "__star", [(500000)]))).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)]))).klass === smalltalk.Number) ? $receiver /t1 : smalltalk.send($receiver, "__slash", [t1])), "_printString", []), "__comma", [unescape("%20bytecodes/sec%3B%20")]), "__comma", [smalltalk.send(((($receiver = ((($receiver = r).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)]))).klass === smalltalk.Number) ? $receiver /t2 : smalltalk.send($receiver, "__slash", [t2])), "_printString", [])]), "__comma", [unescape("%20sends/sec")]);
 return self;}
 }),
 smalltalk.Number);

+ 8 - 8
js/Benchfib.js

@@ -26,7 +26,7 @@ selector: unescape('benchFib'),
 category: '*Benchfib',
 fn: function (){
 var self=this;
-return (($receiver = self < (2)).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (1);})() : (function(){return (($receiver = (($receiver = smalltalk.send(self - (1), "_benchFib", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(self - (2), "_benchFib", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(self - (2), "_benchFib", [])])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (1);}), (function(){return (($receiver = (($receiver = smalltalk.send(self - (1), "_benchFib", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(self - (2), "_benchFib", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(self - (2), "_benchFib", [])])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})]);
+return ((($receiver = self < (2)).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (1);})() : (function(){return ((($receiver = ((($receiver = smalltalk.send(self - (1), "_benchFib", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(self - (2), "_benchFib", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(self - (2), "_benchFib", [])]))).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (1);}), (function(){return ((($receiver = ((($receiver = smalltalk.send(self - (1), "_benchFib", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(self - (2), "_benchFib", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(self - (2), "_benchFib", [])]))).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));})]));
 return self;},
 args: [],
 source: unescape('benchFib%20%0A%09%22Handy%20send-heavy%20benchmark%22%0A%09%22%28result%20//%20seconds%20to%20run%29%20%3D%20approx%20calls%20per%20second%22%0A%09%22%20%7C%20r%20t%20%7C%0A%09%20%20t%20%3A%3D%20Time%20millisecondsToRun%3A%20%5Br%20%3A%3D%2026%20benchFib%5D.%0A%09%20%20%28r%20*%201000%29%20//%20t%22%0A%09%22138000%20on%20a%20Mac%208100/100%22%0A%09%5E%20self%20%3C%202%20%0A%09%09ifTrue%3A%20%5B1%5D%20%0A%09%09ifFalse%3A%20%5B%28self-1%29%20benchFib%20+%20%28self-2%29%20benchFib%20+%201%5D'),
@@ -48,7 +48,7 @@ var prime=nil;
 var k=nil;
 var count=nil;
 size=(8190);
-smalltalk.send((1), "_to_do_", [self, (function(iter){count=(0);flags=smalltalk.send((smalltalk.Array || Array), "_new", []);smalltalk.send(size, "_timesRepeat_", [(function(){return smalltalk.send(flags, "_add_", [true]);})]);return smalltalk.send((1), "_to_do_", [size, (function(i){return (($receiver = smalltalk.send(flags, "_at_", [i])).klass === smalltalk.Boolean) ? ($receiver ? (function(){prime=(($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);k=(($receiver = i).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]);(function(){while((function(){return (($receiver = k).klass === smalltalk.Number) ? $receiver <=size : smalltalk.send($receiver, "__lt_eq", [size]);})()) {(function(){smalltalk.send(flags, "_at_put_", [k, false]);return k=(($receiver = k).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]);})()}})();return count=(($receiver = count).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){prime=(($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);k=(($receiver = i).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]);(function(){while((function(){return (($receiver = k).klass === smalltalk.Number) ? $receiver <=size : smalltalk.send($receiver, "__lt_eq", [size]);})()) {(function(){smalltalk.send(flags, "_at_put_", [k, false]);return k=(($receiver = k).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]);})()}})();return count=(($receiver = count).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})]);})]);})]);
+smalltalk.send((1), "_to_do_", [self, (function(iter){count=(0);flags=smalltalk.send((smalltalk.Array || Array), "_new", []);smalltalk.send(size, "_timesRepeat_", [(function(){return smalltalk.send(flags, "_add_", [true]);})]);return smalltalk.send((1), "_to_do_", [size, (function(i){return ((($receiver = smalltalk.send(flags, "_at_", [i])).klass === smalltalk.Boolean) ? ($receiver ? (function(){prime=((($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));k=((($receiver = i).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]));(function(){while((function(){return ((($receiver = k).klass === smalltalk.Number) ? $receiver <=size : smalltalk.send($receiver, "__lt_eq", [size]));})()) {(function(){smalltalk.send(flags, "_at_put_", [k, false]);return k=((($receiver = k).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]));})()}})();return count=((($receiver = count).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){prime=((($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));k=((($receiver = i).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]));(function(){while((function(){return ((($receiver = k).klass === smalltalk.Number) ? $receiver <=size : smalltalk.send($receiver, "__lt_eq", [size]));})()) {(function(){smalltalk.send(flags, "_at_put_", [k, false]);return k=((($receiver = k).klass === smalltalk.Number) ? $receiver +prime : smalltalk.send($receiver, "__plus", [prime]));})()}})();return count=((($receiver = count).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));})]));})]);})]);
 return count;
 return self;},
 args: [],
@@ -71,10 +71,10 @@ var r=nil;
 var n1=nil;
 var n2=nil;
 n1=(1);
-(function(){while((function(){t1=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return smalltalk.send(n1, "_benchmark", []);})]);return (($receiver = t1).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]);})()) {(function(){return n1=(($receiver = n1).klass === smalltalk.Number) ? $receiver *(2) : smalltalk.send($receiver, "__star", [(2)]);})()}})();
+(function(){while((function(){t1=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return smalltalk.send(n1, "_benchmark", []);})]);return ((($receiver = t1).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]));})()) {(function(){return n1=((($receiver = n1).klass === smalltalk.Number) ? $receiver *(2) : smalltalk.send($receiver, "__star", [(2)]));})()}})();
 n2=(16);
-(function(){while((function(){t2=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return r=smalltalk.send(n2, "_benchFib", []);})]);return (($receiver = t2).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]);})()) {(function(){return n2=(($receiver = n2).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})()}})();
-return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send((($receiver = (($receiver = (($receiver = n1).klass === smalltalk.Number) ? $receiver *(500000) : smalltalk.send($receiver, "__star", [(500000)])).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)])).klass === smalltalk.Number) ? $receiver /t1 : smalltalk.send($receiver, "__slash", [t1]), "_printString", []), "__comma", [unescape("%20bytecodes/sec%3B%20")]), "__comma", [smalltalk.send((($receiver = (($receiver = r).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)])).klass === smalltalk.Number) ? $receiver /t2 : smalltalk.send($receiver, "__slash", [t2]), "_printString", [])]), "__comma", [unescape("%20sends/sec")]);
+(function(){while((function(){t2=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return r=smalltalk.send(n2, "_benchFib", []);})]);return ((($receiver = t2).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]));})()) {(function(){return n2=((($receiver = n2).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));})()}})();
+return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(((($receiver = ((($receiver = ((($receiver = n1).klass === smalltalk.Number) ? $receiver *(500000) : smalltalk.send($receiver, "__star", [(500000)]))).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)]))).klass === smalltalk.Number) ? $receiver /t1 : smalltalk.send($receiver, "__slash", [t1])), "_printString", []), "__comma", [unescape("%20bytecodes/sec%3B%20")]), "__comma", [smalltalk.send(((($receiver = ((($receiver = r).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)]))).klass === smalltalk.Number) ? $receiver /t2 : smalltalk.send($receiver, "__slash", [t2])), "_printString", [])]), "__comma", [unescape("%20sends/sec")]);
 return self;},
 args: [],
 source: unescape('tinyBenchmarks%20%0A%09%22Report%20the%20results%20of%20running%20the%20two%20tiny%20Squeak%20benchmarks.%0A%09ar%209/10/1999%3A%20Adjusted%20to%20run%20at%20least%201%20sec%20to%20get%20more%20stable%20results%22%0A%09%220%20tinyBenchmarks%22%0A%09%22On%20a%20292%20MHz%20G3%20Mac%3A%2022727272%20bytecodes/sec%3B%20984169%20sends/sec%22%0A%09%22On%20a%20400%20MHz%20PII/Win98%3A%20%2018028169%20bytecodes/sec%3B%201081272%20sends/sec%22%0A%09%7C%20t1%20t2%20r%20n1%20n2%20%7C%0A%09n1%20%3A%3D%201.%0A%09%5Bt1%20%3A%3D%20Date%20millisecondsToRun%3A%20%5Bn1%20benchmark%5D.%0A%09t1%20%3C%201000%5D%20whileTrue%3A%5Bn1%20%3A%3D%20n1%20*%202%5D.%20%22Note%3A%20%23benchmark%27s%20runtime%20is%20about%20O%28n%29%22%0A%0A%09n2%20%3A%3D%2016.%0A%09%5Bt2%20%3A%3D%20Date%20millisecondsToRun%3A%20%5Br%20%3A%3D%20n2%20benchFib%5D.%0A%09t2%20%3C%201000%5D%20whileTrue%3A%5Bn2%20%3A%3D%20n2%20+%201%5D.%20%0A%09%22Note%3A%20%23benchFib%27s%20runtime%20is%20about%20O%28k%5En%29%2C%0A%09%09where%20k%20is%20the%20golden%20number%20%3D%20%281%20+%205%20sqrt%29%20/%202%20%3D%201.618....%22%0A%0A%09%5E%20%28%28n1%20*%20500000%20*%201000%29%20/%20t1%29%20printString%2C%20%27%20bytecodes/sec%3B%20%27%2C%0A%09%20%20%28%28r%20*%201000%29%20/%20t2%29%20printString%2C%20%27%20sends/sec%27'),
@@ -152,10 +152,10 @@ var r=nil;
 var n1=nil;
 var n2=nil;
 n1=(1);
-(function(){while((function(){t1=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return smalltalk.send(n1, "_jsbenchmark", []);})]);return (($receiver = t1).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]);})()) {(function(){return n1=(($receiver = n1).klass === smalltalk.Number) ? $receiver *(2) : smalltalk.send($receiver, "__star", [(2)]);})()}})();
+(function(){while((function(){t1=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return smalltalk.send(n1, "_jsbenchmark", []);})]);return ((($receiver = t1).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]));})()) {(function(){return n1=((($receiver = n1).klass === smalltalk.Number) ? $receiver *(2) : smalltalk.send($receiver, "__star", [(2)]));})()}})();
 n2=(28);
-(function(){while((function(){t2=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return r=smalltalk.send(n2, "_jsbenchFib", []);})]);return (($receiver = t2).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]);})()) {(function(){return n2=(($receiver = n2).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);})()}})();
-return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send((($receiver = (($receiver = (($receiver = n1).klass === smalltalk.Number) ? $receiver *(500000) : smalltalk.send($receiver, "__star", [(500000)])).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)])).klass === smalltalk.Number) ? $receiver /t1 : smalltalk.send($receiver, "__slash", [t1]), "_printString", []), "__comma", [unescape("%20bytecodes/sec%3B%20")]), "__comma", [smalltalk.send((($receiver = (($receiver = r).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)])).klass === smalltalk.Number) ? $receiver /t2 : smalltalk.send($receiver, "__slash", [t2]), "_printString", [])]), "__comma", [unescape("%20sends/sec")]);
+(function(){while((function(){t2=smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [(function(){return r=smalltalk.send(n2, "_jsbenchFib", []);})]);return ((($receiver = t2).klass === smalltalk.Number) ? $receiver <(1000) : smalltalk.send($receiver, "__lt", [(1000)]));})()) {(function(){return n2=((($receiver = n2).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));})()}})();
+return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(((($receiver = ((($receiver = ((($receiver = n1).klass === smalltalk.Number) ? $receiver *(500000) : smalltalk.send($receiver, "__star", [(500000)]))).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)]))).klass === smalltalk.Number) ? $receiver /t1 : smalltalk.send($receiver, "__slash", [t1])), "_printString", []), "__comma", [unescape("%20bytecodes/sec%3B%20")]), "__comma", [smalltalk.send(((($receiver = ((($receiver = r).klass === smalltalk.Number) ? $receiver *(1000) : smalltalk.send($receiver, "__star", [(1000)]))).klass === smalltalk.Number) ? $receiver /t2 : smalltalk.send($receiver, "__slash", [t2])), "_printString", [])]), "__comma", [unescape("%20sends/sec")]);
 return self;},
 args: [],
 source: unescape('jstinyBenchmarks%0A%09%220%20jstinyBenchmarks%22%0A%0A%09%7C%20t1%20t2%20r%20n1%20n2%20%7C%0A%09n1%20%3A%3D%201.%0A%09%5Bt1%20%3A%3D%20Date%20millisecondsToRun%3A%20%5Bn1%20jsbenchmark%5D.%0A%09t1%20%3C%201000%5D%20whileTrue%3A%5Bn1%20%3A%3D%20n1%20*%202%5D.%20%22Note%3A%20%23benchmark%27s%20runtime%20is%20about%20O%28n%29%22%0A%0A%09n2%20%3A%3D%2028.%0A%09%5Bt2%20%3A%3D%20Date%20millisecondsToRun%3A%20%5Br%20%3A%3D%20n2%20jsbenchFib%5D.%0A%09t2%20%3C%201000%5D%20whileTrue%3A%5Bn2%20%3A%3D%20n2%20+%201%5D.%20%0A%09%22Note%3A%20%23jsbenchFib%27s%20runtime%20is%20about%20O%28k%5En%29%2C%0A%09%09where%20k%20is%20the%20golden%20number%20%3D%20%281%20+%205%20sqrt%29%20/%202%20%3D%201.618....%22%0A%0A%09%5E%20%28%28n1%20*%20500000%20*%201000%29%20/%20t1%29%20printString%2C%20%27%20bytecodes/sec%3B%20%27%2C%0A%09%20%20%28%28r%20*%201000%29%20/%20t2%29%20printString%2C%20%27%20sends/sec%27'),

+ 53 - 20
js/Canvas.deploy.js

@@ -679,18 +679,7 @@ smalltalk.method({
 selector: 'asJQuery',
 fn: function (){
 var self=this;
-return smalltalk.JQuery._from_(jQuery(self['@element']));
-return self;}
-}),
-smalltalk.TagBrush);
-
-smalltalk.addMethod(
-'_asJQueryDo_',
-smalltalk.method({
-selector: 'asJQueryDo:',
-fn: function (aBlock){
-var self=this;
-smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_asJQuery", [])]);
+return smalltalk.send((typeof window == 'undefined' ? nil : window), "_jQuery_", [smalltalk.send(self, "_element", [])]);
 return self;}
 }),
 smalltalk.TagBrush);
@@ -701,7 +690,7 @@ smalltalk.method({
 selector: 'onKeyDown:',
 fn: function (aBlock){
 var self=this;
-smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_on_do_", ["keydown", aBlock]);
+smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_bind_do_", ["keydown", aBlock]);
 return self;}
 }),
 smalltalk.TagBrush);
@@ -712,7 +701,7 @@ smalltalk.method({
 selector: 'onKeyPress:',
 fn: function (aBlock){
 var self=this;
-smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_on_do_", ["keypress", aBlock]);
+smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_bind_do_", ["keypress", aBlock]);
 return self;}
 }),
 smalltalk.TagBrush);
@@ -723,7 +712,7 @@ smalltalk.method({
 selector: 'onKeyUp:',
 fn: function (aBlock){
 var self=this;
-smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_on_do_", ["keyup", aBlock]);
+smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_bind_do_", ["keyup", aBlock]);
 return self;}
 }),
 smalltalk.TagBrush);
@@ -734,7 +723,7 @@ smalltalk.method({
 selector: 'onFocus:',
 fn: function (aBlock){
 var self=this;
-smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_on_do_", ["focus", aBlock]);
+smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_bind_do_", ["focus", aBlock]);
 return self;}
 }),
 smalltalk.TagBrush);
@@ -745,7 +734,7 @@ smalltalk.method({
 selector: 'onBlur:',
 fn: function (aBlock){
 var self=this;
-smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_on_do_", ["blur", aBlock]);
+smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_bind_do_", ["blur", aBlock]);
 return self;}
 }),
 smalltalk.TagBrush);
@@ -756,7 +745,7 @@ smalltalk.method({
 selector: 'onChange:',
 fn: function (aBlock){
 var self=this;
-smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_on_do_", ["change", aBlock]);
+smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_bind_do_", ["change", aBlock]);
 return self;}
 }),
 smalltalk.TagBrush);
@@ -767,7 +756,7 @@ smalltalk.method({
 selector: 'onClick:',
 fn: function (aBlock){
 var self=this;
-smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_on_do_", ["click", aBlock]);
+smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_bind_do_", ["click", aBlock]);
 return self;}
 }),
 smalltalk.TagBrush);
@@ -790,7 +779,7 @@ smalltalk.method({
 selector: 'initializeFromJQuery:canvas:',
 fn: function (aJQuery, aCanvas){
 var self=this;
-self['@element']=smalltalk.send(smalltalk.send(aJQuery, "_jquery", []), "_get_", [(0)]);
+self['@element']=smalltalk.send(aJQuery, "_get_", [(0)]);
 self['@canvas']=aCanvas;
 return self;}
 }),
@@ -922,6 +911,17 @@ smalltalk.Widget);
 
 
 
+smalltalk.addMethod(
+'_appendToJQuery_',
+smalltalk.method({
+selector: 'appendToJQuery:',
+fn: function (aJQuery){
+var self=this;
+smalltalk.send(aJQuery, "_append_", [smalltalk.send(self, "_asString", [])]);
+return self;}
+}),
+smalltalk.Object);
+
 smalltalk.addMethod(
 '_appendToBrush_',
 smalltalk.method({
@@ -933,6 +933,17 @@ return self;}
 }),
 smalltalk.Object);
 
+smalltalk.addMethod(
+'_appendToJQuery_',
+smalltalk.method({
+selector: 'appendToJQuery:',
+fn: function (aJQuery){
+var self=this;
+smalltalk.send(self, "_value_", [smalltalk.send((smalltalk.HTMLCanvas || HTMLCanvas), "_onJQuery_", [aJQuery])]);
+return self;}
+}),
+smalltalk.BlockClosure);
+
 smalltalk.addMethod(
 '_appendToBrush_',
 smalltalk.method({
@@ -944,6 +955,28 @@ return self;}
 }),
 smalltalk.BlockClosure);
 
+smalltalk.addMethod(
+'_asJQuery',
+smalltalk.method({
+selector: 'asJQuery',
+fn: function (){
+var self=this;
+return jQuery(String(self));
+return self;}
+}),
+smalltalk.String);
+
+smalltalk.addMethod(
+'_appendToJQuery_',
+smalltalk.method({
+selector: 'appendToJQuery:',
+fn: function (aJQuery){
+var self=this;
+smalltalk.send(aJQuery, "_append_", [self]);
+return self;}
+}),
+smalltalk.String);
+
 smalltalk.addMethod(
 '_appendToBrush_',
 smalltalk.method({

+ 91 - 43
js/Canvas.js

@@ -980,27 +980,11 @@ selector: unescape('asJQuery'),
 category: 'converting',
 fn: function (){
 var self=this;
-return smalltalk.JQuery._from_(jQuery(self['@element']));
+return smalltalk.send((typeof window == 'undefined' ? nil : window), "_jQuery_", [smalltalk.send(self, "_element", [])]);
 return self;},
 args: [],
-source: unescape('asJQuery%0A%09%3Creturn%20smalltalk.JQuery._from_%28jQuery%28self%5B%27@element%27%5D%29%29%3E'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TagBrush);
-
-smalltalk.addMethod(
-unescape('_asJQueryDo_'),
-smalltalk.method({
-selector: unescape('asJQueryDo%3A'),
-category: 'converting',
-fn: function (aBlock){
-var self=this;
-smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_asJQuery", [])]);
-return self;},
-args: ["aBlock"],
-source: unescape('asJQueryDo%3A%20aBlock%0A%20%20%20%20aBlock%20value%3A%20self%20asJQuery'),
-messageSends: ["value:", "asJQuery"],
+source: unescape('asJQuery%0A%20%20%20%20%5Ewindow%20jQuery%3A%20self%20element'),
+messageSends: ["jQuery:", "element"],
 referencedClasses: []
 }),
 smalltalk.TagBrush);
@@ -1012,11 +996,11 @@ selector: unescape('onKeyDown%3A'),
 category: 'events',
 fn: function (aBlock){
 var self=this;
-smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_on_do_", ["keydown", aBlock]);
+smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_bind_do_", ["keydown", aBlock]);
 return self;},
 args: ["aBlock"],
-source: unescape('onKeyDown%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27keydown%27%20do%3A%20aBlock'),
-messageSends: ["on:do:", "asJQuery"],
+source: unescape('onKeyDown%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20bind%3A%20%27keydown%27%20do%3A%20aBlock'),
+messageSends: ["bind:do:", "asJQuery"],
 referencedClasses: []
 }),
 smalltalk.TagBrush);
@@ -1028,11 +1012,11 @@ selector: unescape('onKeyPress%3A'),
 category: 'events',
 fn: function (aBlock){
 var self=this;
-smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_on_do_", ["keypress", aBlock]);
+smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_bind_do_", ["keypress", aBlock]);
 return self;},
 args: ["aBlock"],
-source: unescape('onKeyPress%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27keypress%27%20do%3A%20aBlock'),
-messageSends: ["on:do:", "asJQuery"],
+source: unescape('onKeyPress%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20bind%3A%20%27keypress%27%20do%3A%20aBlock'),
+messageSends: ["bind:do:", "asJQuery"],
 referencedClasses: []
 }),
 smalltalk.TagBrush);
@@ -1044,11 +1028,11 @@ selector: unescape('onKeyUp%3A'),
 category: 'events',
 fn: function (aBlock){
 var self=this;
-smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_on_do_", ["keyup", aBlock]);
+smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_bind_do_", ["keyup", aBlock]);
 return self;},
 args: ["aBlock"],
-source: unescape('onKeyUp%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27keyup%27%20do%3A%20aBlock'),
-messageSends: ["on:do:", "asJQuery"],
+source: unescape('onKeyUp%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20bind%3A%20%27keyup%27%20do%3A%20aBlock'),
+messageSends: ["bind:do:", "asJQuery"],
 referencedClasses: []
 }),
 smalltalk.TagBrush);
@@ -1060,11 +1044,11 @@ selector: unescape('onFocus%3A'),
 category: 'events',
 fn: function (aBlock){
 var self=this;
-smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_on_do_", ["focus", aBlock]);
+smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_bind_do_", ["focus", aBlock]);
 return self;},
 args: ["aBlock"],
-source: unescape('onFocus%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27focus%27%20do%3A%20aBlock'),
-messageSends: ["on:do:", "asJQuery"],
+source: unescape('onFocus%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20bind%3A%20%27focus%27%20do%3A%20aBlock'),
+messageSends: ["bind:do:", "asJQuery"],
 referencedClasses: []
 }),
 smalltalk.TagBrush);
@@ -1076,11 +1060,11 @@ selector: unescape('onBlur%3A'),
 category: 'events',
 fn: function (aBlock){
 var self=this;
-smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_on_do_", ["blur", aBlock]);
+smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_bind_do_", ["blur", aBlock]);
 return self;},
 args: ["aBlock"],
-source: unescape('onBlur%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27blur%27%20do%3A%20aBlock'),
-messageSends: ["on:do:", "asJQuery"],
+source: unescape('onBlur%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20bind%3A%20%27blur%27%20do%3A%20aBlock'),
+messageSends: ["bind:do:", "asJQuery"],
 referencedClasses: []
 }),
 smalltalk.TagBrush);
@@ -1092,11 +1076,11 @@ selector: unescape('onChange%3A'),
 category: 'events',
 fn: function (aBlock){
 var self=this;
-smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_on_do_", ["change", aBlock]);
+smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_bind_do_", ["change", aBlock]);
 return self;},
 args: ["aBlock"],
-source: unescape('onChange%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27change%27%20do%3A%20aBlock'),
-messageSends: ["on:do:", "asJQuery"],
+source: unescape('onChange%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20bind%3A%20%27change%27%20do%3A%20aBlock'),
+messageSends: ["bind:do:", "asJQuery"],
 referencedClasses: []
 }),
 smalltalk.TagBrush);
@@ -1108,11 +1092,11 @@ selector: unescape('onClick%3A'),
 category: 'events',
 fn: function (aBlock){
 var self=this;
-smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_on_do_", ["click", aBlock]);
+smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_bind_do_", ["click", aBlock]);
 return self;},
 args: ["aBlock"],
-source: unescape('onClick%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27click%27%20do%3A%20aBlock'),
-messageSends: ["on:do:", "asJQuery"],
+source: unescape('onClick%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20bind%3A%20%27click%27%20do%3A%20aBlock'),
+messageSends: ["bind:do:", "asJQuery"],
 referencedClasses: []
 }),
 smalltalk.TagBrush);
@@ -1141,12 +1125,12 @@ selector: unescape('initializeFromJQuery%3Acanvas%3A'),
 category: 'initialization',
 fn: function (aJQuery, aCanvas){
 var self=this;
-self['@element']=smalltalk.send(smalltalk.send(aJQuery, "_jquery", []), "_get_", [(0)]);
+self['@element']=smalltalk.send(aJQuery, "_get_", [(0)]);
 self['@canvas']=aCanvas;
 return self;},
 args: ["aJQuery", "aCanvas"],
-source: unescape('initializeFromJQuery%3A%20aJQuery%20canvas%3A%20aCanvas%0A%20%20%20%20element%20%3A%3D%20aJQuery%20jquery%20get%3A%200.%0A%20%20%20%20canvas%20%3A%3D%20aCanvas'),
-messageSends: ["get:", "jquery"],
+source: unescape('initializeFromJQuery%3A%20aJQuery%20canvas%3A%20aCanvas%0A%20%20%20%20element%20%3A%3D%20aJQuery%20get%3A%200.%0A%20%20%20%20canvas%20%3A%3D%20aCanvas'),
+messageSends: ["get:"],
 referencedClasses: []
 }),
 smalltalk.TagBrush);
@@ -1332,6 +1316,22 @@ smalltalk.Widget);
 
 
 
+smalltalk.addMethod(
+unescape('_appendToJQuery_'),
+smalltalk.method({
+selector: unescape('appendToJQuery%3A'),
+category: '*Canvas',
+fn: function (aJQuery){
+var self=this;
+smalltalk.send(aJQuery, "_append_", [smalltalk.send(self, "_asString", [])]);
+return self;},
+args: ["aJQuery"],
+source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20aJQuery%20append%3A%20self%20asString'),
+messageSends: ["append:", "asString"],
+referencedClasses: []
+}),
+smalltalk.Object);
+
 smalltalk.addMethod(
 unescape('_appendToBrush_'),
 smalltalk.method({
@@ -1348,6 +1348,22 @@ referencedClasses: []
 }),
 smalltalk.Object);
 
+smalltalk.addMethod(
+unescape('_appendToJQuery_'),
+smalltalk.method({
+selector: unescape('appendToJQuery%3A'),
+category: '*Canvas',
+fn: function (aJQuery){
+var self=this;
+smalltalk.send(self, "_value_", [smalltalk.send((smalltalk.HTMLCanvas || HTMLCanvas), "_onJQuery_", [aJQuery])]);
+return self;},
+args: ["aJQuery"],
+source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20self%20value%3A%20%28HTMLCanvas%20onJQuery%3A%20aJQuery%29'),
+messageSends: ["value:", "onJQuery:"],
+referencedClasses: [smalltalk.HTMLCanvas]
+}),
+smalltalk.BlockClosure);
+
 smalltalk.addMethod(
 unescape('_appendToBrush_'),
 smalltalk.method({
@@ -1364,6 +1380,38 @@ referencedClasses: []
 }),
 smalltalk.BlockClosure);
 
+smalltalk.addMethod(
+unescape('_asJQuery'),
+smalltalk.method({
+selector: unescape('asJQuery'),
+category: '*Canvas',
+fn: function (){
+var self=this;
+return jQuery(String(self));
+return self;},
+args: [],
+source: unescape('asJQuery%0A%20%20%20%20%3Creturn%20jQuery%28String%28self%29%29%3E'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.String);
+
+smalltalk.addMethod(
+unescape('_appendToJQuery_'),
+smalltalk.method({
+selector: unescape('appendToJQuery%3A'),
+category: '*Canvas',
+fn: function (aJQuery){
+var self=this;
+smalltalk.send(aJQuery, "_append_", [self]);
+return self;},
+args: ["aJQuery"],
+source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20aJQuery%20append%3A%20self'),
+messageSends: ["append:"],
+referencedClasses: []
+}),
+smalltalk.String);
+
 smalltalk.addMethod(
 unescape('_appendToBrush_'),
 smalltalk.method({

File diff suppressed because it is too large
+ 16 - 16
js/Compiler.deploy.js


File diff suppressed because it is too large
+ 23 - 23
js/Compiler.js


+ 18 - 16
js/Examples.deploy.js

@@ -5,7 +5,7 @@ smalltalk.method({
 selector: 'increase',
 fn: function (){
 var self=this;
-self['@count']=(($receiver = self['@count']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);
+self['@count']=((($receiver = self['@count']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));
 smalltalk.send(self['@header'], "_contents_", [(function(html){return smalltalk.send(html, "_with_", [smalltalk.send(self['@count'], "_asString", [])]);})]);
 return self;}
 }),
@@ -17,7 +17,7 @@ smalltalk.method({
 selector: 'decrease',
 fn: function (){
 var self=this;
-self['@count']=(($receiver = self['@count']).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]);
+self['@count']=((($receiver = self['@count']).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]));
 smalltalk.send(self['@header'], "_contents_", [(function(html){return smalltalk.send(html, "_with_", [smalltalk.send(self['@count'], "_asString", [])]);})]);
 return self;}
 }),
@@ -137,7 +137,7 @@ selector: 'nextStep',
 fn: function (){
 var self=this;
 (($receiver = self['@movingPiece']) == nil || $receiver == undefined) ? (function(){return smalltalk.send(self, "_newPiece", []);})() : $receiver;
-(($receiver = smalltalk.send(self['@movingPiece'], "_canMoveIn_", [self])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@movingPiece'], "_position_", [(($receiver = smalltalk.send(self['@movingPiece'], "_position", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send((0), "__at", [(1)]) : smalltalk.send($receiver, "__plus", [smalltalk.send((0), "__at", [(1)])])]);})() : (function(){return smalltalk.send(self, "_newPiece", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@movingPiece'], "_position_", [(($receiver = smalltalk.send(self['@movingPiece'], "_position", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send((0), "__at", [(1)]) : smalltalk.send($receiver, "__plus", [smalltalk.send((0), "__at", [(1)])])]);}), (function(){return smalltalk.send(self, "_newPiece", []);})]);
+((($receiver = smalltalk.send(self['@movingPiece'], "_canMoveIn_", [self])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@movingPiece'], "_position_", [((($receiver = smalltalk.send(self['@movingPiece'], "_position", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send((0), "__at", [(1)]) : smalltalk.send($receiver, "__plus", [smalltalk.send((0), "__at", [(1)])]))]);})() : (function(){return smalltalk.send(self, "_newPiece", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@movingPiece'], "_position_", [((($receiver = smalltalk.send(self['@movingPiece'], "_position", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send((0), "__at", [(1)]) : smalltalk.send($receiver, "__plus", [smalltalk.send((0), "__at", [(1)])]))]);}), (function(){return smalltalk.send(self, "_newPiece", []);})]));
 smalltalk.send(self, "_redraw", []);
 return self;}
 }),
@@ -149,7 +149,7 @@ smalltalk.method({
 selector: 'redraw',
 fn: function (){
 var self=this;
-smalltalk.send(self['@renderingContext'], "_clearRectFrom_to_", [smalltalk.send((0), "__at", [smalltalk.send(self, "_width", [])]), smalltalk.send((0), "__at", [smalltalk.send(self, "_height", [])])]);
+smalltalk.send(self['@renderingContext'], "_clearRect_y_to_y_", [(0), smalltalk.send(self, "_width", []), (0), smalltalk.send(self, "_height", [])]);
 (function($rec){smalltalk.send($rec, "_drawMap", []);return smalltalk.send($rec, "_drawPiece", []);})(self);
 return self;}
 }),
@@ -161,12 +161,12 @@ smalltalk.method({
 selector: 'drawMap',
 fn: function (){
 var self=this;
-(function($rec){smalltalk.send($rec, "_fillStyle_", [unescape("%23fafafa")]);return smalltalk.send($rec, "_fillRectFrom_to_", [smalltalk.send((0), "__at", [(0)]), smalltalk.send(smalltalk.send(self, "_width", []), "__at", [smalltalk.send(self, "_height", [])])]);})(self['@renderingContext']);
+(function($rec){smalltalk.send($rec, "_fillStyle_", [unescape("%23fafafa")]);return smalltalk.send($rec, "_fillRect_y_to_y_", [(0), (0), smalltalk.send(self, "_width", []), smalltalk.send(self, "_height", [])]);})(self['@renderingContext']);
 (function($rec){smalltalk.send($rec, "_lineWidth_", [(0.5)]);return smalltalk.send($rec, "_strokeStyle_", [unescape("%23999")]);})(self['@renderingContext']);
 smalltalk.send((0), "_to_do_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_squares", []), "_x", []), (function(each){var x=nil;
-x=(($receiver = each).klass === smalltalk.Number) ? $receiver *smalltalk.send(smalltalk.send(self, "_class", []), "_squareSize", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(self, "_class", []), "_squareSize", [])]);return smalltalk.send(self, "_drawLineFrom_to_", [smalltalk.send(x, "__at", [(0)]), smalltalk.send(x, "__at", [smalltalk.send(self, "_height", [])])]);})]);
+x=((($receiver = each).klass === smalltalk.Number) ? $receiver *smalltalk.send(smalltalk.send(self, "_class", []), "_squareSize", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(self, "_class", []), "_squareSize", [])]));return smalltalk.send(self, "_drawLineFrom_to_", [smalltalk.send(x, "__at", [(0)]), smalltalk.send(x, "__at", [smalltalk.send(self, "_height", [])])]);})]);
 smalltalk.send((0), "_to_do_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_squares", []), "_y", []), (function(each){var y=nil;
-y=(($receiver = each).klass === smalltalk.Number) ? $receiver *smalltalk.send(smalltalk.send(self, "_class", []), "_squareSize", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(self, "_class", []), "_squareSize", [])]);return smalltalk.send(self, "_drawLineFrom_to_", [smalltalk.send((0), "__at", [y]), smalltalk.send(smalltalk.send(self, "_width", []), "__at", [y])]);})]);
+y=((($receiver = each).klass === smalltalk.Number) ? $receiver *smalltalk.send(smalltalk.send(self, "_class", []), "_squareSize", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(self, "_class", []), "_squareSize", [])]));return smalltalk.send(self, "_drawLineFrom_to_", [smalltalk.send((0), "__at", [y]), smalltalk.send(smalltalk.send(self, "_width", []), "__at", [y])]);})]);
 return self;}
 }),
 smalltalk.Tetris);
@@ -177,7 +177,7 @@ smalltalk.method({
 selector: 'drawLineFrom:to:',
 fn: function (aPoint, anotherPoint){
 var self=this;
-(function($rec){smalltalk.send($rec, "_beginPath", []);smalltalk.send($rec, "_moveTo_", [aPoint]);smalltalk.send($rec, "_lineTo_", [anotherPoint]);return smalltalk.send($rec, "_stroke", []);})(self['@renderingContext']);
+(function($rec){smalltalk.send($rec, "_beginPath", []);smalltalk.send($rec, "_moveTo_y_", [smalltalk.send(aPoint, "_x", []), smalltalk.send(aPoint, "_y", [])]);smalltalk.send($rec, "_lineTo_y_", [smalltalk.send(anotherPoint, "_x", []), smalltalk.send(anotherPoint, "_y", [])]);return smalltalk.send($rec, "_stroke", []);})(self['@renderingContext']);
 return self;}
 }),
 smalltalk.Tetris);
@@ -263,7 +263,7 @@ var canvas=nil;
 canvas=smalltalk.send(html, "_canvas", []);
 smalltalk.send(canvas, "_at_put_", ["width", smalltalk.send(smalltalk.send(self, "_width", []), "_asString", [])]);
 smalltalk.send(canvas, "_at_put_", ["height", smalltalk.send(smalltalk.send(self, "_height", []), "_asString", [])]);
-self['@renderingContext']=smalltalk.send((smalltalk.CanvasRenderingContext || CanvasRenderingContext), "_tagBrush_", [canvas]);
+self['@renderingContext']=smalltalk.send(smalltalk.send(canvas, "_element", []), "_getContext_", ["2d"]);
 smalltalk.send(self, "_redraw", []);
 return self;}
 }),
@@ -275,7 +275,7 @@ smalltalk.method({
 selector: 'renderButtonsOn:',
 fn: function (html){
 var self=this;
-(function($rec){smalltalk.send($rec, "_class_", ["tetris_buttons"]);return smalltalk.send($rec, "_with_", [(function(){(function($rec){smalltalk.send($rec, "_with_", ["New game"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_startNewGame", []);})]);})(smalltalk.send(html, "_button", []));return (function($rec){smalltalk.send($rec, "_with_", [unescape("play/pause")]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_update", []);})]);})(smalltalk.send(html, "_button", []));})]);})(smalltalk.send(html, "_div", []));
+(function($rec){smalltalk.send($rec, "_class_", ["tetris_buttons"]);return smalltalk.send($rec, "_with_", [(function(){(function($rec){smalltalk.send($rec, "_with_", ["New game"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_startNewGame", []);})]);})(smalltalk.send(html, "_button", []));return (function($rec){smalltalk.send($rec, "_with_", [unescape("play/pause")]);return smalltalk.send($rec, "_onClick_", [(function(){return nil;})]);})(smalltalk.send(html, "_button", []));})]);})(smalltalk.send(html, "_div", []));
 return self;}
 }),
 smalltalk.Tetris);
@@ -298,7 +298,7 @@ smalltalk.method({
 selector: 'width',
 fn: function (){
 var self=this;
-return (($receiver = smalltalk.send(self, "_squareSize", [])).klass === smalltalk.Number) ? $receiver *smalltalk.send(smalltalk.send(self, "_squares", []), "_x", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(self, "_squares", []), "_x", [])]);
+return ((($receiver = smalltalk.send(self, "_squareSize", [])).klass === smalltalk.Number) ? $receiver *smalltalk.send(smalltalk.send(self, "_squares", []), "_x", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(self, "_squares", []), "_x", [])]));
 return self;}
 }),
 smalltalk.Tetris.klass);
@@ -309,7 +309,7 @@ smalltalk.method({
 selector: 'height',
 fn: function (){
 var self=this;
-return (($receiver = smalltalk.send(self, "_squareSize", [])).klass === smalltalk.Number) ? $receiver *smalltalk.send(smalltalk.send(self, "_squares", []), "_y", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(self, "_squares", []), "_y", [])]);
+return ((($receiver = smalltalk.send(self, "_squareSize", [])).klass === smalltalk.Number) ? $receiver *smalltalk.send(smalltalk.send(self, "_squares", []), "_y", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(self, "_squares", []), "_y", [])]));
 return self;}
 }),
 smalltalk.Tetris.klass);
@@ -355,7 +355,7 @@ smalltalk.method({
 selector: 'position',
 fn: function (){
 var self=this;
-return (($receiver = self['@position']) == nil || $receiver == undefined) ? (function(){return smalltalk.send((($receiver = (($receiver = smalltalk.send(smalltalk.send((smalltalk.Tetris || Tetris), "_squares", []), "_x", [])).klass === smalltalk.Number) ? $receiver /(2) : smalltalk.send($receiver, "__slash", [(2)])).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]), "__at", [(0)]);})() : $receiver;
+return (($receiver = self['@position']) == nil || $receiver == undefined) ? (function(){return smalltalk.send(((($receiver = ((($receiver = smalltalk.send(smalltalk.send((smalltalk.Tetris || Tetris), "_squares", []), "_x", [])).klass === smalltalk.Number) ? $receiver /(2) : smalltalk.send($receiver, "__slash", [(2)]))).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), "__at", [(0)]);})() : $receiver;
 return self;}
 }),
 smalltalk.TetrisPiece);
@@ -411,7 +411,9 @@ selector: 'drawOn:',
 fn: function (aRenderingContext){
 var self=this;
 smalltalk.send(aRenderingContext, "_fillStyle_", [smalltalk.send(self, "_color", [])]);
-smalltalk.send(smalltalk.send(self, "_bounds", []), "_do_", [(function(each){return (function($rec){smalltalk.send($rec, "_fillRectFrom_to_", [(($receiver = (($receiver = each).klass === smalltalk.Number) ? $receiver +smalltalk.send(self, "_position", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(self, "_position", [])])).klass === smalltalk.Number) ? $receiver *smalltalk.send((smalltalk.Tetris || Tetris), "_squareSize", []) : smalltalk.send($receiver, "__star", [smalltalk.send((smalltalk.Tetris || Tetris), "_squareSize", [])]), (($receiver = smalltalk.send((1), "__at", [(1)])).klass === smalltalk.Number) ? $receiver *smalltalk.send((smalltalk.Tetris || Tetris), "_squareSize", []) : smalltalk.send($receiver, "__star", [smalltalk.send((smalltalk.Tetris || Tetris), "_squareSize", [])])]);smalltalk.send($rec, "_strokeStyle_", [unescape("%23999")]);smalltalk.send($rec, "_lineWidth_", [(2)]);return smalltalk.send($rec, "_strokeRectFrom_to_", [(($receiver = (($receiver = each).klass === smalltalk.Number) ? $receiver +smalltalk.send(self, "_position", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(self, "_position", [])])).klass === smalltalk.Number) ? $receiver *smalltalk.send((smalltalk.Tetris || Tetris), "_squareSize", []) : smalltalk.send($receiver, "__star", [smalltalk.send((smalltalk.Tetris || Tetris), "_squareSize", [])]), (($receiver = smalltalk.send((1), "__at", [(1)])).klass === smalltalk.Number) ? $receiver *smalltalk.send((smalltalk.Tetris || Tetris), "_squareSize", []) : smalltalk.send($receiver, "__star", [smalltalk.send((smalltalk.Tetris || Tetris), "_squareSize", [])])]);})(aRenderingContext);})]);
+smalltalk.send(smalltalk.send(self, "_bounds", []), "_do_", [(function(each){var from=nil;
+var to=nil;
+from=((($receiver = ((($receiver = each).klass === smalltalk.Number) ? $receiver +smalltalk.send(self, "_position", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(self, "_position", [])]))).klass === smalltalk.Number) ? $receiver *smalltalk.send((smalltalk.Tetris || Tetris), "_squareSize", []) : smalltalk.send($receiver, "__star", [smalltalk.send((smalltalk.Tetris || Tetris), "_squareSize", [])]));to=((($receiver = smalltalk.send((1), "__at", [(1)])).klass === smalltalk.Number) ? $receiver *smalltalk.send((smalltalk.Tetris || Tetris), "_squareSize", []) : smalltalk.send($receiver, "__star", [smalltalk.send((smalltalk.Tetris || Tetris), "_squareSize", [])]));return (function($rec){smalltalk.send($rec, "_fillRect_y_to_y_", [smalltalk.send(from, "_x", []), smalltalk.send(from, "_y", []), smalltalk.send(to, "_x", []), smalltalk.send(to, "_y", [])]);smalltalk.send($rec, "_strokeStyle_", [unescape("%23999")]);smalltalk.send($rec, "_lineWidth_", [(2)]);return smalltalk.send($rec, "_strokeRect_y_to_y_", [smalltalk.send(from, "_x", []), smalltalk.send(from, "_y", []), smalltalk.send(to, "_x", []), smalltalk.send(to, "_y", [])]);})(aRenderingContext);})]);
 return self;}
 }),
 smalltalk.TetrisPiece);
@@ -422,7 +424,7 @@ smalltalk.method({
 selector: 'canMove',
 fn: function (){
 var self=this;
-return (($receiver = smalltalk.send(smalltalk.send(self, "_position", []), "_y", [])).klass === smalltalk.Number) ? $receiver <(($receiver = smalltalk.send(smalltalk.send((smalltalk.Tetris || Tetris), "_squares", []), "_y", [])).klass === smalltalk.Number) ? $receiver -smalltalk.send(self, "_height", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(self, "_height", [])]) : smalltalk.send($receiver, "__lt", [(($receiver = smalltalk.send(smalltalk.send((smalltalk.Tetris || Tetris), "_squares", []), "_y", [])).klass === smalltalk.Number) ? $receiver -smalltalk.send(self, "_height", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(self, "_height", [])])]);
+return ((($receiver = smalltalk.send(smalltalk.send(self, "_position", []), "_y", [])).klass === smalltalk.Number) ? $receiver <((($receiver = smalltalk.send(smalltalk.send((smalltalk.Tetris || Tetris), "_squares", []), "_y", [])).klass === smalltalk.Number) ? $receiver -smalltalk.send(self, "_height", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(self, "_height", [])])) : smalltalk.send($receiver, "__lt", [((($receiver = smalltalk.send(smalltalk.send((smalltalk.Tetris || Tetris), "_squares", []), "_y", [])).klass === smalltalk.Number) ? $receiver -smalltalk.send(self, "_height", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(self, "_height", [])]))]));
 return self;}
 }),
 smalltalk.TetrisPiece);
@@ -433,7 +435,7 @@ smalltalk.method({
 selector: 'canMoveIn:',
 fn: function (aTetris){
 var self=this;
-return (($receiver = smalltalk.send(smalltalk.send(self, "_position", []), "_y", [])).klass === smalltalk.Number) ? $receiver <(($receiver = smalltalk.send(smalltalk.send(aTetris, "_squares", []), "_y", [])).klass === smalltalk.Number) ? $receiver -smalltalk.send(self, "_height", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(self, "_height", [])]) : smalltalk.send($receiver, "__lt", [(($receiver = smalltalk.send(smalltalk.send(aTetris, "_squares", []), "_y", [])).klass === smalltalk.Number) ? $receiver -smalltalk.send(self, "_height", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(self, "_height", [])])]);
+return ((($receiver = smalltalk.send(smalltalk.send(self, "_position", []), "_y", [])).klass === smalltalk.Number) ? $receiver <((($receiver = smalltalk.send(smalltalk.send(aTetris, "_squares", []), "_y", [])).klass === smalltalk.Number) ? $receiver -smalltalk.send(self, "_height", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(self, "_height", [])])) : smalltalk.send($receiver, "__lt", [((($receiver = smalltalk.send(smalltalk.send(aTetris, "_squares", []), "_y", [])).klass === smalltalk.Number) ? $receiver -smalltalk.send(self, "_height", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(self, "_height", [])]))]));
 return self;}
 }),
 smalltalk.TetrisPiece);

+ 30 - 28
js/Examples.js

@@ -6,7 +6,7 @@ selector: unescape('increase'),
 category: 'actions',
 fn: function (){
 var self=this;
-self['@count']=(($receiver = self['@count']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);
+self['@count']=((($receiver = self['@count']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));
 smalltalk.send(self['@header'], "_contents_", [(function(html){return smalltalk.send(html, "_with_", [smalltalk.send(self['@count'], "_asString", [])]);})]);
 return self;},
 args: [],
@@ -23,7 +23,7 @@ selector: unescape('decrease'),
 category: 'actions',
 fn: function (){
 var self=this;
-self['@count']=(($receiver = self['@count']).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]);
+self['@count']=((($receiver = self['@count']).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]));
 smalltalk.send(self['@header'], "_contents_", [(function(html){return smalltalk.send(html, "_with_", [smalltalk.send(self['@count'], "_asString", [])]);})]);
 return self;},
 args: [],
@@ -193,7 +193,7 @@ category: 'actions',
 fn: function (){
 var self=this;
 (($receiver = self['@movingPiece']) == nil || $receiver == undefined) ? (function(){return smalltalk.send(self, "_newPiece", []);})() : $receiver;
-(($receiver = smalltalk.send(self['@movingPiece'], "_canMoveIn_", [self])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@movingPiece'], "_position_", [(($receiver = smalltalk.send(self['@movingPiece'], "_position", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send((0), "__at", [(1)]) : smalltalk.send($receiver, "__plus", [smalltalk.send((0), "__at", [(1)])])]);})() : (function(){return smalltalk.send(self, "_newPiece", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@movingPiece'], "_position_", [(($receiver = smalltalk.send(self['@movingPiece'], "_position", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send((0), "__at", [(1)]) : smalltalk.send($receiver, "__plus", [smalltalk.send((0), "__at", [(1)])])]);}), (function(){return smalltalk.send(self, "_newPiece", []);})]);
+((($receiver = smalltalk.send(self['@movingPiece'], "_canMoveIn_", [self])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@movingPiece'], "_position_", [((($receiver = smalltalk.send(self['@movingPiece'], "_position", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send((0), "__at", [(1)]) : smalltalk.send($receiver, "__plus", [smalltalk.send((0), "__at", [(1)])]))]);})() : (function(){return smalltalk.send(self, "_newPiece", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@movingPiece'], "_position_", [((($receiver = smalltalk.send(self['@movingPiece'], "_position", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send((0), "__at", [(1)]) : smalltalk.send($receiver, "__plus", [smalltalk.send((0), "__at", [(1)])]))]);}), (function(){return smalltalk.send(self, "_newPiece", []);})]));
 smalltalk.send(self, "_redraw", []);
 return self;},
 args: [],
@@ -210,12 +210,12 @@ selector: unescape('redraw'),
 category: 'actions',
 fn: function (){
 var self=this;
-smalltalk.send(self['@renderingContext'], "_clearRectFrom_to_", [smalltalk.send((0), "__at", [smalltalk.send(self, "_width", [])]), smalltalk.send((0), "__at", [smalltalk.send(self, "_height", [])])]);
+smalltalk.send(self['@renderingContext'], "_clearRect_y_to_y_", [(0), smalltalk.send(self, "_width", []), (0), smalltalk.send(self, "_height", [])]);
 (function($rec){smalltalk.send($rec, "_drawMap", []);return smalltalk.send($rec, "_drawPiece", []);})(self);
 return self;},
 args: [],
-source: unescape('redraw%0A%09renderingContext%20clearRectFrom%3A%200@%20self%20width%20to%3A%200@%20self%20height.%0A%09self%20%0A%09%09drawMap%3B%0A%09%09drawPiece'),
-messageSends: ["clearRectFrom:to:", unescape("@"), "width", "height", "drawMap", "drawPiece"],
+source: unescape('redraw%0A%09renderingContext%20clearRect%3A%200%20y%3A%20self%20width%20to%3A%200%20y%3A%20self%20height.%0A%09self%20%0A%09%09drawMap%3B%0A%09%09drawPiece'),
+messageSends: ["clearRect:y:to:y:", "width", "height", "drawMap", "drawPiece"],
 referencedClasses: []
 }),
 smalltalk.Tetris);
@@ -227,16 +227,16 @@ selector: unescape('drawMap'),
 category: 'actions',
 fn: function (){
 var self=this;
-(function($rec){smalltalk.send($rec, "_fillStyle_", [unescape("%23fafafa")]);return smalltalk.send($rec, "_fillRectFrom_to_", [smalltalk.send((0), "__at", [(0)]), smalltalk.send(smalltalk.send(self, "_width", []), "__at", [smalltalk.send(self, "_height", [])])]);})(self['@renderingContext']);
+(function($rec){smalltalk.send($rec, "_fillStyle_", [unescape("%23fafafa")]);return smalltalk.send($rec, "_fillRect_y_to_y_", [(0), (0), smalltalk.send(self, "_width", []), smalltalk.send(self, "_height", [])]);})(self['@renderingContext']);
 (function($rec){smalltalk.send($rec, "_lineWidth_", [(0.5)]);return smalltalk.send($rec, "_strokeStyle_", [unescape("%23999")]);})(self['@renderingContext']);
 smalltalk.send((0), "_to_do_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_squares", []), "_x", []), (function(each){var x=nil;
-x=(($receiver = each).klass === smalltalk.Number) ? $receiver *smalltalk.send(smalltalk.send(self, "_class", []), "_squareSize", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(self, "_class", []), "_squareSize", [])]);return smalltalk.send(self, "_drawLineFrom_to_", [smalltalk.send(x, "__at", [(0)]), smalltalk.send(x, "__at", [smalltalk.send(self, "_height", [])])]);})]);
+x=((($receiver = each).klass === smalltalk.Number) ? $receiver *smalltalk.send(smalltalk.send(self, "_class", []), "_squareSize", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(self, "_class", []), "_squareSize", [])]));return smalltalk.send(self, "_drawLineFrom_to_", [smalltalk.send(x, "__at", [(0)]), smalltalk.send(x, "__at", [smalltalk.send(self, "_height", [])])]);})]);
 smalltalk.send((0), "_to_do_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_squares", []), "_y", []), (function(each){var y=nil;
-y=(($receiver = each).klass === smalltalk.Number) ? $receiver *smalltalk.send(smalltalk.send(self, "_class", []), "_squareSize", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(self, "_class", []), "_squareSize", [])]);return smalltalk.send(self, "_drawLineFrom_to_", [smalltalk.send((0), "__at", [y]), smalltalk.send(smalltalk.send(self, "_width", []), "__at", [y])]);})]);
+y=((($receiver = each).klass === smalltalk.Number) ? $receiver *smalltalk.send(smalltalk.send(self, "_class", []), "_squareSize", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(self, "_class", []), "_squareSize", [])]));return smalltalk.send(self, "_drawLineFrom_to_", [smalltalk.send((0), "__at", [y]), smalltalk.send(smalltalk.send(self, "_width", []), "__at", [y])]);})]);
 return self;},
 args: [],
-source: unescape('drawMap%0A%09renderingContext%20%0A%09%09fillStyle%3A%20%27%23fafafa%27%3B%0A%09%09fillRectFrom%3A%200@0%20to%3A%20self%20width@self%20height.%0A%09renderingContext%20%0A%09%09lineWidth%3A%200.5%3B%0A%09%09strokeStyle%3A%20%27%23999%27.%0A%090%20to%3A%20self%20class%20squares%20x%20do%3A%20%5B%3Aeach%20%7C%20%7C%20x%20%7C%0A%09%09x%20%3A%3D%20each%20*%20self%20class%20squareSize.%0A%09%09self%20drawLineFrom%3A%20x@0%20to%3A%20x@self%20height%5D.%0A%090%20to%3A%20self%20class%20squares%20y%20do%3A%20%5B%3Aeach%20%7C%20%7C%20y%20%7C%0A%09%09y%20%3A%3D%20each%20*%20self%20class%20squareSize.%0A%09%09self%20drawLineFrom%3A%200@y%20to%3A%20self%20width@y%5D.'),
-messageSends: ["fillStyle:", "fillRectFrom:to:", unescape("@"), "width", "height", "lineWidth:", "strokeStyle:", "to:do:", "x", "squares", "class", unescape("*"), "squareSize", "drawLineFrom:to:", "y"],
+source: unescape('drawMap%0A%09renderingContext%20%0A%09%09fillStyle%3A%20%27%23fafafa%27%3B%0A%09%09fillRect%3A%200%20y%3A%200%20to%3A%20self%20width%20y%3A%20self%20height.%0A%09renderingContext%20%0A%09%09lineWidth%3A%200.5%3B%0A%09%09strokeStyle%3A%20%27%23999%27.%0A%090%20to%3A%20self%20class%20squares%20x%20do%3A%20%5B%3Aeach%20%7C%20%7C%20x%20%7C%0A%09%09x%20%3A%3D%20each%20*%20self%20class%20squareSize.%0A%09%09self%20drawLineFrom%3A%20x@0%20to%3A%20x@self%20height%5D.%0A%090%20to%3A%20self%20class%20squares%20y%20do%3A%20%5B%3Aeach%20%7C%20%7C%20y%20%7C%0A%09%09y%20%3A%3D%20each%20*%20self%20class%20squareSize.%0A%09%09self%20drawLineFrom%3A%200@y%20to%3A%20self%20width@y%5D.'),
+messageSends: ["fillStyle:", "fillRect:y:to:y:", "width", "height", "lineWidth:", "strokeStyle:", "to:do:", "x", "squares", "class", unescape("*"), "squareSize", "drawLineFrom:to:", unescape("@"), "y"],
 referencedClasses: []
 }),
 smalltalk.Tetris);
@@ -248,11 +248,11 @@ selector: unescape('drawLineFrom%3Ato%3A'),
 category: 'actions',
 fn: function (aPoint, anotherPoint){
 var self=this;
-(function($rec){smalltalk.send($rec, "_beginPath", []);smalltalk.send($rec, "_moveTo_", [aPoint]);smalltalk.send($rec, "_lineTo_", [anotherPoint]);return smalltalk.send($rec, "_stroke", []);})(self['@renderingContext']);
+(function($rec){smalltalk.send($rec, "_beginPath", []);smalltalk.send($rec, "_moveTo_y_", [smalltalk.send(aPoint, "_x", []), smalltalk.send(aPoint, "_y", [])]);smalltalk.send($rec, "_lineTo_y_", [smalltalk.send(anotherPoint, "_x", []), smalltalk.send(anotherPoint, "_y", [])]);return smalltalk.send($rec, "_stroke", []);})(self['@renderingContext']);
 return self;},
 args: ["aPoint", "anotherPoint"],
-source: unescape('drawLineFrom%3A%20aPoint%20to%3A%20anotherPoint%0A%09renderingContext%20%0A%09%09beginPath%3B%0A%09%09moveTo%3A%20aPoint%3B%0A%09%09lineTo%3A%20anotherPoint%3B%0A%09%09stroke'),
-messageSends: ["beginPath", "moveTo:", "lineTo:", "stroke"],
+source: unescape('drawLineFrom%3A%20aPoint%20to%3A%20anotherPoint%0A%09renderingContext%20%0A%09%09beginPath%3B%0A%09%09moveTo%3A%20aPoint%20x%20y%3A%20aPoint%20y%3B%0A%09%09lineTo%3A%20anotherPoint%20x%20y%3A%20anotherPoint%20y%3B%0A%09%09stroke'),
+messageSends: ["beginPath", "moveTo:y:", "x", "y", "lineTo:y:", "stroke"],
 referencedClasses: []
 }),
 smalltalk.Tetris);
@@ -369,12 +369,12 @@ var canvas=nil;
 canvas=smalltalk.send(html, "_canvas", []);
 smalltalk.send(canvas, "_at_put_", ["width", smalltalk.send(smalltalk.send(self, "_width", []), "_asString", [])]);
 smalltalk.send(canvas, "_at_put_", ["height", smalltalk.send(smalltalk.send(self, "_height", []), "_asString", [])]);
-self['@renderingContext']=smalltalk.send((smalltalk.CanvasRenderingContext || CanvasRenderingContext), "_tagBrush_", [canvas]);
+self['@renderingContext']=smalltalk.send(smalltalk.send(canvas, "_element", []), "_getContext_", ["2d"]);
 smalltalk.send(self, "_redraw", []);
 return self;},
 args: ["html"],
-source: unescape('renderCanvasOn%3A%20html%0A%09%7C%20canvas%20%7C%0A%09canvas%20%3A%3D%20html%20canvas.%0A%09canvas%20at%3A%20%27width%27%20put%3A%20self%20width%20asString.%0A%09canvas%20at%3A%20%27height%27%20put%3A%20self%20height%20asString.%0A%09renderingContext%20%3A%3D%20CanvasRenderingContext%20tagBrush%3A%20canvas.%0A%09self%20redraw'),
-messageSends: ["canvas", "at:put:", "asString", "width", "height", "tagBrush:", "redraw"],
+source: unescape('renderCanvasOn%3A%20html%0A%09%7C%20canvas%20%7C%0A%09canvas%20%3A%3D%20html%20canvas.%0A%09canvas%20at%3A%20%27width%27%20put%3A%20self%20width%20asString.%0A%09canvas%20at%3A%20%27height%27%20put%3A%20self%20height%20asString.%0A%09renderingContext%20%3A%3D%20canvas%20element%20getContext%3A%20%272d%27.%0A%09self%20redraw'),
+messageSends: ["canvas", "at:put:", "asString", "width", "height", "getContext:", "element", "redraw"],
 referencedClasses: []
 }),
 smalltalk.Tetris);
@@ -386,11 +386,11 @@ selector: unescape('renderButtonsOn%3A'),
 category: 'rendering',
 fn: function (html){
 var self=this;
-(function($rec){smalltalk.send($rec, "_class_", ["tetris_buttons"]);return smalltalk.send($rec, "_with_", [(function(){(function($rec){smalltalk.send($rec, "_with_", ["New game"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_startNewGame", []);})]);})(smalltalk.send(html, "_button", []));return (function($rec){smalltalk.send($rec, "_with_", [unescape("play/pause")]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_update", []);})]);})(smalltalk.send(html, "_button", []));})]);})(smalltalk.send(html, "_div", []));
+(function($rec){smalltalk.send($rec, "_class_", ["tetris_buttons"]);return smalltalk.send($rec, "_with_", [(function(){(function($rec){smalltalk.send($rec, "_with_", ["New game"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_startNewGame", []);})]);})(smalltalk.send(html, "_button", []));return (function($rec){smalltalk.send($rec, "_with_", [unescape("play/pause")]);return smalltalk.send($rec, "_onClick_", [(function(){return nil;})]);})(smalltalk.send(html, "_button", []));})]);})(smalltalk.send(html, "_div", []));
 return self;},
 args: ["html"],
-source: unescape('renderButtonsOn%3A%20html%0A%09html%20div%20%0A%09%09class%3A%20%27tetris_buttons%27%3B%0A%09%09with%3A%20%5B%0A%09%09%09html%20button%0A%09%09%09%09with%3A%20%27New%20game%27%3B%0A%09%09%09%09onClick%3A%20%5Bself%20startNewGame%5D.%0A%09%09%09html%20button%0A%09%09%09%09with%3A%20%27play/pause%27%3B%0A%09%09%09%09onClick%3A%20%5Bself%20update%5D%5D'),
-messageSends: ["class:", "with:", "onClick:", "startNewGame", "button", "update", "div"],
+source: unescape('renderButtonsOn%3A%20html%0A%09html%20div%20%0A%09%09class%3A%20%27tetris_buttons%27%3B%0A%09%09with%3A%20%5B%0A%09%09%09html%20button%0A%09%09%09%09with%3A%20%27New%20game%27%3B%0A%09%09%09%09onClick%3A%20%5Bself%20startNewGame%5D.%0A%09%09%09html%20button%0A%09%09%09%09with%3A%20%27play/pause%27%3B%0A%09%09%09%09onClick%3A%20%5B%5D%5D'),
+messageSends: ["class:", "with:", "onClick:", "startNewGame", "button", "div"],
 referencedClasses: []
 }),
 smalltalk.Tetris);
@@ -419,7 +419,7 @@ selector: unescape('width'),
 category: 'accessing',
 fn: function (){
 var self=this;
-return (($receiver = smalltalk.send(self, "_squareSize", [])).klass === smalltalk.Number) ? $receiver *smalltalk.send(smalltalk.send(self, "_squares", []), "_x", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(self, "_squares", []), "_x", [])]);
+return ((($receiver = smalltalk.send(self, "_squareSize", [])).klass === smalltalk.Number) ? $receiver *smalltalk.send(smalltalk.send(self, "_squares", []), "_x", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(self, "_squares", []), "_x", [])]));
 return self;},
 args: [],
 source: unescape('width%0A%09%5Eself%20squareSize%20*%20%28self%20squares%20x%29'),
@@ -435,7 +435,7 @@ selector: unescape('height'),
 category: 'accessing',
 fn: function (){
 var self=this;
-return (($receiver = smalltalk.send(self, "_squareSize", [])).klass === smalltalk.Number) ? $receiver *smalltalk.send(smalltalk.send(self, "_squares", []), "_y", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(self, "_squares", []), "_y", [])]);
+return ((($receiver = smalltalk.send(self, "_squareSize", [])).klass === smalltalk.Number) ? $receiver *smalltalk.send(smalltalk.send(self, "_squares", []), "_y", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(self, "_squares", []), "_y", [])]));
 return self;},
 args: [],
 source: unescape('height%0A%09%5Eself%20squareSize%20*%20%28self%20squares%20y%29'),
@@ -501,7 +501,7 @@ selector: unescape('position'),
 category: 'accessing',
 fn: function (){
 var self=this;
-return (($receiver = self['@position']) == nil || $receiver == undefined) ? (function(){return smalltalk.send((($receiver = (($receiver = smalltalk.send(smalltalk.send((smalltalk.Tetris || Tetris), "_squares", []), "_x", [])).klass === smalltalk.Number) ? $receiver /(2) : smalltalk.send($receiver, "__slash", [(2)])).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]), "__at", [(0)]);})() : $receiver;
+return (($receiver = self['@position']) == nil || $receiver == undefined) ? (function(){return smalltalk.send(((($receiver = ((($receiver = smalltalk.send(smalltalk.send((smalltalk.Tetris || Tetris), "_squares", []), "_x", [])).klass === smalltalk.Number) ? $receiver /(2) : smalltalk.send($receiver, "__slash", [(2)]))).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), "__at", [(0)]);})() : $receiver;
 return self;},
 args: [],
 source: unescape('position%0A%09%5Eposition%20ifNil%3A%20%5B%28Tetris%20squares%20x%20/%202%29%20-1%20@%200%5D'),
@@ -582,11 +582,13 @@ category: 'drawing',
 fn: function (aRenderingContext){
 var self=this;
 smalltalk.send(aRenderingContext, "_fillStyle_", [smalltalk.send(self, "_color", [])]);
-smalltalk.send(smalltalk.send(self, "_bounds", []), "_do_", [(function(each){return (function($rec){smalltalk.send($rec, "_fillRectFrom_to_", [(($receiver = (($receiver = each).klass === smalltalk.Number) ? $receiver +smalltalk.send(self, "_position", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(self, "_position", [])])).klass === smalltalk.Number) ? $receiver *smalltalk.send((smalltalk.Tetris || Tetris), "_squareSize", []) : smalltalk.send($receiver, "__star", [smalltalk.send((smalltalk.Tetris || Tetris), "_squareSize", [])]), (($receiver = smalltalk.send((1), "__at", [(1)])).klass === smalltalk.Number) ? $receiver *smalltalk.send((smalltalk.Tetris || Tetris), "_squareSize", []) : smalltalk.send($receiver, "__star", [smalltalk.send((smalltalk.Tetris || Tetris), "_squareSize", [])])]);smalltalk.send($rec, "_strokeStyle_", [unescape("%23999")]);smalltalk.send($rec, "_lineWidth_", [(2)]);return smalltalk.send($rec, "_strokeRectFrom_to_", [(($receiver = (($receiver = each).klass === smalltalk.Number) ? $receiver +smalltalk.send(self, "_position", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(self, "_position", [])])).klass === smalltalk.Number) ? $receiver *smalltalk.send((smalltalk.Tetris || Tetris), "_squareSize", []) : smalltalk.send($receiver, "__star", [smalltalk.send((smalltalk.Tetris || Tetris), "_squareSize", [])]), (($receiver = smalltalk.send((1), "__at", [(1)])).klass === smalltalk.Number) ? $receiver *smalltalk.send((smalltalk.Tetris || Tetris), "_squareSize", []) : smalltalk.send($receiver, "__star", [smalltalk.send((smalltalk.Tetris || Tetris), "_squareSize", [])])]);})(aRenderingContext);})]);
+smalltalk.send(smalltalk.send(self, "_bounds", []), "_do_", [(function(each){var from=nil;
+var to=nil;
+from=((($receiver = ((($receiver = each).klass === smalltalk.Number) ? $receiver +smalltalk.send(self, "_position", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(self, "_position", [])]))).klass === smalltalk.Number) ? $receiver *smalltalk.send((smalltalk.Tetris || Tetris), "_squareSize", []) : smalltalk.send($receiver, "__star", [smalltalk.send((smalltalk.Tetris || Tetris), "_squareSize", [])]));to=((($receiver = smalltalk.send((1), "__at", [(1)])).klass === smalltalk.Number) ? $receiver *smalltalk.send((smalltalk.Tetris || Tetris), "_squareSize", []) : smalltalk.send($receiver, "__star", [smalltalk.send((smalltalk.Tetris || Tetris), "_squareSize", [])]));return (function($rec){smalltalk.send($rec, "_fillRect_y_to_y_", [smalltalk.send(from, "_x", []), smalltalk.send(from, "_y", []), smalltalk.send(to, "_x", []), smalltalk.send(to, "_y", [])]);smalltalk.send($rec, "_strokeStyle_", [unescape("%23999")]);smalltalk.send($rec, "_lineWidth_", [(2)]);return smalltalk.send($rec, "_strokeRect_y_to_y_", [smalltalk.send(from, "_x", []), smalltalk.send(from, "_y", []), smalltalk.send(to, "_x", []), smalltalk.send(to, "_y", [])]);})(aRenderingContext);})]);
 return self;},
 args: ["aRenderingContext"],
-source: unescape('drawOn%3A%20aRenderingContext%0A%09aRenderingContext%20fillStyle%3A%20self%20color.%0A%09self%20bounds%20do%3A%20%5B%3Aeach%20%7C%0A%09%09aRenderingContext%20%0A%09%09%09fillRectFrom%3A%20each%20+%20self%20position*%20Tetris%20squareSize%20to%3A%201@1%20*%20Tetris%20squareSize%3B%0A%09%09%09strokeStyle%3A%20%27%23999%27%3B%0A%09%09%09lineWidth%3A%202%3B%0A%09%09%09strokeRectFrom%3A%20each%20+%20self%20position*%20Tetris%20squareSize%20to%3A%201@1%20*%20Tetris%20squareSize%5D'),
-messageSends: ["fillStyle:", "color", "do:", "bounds", "fillRectFrom:to:", unescape("*"), unescape("+"), "position", "squareSize", unescape("@"), "strokeStyle:", "lineWidth:", "strokeRectFrom:to:"],
+source: unescape('drawOn%3A%20aRenderingContext%0A%09aRenderingContext%20fillStyle%3A%20self%20color.%0A%09self%20bounds%20do%3A%20%5B%3Aeach%20%7C%7C%20from%20to%20%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20from%20%3A%3D%20each%20+%20self%20position*%20Tetris%20squareSize.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20to%20%3A%3D%201@1%20*%20Tetris%20squareSize.%0A%09%09aRenderingContext%20%0A%09%09%09fillRect%3A%20from%20x%20y%3A%20from%20y%20to%3A%20to%20x%20y%3A%20to%20y%3B%0A%09%09%09strokeStyle%3A%20%27%23999%27%3B%0A%09%09%09lineWidth%3A%202%3B%0A%09%09%09strokeRect%3A%20from%20x%20y%3A%20from%20y%20to%3A%20to%20x%20y%3A%20to%20y%5D'),
+messageSends: ["fillStyle:", "color", "do:", "bounds", unescape("*"), unescape("+"), "position", "squareSize", unescape("@"), "fillRect:y:to:y:", "x", "y", "strokeStyle:", "lineWidth:", "strokeRect:y:to:y:"],
 referencedClasses: [smalltalk.Tetris]
 }),
 smalltalk.TetrisPiece);
@@ -598,7 +600,7 @@ selector: unescape('canMove'),
 category: 'testing',
 fn: function (){
 var self=this;
-return (($receiver = smalltalk.send(smalltalk.send(self, "_position", []), "_y", [])).klass === smalltalk.Number) ? $receiver <(($receiver = smalltalk.send(smalltalk.send((smalltalk.Tetris || Tetris), "_squares", []), "_y", [])).klass === smalltalk.Number) ? $receiver -smalltalk.send(self, "_height", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(self, "_height", [])]) : smalltalk.send($receiver, "__lt", [(($receiver = smalltalk.send(smalltalk.send((smalltalk.Tetris || Tetris), "_squares", []), "_y", [])).klass === smalltalk.Number) ? $receiver -smalltalk.send(self, "_height", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(self, "_height", [])])]);
+return ((($receiver = smalltalk.send(smalltalk.send(self, "_position", []), "_y", [])).klass === smalltalk.Number) ? $receiver <((($receiver = smalltalk.send(smalltalk.send((smalltalk.Tetris || Tetris), "_squares", []), "_y", [])).klass === smalltalk.Number) ? $receiver -smalltalk.send(self, "_height", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(self, "_height", [])])) : smalltalk.send($receiver, "__lt", [((($receiver = smalltalk.send(smalltalk.send((smalltalk.Tetris || Tetris), "_squares", []), "_y", [])).klass === smalltalk.Number) ? $receiver -smalltalk.send(self, "_height", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(self, "_height", [])]))]));
 return self;},
 args: [],
 source: unescape('canMove%0A%09%5Eself%20position%20y%20%3C%20%28Tetris%20squares%20y%20-%20self%20height%29'),
@@ -614,7 +616,7 @@ selector: unescape('canMoveIn%3A'),
 category: 'testing',
 fn: function (aTetris){
 var self=this;
-return (($receiver = smalltalk.send(smalltalk.send(self, "_position", []), "_y", [])).klass === smalltalk.Number) ? $receiver <(($receiver = smalltalk.send(smalltalk.send(aTetris, "_squares", []), "_y", [])).klass === smalltalk.Number) ? $receiver -smalltalk.send(self, "_height", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(self, "_height", [])]) : smalltalk.send($receiver, "__lt", [(($receiver = smalltalk.send(smalltalk.send(aTetris, "_squares", []), "_y", [])).klass === smalltalk.Number) ? $receiver -smalltalk.send(self, "_height", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(self, "_height", [])])]);
+return ((($receiver = smalltalk.send(smalltalk.send(self, "_position", []), "_y", [])).klass === smalltalk.Number) ? $receiver <((($receiver = smalltalk.send(smalltalk.send(aTetris, "_squares", []), "_y", [])).klass === smalltalk.Number) ? $receiver -smalltalk.send(self, "_height", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(self, "_height", [])])) : smalltalk.send($receiver, "__lt", [((($receiver = smalltalk.send(smalltalk.send(aTetris, "_squares", []), "_y", [])).klass === smalltalk.Number) ? $receiver -smalltalk.send(self, "_height", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(self, "_height", [])]))]));
 return self;},
 args: ["aTetris"],
 source: unescape('canMoveIn%3A%20aTetris%0A%09%5Eself%20position%20y%20%3C%20%28aTetris%20squares%20y%20-%20self%20height%29'),

File diff suppressed because it is too large
+ 26 - 26
js/IDE.deploy.js


File diff suppressed because it is too large
+ 34 - 34
js/IDE.js


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

@@ -1,39 +0,0 @@
-smalltalk.addClass('JQueryTest', smalltalk.TestCase, ['document'], 'JQuery-Tests');
-smalltalk.addMethod(
-'_setUp',
-smalltalk.method({
-selector: 'setUp',
-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;}
-}),
-smalltalk.JQueryTest);
-
-smalltalk.addMethod(
-'_testFind',
-smalltalk.method({
-selector: 'testFind',
-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;}
-}),
-smalltalk.JQueryTest);
-
-smalltalk.addMethod(
-'_testEach',
-smalltalk.method({
-selector: 'testEach',
-fn: function (){
-var self=this;
-var classes=nil;
-classes=smalltalk.send((smalltalk.Array || 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 || JQuery), "_fromElement_", [element]), "_attr_", ["class"])]);})]);
-smalltalk.send(self, "_assert_equals_", [smalltalk.send(["firstname", "lastname"], "_printString", []), smalltalk.send(classes, "_printString", [])]);
-return self;}
-}),
-smalltalk.JQueryTest);
-
-
-

+ 0 - 54
js/JQuery-Tests.js

@@ -1,54 +0,0 @@
-smalltalk.addClass('JQueryTest', smalltalk.TestCase, ['document'], 'JQuery-Tests');
-smalltalk.addMethod(
-unescape('_setUp'),
-smalltalk.method({
-selector: unescape('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;},
-args: [],
-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(
-unescape('_testFind'),
-smalltalk.method({
-selector: unescape('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;},
-args: [],
-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.'),
-messageSends: ["assert:equals:", "html", "find:", "asJQuery"],
-referencedClasses: []
-}),
-smalltalk.JQueryTest);
-
-smalltalk.addMethod(
-unescape('_testEach'),
-smalltalk.method({
-selector: unescape('testEach'),
-category: 'tests',
-fn: function (){
-var self=this;
-var classes=nil;
-classes=smalltalk.send((smalltalk.Array || 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 || JQuery), "_fromElement_", [element]), "_attr_", ["class"])]);})]);
-smalltalk.send(self, "_assert_equals_", [smalltalk.send(["firstname", "lastname"], "_printString", []), smalltalk.send(classes, "_printString", [])]);
-return self;},
-args: [],
-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);
-
-
-

+ 0 - 826
js/JQuery.deploy.js

@@ -1,826 +0,0 @@
-smalltalk.addClass('JQuery', smalltalk.Object, ['jquery'], 'JQuery');
-smalltalk.addMethod(
-'_append_',
-smalltalk.method({
-selector: 'append:',
-fn: function (anObject){
-var self=this;
-smalltalk.send(anObject, "_appendToJQuery_", [self]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_appendElement_',
-smalltalk.method({
-selector: 'appendElement:',
-fn: function (anElement){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["append", anElement]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_appendToJQuery_',
-smalltalk.method({
-selector: 'appendToJQuery:',
-fn: function (aJQuery){
-var self=this;
-smalltalk.send(aJQuery, "_appendElement_", [self['@jquery']]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_contents_',
-smalltalk.method({
-selector: 'contents:',
-fn: function (anObject){
-var self=this;
-smalltalk.send(self, "_empty", []);
-smalltalk.send(self, "_append_", [anObject]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_empty',
-smalltalk.method({
-selector: 'empty',
-fn: function (){
-var self=this;
-return smalltalk.send(self, "_call_", ["empty"]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_jquery',
-smalltalk.method({
-selector: 'jquery',
-fn: function (){
-var self=this;
-return self['@jquery'];
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_removeAttribute_',
-smalltalk.method({
-selector: 'removeAttribute:',
-fn: function (aString){
-var self=this;
-return smalltalk.send(self, "_call_withArgument_", ["removeAttribute", aString]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_attr_',
-smalltalk.method({
-selector: 'attr:',
-fn: function (aString){
-var self=this;
-return smalltalk.send(self, "_call_withArgument_", ["attr", aString]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_val',
-smalltalk.method({
-selector: 'val',
-fn: function (){
-var self=this;
-return smalltalk.send(self, "_call_", ["val"]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_val_',
-smalltalk.method({
-selector: 'val:',
-fn: function (aString){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["val", aString]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_attrAt_put_',
-smalltalk.method({
-selector: 'attrAt:put:',
-fn: function (aString, anotherString){
-var self=this;
-self['@jquery'].attr(aString, anotherString);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_cssAt_',
-smalltalk.method({
-selector: 'cssAt:',
-fn: function (aString){
-var self=this;
-return self['@jquery'].css(aString);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_cssAt_put_',
-smalltalk.method({
-selector: 'cssAt:put:',
-fn: function (aString, anotherString){
-var self=this;
-self['@jquery'].css(aString, anotherString);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_addClass_',
-smalltalk.method({
-selector: 'addClass:',
-fn: function (aString){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["addClass", aString]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_removeClass_',
-smalltalk.method({
-selector: 'removeClass:',
-fn: function (aString){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["removeClass", aString]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_toggleClass_',
-smalltalk.method({
-selector: 'toggleClass:',
-fn: function (aString){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["toggleClass", aString]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_height',
-smalltalk.method({
-selector: 'height',
-fn: function (){
-var self=this;
-return smalltalk.send(self, "_call_", ["height"]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_height_',
-smalltalk.method({
-selector: 'height:',
-fn: function (anInteger){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["height", anInteger]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_width_',
-smalltalk.method({
-selector: 'width:',
-fn: function (anInteger){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["width", anInteger]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_width',
-smalltalk.method({
-selector: 'width',
-fn: function (){
-var self=this;
-return smalltalk.send(self, "_call_", ["width"]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_innerHeight',
-smalltalk.method({
-selector: 'innerHeight',
-fn: function (){
-var self=this;
-return smalltalk.send(self, "_call_", ["innerHeight"]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_innerWidth',
-smalltalk.method({
-selector: 'innerWidth',
-fn: function (){
-var self=this;
-return smalltalk.send(self, "_call_", ["innerWidth"]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_outerHeight',
-smalltalk.method({
-selector: 'outerHeight',
-fn: function (){
-var self=this;
-return smalltalk.send(self, "_call_", ["outerHeight"]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_outerWidth',
-smalltalk.method({
-selector: 'outerWidth',
-fn: function (){
-var self=this;
-return smalltalk.send(self, "_call_", ["outerWidth"]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_top',
-smalltalk.method({
-selector: 'top',
-fn: function (){
-var self=this;
-return smalltalk.send(smalltalk.send(self, "_call_", ["position"]), "_basicAt_", ["top"]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_left',
-smalltalk.method({
-selector: 'left',
-fn: function (){
-var self=this;
-return smalltalk.send(smalltalk.send(self, "_call_", ["position"]), "_basicAt_", ["left"]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_offsetLeft',
-smalltalk.method({
-selector: 'offsetLeft',
-fn: function (){
-var self=this;
-return smalltalk.send(smalltalk.send(self, "_call_", ["offset"]), "_basicAt_", ["left"]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_offsetTop',
-smalltalk.method({
-selector: 'offsetTop',
-fn: function (){
-var self=this;
-return smalltalk.send(smalltalk.send(self, "_call_", ["offset"]), "_basicAt_", ["top"]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_scrollLeft',
-smalltalk.method({
-selector: 'scrollLeft',
-fn: function (){
-var self=this;
-return smalltalk.send(self, "_call_", ["scrollLeft"]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_scrollTop',
-smalltalk.method({
-selector: 'scrollTop',
-fn: function (){
-var self=this;
-return smalltalk.send(self, "_call_", ["scrollTop"]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_scrollLeft_',
-smalltalk.method({
-selector: 'scrollLeft:',
-fn: function (anInteger){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["scrollLeft", anInteger]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_scrollTop_',
-smalltalk.method({
-selector: 'scrollTop:',
-fn: function (anInteger){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["scrollTop", anInteger]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_fadeIn',
-smalltalk.method({
-selector: 'fadeIn',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_call_", ["fadeIn"]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_slideDown',
-smalltalk.method({
-selector: 'slideDown',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_call_", ["slideDown"]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_fadeInSlow',
-smalltalk.method({
-selector: 'fadeInSlow',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["fadeIn", "slow"]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_fadeOut',
-smalltalk.method({
-selector: 'fadeOut',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_call_", ["fadeOut"]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_fadeOutSlow',
-smalltalk.method({
-selector: 'fadeOutSlow',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["fadeOut", "slow"]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_slideUp',
-smalltalk.method({
-selector: 'slideUp',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_call_", ["slideUp"]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_fadeOut_do_',
-smalltalk.method({
-selector: 'fadeOut:do:',
-fn: function (aString, aBlock){
-var self=this;
-self['@jquery'].fadeOut(aString, aBlock);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_do_',
-smalltalk.method({
-selector: 'do:',
-fn: function (aBlock){
-var self=this;
-smalltalk.send(self, "_elementsDo_", [(function(anElement){return smalltalk.send(aBlock, "_value_", [smalltalk.send((smalltalk.JQuery || JQuery), "_fromElement_", [anElement])]);})]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_focus',
-smalltalk.method({
-selector: 'focus',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_call_", ["focus"]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_show',
-smalltalk.method({
-selector: 'show',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_call_", ["show"]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_hide',
-smalltalk.method({
-selector: 'hide',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_call_", ["hide"]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_remove',
-smalltalk.method({
-selector: 'remove',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_call_", ["remove"]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_on_do_',
-smalltalk.method({
-selector: 'on:do:',
-fn: function (anEventString, aBlock){
-var self=this;
-self['@jquery'].bind(anEventString, function(e){aBlock(e, self)});
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_removeEvents_',
-smalltalk.method({
-selector: 'removeEvents:',
-fn: function (aString){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["unbind", aString]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_onLoadDo_',
-smalltalk.method({
-selector: 'onLoadDo:',
-fn: function (aBlock){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["load", aBlock]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_initializeWithJQueryObject_',
-smalltalk.method({
-selector: 'initializeWithJQueryObject:',
-fn: function (anObject){
-var self=this;
-self['@jquery']=anObject;
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_call_',
-smalltalk.method({
-selector: 'call:',
-fn: function (aString){
-var self=this;
-return self['@jquery'][aString]();
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_call_withArgument_',
-smalltalk.method({
-selector: 'call:withArgument:',
-fn: function (aString, anObject){
-var self=this;
-return self['@jquery'][aString](anObject);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_elementsDo_',
-smalltalk.method({
-selector: 'elementsDo:',
-fn: function (aBlock){
-var self=this;
-self['@jquery'].each(function(index, element){aBlock(element, self)});
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_hasClass_',
-smalltalk.method({
-selector: 'hasClass:',
-fn: function (aString){
-var self=this;
-return smalltalk.send(self, "_call_withArgument_", ["hasClass", aString]);
-return self;}
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-'_find_',
-smalltalk.method({
-selector: 'find:',
-fn: function (aSelector){
-var self=this;
-return smalltalk.send(self, "_call_withArgument_", ["find", aSelector]);
-return self;}
-}),
-smalltalk.JQuery);
-
-
-smalltalk.addMethod(
-'_fromString_',
-smalltalk.method({
-selector: 'fromString:',
-fn: function (aString){
-var self=this;
-var newJQuery=nil;
-newJQuery = jQuery(String(aString));
-return smalltalk.send(self, "_from_", [newJQuery]);
-return self;}
-}),
-smalltalk.JQuery.klass);
-
-smalltalk.addMethod(
-'_from_',
-smalltalk.method({
-selector: 'from:',
-fn: function (anObject){
-var self=this;
-return (function($rec){smalltalk.send($rec, "_initializeWithJQueryObject_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
-return self;}
-}),
-smalltalk.JQuery.klass);
-
-smalltalk.addMethod(
-'_window',
-smalltalk.method({
-selector: 'window',
-fn: function (){
-var self=this;
-return self._from_(jQuery(window));
-return self;}
-}),
-smalltalk.JQuery.klass);
-
-smalltalk.addMethod(
-'_body',
-smalltalk.method({
-selector: 'body',
-fn: function (){
-var self=this;
-return self._from_(jQuery('body'));
-return self;}
-}),
-smalltalk.JQuery.klass);
-
-smalltalk.addMethod(
-'_document',
-smalltalk.method({
-selector: 'document',
-fn: function (){
-var self=this;
-return self._from_(jQuery(document));
-return self;}
-}),
-smalltalk.JQuery.klass);
-
-smalltalk.addMethod(
-'_fromElement_',
-smalltalk.method({
-selector: 'fromElement:',
-fn: function (anElement){
-var self=this;
-var newJQuery=nil;
-newJQuery = jQuery(anElement);
-return smalltalk.send(self, "_from_", [newJQuery]);
-return self;}
-}),
-smalltalk.JQuery.klass);
-
-smalltalk.addMethod(
-'_documentReady_',
-smalltalk.method({
-selector: 'documentReady:',
-fn: function (aBlock){
-var self=this;
-jQuery(document).ready(aBlock);
-return self;}
-}),
-smalltalk.JQuery.klass);
-
-
-smalltalk.addClass('Ajax', smalltalk.Object, ['settings'], 'JQuery');
-smalltalk.addMethod(
-'_at_',
-smalltalk.method({
-selector: 'at:',
-fn: function (aKey){
-var self=this;
-return smalltalk.send(self['@settings'], "_at_ifAbsent_", [aKey, (function(){return nil;})]);
-return self;}
-}),
-smalltalk.Ajax);
-
-smalltalk.addMethod(
-'_at_put_',
-smalltalk.method({
-selector: 'at:put:',
-fn: function (aKey, aValue){
-var self=this;
-smalltalk.send(self['@settings'], "_at_put_", [aKey, aValue]);
-return self;}
-}),
-smalltalk.Ajax);
-
-smalltalk.addMethod(
-'_url',
-smalltalk.method({
-selector: 'url',
-fn: function (){
-var self=this;
-return smalltalk.send(self, "_at_", ["url"]);
-return self;}
-}),
-smalltalk.Ajax);
-
-smalltalk.addMethod(
-'_url_',
-smalltalk.method({
-selector: 'url:',
-fn: function (aString){
-var self=this;
-smalltalk.send(self, "_at_put_", ["url", aString]);
-return self;}
-}),
-smalltalk.Ajax);
-
-smalltalk.addMethod(
-'_send',
-smalltalk.method({
-selector: 'send',
-fn: function (){
-var self=this;
-jQuery.ajax(self['@settings']);
-return self;}
-}),
-smalltalk.Ajax);
-
-smalltalk.addMethod(
-'_onSuccessDo_',
-smalltalk.method({
-selector: 'onSuccessDo:',
-fn: function (aBlock){
-var self=this;
-smalltalk.send(self, "_at_put_", ["success", aBlock]);
-return self;}
-}),
-smalltalk.Ajax);
-
-smalltalk.addMethod(
-'_onCompleteDo_',
-smalltalk.method({
-selector: 'onCompleteDo:',
-fn: function (aBlock){
-var self=this;
-smalltalk.send(self, "_at_put_", ["complete", aBlock]);
-return self;}
-}),
-smalltalk.Ajax);
-
-smalltalk.addMethod(
-'_onErrorDo_',
-smalltalk.method({
-selector: 'onErrorDo:',
-fn: function (aBlock){
-var self=this;
-smalltalk.send(self, "_at_put_", ["error", aBlock]);
-return self;}
-}),
-smalltalk.Ajax);
-
-smalltalk.addMethod(
-'_initialize',
-smalltalk.method({
-selector: 'initialize',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_initialize", [], smalltalk.Object);
-self['@settings']=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []);
-return self;}
-}),
-smalltalk.Ajax);
-
-
-smalltalk.addMethod(
-'_url_',
-smalltalk.method({
-selector: 'url:',
-fn: function (aString){
-var self=this;
-return (function($rec){smalltalk.send($rec, "_url_", [aString]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
-return self;}
-}),
-smalltalk.Ajax.klass);
-
-
-smalltalk.addMethod(
-'_appendToJQuery_',
-smalltalk.method({
-selector: 'appendToJQuery:',
-fn: function (aJQuery){
-var self=this;
-smalltalk.send(self, "_value_", [smalltalk.send((smalltalk.HTMLCanvas || HTMLCanvas), "_onJQuery_", [aJQuery])]);
-return self;}
-}),
-smalltalk.BlockClosure);
-
-smalltalk.addMethod(
-'_asJQuery',
-smalltalk.method({
-selector: 'asJQuery',
-fn: function (){
-var self=this;
-return smalltalk.send((smalltalk.JQuery || JQuery), "_fromString_", [self]);
-return self;}
-}),
-smalltalk.String);
-
-smalltalk.addMethod(
-'_appendToJQuery_',
-smalltalk.method({
-selector: 'appendToJQuery:',
-fn: function (aJQuery){
-var self=this;
-aJQuery._appendElement_(String(self));
-return self;}
-}),
-smalltalk.String);
-
-smalltalk.addMethod(
-'_appendToJQuery_',
-smalltalk.method({
-selector: 'appendToJQuery:',
-fn: function (aJQuery){
-var self=this;
-smalltalk.send(aJQuery, "_appendElement_", [smalltalk.send(self['@root'], "_element", [])]);
-return self;}
-}),
-smalltalk.HTMLCanvas);
-

+ 0 - 1197
js/JQuery.js

@@ -1,1197 +0,0 @@
-smalltalk.addClass('JQuery', smalltalk.Object, ['jquery'], 'JQuery');
-smalltalk.addMethod(
-unescape('_append_'),
-smalltalk.method({
-selector: unescape('append%3A'),
-category: 'DOM insertion',
-fn: function (anObject){
-var self=this;
-smalltalk.send(anObject, "_appendToJQuery_", [self]);
-return self;},
-args: ["anObject"],
-source: unescape('append%3A%20anObject%0A%20%20%20%20%22Append%20anObject%20at%20the%20end%20of%20the%20element.%22%0A%20%20%20%20anObject%20appendToJQuery%3A%20self'),
-messageSends: ["appendToJQuery:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_appendElement_'),
-smalltalk.method({
-selector: unescape('appendElement%3A'),
-category: 'DOM insertion',
-fn: function (anElement){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["append", anElement]);
-return self;},
-args: ["anElement"],
-source: unescape('appendElement%3A%20anElement%0A%20%20%20%20%22Append%20anElement%20at%20the%20end%20of%20the%20element.%0A%20%20%20%20%20Dont%27t%20call%20this%20method%20directly%2C%20use%20%23append%3A%20instead%22%0A%20%20%20%20self%20call%3A%20%27append%27%20withArgument%3A%20anElement'),
-messageSends: ["call:withArgument:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_appendToJQuery_'),
-smalltalk.method({
-selector: unescape('appendToJQuery%3A'),
-category: 'DOM insertion',
-fn: function (aJQuery){
-var self=this;
-smalltalk.send(aJQuery, "_appendElement_", [self['@jquery']]);
-return self;},
-args: ["aJQuery"],
-source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20aJQuery%20appendElement%3A%20jquery'),
-messageSends: ["appendElement:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_contents_'),
-smalltalk.method({
-selector: unescape('contents%3A'),
-category: 'DOM insertion',
-fn: function (anObject){
-var self=this;
-smalltalk.send(self, "_empty", []);
-smalltalk.send(self, "_append_", [anObject]);
-return self;},
-args: ["anObject"],
-source: unescape('contents%3A%20anObject%0A%20%20%20%20self%20empty.%0A%20%20%20%20self%20append%3A%20anObject'),
-messageSends: ["empty", "append:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_empty'),
-smalltalk.method({
-selector: unescape('empty'),
-category: 'DOM insertion',
-fn: function (){
-var self=this;
-return smalltalk.send(self, "_call_", ["empty"]);
-return self;},
-args: [],
-source: unescape('empty%0A%20%20%20%20%5Eself%20call%3A%20%27empty%27'),
-messageSends: ["call:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_jquery'),
-smalltalk.method({
-selector: unescape('jquery'),
-category: 'accessing',
-fn: function (){
-var self=this;
-return self['@jquery'];
-return self;},
-args: [],
-source: unescape('jquery%0A%09%5Ejquery'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_removeAttribute_'),
-smalltalk.method({
-selector: unescape('removeAttribute%3A'),
-category: 'attributes',
-fn: function (aString){
-var self=this;
-return smalltalk.send(self, "_call_withArgument_", ["removeAttribute", aString]);
-return self;},
-args: ["aString"],
-source: unescape('removeAttribute%3A%20aString%0A%20%20%20%20%22Remove%20an%20attribute%20from%20each%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%5Eself%20call%3A%20%27removeAttribute%27%20withArgument%3A%20aString'),
-messageSends: ["call:withArgument:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_attr_'),
-smalltalk.method({
-selector: unescape('attr%3A'),
-category: 'attributes',
-fn: function (aString){
-var self=this;
-return smalltalk.send(self, "_call_withArgument_", ["attr", aString]);
-return self;},
-args: ["aString"],
-source: unescape('attr%3A%20aString%0A%20%20%20%20%22Get%20the%20value%20of%20an%20attribute%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%5Eself%20call%3A%20%27attr%27%20withArgument%3A%20aString'),
-messageSends: ["call:withArgument:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_val'),
-smalltalk.method({
-selector: unescape('val'),
-category: 'attributes',
-fn: function (){
-var self=this;
-return smalltalk.send(self, "_call_", ["val"]);
-return self;},
-args: [],
-source: unescape('val%0A%20%20%20%20%22Get%20the%20current%20value%20of%20the%20first%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%5Eself%20call%3A%20%27val%27'),
-messageSends: ["call:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_val_'),
-smalltalk.method({
-selector: unescape('val%3A'),
-category: 'attributes',
-fn: function (aString){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["val", aString]);
-return self;},
-args: ["aString"],
-source: unescape('val%3A%20aString%0A%20%20%20%20self%20call%3A%20%27val%27%20withArgument%3A%20aString'),
-messageSends: ["call:withArgument:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_attrAt_put_'),
-smalltalk.method({
-selector: unescape('attrAt%3Aput%3A'),
-category: 'attributes',
-fn: function (aString, anotherString){
-var self=this;
-self['@jquery'].attr(aString, anotherString);
-return self;},
-args: ["aString", "anotherString"],
-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(
-unescape('_cssAt_'),
-smalltalk.method({
-selector: unescape('cssAt%3A'),
-category: 'css',
-fn: function (aString){
-var self=this;
-return self['@jquery'].css(aString);
-return self;},
-args: ["aString"],
-source: unescape('cssAt%3A%20aString%0A%09%3Creturn%20self%5B%27@jquery%27%5D.css%28aString%29%3E'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_cssAt_put_'),
-smalltalk.method({
-selector: unescape('cssAt%3Aput%3A'),
-category: 'css',
-fn: function (aString, anotherString){
-var self=this;
-self['@jquery'].css(aString, anotherString);
-return self;},
-args: ["aString", "anotherString"],
-source: unescape('cssAt%3A%20aString%20put%3A%20anotherString%0A%20%20%20%20%3Cself%5B%27@jquery%27%5D.css%28aString%2C%20anotherString%29%3E'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_addClass_'),
-smalltalk.method({
-selector: unescape('addClass%3A'),
-category: 'css',
-fn: function (aString){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["addClass", aString]);
-return self;},
-args: ["aString"],
-source: unescape('addClass%3A%20aString%0A%20%20%20%20%22Adds%20the%20specified%20class%28es%29%20to%20each%20of%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20self%20call%3A%20%27addClass%27%20withArgument%3A%20aString'),
-messageSends: ["call:withArgument:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_removeClass_'),
-smalltalk.method({
-selector: unescape('removeClass%3A'),
-category: 'css',
-fn: function (aString){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["removeClass", aString]);
-return self;},
-args: ["aString"],
-source: unescape('removeClass%3A%20aString%0A%20%20%20%20%22Remove%20a%20single%20class%2C%20multiple%20classes%2C%20or%20all%20classes%20from%20each%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20self%20call%3A%20%27removeClass%27%20withArgument%3A%20aString'),
-messageSends: ["call:withArgument:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_toggleClass_'),
-smalltalk.method({
-selector: unescape('toggleClass%3A'),
-category: 'css',
-fn: function (aString){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["toggleClass", aString]);
-return self;},
-args: ["aString"],
-source: unescape('toggleClass%3A%20aString%0A%20%20%20%20%22Add%20or%20remove%20one%20or%20more%20classes%20from%20each%20element%20in%20the%20set%20of%20matched%20elements%2C%20depending%20on%20either%20the%20class%27s%20presence%20or%20the%20value%20of%20the%20switch%20argument.%22%0A%20%20%20%20self%20call%3A%20%27toggleClass%27%20withArgument%3A%20aString'),
-messageSends: ["call:withArgument:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_height'),
-smalltalk.method({
-selector: unescape('height'),
-category: 'css',
-fn: function (){
-var self=this;
-return smalltalk.send(self, "_call_", ["height"]);
-return self;},
-args: [],
-source: unescape('height%20%0A%20%20%20%20%22Get%20the%20current%20computed%20height%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%5Eself%20call%3A%20%27height%27'),
-messageSends: ["call:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_height_'),
-smalltalk.method({
-selector: unescape('height%3A'),
-category: 'css',
-fn: function (anInteger){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["height", anInteger]);
-return self;},
-args: ["anInteger"],
-source: unescape('height%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27height%27%20withArgument%3A%20anInteger'),
-messageSends: ["call:withArgument:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_width_'),
-smalltalk.method({
-selector: unescape('width%3A'),
-category: 'css',
-fn: function (anInteger){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["width", anInteger]);
-return self;},
-args: ["anInteger"],
-source: unescape('width%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27width%27%20withArgument%3A%20anInteger'),
-messageSends: ["call:withArgument:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_width'),
-smalltalk.method({
-selector: unescape('width'),
-category: 'css',
-fn: function (){
-var self=this;
-return smalltalk.send(self, "_call_", ["width"]);
-return self;},
-args: [],
-source: unescape('width%0A%20%20%20%20%22Get%20the%20current%20computed%20width%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%5Eself%20call%3A%20%27width%27'),
-messageSends: ["call:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_innerHeight'),
-smalltalk.method({
-selector: unescape('innerHeight'),
-category: 'css',
-fn: function (){
-var self=this;
-return smalltalk.send(self, "_call_", ["innerHeight"]);
-return self;},
-args: [],
-source: unescape('innerHeight%0A%20%20%20%20%22Get%20the%20current%20computed%20height%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20including%20padding%20but%20not%20border.%22%0A%20%20%20%20%5Eself%20call%3A%20%27innerHeight%27'),
-messageSends: ["call:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_innerWidth'),
-smalltalk.method({
-selector: unescape('innerWidth'),
-category: 'css',
-fn: function (){
-var self=this;
-return smalltalk.send(self, "_call_", ["innerWidth"]);
-return self;},
-args: [],
-source: unescape('innerWidth%0A%20%20%20%20%22Get%20the%20current%20computed%20width%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20including%20padding%20but%20not%20border.%22%0A%20%20%20%20%5Eself%20call%3A%20%27innerWidth%27'),
-messageSends: ["call:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_outerHeight'),
-smalltalk.method({
-selector: unescape('outerHeight'),
-category: 'css',
-fn: function (){
-var self=this;
-return smalltalk.send(self, "_call_", ["outerHeight"]);
-return self;},
-args: [],
-source: unescape('outerHeight%0A%20%20%20%20%22Get%20the%20current%20computed%20height%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20including%20padding%2C%20border%2C%20and%20optionally%20margin.%22%0A%20%20%20%20%5Eself%20call%3A%20%27outerHeight%27'),
-messageSends: ["call:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_outerWidth'),
-smalltalk.method({
-selector: unescape('outerWidth'),
-category: 'css',
-fn: function (){
-var self=this;
-return smalltalk.send(self, "_call_", ["outerWidth"]);
-return self;},
-args: [],
-source: unescape('outerWidth%0A%20%20%20%20%22Get%20the%20current%20computed%20width%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20including%20padding%20and%20border.%22%0A%20%20%20%20%5Eself%20call%3A%20%27outerWidth%27'),
-messageSends: ["call:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_top'),
-smalltalk.method({
-selector: unescape('top'),
-category: 'css',
-fn: function (){
-var self=this;
-return smalltalk.send(smalltalk.send(self, "_call_", ["position"]), "_basicAt_", ["top"]);
-return self;},
-args: [],
-source: unescape('top%0A%20%20%20%20%22Get%20the%20current%20y%20coordinate%20of%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20relative%20to%20the%20offset%20parent.%22%0A%20%20%20%20%5E%28self%20call%3A%20%27position%27%29%20basicAt%3A%20%27top%27'),
-messageSends: ["basicAt:", "call:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_left'),
-smalltalk.method({
-selector: unescape('left'),
-category: 'css',
-fn: function (){
-var self=this;
-return smalltalk.send(smalltalk.send(self, "_call_", ["position"]), "_basicAt_", ["left"]);
-return self;},
-args: [],
-source: unescape('left%0A%20%20%20%20%22Get%20the%20current%20x%20coordinate%20of%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20relative%20to%20the%20offset%20parent.%22%0A%20%20%20%20%5E%28self%20call%3A%20%27position%27%29%20basicAt%3A%20%27left%27'),
-messageSends: ["basicAt:", "call:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_offsetLeft'),
-smalltalk.method({
-selector: unescape('offsetLeft'),
-category: 'css',
-fn: function (){
-var self=this;
-return smalltalk.send(smalltalk.send(self, "_call_", ["offset"]), "_basicAt_", ["left"]);
-return self;},
-args: [],
-source: unescape('offsetLeft%0A%20%20%20%20%22Get%20the%20current%20coordinates%20of%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20relative%20to%20the%20document.%22%0A%20%20%20%20%5E%28self%20call%3A%20%27offset%27%29%20basicAt%3A%20%27left%27'),
-messageSends: ["basicAt:", "call:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_offsetTop'),
-smalltalk.method({
-selector: unescape('offsetTop'),
-category: 'css',
-fn: function (){
-var self=this;
-return smalltalk.send(smalltalk.send(self, "_call_", ["offset"]), "_basicAt_", ["top"]);
-return self;},
-args: [],
-source: unescape('offsetTop%0A%20%20%20%20%22Get%20the%20current%20coordinates%20of%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20relative%20to%20the%20document.%22%0A%20%20%20%20%5E%28self%20call%3A%20%27offset%27%29%20basicAt%3A%20%27top%27'),
-messageSends: ["basicAt:", "call:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_scrollLeft'),
-smalltalk.method({
-selector: unescape('scrollLeft'),
-category: 'css',
-fn: function (){
-var self=this;
-return smalltalk.send(self, "_call_", ["scrollLeft"]);
-return self;},
-args: [],
-source: unescape('scrollLeft%0A%20%20%20%20%22Get%20the%20current%20horizontal%20position%20of%20the%20scroll%20bar%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%5Eself%20call%3A%20%27scrollLeft%27'),
-messageSends: ["call:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_scrollTop'),
-smalltalk.method({
-selector: unescape('scrollTop'),
-category: 'css',
-fn: function (){
-var self=this;
-return smalltalk.send(self, "_call_", ["scrollTop"]);
-return self;},
-args: [],
-source: unescape('scrollTop%0A%20%20%20%20%22Get%20the%20current%20vertical%20position%20of%20the%20scroll%20bar%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%5Eself%20call%3A%20%27scrollTop%27'),
-messageSends: ["call:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_scrollLeft_'),
-smalltalk.method({
-selector: unescape('scrollLeft%3A'),
-category: 'css',
-fn: function (anInteger){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["scrollLeft", anInteger]);
-return self;},
-args: ["anInteger"],
-source: unescape('scrollLeft%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27scrollLeft%27%20withArgument%3A%20anInteger'),
-messageSends: ["call:withArgument:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_scrollTop_'),
-smalltalk.method({
-selector: unescape('scrollTop%3A'),
-category: 'css',
-fn: function (anInteger){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["scrollTop", anInteger]);
-return self;},
-args: ["anInteger"],
-source: unescape('scrollTop%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27scrollTop%27%20withArgument%3A%20anInteger'),
-messageSends: ["call:withArgument:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_fadeIn'),
-smalltalk.method({
-selector: unescape('fadeIn'),
-category: 'effects',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_call_", ["fadeIn"]);
-return self;},
-args: [],
-source: unescape('fadeIn%0A%20%09self%20call%3A%20%27fadeIn%27'),
-messageSends: ["call:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_slideDown'),
-smalltalk.method({
-selector: unescape('slideDown'),
-category: 'effects',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_call_", ["slideDown"]);
-return self;},
-args: [],
-source: unescape('slideDown%0A%20%09self%20call%3A%20%27slideDown%27'),
-messageSends: ["call:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_fadeInSlow'),
-smalltalk.method({
-selector: unescape('fadeInSlow'),
-category: 'effects',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["fadeIn", "slow"]);
-return self;},
-args: [],
-source: unescape('fadeInSlow%0A%20%09self%20call%3A%20%27fadeIn%27%20withArgument%3A%20%27slow%27'),
-messageSends: ["call:withArgument:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_fadeOut'),
-smalltalk.method({
-selector: unescape('fadeOut'),
-category: 'effects',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_call_", ["fadeOut"]);
-return self;},
-args: [],
-source: unescape('fadeOut%0A%20%09self%20call%3A%20%27fadeOut%27'),
-messageSends: ["call:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_fadeOutSlow'),
-smalltalk.method({
-selector: unescape('fadeOutSlow'),
-category: 'effects',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["fadeOut", "slow"]);
-return self;},
-args: [],
-source: unescape('fadeOutSlow%0A%20%09self%20call%3A%20%27fadeOut%27%20withArgument%3A%20%27slow%27'),
-messageSends: ["call:withArgument:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_slideUp'),
-smalltalk.method({
-selector: unescape('slideUp'),
-category: 'effects',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_call_", ["slideUp"]);
-return self;},
-args: [],
-source: unescape('slideUp%0A%20%09self%20call%3A%20%27slideUp%27'),
-messageSends: ["call:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_fadeOut_do_'),
-smalltalk.method({
-selector: unescape('fadeOut%3Ado%3A'),
-category: 'effects',
-fn: function (aString, aBlock){
-var self=this;
-self['@jquery'].fadeOut(aString, aBlock);
-return self;},
-args: ["aString", "aBlock"],
-source: unescape('fadeOut%3A%20aString%20do%3A%20aBlock%0A%20%20%20%20%3Cself%5B%27@jquery%27%5D.fadeOut%28aString%2C%20aBlock%29%3E'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_do_'),
-smalltalk.method({
-selector: unescape('do%3A'),
-category: 'enumerating',
-fn: function (aBlock){
-var self=this;
-smalltalk.send(self, "_elementsDo_", [(function(anElement){return smalltalk.send(aBlock, "_value_", [smalltalk.send((smalltalk.JQuery || JQuery), "_fromElement_", [anElement])]);})]);
-return self;},
-args: ["aBlock"],
-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(
-unescape('_focus'),
-smalltalk.method({
-selector: unescape('focus'),
-category: 'events',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_call_", ["focus"]);
-return self;},
-args: [],
-source: unescape('focus%0A%20%20%20%20self%20call%3A%20%27focus%27'),
-messageSends: ["call:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_show'),
-smalltalk.method({
-selector: unescape('show'),
-category: 'events',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_call_", ["show"]);
-return self;},
-args: [],
-source: unescape('show%0A%20%20%20%20self%20call%3A%20%27show%27'),
-messageSends: ["call:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_hide'),
-smalltalk.method({
-selector: unescape('hide'),
-category: 'events',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_call_", ["hide"]);
-return self;},
-args: [],
-source: unescape('hide%0A%20%20%20%20self%20call%3A%20%27hide%27'),
-messageSends: ["call:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_remove'),
-smalltalk.method({
-selector: unescape('remove'),
-category: 'events',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_call_", ["remove"]);
-return self;},
-args: [],
-source: unescape('remove%0A%20%20%20%20self%20call%3A%20%27remove%27'),
-messageSends: ["call:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_on_do_'),
-smalltalk.method({
-selector: unescape('on%3Ado%3A'),
-category: 'events',
-fn: function (anEventString, aBlock){
-var self=this;
-self['@jquery'].bind(anEventString, function(e){aBlock(e, self)});
-return self;},
-args: ["anEventString", "aBlock"],
-source: unescape('on%3A%20anEventString%20do%3A%20aBlock%0A%20%20%20%20%22Attach%20aBlock%20for%20anEventString%20on%20the%20element%22%0A%20%20%20%20%3Cself%5B%27@jquery%27%5D.bind%28anEventString%2C%20function%28e%29%7BaBlock%28e%2C%20self%29%7D%29%3E'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_removeEvents_'),
-smalltalk.method({
-selector: unescape('removeEvents%3A'),
-category: 'events',
-fn: function (aString){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["unbind", aString]);
-return self;},
-args: ["aString"],
-source: unescape('removeEvents%3A%20aString%0A%20%20%20%20%22Unbind%20all%20handlers%20attached%20to%20the%20event%20aString%22%0A%20%20%20%20self%20call%3A%20%27unbind%27%20withArgument%3A%20aString'),
-messageSends: ["call:withArgument:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_onLoadDo_'),
-smalltalk.method({
-selector: unescape('onLoadDo%3A'),
-category: 'events',
-fn: function (aBlock){
-var self=this;
-smalltalk.send(self, "_call_withArgument_", ["load", aBlock]);
-return self;},
-args: ["aBlock"],
-source: unescape('onLoadDo%3A%20aBlock%0A%09%22Bind%20an%20event%20handler%20to%20the%20%27load%27%20JavaScript%20event.%22%0A%09self%20call%3A%20%27load%27%20withArgument%3A%20aBlock'),
-messageSends: ["call:withArgument:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_initializeWithJQueryObject_'),
-smalltalk.method({
-selector: unescape('initializeWithJQueryObject%3A'),
-category: 'initialization',
-fn: function (anObject){
-var self=this;
-self['@jquery']=anObject;
-return self;},
-args: ["anObject"],
-source: unescape('initializeWithJQueryObject%3A%20anObject%0A%20%20%20%20jquery%20%3A%3D%20anObject'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_call_'),
-smalltalk.method({
-selector: unescape('call%3A'),
-category: 'private',
-fn: function (aString){
-var self=this;
-return self['@jquery'][aString]();
-return self;},
-args: ["aString"],
-source: unescape('call%3A%20aString%0A%09%3Creturn%20self%5B%27@jquery%27%5D%5BaString%5D%28%29%3E'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_call_withArgument_'),
-smalltalk.method({
-selector: unescape('call%3AwithArgument%3A'),
-category: 'private',
-fn: function (aString, anObject){
-var self=this;
-return self['@jquery'][aString](anObject);
-return self;},
-args: ["aString", "anObject"],
-source: unescape('call%3A%20aString%20withArgument%3A%20anObject%0A%20%20%20%20%3Creturn%20self%5B%27@jquery%27%5D%5BaString%5D%28anObject%29%3E'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_elementsDo_'),
-smalltalk.method({
-selector: unescape('elementsDo%3A'),
-category: 'private',
-fn: function (aBlock){
-var self=this;
-self['@jquery'].each(function(index, element){aBlock(element, self)});
-return self;},
-args: ["aBlock"],
-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(
-unescape('_hasClass_'),
-smalltalk.method({
-selector: unescape('hasClass%3A'),
-category: 'testing',
-fn: function (aString){
-var self=this;
-return smalltalk.send(self, "_call_withArgument_", ["hasClass", aString]);
-return self;},
-args: ["aString"],
-source: unescape('hasClass%3A%20aString%0A%20%20%20%20%22Determine%20whether%20any%20of%20the%20matched%20elements%20are%20assigned%20the%20given%20class.%22%0A%20%20%20%20%5Eself%20call%3A%20%27hasClass%27%20withArgument%3A%20aString'),
-messageSends: ["call:withArgument:"],
-referencedClasses: []
-}),
-smalltalk.JQuery);
-
-smalltalk.addMethod(
-unescape('_find_'),
-smalltalk.method({
-selector: unescape('find%3A'),
-category: 'traversing',
-fn: function (aSelector){
-var self=this;
-return smalltalk.send(self, "_call_withArgument_", ["find", aSelector]);
-return self;},
-args: ["aSelector"],
-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(
-unescape('_fromString_'),
-smalltalk.method({
-selector: unescape('fromString%3A'),
-category: 'instance creation',
-fn: function (aString){
-var self=this;
-var newJQuery=nil;
-newJQuery = jQuery(String(aString));
-return smalltalk.send(self, "_from_", [newJQuery]);
-return self;},
-args: ["aString"],
-source: unescape('fromString%3A%20aString%0A%20%20%20%20%7C%20newJQuery%20%7C%0A%20%20%20%20%3CnewJQuery%20%3D%20jQuery%28String%28aString%29%29%3E.%0A%20%20%20%20%5Eself%20from%3A%20newJQuery'),
-messageSends: ["from:"],
-referencedClasses: []
-}),
-smalltalk.JQuery.klass);
-
-smalltalk.addMethod(
-unescape('_from_'),
-smalltalk.method({
-selector: unescape('from%3A'),
-category: 'instance creation',
-fn: function (anObject){
-var self=this;
-return (function($rec){smalltalk.send($rec, "_initializeWithJQueryObject_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
-return self;},
-args: ["anObject"],
-source: unescape('from%3A%20anObject%0A%20%20%20%20%5Eself%20new%0A%09initializeWithJQueryObject%3A%20anObject%3B%0A%09yourself'),
-messageSends: ["initializeWithJQueryObject:", "yourself", "new"],
-referencedClasses: []
-}),
-smalltalk.JQuery.klass);
-
-smalltalk.addMethod(
-unescape('_window'),
-smalltalk.method({
-selector: unescape('window'),
-category: 'instance creation',
-fn: function (){
-var self=this;
-return self._from_(jQuery(window));
-return self;},
-args: [],
-source: unescape('window%0A%09%3Creturn%20self._from_%28jQuery%28window%29%29%3E'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.JQuery.klass);
-
-smalltalk.addMethod(
-unescape('_body'),
-smalltalk.method({
-selector: unescape('body'),
-category: 'instance creation',
-fn: function (){
-var self=this;
-return self._from_(jQuery('body'));
-return self;},
-args: [],
-source: unescape('body%0A%09%3Creturn%20self._from_%28jQuery%28%27body%27%29%29%3E'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.JQuery.klass);
-
-smalltalk.addMethod(
-unescape('_document'),
-smalltalk.method({
-selector: unescape('document'),
-category: 'instance creation',
-fn: function (){
-var self=this;
-return self._from_(jQuery(document));
-return self;},
-args: [],
-source: unescape('document%0A%09%3Creturn%20self._from_%28jQuery%28document%29%29%3E'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.JQuery.klass);
-
-smalltalk.addMethod(
-unescape('_fromElement_'),
-smalltalk.method({
-selector: unescape('fromElement%3A'),
-category: 'instance creation',
-fn: function (anElement){
-var self=this;
-var newJQuery=nil;
-newJQuery = jQuery(anElement);
-return smalltalk.send(self, "_from_", [newJQuery]);
-return self;},
-args: ["anElement"],
-source: unescape('fromElement%3A%20anElement%0A%20%20%20%20%7C%20newJQuery%20%7C%0A%20%20%20%20%3CnewJQuery%20%3D%20jQuery%28anElement%29%3E.%0A%20%20%20%20%5Eself%20from%3A%20newJQuery'),
-messageSends: ["from:"],
-referencedClasses: []
-}),
-smalltalk.JQuery.klass);
-
-smalltalk.addMethod(
-unescape('_documentReady_'),
-smalltalk.method({
-selector: unescape('documentReady%3A'),
-category: 'instance creation',
-fn: function (aBlock){
-var self=this;
-jQuery(document).ready(aBlock);
-return self;},
-args: ["aBlock"],
-source: unescape('documentReady%3A%20aBlock%0A%09%3CjQuery%28document%29.ready%28aBlock%29%3E'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.JQuery.klass);
-
-
-smalltalk.addClass('Ajax', smalltalk.Object, ['settings'], 'JQuery');
-smalltalk.Ajax.comment=unescape('instance%20variable%20names%3A%0A-%20settings%20%20A%20set%20of%20key/value%20pairs%20that%20configure%20the%20Ajax%20request.%20All%20settings%20are%20optional.%0A%0AFull%20list%20of%20settings%20options%20at%20http%3A//api.jquery.com/jQuery.ajax/')
-smalltalk.addMethod(
-unescape('_at_'),
-smalltalk.method({
-selector: unescape('at%3A'),
-category: 'accessing',
-fn: function (aKey){
-var self=this;
-return smalltalk.send(self['@settings'], "_at_ifAbsent_", [aKey, (function(){return nil;})]);
-return self;},
-args: ["aKey"],
-source: unescape('at%3A%20aKey%0A%20%20%20%20%5Esettings%20at%3A%20aKey%20ifAbsent%3A%20%5Bnil%5D'),
-messageSends: ["at:ifAbsent:"],
-referencedClasses: []
-}),
-smalltalk.Ajax);
-
-smalltalk.addMethod(
-unescape('_at_put_'),
-smalltalk.method({
-selector: unescape('at%3Aput%3A'),
-category: 'accessing',
-fn: function (aKey, aValue){
-var self=this;
-smalltalk.send(self['@settings'], "_at_put_", [aKey, aValue]);
-return self;},
-args: ["aKey", "aValue"],
-source: unescape('at%3A%20aKey%20put%3A%20aValue%0A%20%20%20%20settings%20at%3A%20aKey%20put%3A%20aValue'),
-messageSends: ["at:put:"],
-referencedClasses: []
-}),
-smalltalk.Ajax);
-
-smalltalk.addMethod(
-unescape('_url'),
-smalltalk.method({
-selector: unescape('url'),
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.send(self, "_at_", ["url"]);
-return self;},
-args: [],
-source: unescape('url%0A%20%20%20%20%5Eself%20at%3A%20%27url%27'),
-messageSends: ["at:"],
-referencedClasses: []
-}),
-smalltalk.Ajax);
-
-smalltalk.addMethod(
-unescape('_url_'),
-smalltalk.method({
-selector: unescape('url%3A'),
-category: 'accessing',
-fn: function (aString){
-var self=this;
-smalltalk.send(self, "_at_put_", ["url", aString]);
-return self;},
-args: ["aString"],
-source: unescape('url%3A%20aString%0A%20%20%20%20self%20at%3A%20%27url%27%20put%3A%20aString'),
-messageSends: ["at:put:"],
-referencedClasses: []
-}),
-smalltalk.Ajax);
-
-smalltalk.addMethod(
-unescape('_send'),
-smalltalk.method({
-selector: unescape('send'),
-category: 'actions',
-fn: function (){
-var self=this;
-jQuery.ajax(self['@settings']);
-return self;},
-args: [],
-source: unescape('send%0A%20%20%20%20%3CjQuery.ajax%28self%5B%27@settings%27%5D%29%3E'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.Ajax);
-
-smalltalk.addMethod(
-unescape('_onSuccessDo_'),
-smalltalk.method({
-selector: unescape('onSuccessDo%3A'),
-category: 'callbacks',
-fn: function (aBlock){
-var self=this;
-smalltalk.send(self, "_at_put_", ["success", aBlock]);
-return self;},
-args: ["aBlock"],
-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(
-unescape('_onCompleteDo_'),
-smalltalk.method({
-selector: unescape('onCompleteDo%3A'),
-category: 'callbacks',
-fn: function (aBlock){
-var self=this;
-smalltalk.send(self, "_at_put_", ["complete", aBlock]);
-return self;},
-args: ["aBlock"],
-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(
-unescape('_onErrorDo_'),
-smalltalk.method({
-selector: unescape('onErrorDo%3A'),
-category: 'callbacks',
-fn: function (aBlock){
-var self=this;
-smalltalk.send(self, "_at_put_", ["error", aBlock]);
-return self;},
-args: ["aBlock"],
-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(
-unescape('_initialize'),
-smalltalk.method({
-selector: unescape('initialize'),
-category: 'initialization',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_initialize", [], smalltalk.Object);
-self['@settings']=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []);
-return self;},
-args: [],
-source: unescape('initialize%0A%20%20%20%20super%20initialize.%0A%20%20%20%20settings%20%3A%3D%20Dictionary%20new'),
-messageSends: ["initialize", "new"],
-referencedClasses: [smalltalk.Dictionary]
-}),
-smalltalk.Ajax);
-
-
-smalltalk.addMethod(
-unescape('_url_'),
-smalltalk.method({
-selector: unescape('url%3A'),
-category: 'instance creation',
-fn: function (aString){
-var self=this;
-return (function($rec){smalltalk.send($rec, "_url_", [aString]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
-return self;},
-args: ["aString"],
-source: unescape('url%3A%20aString%0A%20%20%20%20%5Eself%20new%0A%09url%3A%20aString%3B%0A%09yourself'),
-messageSends: ["url:", "yourself", "new"],
-referencedClasses: []
-}),
-smalltalk.Ajax.klass);
-
-
-smalltalk.addMethod(
-unescape('_appendToJQuery_'),
-smalltalk.method({
-selector: unescape('appendToJQuery%3A'),
-category: '*JQuery',
-fn: function (aJQuery){
-var self=this;
-smalltalk.send(self, "_value_", [smalltalk.send((smalltalk.HTMLCanvas || HTMLCanvas), "_onJQuery_", [aJQuery])]);
-return self;},
-args: ["aJQuery"],
-source: unescape('appendToJQuery%3A%20aJQuery%0A%09self%20value%3A%20%28HTMLCanvas%20onJQuery%3A%20aJQuery%29'),
-messageSends: ["value:", "onJQuery:"],
-referencedClasses: [smalltalk.HTMLCanvas]
-}),
-smalltalk.BlockClosure);
-
-smalltalk.addMethod(
-unescape('_asJQuery'),
-smalltalk.method({
-selector: unescape('asJQuery'),
-category: '*JQuery',
-fn: function (){
-var self=this;
-return smalltalk.send((smalltalk.JQuery || JQuery), "_fromString_", [self]);
-return self;},
-args: [],
-source: unescape('asJQuery%0A%20%20%20%20%5EJQuery%20fromString%3A%20self'),
-messageSends: ["fromString:"],
-referencedClasses: [smalltalk.JQuery]
-}),
-smalltalk.String);
-
-smalltalk.addMethod(
-unescape('_appendToJQuery_'),
-smalltalk.method({
-selector: unescape('appendToJQuery%3A'),
-category: '*JQuery',
-fn: function (aJQuery){
-var self=this;
-aJQuery._appendElement_(String(self));
-return self;},
-args: ["aJQuery"],
-source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20%3CaJQuery._appendElement_%28String%28self%29%29%3E'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.String);
-
-smalltalk.addMethod(
-unescape('_appendToJQuery_'),
-smalltalk.method({
-selector: unescape('appendToJQuery%3A'),
-category: '*JQuery',
-fn: function (aJQuery){
-var self=this;
-smalltalk.send(aJQuery, "_appendElement_", [smalltalk.send(self['@root'], "_element", [])]);
-return self;},
-args: ["aJQuery"],
-source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20aJQuery%20appendElement%3A%20root%20element'),
-messageSends: ["appendElement:", "element"],
-referencedClasses: []
-}),
-smalltalk.HTMLCanvas);
-

+ 40 - 11
js/Kernel-Tests.deploy.js

@@ -27,8 +27,8 @@ smalltalk.method({
 selector: 'testIncludesSubString',
 fn: function (){
 var self=this;
-smalltalk.send(self, "_assert_", [smalltalk.send("jtalk", "_includesSubString_", ["alk"])]);
-smalltalk.send(self, "_deny_", [smalltalk.send("jtalk", "_includesSubString_", ["zork"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send("amber", "_includesSubString_", ["ber"])]);
+smalltalk.send(self, "_deny_", [smalltalk.send("amber", "_includesSubString_", ["zork"])]);
 return self;}
 }),
 smalltalk.StringTest);
@@ -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');
@@ -152,14 +163,14 @@ smalltalk.method({
 selector: 'testIfTrueIfFalse',
 fn: function (){
 var self=this;
-smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = true).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return "alternative block";})]), "__eq", ["alternative block"])]);
-smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = true).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return "alternative block";})]), "__eq", [nil])]);
-smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = false).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return "alternative block";})]), "__eq", [nil])]);
-smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = false).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return "alternative block";})]), "__eq", ["alternative block"])]);
-smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = false).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "alternative block";}), (function(){return "alternative block2";})]), "__eq", ["alternative block2"])]);
-smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = false).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return "alternative block";}), (function(){return "alternative block2";})]), "__eq", ["alternative block"])]);
-smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = true).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "alternative block";}), (function(){return "alternative block2";})]), "__eq", ["alternative block"])]);
-smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = true).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return "alternative block";}), (function(){return "alternative block2";})]), "__eq", ["alternative block2"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = true).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return "alternative block";})])), "__eq", ["alternative block"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = true).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return "alternative block";})])), "__eq", [nil])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = false).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return "alternative block";})])), "__eq", [nil])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = false).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return "alternative block";})])), "__eq", ["alternative block"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = false).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "alternative block";}), (function(){return "alternative block2";})])), "__eq", ["alternative block2"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = false).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return "alternative block";}), (function(){return "alternative block2";})])), "__eq", ["alternative block"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = true).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "alternative block";}), (function(){return "alternative block2";})])), "__eq", ["alternative block"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = true).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return "alternative block";}), (function(){return "alternative block2";})])), "__eq", ["alternative block2"])]);
 return self;}
 }),
 smalltalk.BooleanTest);
@@ -198,7 +209,7 @@ smalltalk.send(self, "_assert_", [smalltalk.send((2) - (1), "__eq", [(1)])]);
 smalltalk.send(self, "_assert_", [smalltalk.send((-2) - (1), "__eq", [(-3)])]);
 smalltalk.send(self, "_assert_", [smalltalk.send((12) / (2), "__eq", [(6)])]);
 smalltalk.send(self, "_assert_", [smalltalk.send((3) * (4), "__eq", [(12)])]);
-smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = (1) + (2)).klass === smalltalk.Number) ? $receiver *(3) : smalltalk.send($receiver, "__star", [(3)]), "__eq", [(9)])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = (1) + (2)).klass === smalltalk.Number) ? $receiver *(3) : smalltalk.send($receiver, "__star", [(3)])), "__eq", [(9)])]);
 smalltalk.send(self, "_assert_", [smalltalk.send((1) + (2) * (3), "__eq", [(7)])]);
 return self;}
 }),
@@ -285,3 +296,21 @@ smalltalk.NumberTest);
 
 
 
+smalltalk.addClass('JSObjectProxyTest', smalltalk.TestCase, [], 'Kernel-Tests');
+smalltalk.addMethod(
+'_testMethodWithArguments',
+smalltalk.method({
+selector: 'testMethodWithArguments',
+fn: function (){
+var self=this;
+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.JSObjectProxyTest);
+
+
+

+ 51 - 12
js/Kernel-Tests.js

@@ -38,11 +38,11 @@ selector: unescape('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"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send("amber", "_includesSubString_", ["ber"])]);
+smalltalk.send(self, "_deny_", [smalltalk.send("amber", "_includesSubString_", ["zork"])]);
 return self;},
 args: [],
-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.'),
+source: unescape('testIncludesSubString%0A%09self%20assert%3A%20%28%27amber%27%20includesSubString%3A%20%27ber%27%29.%0A%09self%20deny%3A%20%28%27amber%27%20includesSubString%3A%20%27zork%27%29.'),
 messageSends: ["assert:", "includesSubString:", "deny:"],
 referencedClasses: []
 }),
@@ -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%20'),
+messageSends: ["assert:equals:", "copyWithoutAll:"],
+referencedClasses: []
+}),
+smalltalk.StringTest);
+
 
 
 smalltalk.addClass('DictionaryTest', smalltalk.TestCase, [], 'Kernel-Tests');
@@ -203,14 +219,14 @@ selector: unescape('testIfTrueIfFalse'),
 category: 'not yet classified',
 fn: function (){
 var self=this;
-smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = true).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return "alternative block";})]), "__eq", ["alternative block"])]);
-smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = true).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return "alternative block";})]), "__eq", [nil])]);
-smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = false).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return "alternative block";})]), "__eq", [nil])]);
-smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = false).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return "alternative block";})]), "__eq", ["alternative block"])]);
-smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = false).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "alternative block";}), (function(){return "alternative block2";})]), "__eq", ["alternative block2"])]);
-smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = false).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return "alternative block";}), (function(){return "alternative block2";})]), "__eq", ["alternative block"])]);
-smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = true).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "alternative block";}), (function(){return "alternative block2";})]), "__eq", ["alternative block"])]);
-smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = true).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return "alternative block";}), (function(){return "alternative block2";})]), "__eq", ["alternative block2"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = true).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return "alternative block";})])), "__eq", ["alternative block"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = true).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return "alternative block";})])), "__eq", [nil])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = false).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return "alternative block";})])), "__eq", [nil])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = false).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return "alternative block";})])), "__eq", ["alternative block"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = false).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "alternative block";}), (function(){return "alternative block2";})])), "__eq", ["alternative block2"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = false).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return "alternative block";}), (function(){return "alternative block2";})])), "__eq", ["alternative block"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = true).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "alternative block";}), (function(){return "alternative block2";})])), "__eq", ["alternative block"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = true).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return "alternative block";}), (function(){return "alternative block2";})])), "__eq", ["alternative block2"])]);
 return self;},
 args: [],
 source: unescape('testIfTrueIfFalse%0A%20%0A%09self%20assert%3A%20%28true%20ifTrue%3A%20%5B%27alternative%20block%27%5D%29%20%3D%20%27alternative%20block%27.%0A%09self%20assert%3A%20%28true%20ifFalse%3A%20%5B%27alternative%20block%27%5D%29%20%3D%20nil.%0A%0A%09self%20assert%3A%20%28false%20ifTrue%3A%20%5B%27alternative%20block%27%5D%29%20%3D%20nil.%0A%09self%20assert%3A%20%28false%20ifFalse%3A%20%5B%27alternative%20block%27%5D%29%20%3D%20%27alternative%20block%27.%0A%0A%09self%20assert%3A%20%28false%20ifTrue%3A%20%5B%27alternative%20block%27%5D%20ifFalse%3A%20%5B%27alternative%20block2%27%5D%29%20%3D%20%27alternative%20block2%27.%0A%09self%20assert%3A%20%28false%20ifFalse%3A%20%5B%27alternative%20block%27%5D%20ifTrue%3A%20%5B%27alternative%20block2%27%5D%29%20%3D%20%27alternative%20block%27.%0A%0A%09self%20assert%3A%20%28true%20ifTrue%3A%20%5B%27alternative%20block%27%5D%20ifFalse%3A%20%5B%27alternative%20block2%27%5D%29%20%3D%20%27alternative%20block%27.%0A%09self%20assert%3A%20%28true%20ifFalse%3A%20%5B%27alternative%20block%27%5D%20ifTrue%3A%20%5B%27alternative%20block2%27%5D%29%20%3D%20%27alternative%20block2%27.'),
@@ -259,7 +275,7 @@ smalltalk.send(self, "_assert_", [smalltalk.send((2) - (1), "__eq", [(1)])]);
 smalltalk.send(self, "_assert_", [smalltalk.send((-2) - (1), "__eq", [(-3)])]);
 smalltalk.send(self, "_assert_", [smalltalk.send((12) / (2), "__eq", [(6)])]);
 smalltalk.send(self, "_assert_", [smalltalk.send((3) * (4), "__eq", [(12)])]);
-smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = (1) + (2)).klass === smalltalk.Number) ? $receiver *(3) : smalltalk.send($receiver, "__star", [(3)]), "__eq", [(9)])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = (1) + (2)).klass === smalltalk.Number) ? $receiver *(3) : smalltalk.send($receiver, "__star", [(3)])), "__eq", [(9)])]);
 smalltalk.send(self, "_assert_", [smalltalk.send((1) + (2) * (3), "__eq", [(7)])]);
 return self;},
 args: [],
@@ -375,3 +391,26 @@ smalltalk.NumberTest);
 
 
 
+smalltalk.addClass('JSObjectProxyTest', smalltalk.TestCase, [], 'Kernel-Tests');
+smalltalk.addMethod(
+unescape('_testMethodWithArguments'),
+smalltalk.method({
+selector: unescape('testMethodWithArguments'),
+category: 'tests',
+fn: function (){
+var self=this;
+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('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.%0A%09'),
+messageSends: ["deny:", "hasClass:", "asJQuery", "addClass:", "assert:", "removeClass:"],
+referencedClasses: []
+}),
+smalltalk.JSObjectProxyTest);
+
+
+

File diff suppressed because it is too large
+ 48 - 26
js/Kernel.deploy.js


File diff suppressed because it is too large
+ 76 - 44
js/Kernel.js


+ 4 - 4
js/SUnit.deploy.js

@@ -118,7 +118,7 @@ smalltalk.method({
 selector: 'assert:description:',
 fn: function (aBoolean, aString){
 var self=this;
-(($receiver = aBoolean).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_signalFailure_", [aString]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_signalFailure_", [aString]);})]);
+((($receiver = aBoolean).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_signalFailure_", [aString]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_signalFailure_", [aString]);})]));
 return self;}
 }),
 smalltalk.TestCase);
@@ -165,7 +165,7 @@ fn: function (){
 var self=this;
 var selectors=nil;
 selectors=smalltalk.send(self, "_testSelectors", []);
-(($receiver = smalltalk.send(self, "_shouldInheritSelectors", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(selectors, "_addAll_", [smalltalk.send(smalltalk.send(self, "_superclass", []), "_allTestSelectors", [])]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(selectors, "_addAll_", [smalltalk.send(smalltalk.send(self, "_superclass", []), "_allTestSelectors", [])]);})]);
+((($receiver = smalltalk.send(self, "_shouldInheritSelectors", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(selectors, "_addAll_", [smalltalk.send(smalltalk.send(self, "_superclass", []), "_allTestSelectors", [])]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(selectors, "_addAll_", [smalltalk.send(smalltalk.send(self, "_superclass", []), "_allTestSelectors", [])]);})]));
 return selectors;
 return self;}
 }),
@@ -292,7 +292,7 @@ smalltalk.method({
 selector: 'increaseRuns',
 fn: function (){
 var self=this;
-self['@runs']=(($receiver = self['@runs']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);
+self['@runs']=((($receiver = self['@runs']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));
 return self;}
 }),
 smalltalk.TestResult);
@@ -303,7 +303,7 @@ smalltalk.method({
 selector: 'status',
 fn: function (){
 var self=this;
-return (($receiver = smalltalk.send(smalltalk.send(self, "_errors", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (($receiver = smalltalk.send(smalltalk.send(self, "_failures", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "success";})() : (function(){return "failure";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "success";}), (function(){return "failure";})]);})() : (function(){return "error";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (($receiver = smalltalk.send(smalltalk.send(self, "_failures", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "success";})() : (function(){return "failure";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "success";}), (function(){return "failure";})]);}), (function(){return "error";})]);
+return ((($receiver = smalltalk.send(smalltalk.send(self, "_errors", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_failures", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "success";})() : (function(){return "failure";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "success";}), (function(){return "failure";})]));})() : (function(){return "error";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_failures", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "success";})() : (function(){return "failure";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "success";}), (function(){return "failure";})]));}), (function(){return "error";})]));
 return self;}
 }),
 smalltalk.TestResult);

+ 4 - 4
js/SUnit.js

@@ -169,7 +169,7 @@ selector: unescape('assert%3Adescription%3A'),
 category: 'testing',
 fn: function (aBoolean, aString){
 var self=this;
-(($receiver = aBoolean).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_signalFailure_", [aString]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_signalFailure_", [aString]);})]);
+((($receiver = aBoolean).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_signalFailure_", [aString]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_signalFailure_", [aString]);})]));
 return self;},
 args: ["aBoolean", "aString"],
 source: unescape('assert%3A%20aBoolean%20description%3A%20aString%0A%09aBoolean%20ifFalse%3A%20%5Bself%20signalFailure%3A%20aString%5D'),
@@ -236,7 +236,7 @@ fn: function (){
 var self=this;
 var selectors=nil;
 selectors=smalltalk.send(self, "_testSelectors", []);
-(($receiver = smalltalk.send(self, "_shouldInheritSelectors", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(selectors, "_addAll_", [smalltalk.send(smalltalk.send(self, "_superclass", []), "_allTestSelectors", [])]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(selectors, "_addAll_", [smalltalk.send(smalltalk.send(self, "_superclass", []), "_allTestSelectors", [])]);})]);
+((($receiver = smalltalk.send(self, "_shouldInheritSelectors", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(selectors, "_addAll_", [smalltalk.send(smalltalk.send(self, "_superclass", []), "_allTestSelectors", [])]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(selectors, "_addAll_", [smalltalk.send(smalltalk.send(self, "_superclass", []), "_allTestSelectors", [])]);})]));
 return selectors;
 return self;},
 args: [],
@@ -418,7 +418,7 @@ selector: unescape('increaseRuns'),
 category: 'accessing',
 fn: function (){
 var self=this;
-self['@runs']=(($receiver = self['@runs']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]);
+self['@runs']=((($receiver = self['@runs']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));
 return self;},
 args: [],
 source: unescape('increaseRuns%0A%09runs%20%3A%3D%20runs%20+%201'),
@@ -434,7 +434,7 @@ selector: unescape('status'),
 category: 'accessing',
 fn: function (){
 var self=this;
-return (($receiver = smalltalk.send(smalltalk.send(self, "_errors", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (($receiver = smalltalk.send(smalltalk.send(self, "_failures", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "success";})() : (function(){return "failure";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "success";}), (function(){return "failure";})]);})() : (function(){return "error";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (($receiver = smalltalk.send(smalltalk.send(self, "_failures", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "success";})() : (function(){return "failure";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "success";}), (function(){return "failure";})]);}), (function(){return "error";})]);
+return ((($receiver = smalltalk.send(smalltalk.send(self, "_errors", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_failures", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "success";})() : (function(){return "failure";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "success";}), (function(){return "failure";})]));})() : (function(){return "error";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_failures", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "success";})() : (function(){return "failure";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "success";}), (function(){return "failure";})]));}), (function(){return "error";})]));
 return self;},
 args: [],
 source: unescape('status%0A%09%5Eself%20errors%20isEmpty%20%0A%09%09ifTrue%3A%20%5B%0A%09%09%09self%20failures%20isEmpty%20%0A%09%09%09%09ifTrue%3A%20%5B%27success%27%5D%0A%09%09%09%09ifFalse%3A%20%5B%27failure%27%5D%5D%0A%09%09ifFalse%3A%20%5B%27error%27%5D'),

+ 0 - 3
js/amber.js

@@ -67,14 +67,12 @@
 	    loadJS("boot.js");
 	    loadJS("Kernel.deploy.js");
 	    loadJS("Canvas.deploy.js");
-	    loadJS("JQuery.deploy.js");
 	} else {
 	    loadIDEDependencies();
 	    loadCSS('amber.css');
 	    loadJS("boot.js");
 	    loadJS("Kernel.js");
 	    loadJS("Canvas.js");
-	    loadJS("JQuery.js");
 	    loadJS("Compiler.js");
 	    loadJS("parser.js");
 	    loadJS("IDE.js");
@@ -82,7 +80,6 @@
 	    loadJS("Examples.js");
 	    loadJS("Benchfib.js");
 	    loadJS("Kernel-Tests.js");
-	    loadJS("JQuery-Tests.js");
 	}
 
 	// Load other files, possibly with another directory prefix than 'js'

+ 16 - 2
js/boot.js

@@ -48,13 +48,27 @@ function SmalltalkNil(){};
 function Smalltalk(){
 
     var st = this;
-    this.thisContext = undefined;
 
+    /* This is the current call context object. While it is publicly available,
+       Use smalltalk.getThisContext() instead which will answer a safe copy of 
+       the current context */
+
+    st.thisContext = undefined;
+
+    /* List of all reserved words in JavaScript. They may not be used as variables
+       in Smalltalk. */
+
+    st.reservedWords = ['break', 'case', 'catch', 'class', 'continue', 'debugger', 
+			'default', 'delete', 'do', 'else', 'finally', 'for', 'function', 
+			'if', 'in', 'instanceof', 'new', 'private', 'protected', 
+			'public', 'return', 'static', 'switch', 'this', 'throw',
+			'try', 'typeof', 'var', 'void', 'while', 'with', 'yield'];
     
     /* We hold all Packages in a separate Object */
+
     st.packages = {};
 
-    /* Smalltalk Package object. To add a Package, use smalltalk.addPackage() */
+    /* Smalltalk package creation. To add a Package, use smalltalk.addPackage() */
 
     function pkg(spec) {
 	var that      = new SmalltalkPackage();

+ 0 - 10
scripts/compile.js

@@ -1,10 +0,0 @@
-if(arguments[0]) {
-    smalltalk.Importer._new()._import_(read(arguments[0])._stream());
-}
-
-if(arguments[1]) {
-    print(smalltalk.Exporter._new()._exportCategory_(arguments[1]));
-}
-
-
-

+ 0 - 27
scripts/jtalk

@@ -1,27 +0,0 @@
-#!/bin/bash
-
-USAGE=" $0 [OPTIONS]\n\n
-
-The currently defined set of flags is:\n\n
-
--o category\t fileout compiled classes in category\n
--f file   \t filein file\n"
-FILE=''
-CATEGORY=''
-
-if [ $# == 0 ]; then
-        echo -e $USAGE
-        exit 1
-fi
-
-while getopts f:o:h o
-do        case "$o" in
-        f) 	  FILE="$OPTARG";;
-        o) 	  CATEGORY="$OPTARG";;
-        h)    echo -e "Usage:"
-              echo -e $USAGE
-                exit 1;;
-        esac
-done
-
-d8 ./js/boot.js ./js/kernel.js ./js/parser.js ./js/compiler.js ./js/canvas.js ./js/init.js ./scripts/compile.js -- $FILE $CATEGORY

+ 46 - 46
server/FileServer.js

@@ -1,8 +1,8 @@
 smalltalk.addClass('FileServer', smalltalk.Object, ['path', 'http', 'fs', 'url', 'port', 'basePath', 'sys'], 'FileServer');
 smalltalk.addMethod(
-'_basePath',
+unescape('_basePath'),
 smalltalk.method({
-selector: 'basePath',
+selector: unescape('basePath'),
 category: 'accessing',
 fn: function (){
 var self=this;
@@ -16,9 +16,9 @@ referencedClasses: []
 smalltalk.FileServer);
 
 smalltalk.addMethod(
-'_basePath_',
+unescape('_basePath_'),
 smalltalk.method({
-selector: 'basePath:',
+selector: unescape('basePath%3A'),
 category: 'accessing',
 fn: function (aString){
 var self=this;
@@ -32,9 +32,9 @@ referencedClasses: []
 smalltalk.FileServer);
 
 smalltalk.addMethod(
-'_port',
+unescape('_port'),
 smalltalk.method({
-selector: 'port',
+selector: unescape('port'),
 category: 'accessing',
 fn: function (){
 var self=this;
@@ -48,9 +48,9 @@ referencedClasses: []
 smalltalk.FileServer);
 
 smalltalk.addMethod(
-'_initialize',
+unescape('_initialize'),
 smalltalk.method({
-selector: 'initialize',
+selector: unescape('initialize'),
 category: 'initialization',
 fn: function (){
 var self=this;
@@ -69,9 +69,9 @@ referencedClasses: []
 smalltalk.FileServer);
 
 smalltalk.addMethod(
-'_require_',
+unescape('_require_'),
 smalltalk.method({
-selector: 'require:',
+selector: unescape('require%3A'),
 category: 'private',
 fn: function (aModuleString){
 var self=this;
@@ -85,9 +85,9 @@ referencedClasses: []
 smalltalk.FileServer);
 
 smalltalk.addMethod(
-'_writeData_toFileNamed_',
+unescape('_writeData_toFileNamed_'),
 smalltalk.method({
-selector: 'writeData:toFileNamed:',
+selector: unescape('writeData%3AtoFileNamed%3A'),
 category: 'private',
 fn: function (data, aFilename){
 var self=this;
@@ -101,9 +101,9 @@ referencedClasses: []
 smalltalk.FileServer);
 
 smalltalk.addMethod(
-'_respondNotFoundTo_',
+unescape('_respondNotFoundTo_'),
 smalltalk.method({
-selector: 'respondNotFoundTo:',
+selector: unescape('respondNotFoundTo%3A'),
 category: 'request handling',
 fn: function (aResponse){
 var self=this;
@@ -117,13 +117,13 @@ referencedClasses: []
 smalltalk.FileServer);
 
 smalltalk.addMethod(
-'_handleRequest_respondTo_',
+unescape('_handleRequest_respondTo_'),
 smalltalk.method({
-selector: 'handleRequest:respondTo:',
+selector: unescape('handleRequest%3ArespondTo%3A'),
 category: 'request handling',
 fn: function (aRequest, aResponse){
 var self=this;
-(($receiver = smalltalk.send(smalltalk.send(aRequest, "_method", []), "__eq", ["PUT"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_handlePUTRequest_respondTo_", [aRequest, aResponse]);})() : (function(){return smalltalk.send(self, "_handleGETRequest_respondTo_", [aRequest, aResponse]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_handlePUTRequest_respondTo_", [aRequest, aResponse]);}), (function(){return smalltalk.send(self, "_handleGETRequest_respondTo_", [aRequest, aResponse]);})]);
+((($receiver = smalltalk.send(smalltalk.send(aRequest, "_method", []), "__eq", ["PUT"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_handlePUTRequest_respondTo_", [aRequest, aResponse]);})() : (function(){return smalltalk.send(self, "_handleGETRequest_respondTo_", [aRequest, aResponse]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_handlePUTRequest_respondTo_", [aRequest, aResponse]);}), (function(){return smalltalk.send(self, "_handleGETRequest_respondTo_", [aRequest, aResponse]);})]));
 return self;},
 args: ["aRequest", "aResponse"],
 source: unescape('handleRequest%3A%20aRequest%20respondTo%3A%20aResponse%0A%09aRequest%20method%20%3D%20%27PUT%27%0A%09%09ifTrue%3A%20%5Bself%20handlePUTRequest%3A%20aRequest%20respondTo%3A%20aResponse%5D%0A%09%09ifFalse%3A%20%5Bself%20handleGETRequest%3A%20aRequest%20respondTo%3A%20aResponse%5D'),
@@ -133,9 +133,9 @@ referencedClasses: []
 smalltalk.FileServer);
 
 smalltalk.addMethod(
-'_handleGETRequest_respondTo_',
+unescape('_handleGETRequest_respondTo_'),
 smalltalk.method({
-selector: 'handleGETRequest:respondTo:',
+selector: unescape('handleGETRequest%3ArespondTo%3A'),
 category: 'request handling',
 fn: function (aRequest, aResponse){
 var self=this;
@@ -143,7 +143,7 @@ var uri=nil;
 var filename=nil;
 uri=smalltalk.send(smalltalk.send(self['@url'], "_parse_", [smalltalk.send(aRequest, "_url", [])]), "_pathname", []);
 filename=smalltalk.send(self['@path'], "_join_with_", [smalltalk.send(self, "_basePath", []), uri]);
-smalltalk.send(self['@path'], "_exists_do_", [filename, (function(boolean){return (($receiver = boolean).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_respondNotFoundTo_", [aResponse]);})() : (function(){return smalltalk.send(self, "_respondFileNamed_to_", [filename, aResponse]);})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return smalltalk.send(self, "_respondNotFoundTo_", [aResponse]);}), (function(){return smalltalk.send(self, "_respondFileNamed_to_", [filename, aResponse]);})]);})]);
+smalltalk.send(self['@path'], "_exists_do_", [filename, (function(boolean){return ((($receiver = boolean).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_respondNotFoundTo_", [aResponse]);})() : (function(){return smalltalk.send(self, "_respondFileNamed_to_", [filename, aResponse]);})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return smalltalk.send(self, "_respondNotFoundTo_", [aResponse]);}), (function(){return smalltalk.send(self, "_respondFileNamed_to_", [filename, aResponse]);})]));})]);
 return self;},
 args: ["aRequest", "aResponse"],
 source: unescape('handleGETRequest%3A%20aRequest%20respondTo%3A%20aResponse%0A%09%7C%20uri%20filename%20%7C%0A%09uri%20%3A%3D%20%28url%20parse%3A%20aRequest%20url%29%20pathname.%0A%09filename%20%3A%3D%20path%20join%3A%20self%20basePath%20with%3A%20uri.%0A%09path%20exists%3A%20filename%20do%3A%20%5B%3Aboolean%20%7C%20%0A%09%09boolean%20%0A%09%09%09ifFalse%3A%20%5Bself%20respondNotFoundTo%3A%20aResponse%5D%0A%09%09%09ifTrue%3A%20%5Bself%20respondFileNamed%3A%20filename%20to%3A%20aResponse%5D%5D'),
@@ -153,9 +153,9 @@ referencedClasses: []
 smalltalk.FileServer);
 
 smalltalk.addMethod(
-'_handlePUTRequest_respondTo_',
+unescape('_handlePUTRequest_respondTo_'),
 smalltalk.method({
-selector: 'handlePUTRequest:respondTo:',
+selector: unescape('handlePUTRequest%3ArespondTo%3A'),
 category: 'request handling',
 fn: function (aRequest, aResponse){
 var self=this;
@@ -173,17 +173,17 @@ referencedClasses: []
 smalltalk.FileServer);
 
 smalltalk.addMethod(
-'_respondFileNamed_to_',
+unescape('_respondFileNamed_to_'),
 smalltalk.method({
-selector: 'respondFileNamed:to:',
+selector: unescape('respondFileNamed%3Ato%3A'),
 category: 'request handling',
 fn: function (aFilename, aResponse){
 var self=this;
 var type=nil;
 var filename=nil;
 filename=aFilename;
-(($receiver = smalltalk.send(smalltalk.send(self['@fs'], "_statSync_", [aFilename]), "_isDirectory", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return filename=smalltalk.send(filename, "__comma", ["index.html"]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return filename=smalltalk.send(filename, "__comma", ["index.html"]);})]);
-smalltalk.send(self['@fs'], "_readFile_do_", [filename, (function(ex, file){return (($receiver = smalltalk.send(ex, "_notNil", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_respondInternalErrorTo_", [aResponse]);})() : (function(){type=smalltalk.send(smalltalk.send(self, "_class", []), "_mimeTypeFor_", [filename]);return (function($rec){smalltalk.send($rec, "_writeHead_options_", [(200), smalltalk.Dictionary._fromPairs_([smalltalk.send(unescape("Content-Type"), "__minus_gt", [type])])]);smalltalk.send($rec, "_write_binary_", [file, "binary"]);return smalltalk.send($rec, "_end", []);})(aResponse);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_respondInternalErrorTo_", [aResponse]);}), (function(){type=smalltalk.send(smalltalk.send(self, "_class", []), "_mimeTypeFor_", [filename]);return (function($rec){smalltalk.send($rec, "_writeHead_options_", [(200), smalltalk.Dictionary._fromPairs_([smalltalk.send(unescape("Content-Type"), "__minus_gt", [type])])]);smalltalk.send($rec, "_write_binary_", [file, "binary"]);return smalltalk.send($rec, "_end", []);})(aResponse);})]);})]);
+((($receiver = smalltalk.send(smalltalk.send(self['@fs'], "_statSync_", [aFilename]), "_isDirectory", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return filename=smalltalk.send(filename, "__comma", ["index.html"]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return filename=smalltalk.send(filename, "__comma", ["index.html"]);})]));
+smalltalk.send(self['@fs'], "_readFile_do_", [filename, (function(ex, file){return ((($receiver = smalltalk.send(ex, "_notNil", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_respondInternalErrorTo_", [aResponse]);})() : (function(){type=smalltalk.send(smalltalk.send(self, "_class", []), "_mimeTypeFor_", [filename]);return (function($rec){smalltalk.send($rec, "_writeHead_options_", [(200), smalltalk.Dictionary._fromPairs_([smalltalk.send(unescape("Content-Type"), "__minus_gt", [type])])]);smalltalk.send($rec, "_write_binary_", [file, "binary"]);return smalltalk.send($rec, "_end", []);})(aResponse);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_respondInternalErrorTo_", [aResponse]);}), (function(){type=smalltalk.send(smalltalk.send(self, "_class", []), "_mimeTypeFor_", [filename]);return (function($rec){smalltalk.send($rec, "_writeHead_options_", [(200), smalltalk.Dictionary._fromPairs_([smalltalk.send(unescape("Content-Type"), "__minus_gt", [type])])]);smalltalk.send($rec, "_write_binary_", [file, "binary"]);return smalltalk.send($rec, "_end", []);})(aResponse);})]));})]);
 return self;},
 args: ["aFilename", "aResponse"],
 source: unescape('respondFileNamed%3A%20aFilename%20to%3A%20aResponse%0A%09%7C%20type%20filename%20%7C%0A%0A%09filename%20%3A%3D%20aFilename.%0A%09%28fs%20statSync%3A%20aFilename%29%20isDirectory%20ifTrue%3A%20%5B%0A%20%20%20%20%20%20%20%20%09filename%20%3A%3D%20filename%2C%20%27index.html%27%5D.%0A%0A%09fs%20readFile%3A%20filename%20do%3A%20%5B%3Aex%20%3Afile%20%7C%0A%09%09ex%20notNil%20%0A%09%09%09ifTrue%3A%20%5Bself%20respondInternalErrorTo%3A%20aResponse%5D%0A%09%09%09ifFalse%3A%20%5B%0A%20%20%20%20%20%20%20%20%09%09%09type%20%3A%3D%20self%20class%20mimeTypeFor%3A%20filename.%0A%09%09%09%09aResponse%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%09%09writeHead%3A%20200%20options%3A%20%20%23%7B%27Content-Type%27%20-%3E%20type%7D%3B%0A%09%09%09%09%09write%3A%20file%20binary%3A%20%27binary%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%09%09end%5D%5D'),
@@ -193,9 +193,9 @@ referencedClasses: []
 smalltalk.FileServer);
 
 smalltalk.addMethod(
-'_respondInternalErrorTo_',
+unescape('_respondInternalErrorTo_'),
 smalltalk.method({
-selector: 'respondInternalErrorTo:',
+selector: unescape('respondInternalErrorTo%3A'),
 category: 'request handling',
 fn: function (aResponse){
 var self=this;
@@ -209,9 +209,9 @@ referencedClasses: []
 smalltalk.FileServer);
 
 smalltalk.addMethod(
-'_respondOKTo_',
+unescape('_respondOKTo_'),
 smalltalk.method({
-selector: 'respondOKTo:',
+selector: unescape('respondOKTo%3A'),
 category: 'request handling',
 fn: function (aResponse){
 var self=this;
@@ -225,9 +225,9 @@ referencedClasses: []
 smalltalk.FileServer);
 
 smalltalk.addMethod(
-'_startOn_',
+unescape('_startOn_'),
 smalltalk.method({
-selector: 'startOn:',
+selector: unescape('startOn%3A'),
 category: 'starting',
 fn: function (aPort){
 var self=this;
@@ -242,9 +242,9 @@ referencedClasses: []
 smalltalk.FileServer);
 
 smalltalk.addMethod(
-'_start',
+unescape('_start'),
 smalltalk.method({
-selector: 'start',
+selector: unescape('start'),
 category: 'starting',
 fn: function (){
 var self=this;
@@ -261,9 +261,9 @@ smalltalk.FileServer);
 
 smalltalk.FileServer.klass.iVarNames = ['port','mimeTypes'];
 smalltalk.addMethod(
-'_port',
+unescape('_port'),
 smalltalk.method({
-selector: 'port',
+selector: unescape('port'),
 category: 'accessing',
 fn: function (){
 var self=this;
@@ -277,9 +277,9 @@ referencedClasses: []
 smalltalk.FileServer.klass);
 
 smalltalk.addMethod(
-'_port_',
+unescape('_port_'),
 smalltalk.method({
-selector: 'port:',
+selector: unescape('port%3A'),
 category: 'accessing',
 fn: function (aNumber){
 var self=this;
@@ -293,9 +293,9 @@ referencedClasses: []
 smalltalk.FileServer.klass);
 
 smalltalk.addMethod(
-'_defaultMimeTypes',
+unescape('_defaultMimeTypes'),
 smalltalk.method({
-selector: 'defaultMimeTypes',
+selector: unescape('defaultMimeTypes'),
 category: 'accessing',
 fn: function (){
 var self=this;
@@ -309,9 +309,9 @@ referencedClasses: []
 smalltalk.FileServer.klass);
 
 smalltalk.addMethod(
-'_mimeTypes',
+unescape('_mimeTypes'),
 smalltalk.method({
-selector: 'mimeTypes',
+selector: unescape('mimeTypes'),
 category: 'accessing',
 fn: function (){
 var self=this;
@@ -325,9 +325,9 @@ referencedClasses: []
 smalltalk.FileServer.klass);
 
 smalltalk.addMethod(
-'_mimeTypeFor_',
+unescape('_mimeTypeFor_'),
 smalltalk.method({
-selector: 'mimeTypeFor:',
+selector: unescape('mimeTypeFor%3A'),
 category: 'accessing',
 fn: function (aString){
 var self=this;
@@ -341,9 +341,9 @@ referencedClasses: []
 smalltalk.FileServer.klass);
 
 smalltalk.addMethod(
-'_main',
+unescape('_main'),
 smalltalk.method({
-selector: 'main',
+selector: unescape('main'),
 category: 'initialization',
 fn: function (){
 var self=this;

File diff suppressed because it is too large
+ 269 - 165
server/server.js


+ 25 - 14
st/Canvas.st

@@ -282,41 +282,37 @@ rel: aString
 !TagBrush methodsFor: 'converting'!
 
 asJQuery
-	<return smalltalk.JQuery._from_(jQuery(self['@element']))>
-!
-
-asJQueryDo: aBlock
-    aBlock value: self asJQuery
+    ^window jQuery: self element
 ! !
 
 !TagBrush methodsFor: 'events'!
 
 onKeyDown: aBlock
-    self asJQuery on: 'keydown' do: aBlock
+    self asJQuery bind: 'keydown' do: aBlock
 !
 
 onKeyPress: aBlock
-    self asJQuery on: 'keypress' do: aBlock
+    self asJQuery bind: 'keypress' do: aBlock
 !
 
 onKeyUp: aBlock
-    self asJQuery on: 'keyup' do: aBlock
+    self asJQuery bind: 'keyup' do: aBlock
 !
 
 onFocus: aBlock
-    self asJQuery on: 'focus' do: aBlock
+    self asJQuery bind: 'focus' do: aBlock
 !
 
 onBlur: aBlock
-    self asJQuery on: 'blur' do: aBlock
+    self asJQuery bind: 'blur' do: aBlock
 !
 
 onChange: aBlock
-    self asJQuery on: 'change' do: aBlock
+    self asJQuery bind: 'change' do: aBlock
 !
 
 onClick: aBlock
-    self asJQuery on: 'click' do: aBlock
+    self asJQuery bind: 'click' do: aBlock
 ! !
 
 !TagBrush methodsFor: 'initialization'!
@@ -327,7 +323,7 @@ initializeFromString: aString canvas: aCanvas
 !
 
 initializeFromJQuery: aJQuery canvas: aCanvas
-    element := aJQuery jquery get: 0.
+    element := aJQuery get: 0.
     canvas := aCanvas
 ! !
 
@@ -395,19 +391,34 @@ renderOn: html
 
 !Object methodsFor: '*Canvas'!
 
+appendToJQuery: aJQuery
+    aJQuery append: self asString
+!
+
 appendToBrush: aTagBrush
     aTagBrush append: self asString
 ! !
 
 !BlockClosure methodsFor: '*Canvas'!
 
+appendToJQuery: aJQuery
+    self value: (HTMLCanvas onJQuery: aJQuery)
+!
+
 appendToBrush: aTagBrush
     aTagBrush appendBlock: self
 ! !
 
 !String methodsFor: '*Canvas'!
 
+asJQuery
+    <return jQuery(String(self))>
+!
+
+appendToJQuery: aJQuery
+    aJQuery append: self
+!
+
 appendToBrush: aTagBrush
     aTagBrush appendString: self
 ! !
-

+ 22 - 12
st/Compiler.st

@@ -779,6 +779,12 @@ source: aString
 
 argVariables
 	^argVariables copy
+!
+
+safeVariableNameFor: aString
+	^(Smalltalk current reservedWords includes: aString)
+		ifTrue: [aString, '_']
+		ifFalse: [aString]
 ! !
 
 !Compiler methodsFor: 'compiling'!
@@ -865,7 +871,7 @@ initialize
 !Compiler methodsFor: 'optimizations'!
 
 checkClass: aClassName for: receiver
-        stream nextPutAll: '(($receiver = ', receiver, ').klass === smalltalk.', aClassName, ') ? '
+        stream nextPutAll: '((($receiver = ', receiver, ').klass === smalltalk.', aClassName, ') ? '
 !
 
 inlineLiteral: aSelector receiverNode: anObject argumentNodes: aCollection
@@ -1184,9 +1190,10 @@ visitBlockNode: aNode
 !
 
 visitSequenceNode: aNode
-	aNode temps do: [:each |
-	    tempVariables add: each.
-	    stream nextPutAll: 'var ', each, '=nil;'; lf].
+	aNode temps do: [:each || temp |
+            temp := self safeVariableNameFor: each.
+	    tempVariables add: temp.
+	    stream nextPutAll: 'var ', temp, '=nil;'; lf].
 	aNode nodes do: [:each |
 	    self visit: each.
 	    stream nextPutAll: ';']
@@ -1200,9 +1207,10 @@ visitBlockSequenceNode: aNode
 	    ifTrue: [
 		stream nextPutAll: 'return nil;']
 	    ifFalse: [
-		aNode temps do: [:each |
-		    tempVariables add: each.
-		    stream nextPutAll: 'var ', each, '=nil;'; lf].
+		aNode temps do: [:each | | temp |
+                    temp := self safeVariableNameFor: each.
+		    tempVariables add: temp.
+		    stream nextPutAll: 'var ', temp, '=nil;'; lf].
 		index := 0.
 		aNode nodes do: [:each |
 		    index := index + 1.
@@ -1245,7 +1253,7 @@ visitSendNode: aNode
 		ifTrue: [
 			(self inlineLiteral: aNode selector receiverNode: aNode receiver argumentNodes: aNode arguments) ifFalse: [
 				(self inline: aNode selector receiver: receiver argumentNodes: aNode arguments)
-                			ifTrue: [stream nextPutAll: ' : ', (self send: aNode selector to: '$receiver' arguments: aNode arguments superSend: superSend)]
+                			ifTrue: [stream nextPutAll: ' : ', (self send: aNode selector to: '$receiver' arguments: aNode arguments superSend: superSend), ')']
                 			ifFalse: [stream nextPutAll: (self send: aNode selector to: receiver arguments: aNode arguments superSend: superSend)]]]
 		ifFalse: [stream nextPutAll: (self send: aNode selector to: receiver arguments: aNode arguments superSend: superSend)]
 !
@@ -1288,19 +1296,21 @@ visitClassReferenceNode: aNode
 !
 
 visitVariableNode: aNode
+	| varName |
 	(self currentClass allInstanceVariableNames includes: aNode value) 
 		ifTrue: [stream nextPutAll: 'self[''@', aNode value, ''']']
 		ifFalse: [
-			(self knownVariables includes: aNode value) 
+                  	varName := self safeVariableNameFor: aNode value.
+			(self knownVariables includes: varName) 
                   		ifFalse: [
                                   	unknownVariables add: aNode value.
                                   	aNode assigned 
-                                  		ifTrue: [stream nextPutAll: aNode value]
-                                  		ifFalse: [stream nextPutAll: '(typeof ', aNode value, ' == ''undefined'' ? nil : ', aNode value, ')']]
+                                  		ifTrue: [stream nextPutAll: varName]
+                                  		ifFalse: [stream nextPutAll: '(typeof ', varName, ' == ''undefined'' ? nil : ', varName, ')']]
                   		ifTrue: [
                                   	aNode value = 'thisContext'
                                   		ifTrue: [stream nextPutAll: '(smalltalk.getThisContext())']
-                				ifFalse: [stream nextPutAll:aNode value]]]
+                				ifFalse: [stream nextPutAll: varName]]]
 !
 
 visitJSStatementNode: aNode

+ 11 - 9
st/Examples.st

@@ -83,7 +83,7 @@ nextStep
 !
 
 redraw
-	renderingContext clearRectFrom: 0@ self width to: 0@ self height.
+	renderingContext clearRect: 0 y: self width to: 0 y: self height.
 	self 
 		drawMap;
 		drawPiece
@@ -92,7 +92,7 @@ redraw
 drawMap
 	renderingContext 
 		fillStyle: '#fafafa';
-		fillRectFrom: 0@0 to: self width@self height.
+		fillRect: 0 y: 0 to: self width y: self height.
 	renderingContext 
 		lineWidth: 0.5;
 		strokeStyle: '#999'.
@@ -107,8 +107,8 @@ drawMap
 drawLineFrom: aPoint to: anotherPoint
 	renderingContext 
 		beginPath;
-		moveTo: aPoint;
-		lineTo: anotherPoint;
+		moveTo: aPoint x y: aPoint y;
+		lineTo: anotherPoint x y: anotherPoint y;
 		stroke
 !
 
@@ -156,7 +156,7 @@ renderCanvasOn: html
 	canvas := html canvas.
 	canvas at: 'width' put: self width asString.
 	canvas at: 'height' put: self height asString.
-	renderingContext := CanvasRenderingContext tagBrush: canvas.
+	renderingContext := canvas element getContext: '2d'.
 	self redraw
 !
 
@@ -169,7 +169,7 @@ renderButtonsOn: html
 				onClick: [self startNewGame].
 			html button
 				with: 'play/pause';
-				onClick: [self update]]
+				onClick: []]
 ! !
 
 !Tetris class methodsFor: 'accessing'!
@@ -228,12 +228,14 @@ height
 
 drawOn: aRenderingContext
 	aRenderingContext fillStyle: self color.
-	self bounds do: [:each |
+	self bounds do: [:each || from to |
+                from := each + self position* Tetris squareSize.
+                to := 1@1 * Tetris squareSize.
 		aRenderingContext 
-			fillRectFrom: each + self position* Tetris squareSize to: 1@1 * Tetris squareSize;
+			fillRect: from x y: from y to: to x y: to y;
 			strokeStyle: '#999';
 			lineWidth: 2;
-			strokeRectFrom: each + self position* Tetris squareSize to: 1@1 * Tetris squareSize]
+			strokeRect: from x y: from y to: to x y: to y]
 ! !
 
 !TetrisPiece methodsFor: 'testing'!

+ 34 - 27
st/IDE.st

@@ -32,7 +32,7 @@ removeBodyMargin
 !
 
 setBodyMargin: anInteger
-    '.jtalkBody' asJQuery cssAt: 'margin-bottom' put: anInteger asString, 'px'
+    '.jtalkBody' asJQuery css: 'margin-bottom' put: anInteger asString, 'px'
 !
 
 onResize: aBlock
@@ -100,7 +100,7 @@ search: aString
 
 addTab: aWidget
     self tabs add: aWidget.
-    '#jtalk' asJQuery append: aWidget.
+    aWidget appendToJQuery: '#jtalk' asJQuery.
     aWidget hide
 !
 
@@ -114,10 +114,10 @@ removeTab: aWidget
 initialize
     super initialize.
     opened := true.
+    [:html | html div id: 'jtalk'] appendToJQuery: 'body' asJQuery.
     'body' asJQuery 
-	append: [:html | html div id: 'jtalk'];
 	addClass: 'jtalkBody'.
-    '#jtalk' asJQuery append: self.
+    self appendToJQuery: '#jtalk' asJQuery.
     self 
 	addTab: Transcript current;
 	addTab: Workspace new;
@@ -366,7 +366,6 @@ clear
 
 renderBoxOn: html
     textarea := html textarea.
-    textarea asJQuery call: 'tabby'.
     textarea 
 	class: 'jt_transcript';
 	at: 'spellcheck' put: 'false'
@@ -760,22 +759,28 @@ handleSourceAreaKeyDown: anEvent
 !
 
 commitPackage
-    selectedPackage ifNotNil: [
-	(Ajax url: self class commitPathJs, '/', selectedPackage, '.js')
-	    at: 'type' put: 'PUT';
-	    at: 'data' put: (Exporter new exportPackage: selectedPackage);
-	    at: 'error' put: [self alert: 'Commit failed!!'];
-	    send.
-	(Ajax url: self class commitPathJs, '/', selectedPackage, '.deploy.js')
-	    at: 'type' put: 'PUT';
-	    at: 'data' put: (StrippedExporter new exportPackage: selectedPackage);
-	    at: 'error' put: [self alert: 'Commit failed!!'];
-	    send.
-	(Ajax url: self class commitPathSt, '/', selectedPackage, '.st')
-	    at: 'type' put: 'PUT';
-	    at: 'data' put: (ChunkExporter new exportPackage: selectedPackage);
-	    at: 'error' put: [self alert: 'Commit failed!!'];
-	    send]
+	selectedPackage ifNotNil: [
+		jQuery 
+			ajax: self class commitPathJs, '/', selectedPackage, '.js'
+			options: #{
+				'type' -> 'PUT'.
+				'data' -> (Exporter new exportPackage: selectedPackage).
+				'error' -> [self alert: 'Commit failed!!']
+			}.
+		jQuery 
+			ajax: self class commitPathJs, '/', selectedPackage, '.deploy.js'
+			options: #{
+				'type' -> 'PUT'.
+				'data' -> (StrippedExporter new exportPackage: selectedPackage).
+				'error' -> [self alert: 'Commit failed!!']
+			}.
+		jQuery 
+			ajax: self class commitPathSt, '/', selectedPackage, '.st'
+			options: #{
+				'type' -> 'PUT'.
+				'data' -> (ChunkExporter new exportPackage: selectedPackage).
+				'error' -> [self alert: 'Commit failed!!']
+			}]
 !
 
 renamePackage
@@ -978,12 +983,13 @@ updateSourceAndButtons
 		html button
 			with: 'References';
 			onClick: [self searchClassReferences]].
-	methodButtons contents: [:html |
+	methodButtons contents: [:html | | protocolSelect referencesSelect |
 		html button
 			with: 'Remove method';
 			onClick: [self removeMethod].
-		html select 
-			onChange: [:e :select | self setMethodProtocol: select val];
+		protocolSelect := html select.
+                protocolSelect
+			onChange: [ self setMethodProtocol: protocolSelect asJQuery val];
 			with: [
 				html option
 					with: 'Method protocol';
@@ -994,8 +1000,9 @@ updateSourceAndButtons
 				self protocols do: [:each |
 					html option with: each]].
 		selectedMethod isNil ifFalse: [
-			html select 
-				onChange: [:e :select | self searchReferencesOf: select val];
+			referencesSelect := html select.
+                        referencesSelect
+				onChange: [self searchReferencesOf: referencesSelect asJQuery val];
 				with: [
 					html option
 						with: 'References';
@@ -1620,7 +1627,7 @@ renderOn: html
 	cssClass := ''.
 	li := html li 
 		onClick: [self browser selectClass: self theClass]. 
-	li asJQuery contents: self label.
+	li asJQuery html: self label.
 
 	self browser selectedClass = self theClass ifTrue:  [
 		cssClass := cssClass, ' selected'].

+ 0 - 34
st/JQuery-Tests.st

@@ -1,34 +0,0 @@
-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
-! !
-

+ 0 - 390
st/JQuery.st

@@ -1,390 +0,0 @@
-Object subclass: #JQuery
-	instanceVariableNames: 'jquery'
-	category: 'JQuery'!
-
-!JQuery methodsFor: 'DOM insertion'!
-
-append: anObject
-    "Append anObject at the end of the element."
-    anObject appendToJQuery: self
-!
-
-appendElement: anElement
-    "Append anElement at the end of the element.
-     Dont't call this method directly, use #append: instead"
-    self call: 'append' withArgument: anElement
-!
-
-appendToJQuery: aJQuery
-    aJQuery appendElement: jquery
-!
-
-contents: anObject
-    self empty.
-    self append: anObject
-!
-
-empty
-    ^self call: 'empty'
-! !
-
-!JQuery methodsFor: 'accessing'!
-
-jquery
-	^jquery
-! !
-
-!JQuery methodsFor: 'attributes'!
-
-removeAttribute: aString
-    "Remove an attribute from each element in the set of matched elements."
-    ^self call: 'removeAttribute' withArgument: aString
-!
-
-attr: aString
-    "Get the value of an attribute for the first element in the set of matched elements."
-    ^self call: 'attr' withArgument: aString
-!
-
-val
-    "Get the current value of the first element in the set of matched elements."
-    ^self call: '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'!
-
-cssAt: aString
-	<return self['@jquery'].css(aString)>
-!
-
-cssAt: aString put: anotherString
-    <self['@jquery'].css(aString, anotherString)>
-!
-
-addClass: aString
-    "Adds the specified class(es) to each of the set of matched elements."
-    self call: 'addClass' withArgument: aString
-!
-
-removeClass: aString
-    "Remove a single class, multiple classes, or all classes from each element in the set of matched elements."
-    self call: 'removeClass' withArgument: aString
-!
-
-toggleClass: aString
-    "Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument."
-    self call: 'toggleClass' withArgument: aString
-!
-
-height 
-    "Get the current computed height for the first element in the set of matched elements."
-    ^self call: 'height'
-!
-
-height: anInteger
-    self call: 'height' withArgument: anInteger
-!
-
-width: anInteger
-    self call: 'width' withArgument: anInteger
-!
-
-width
-    "Get the current computed width for the first element in the set of matched elements."
-    ^self call: 'width'
-!
-
-innerHeight
-    "Get the current computed height for the first element in the set of matched elements, including padding but not border."
-    ^self call: 'innerHeight'
-!
-
-innerWidth
-    "Get the current computed width for the first element in the set of matched elements, including padding but not border."
-    ^self call: 'innerWidth'
-!
-
-outerHeight
-    "Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin."
-    ^self call: 'outerHeight'
-!
-
-outerWidth
-    "Get the current computed width for the first element in the set of matched elements, including padding and border."
-    ^self call: 'outerWidth'
-!
-
-top
-    "Get the current y coordinate of the first element in the set of matched elements, relative to the offset parent."
-    ^(self call: 'position') basicAt: 'top'
-!
-
-left
-    "Get the current x coordinate of the first element in the set of matched elements, relative to the offset parent."
-    ^(self call: 'position') basicAt: 'left'
-!
-
-offsetLeft
-    "Get the current coordinates of the first element in the set of matched elements, relative to the document."
-    ^(self call: 'offset') basicAt: 'left'
-!
-
-offsetTop
-    "Get the current coordinates of the first element in the set of matched elements, relative to the document."
-    ^(self call: 'offset') basicAt: 'top'
-!
-
-scrollLeft
-    "Get the current horizontal position of the scroll bar for the first element in the set of matched elements."
-    ^self call: 'scrollLeft'
-!
-
-scrollTop
-    "Get the current vertical position of the scroll bar for the first element in the set of matched elements."
-    ^self call: 'scrollTop'
-!
-
-scrollLeft: anInteger
-    self call: 'scrollLeft' withArgument: anInteger
-!
-
-scrollTop: anInteger
-    self call: 'scrollTop' withArgument: anInteger
-! !
-
-!JQuery methodsFor: 'effects'!
-
-fadeIn
- 	self call: 'fadeIn'
-!
-
-slideDown
- 	self call: 'slideDown'
-!
-
-fadeInSlow
- 	self call: 'fadeIn' withArgument: 'slow'
-!
-
-fadeOut
- 	self call: 'fadeOut'
-!
-
-fadeOutSlow
- 	self call: 'fadeOut' withArgument: 'slow'
-!
-
-slideUp
- 	self call: 'slideUp'
-!
-
-fadeOut: aString do: aBlock
-    <self['@jquery'].fadeOut(aString, aBlock)>
-! !
-
-!JQuery methodsFor: 'enumerating'!
-
-do: aBlock
-    self elementsDo: [:anElement|  aBlock value: (JQuery fromElement: anElement)]
-! !
-
-!JQuery methodsFor: 'events'!
-
-focus
-    self call: 'focus'
-!
-
-show
-    self call: 'show'
-!
-
-hide
-    self call: 'hide'
-!
-
-remove
-    self call: 'remove'
-!
-
-on: anEventString do: aBlock
-    "Attach aBlock for anEventString on the element"
-    <self['@jquery'].bind(anEventString, function(e){aBlock(e, self)})>
-!
-
-removeEvents: aString
-    "Unbind all handlers attached to the event aString"
-    self call: 'unbind' withArgument: aString
-!
-
-onLoadDo: aBlock
-	"Bind an event handler to the 'load' JavaScript event."
-	self call: 'load' withArgument: aBlock
-! !
-
-!JQuery methodsFor: 'initialization'!
-
-initializeWithJQueryObject: anObject
-    jquery := anObject
-! !
-
-!JQuery methodsFor: 'private'!
-
-call: aString
-	<return self['@jquery'][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'!
-
-hasClass: aString
-    "Determine whether any of the matched elements are assigned the given class."
-    ^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
-    | newJQuery |
-    <newJQuery = jQuery(String(aString))>.
-    ^self from: newJQuery
-!
-
-from: anObject
-    ^self new
-	initializeWithJQueryObject: anObject;
-	yourself
-!
-
-window
-	<return self._from_(jQuery(window))>
-!
-
-body
-	<return self._from_(jQuery('body'))>
-!
-
-document
-	<return self._from_(jQuery(document))>
-!
-
-fromElement: anElement
-    | newJQuery |
-    <newJQuery = jQuery(anElement)>.
-    ^self from: newJQuery
-!
-
-documentReady: aBlock
-	<jQuery(document).ready(aBlock)>
-! !
-
-Object subclass: #Ajax
-	instanceVariableNames: 'settings'
-	category: 'JQuery'!
-!Ajax commentStamp!
-instance variable names:
-- settings  A set of key/value pairs that configure the Ajax request. All settings are optional.
-
-Full list of settings options at http://api.jquery.com/jQuery.ajax/!
-
-!Ajax methodsFor: 'accessing'!
-
-at: aKey
-    ^settings at: aKey ifAbsent: [nil]
-!
-
-at: aKey put: aValue
-    settings at: aKey put: aValue
-!
-
-url
-    ^self at: 'url'
-!
-
-url: aString
-    self at: 'url' put: aString
-! !
-
-!Ajax methodsFor: 'actions'!
-
-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
-    super initialize.
-    settings := Dictionary new
-! !
-
-!Ajax class methodsFor: 'instance creation'!
-
-url: aString
-    ^self new
-	url: aString;
-	yourself
-! !
-
-!BlockClosure methodsFor: '*JQuery'!
-
-appendToJQuery: aJQuery
-	self value: (HTMLCanvas onJQuery: aJQuery)
-! !
-
-!String methodsFor: '*JQuery'!
-
-asJQuery
-    ^JQuery fromString: self
-!
-
-appendToJQuery: aJQuery
-    <aJQuery._appendElement_(String(self))>
-! !
-
-!HTMLCanvas methodsFor: '*JQuery'!
-
-appendToJQuery: aJQuery
-    aJQuery appendElement: root element
-! !
-

+ 24 - 2
st/Kernel-Tests.st

@@ -17,8 +17,8 @@ testStreamContents
 !
 
 testIncludesSubString
-	self assert: ('jtalk' includesSubString: 'alk').
-	self deny: ('jtalk' includesSubString: 'zork').
+	self assert: ('amber' includesSubString: 'ber').
+	self deny: ('amber' includesSubString: 'zork').
 !
 
 testEquality
@@ -30,6 +30,12 @@ testEquality
 
 	"test JS falsy value"
 	self deny: '' = 0
+!
+
+testCopyWithoutAll
+	self 
+		assert: 'hello world' 
+		equals: ('*hello* *world*' copyWithoutAll: '*')
 ! !
 
 TestCase subclass: #DictionaryTest
@@ -233,3 +239,19 @@ testTruncated
 	self assert: 3.51 truncated = 3
 ! !
 
+TestCase subclass: #JSObjectProxyTest
+	instanceVariableNames: ''
+	category: 'Kernel-Tests'!
+
+!JSObjectProxyTest methodsFor: 'tests'!
+
+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').
+! !
+

+ 36 - 0
st/Kernel.st

@@ -289,6 +289,11 @@ parseError: anException parsing: aString
                   lines withIndexDo: [:l :i |
                      s nextPutAll: i asString, ': ', l, String lf]].
 	^ Error new messageText: ('Parse error on line ' , row , ' column ' , col , ' : ' , message , ' Below is code with line numbers and ===> marker inserted:' , String lf, code)
+!
+
+reservedWords
+	"JavaScript reserved words"
+	<return self.reservedWords>
 ! !
 
 !Smalltalk methodsFor: 'classes'!
@@ -1418,6 +1423,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'!
@@ -2778,6 +2790,11 @@ x: aNumber
 
 / aPoint
 	^Point x: self x / aPoint asPoint x y: self y / aPoint asPoint y
+!
+
+= aPoint
+	^aPoint class = self class and: [
+		(aPoint x = self x) & (aPoint y = self y)]
 ! !
 
 !Point methodsFor: 'converting'!
@@ -2817,6 +2834,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
@@ -2919,6 +2947,14 @@ jsObject: aJSObject
 
 jsObject
 	^jsObject
+!
+
+at: aString
+	<return self['@jsObject'][aString]>
+!
+
+at: aString put: anObject
+	<self['@jsObject'][aString] = anObject>
 ! !
 
 !JSObjectProxy methodsFor: 'proxy'!

+ 6 - 11
st/Makefile

@@ -49,29 +49,24 @@ Compiler.js: Compiler.st Kernel.js
 #
 # NOTE: With the new dependency model in class Package etc this will change!
 #
-# JQuery uses Canvas
-JQuery.js: JQuery.st Canvas.js
-	$(AMBERC) $(FLAGS) -l Canvas $<
+Canvas.js: Canvas.st
+	$(AMBERC) $(FLAGS) $<
 
 # IDE uses JQuery
-IDE.js: IDE.st JQuery.js
-	$(AMBERC) $(FLAGS) -l Canvas,JQuery $<
+IDE.js: IDE.st Canvas.js
+	$(AMBERC) $(FLAGS) -l Canvas $<
 
 TrySmalltalk.js: TrySmalltalk.st IDE.js
-	$(AMBERC) $(FLAGS) -l Canvas,JQuery,IDE $<
+	$(AMBERC) $(FLAGS) -l Canvas,IDE $<
 
 # Some Examples use SUnit and also IDE
 Examples.js: Examples.st SUnit.js IDE.js
-	$(AMBERC) $(FLAGS) -l SUnit,Canvas,JQuery,IDE $<;
+	$(AMBERC) $(FLAGS) -l SUnit,Canvas,IDE $<;
 
 # Tests typically also use SUnit
 Kernel-Tests.js: Kernel-Tests.st SUnit.js
 	$(AMBERC) $(FLAGS) -l SUnit $<;
 
-# Tests typically also use SUnit
-JQuery-Tests.js: JQuery-Tests.st JQuery.js SUnit.js
-	$(AMBERC) $(FLAGS) -l Canvas,JQuery,SUnit $<;
-
 
 # Installing is simply copying all js files to js directory.
 install: all

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