Browse Source

- Fixed the object inspector
- New Date class
- Fixed JQuery>>on:do:

Nicolas Petton 14 years ago
parent
commit
cd1d834f8a
5 changed files with 728 additions and 225 deletions
  1. 1 0
      css/jtalk.css
  2. 19 21
      js/IDE.js
  3. 250 202
      js/JQuery.js
  4. 457 1
      js/Kernel.js
  5. 1 1
      js/boot.js

+ 1 - 0
css/jtalk.css

@@ -64,6 +64,7 @@ body.jtalkBody {
        left: 0;
        right: 0;
        height: 300px;
+       z-index: 1000;
 }
 
 #jtalk .ui-resizable-handle {

+ 19 - 21
js/IDE.js

@@ -1440,12 +1440,12 @@ fn: function () {
     var self = this;
     self._disableSaveButton();
     self['@classButtons']._contents_(function (html) {(function ($rec) {$rec._with_("Rename class");return $rec._onClick_(function () {return self._renameClass();});}(html._button()));return function ($rec) {$rec._with_("Remove class");return $rec._onClick_(function () {return self._removeClass();});}(html._button());});
-    self['@methodButtons']._contents_(function (html) {(function ($rec) {$rec._with_("Remove method");return $rec._onClick_(function () {return self._removeMethod();});}(html._button()));return function ($rec) {$rec._onChange_(function (s) {return self._setMethodProtocol_(s._val());});return $rec._with_(function () {(function ($rec) {$rec._with_("Method protocol");return $rec._at_put_("disabled", "disabled");}(html._option()));(function ($rec) {$rec._class_("important");return $rec._with_("New...");}(html._option()));return self._protocols()._do_(function (each) {return html._option()._with_(each);});});}(html._select());});
+    self['@methodButtons']._contents_(function (html) {(function ($rec) {$rec._with_("Remove method");return $rec._onClick_(function () {return self._removeMethod();});}(html._button()));return function ($rec) {$rec._onChange_(function (e, select) {return self._setMethodProtocol_(select._val());});return $rec._with_(function () {(function ($rec) {$rec._with_("Method protocol");return $rec._at_put_("disabled", "disabled");}(html._option()));(function ($rec) {$rec._class_("important");return $rec._with_("New...");}(html._option()));return self._protocols()._do_(function (each) {return html._option()._with_(each);});});}(html._select());});
     self['@selectedMethod']._ifNil_ifNotNil_(function () {self._hideMethodButtons();return self['@selectedClass']._ifNil_ifNotNil_(function () {return self._hideClassButtons();}, function () {return self._showClassButtons();});}, function () {self._hideClassButtons();return self._showMethodButtons();});
     self['@sourceTextarea']._asJQuery()._val_(self._source());
     return self;
 },
-source: unescape('updateSourceAndButtons%0A%09self%20disableSaveButton.%0A%09classButtons%20contents%3A%20%5B%3Ahtml%20%7C%0A%09%09html%20button%0A%09%09%09with%3A%20%27Rename%20class%27%3B%0A%09%09%09onClick%3A%20%5Bself%20renameClass%5D.%0A%09%09html%20button%0A%09%09with%3A%20%27Remove%20class%27%3B%0A%09%09onClick%3A%20%5Bself%20removeClass%5D%5D.%0A%09methodButtons%20contents%3A%20%5B%3Ahtml%20%7C%0A%09%09html%20button%0A%09%09%09with%3A%20%27Remove%20method%27%3B%0A%09%09%09onClick%3A%20%5Bself%20removeMethod%5D.%0A%09%09html%20select%20%0A%09%20%20%20%20%09%09onChange%3A%20%5B%3As%20%7C%20self%20setMethodProtocol%3A%20s%20val%5D%3B%0A%09%20%20%20%20%09%09with%3A%20%5B%0A%09%09%09%09html%20option%0A%09%09%20%20%20%20%09%09%09with%3A%20%27Method%20protocol%27%3B%0A%09%09%20%20%20%20%09%09%09at%3A%20%27disabled%27%20put%3A%20%27disabled%27.%0A%09%09%09%09html%20option%0A%09%09%20%20%20%20%09%09%09class%3A%20%27important%27%3B%0A%09%09%20%20%20%20%09%09%09with%3A%20%27New...%27.%0A%09%09%09%09self%20protocols%20do%3A%20%5B%3Aeach%20%7C%0A%09%09%20%20%20%20%09%09%09html%20option%20with%3A%20each%5D%5D%5D.%0A%20%20%20%20%09selectedMethod%20%0A%09%09ifNil%3A%20%5B%0A%09%20%20%20%20%09%09self%20hideMethodButtons.%0A%09%20%20%20%20%09%09%09selectedClass%20%0A%09%09%09%09%09ifNil%3A%20%5Bself%20hideClassButtons%5D%0A%09%20%20%20%20%09%09%09%09ifNotNil%3A%20%5Bself%20showClassButtons%5D%5D%0A%09%09ifNotNil%3A%20%5B%0A%09%20%20%20%20%09%09self%20hideClassButtons.%0A%09%20%20%20%20%09%09self%20showMethodButtons%5D.%0A%20%20%20%20%09sourceTextarea%20asJQuery%20val%3A%20self%20source%0A')}),
+source: unescape('updateSourceAndButtons%0A%09self%20disableSaveButton.%0A%09classButtons%20contents%3A%20%5B%3Ahtml%20%7C%0A%09%09html%20button%0A%09%09%09with%3A%20%27Rename%20class%27%3B%0A%09%09%09onClick%3A%20%5Bself%20renameClass%5D.%0A%09%09html%20button%0A%09%09with%3A%20%27Remove%20class%27%3B%0A%09%09onClick%3A%20%5Bself%20removeClass%5D%5D.%0A%09methodButtons%20contents%3A%20%5B%3Ahtml%20%7C%0A%09%09html%20button%0A%09%09%09with%3A%20%27Remove%20method%27%3B%0A%09%09%09onClick%3A%20%5Bself%20removeMethod%5D.%0A%09%09html%20select%20%0A%09%20%20%20%20%09%09onChange%3A%20%5B%3Ae%20%3Aselect%20%7C%20self%20setMethodProtocol%3A%20select%20val%5D%3B%0A%09%20%20%20%20%09%09with%3A%20%5B%0A%09%09%09%09html%20option%0A%09%09%20%20%20%20%09%09%09with%3A%20%27Method%20protocol%27%3B%0A%09%09%20%20%20%20%09%09%09at%3A%20%27disabled%27%20put%3A%20%27disabled%27.%0A%09%09%09%09html%20option%0A%09%09%20%20%20%20%09%09%09class%3A%20%27important%27%3B%0A%09%09%20%20%20%20%09%09%09with%3A%20%27New...%27.%0A%09%09%09%09self%20protocols%20do%3A%20%5B%3Aeach%20%7C%0A%09%09%20%20%20%20%09%09%09html%20option%20with%3A%20each%5D%5D%5D.%0A%20%20%20%20%09selectedMethod%20%0A%09%09ifNil%3A%20%5B%0A%09%20%20%20%20%09%09self%20hideMethodButtons.%0A%09%20%20%20%20%09%09%09selectedClass%20%0A%09%09%09%09%09ifNil%3A%20%5Bself%20hideClassButtons%5D%0A%09%20%20%20%20%09%09%09%09ifNotNil%3A%20%5Bself%20showClassButtons%5D%5D%0A%09%09ifNotNil%3A%20%5B%0A%09%20%20%20%20%09%09self%20hideClassButtons.%0A%09%20%20%20%20%09%09self%20showMethodButtons%5D.%0A%20%20%20%20%09sourceTextarea%20asJQuery%20val%3A%20self%20source%0A')}),
 smalltalk.Browser);
 
 smalltalk.addMethod(
@@ -1517,7 +1517,7 @@ source: unescape('commitPath%0A%09%5E%27js%27')}),
 smalltalk.Browser.klass);
 
 
-smalltalk.addClass('Inspector', smalltalk.TabWidget, ['label', 'variables', 'inspectStack', 'selectedVariable', 'variablesList', 'valueTextarea', 'workspaceTextarea', 'diveButton'], 'IDE');
+smalltalk.addClass('Inspector', smalltalk.TabWidget, ['label', 'variables', 'object', 'selectedVariable', 'variablesList', 'valueTextarea', 'workspaceTextarea', 'diveButton'], 'IDE');
 smalltalk.addMethod(
 '_label',
 smalltalk.method({
@@ -1551,27 +1551,12 @@ selector: 'inspect:',
 category: 'actions',
 fn: function (anObject) {
     var self = this;
-    self['@inspectStack']._add_(anObject);
+    self['@object'] = anObject;
     self['@variables'] = [];
-    anObject._inspectOn_(self);
+    self['@object']._inspectOn_(self);
     return self;
 },
-source: unescape('inspect%3A%20anObject%0A%09inspectStack%20add%3A%20anObject.%0A%09variables%20%3A%3D%20%23%28%29.%0A%09anObject%20inspectOn%3A%20self')}),
-smalltalk.Inspector);
-
-smalltalk.addMethod(
-'_initialize',
-smalltalk.method({
-selector: 'initialize',
-category: 'initialization',
-fn: function () {
-    var self = this;
-    self.klass.superclass.fn.prototype._initialize.apply(self, []);
-    self['@variables'] = [];
-    self['@inspectStack'] = [];
-    return self;
-},
-source: unescape('initialize%0A%09super%20initialize.%0A%09variables%20%3A%3D%20%23%28%29.%0A%09inspectStack%20%3A%3D%20%23%28%29')}),
+source: unescape('inspect%3A%20anObject%0A%09object%20%3A%3D%20anObject.%0A%09variables%20%3A%3D%20%23%28%29.%0A%09object%20inspectOn%3A%20self')}),
 smalltalk.Inspector);
 
 smalltalk.addMethod(
@@ -1759,6 +1744,19 @@ fn: function () {
 source: unescape('updateButtons%0A%09%28self%20selectedVariable%20notNil%20and%3A%20%5B%28self%20variables%20at%3A%20self%20selectedVariable%29%20notNil%5D%29%0A%09%09ifFalse%3A%20%5BdiveButton%20at%3A%20%27disabled%27%20put%3A%20true%5D%20%0A%09%09ifTrue%3A%20%5BdiveButton%20removeAt%3A%20%27disabled%27%5D%0A%09%09')}),
 smalltalk.Inspector);
 
+smalltalk.addMethod(
+'_refresh',
+smalltalk.method({
+selector: 'refresh',
+category: 'actions',
+fn: function () {
+    var self = this;
+    (function ($rec) {$rec._inspect_(self['@object']);$rec._updateVariablesList();return $rec._updateValueTextarea();}(self));
+    return self;
+},
+source: unescape('refresh%0A%09self%20%0A%09%09inspect%3A%20object%3B%20%0A%09%09updateVariablesList%3B%0A%09%09updateValueTextarea')}),
+smalltalk.Inspector);
+
 
 smalltalk.addMethod(
 '_on_',

+ 250 - 202
js/JQuery.js

@@ -4,10 +4,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'removeAttribute:',
 category: 'attributes',
-fn: function (aString){
-var self=this;
-return self._call_withArgument_("removeAttribute",aString);
-return self;},
+fn: function (aString) {
+    var self = this;
+    return self._call_withArgument_("removeAttribute", aString);
+    return self;
+},
 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%0A')}),
 smalltalk.JQuery);
 
@@ -16,10 +17,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'attr:',
 category: 'attributes',
-fn: function (aString){
-var self=this;
-return self._call_withArgument_("attr",aString);
-return self;},
+fn: function (aString) {
+    var self = this;
+    return self._call_withArgument_("attr", aString);
+    return self;
+},
 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%0A')}),
 smalltalk.JQuery);
 
@@ -28,10 +30,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'val',
 category: 'attributes',
-fn: function (){
-var self=this;
-return self._call_("val");
-return self;},
+fn: function () {
+    var self = this;
+    return self._call_("val");
+    return self;
+},
 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%0A')}),
 smalltalk.JQuery);
 
@@ -40,10 +43,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'val:',
 category: 'attributes',
-fn: function (aString){
-var self=this;
-self._call_withArgument_("val",aString);
-return self;},
+fn: function (aString) {
+    var self = this;
+    self._call_withArgument_("val", aString);
+    return self;
+},
 source: unescape('val%3A%20aString%0A%20%20%20%20self%20call%3A%20%27val%27%20withArgument%3A%20aString%0A')}),
 smalltalk.JQuery);
 
@@ -52,10 +56,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'cssAt:',
 category: 'css',
-fn: function (aString){
-var self=this;
-return (function(){return self['@jquery'].css(aString)})();
-return self;},
+fn: function (aString) {
+    var self = this;
+    return function () {return self['@jquery'].css(aString);}();
+    return self;
+},
 source: unescape('cssAt%3A%20aString%0A%20%20%20%20%5E%7B%27return%20self%5B%27%27@jquery%27%27%5D.css%28aString%29%27%7D%0A')}),
 smalltalk.JQuery);
 
@@ -64,10 +69,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'cssAt:put:',
 category: 'css',
-fn: function (aString, anotherString){
-var self=this;
-(function(){self['@jquery'].css(aString, anotherString)})();
-return self;},
+fn: function (aString, anotherString) {
+    var self = this;
+    (function () {self['@jquery'].css(aString, anotherString);}());
+    return self;
+},
 source: unescape('cssAt%3A%20aString%20put%3A%20anotherString%0A%20%20%20%20%7B%27self%5B%27%27@jquery%27%27%5D.css%28aString%2C%20anotherString%29%27%7D%0A')}),
 smalltalk.JQuery);
 
@@ -76,10 +82,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'addClass:',
 category: 'css',
-fn: function (aString){
-var self=this;
-self._call_withArgument_("addClass",aString);
-return self;},
+fn: function (aString) {
+    var self = this;
+    self._call_withArgument_("addClass", aString);
+    return self;
+},
 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%0A')}),
 smalltalk.JQuery);
 
@@ -88,10 +95,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'removeClass:',
 category: 'css',
-fn: function (aString){
-var self=this;
-self._call_withArgument_("removeClass",aString);
-return self;},
+fn: function (aString) {
+    var self = this;
+    self._call_withArgument_("removeClass", aString);
+    return self;
+},
 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%0A')}),
 smalltalk.JQuery);
 
@@ -100,10 +108,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'toggleClass:',
 category: 'css',
-fn: function (aString){
-var self=this;
-self._call_withArgument_("toggleClass",aString);
-return self;},
+fn: function (aString) {
+    var self = this;
+    self._call_withArgument_("toggleClass", aString);
+    return self;
+},
 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%0A')}),
 smalltalk.JQuery);
 
@@ -112,10 +121,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'height',
 category: 'css',
-fn: function (){
-var self=this;
-return self._call_("height");
-return self;},
+fn: function () {
+    var self = this;
+    return self._call_("height");
+    return self;
+},
 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%0A')}),
 smalltalk.JQuery);
 
@@ -124,10 +134,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'height:',
 category: 'css',
-fn: function (anInteger){
-var self=this;
-self._call_withArgument_("height",anInteger);
-return self;},
+fn: function (anInteger) {
+    var self = this;
+    self._call_withArgument_("height", anInteger);
+    return self;
+},
 source: unescape('height%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27height%27%20withArgument%3A%20anInteger%0A')}),
 smalltalk.JQuery);
 
@@ -136,10 +147,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'width:',
 category: 'css',
-fn: function (anInteger){
-var self=this;
-self._call_withArgument_("width",anInteger);
-return self;},
+fn: function (anInteger) {
+    var self = this;
+    self._call_withArgument_("width", anInteger);
+    return self;
+},
 source: unescape('width%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27width%27%20withArgument%3A%20anInteger%0A')}),
 smalltalk.JQuery);
 
@@ -148,10 +160,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'width',
 category: 'css',
-fn: function (){
-var self=this;
-return self._call_("width");
-return self;},
+fn: function () {
+    var self = this;
+    return self._call_("width");
+    return self;
+},
 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%0A')}),
 smalltalk.JQuery);
 
@@ -160,10 +173,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'innerHeight',
 category: 'css',
-fn: function (){
-var self=this;
-return self._call_("innerHeight");
-return self;},
+fn: function () {
+    var self = this;
+    return self._call_("innerHeight");
+    return self;
+},
 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%0A')}),
 smalltalk.JQuery);
 
@@ -172,10 +186,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'innerWidth',
 category: 'css',
-fn: function (){
-var self=this;
-return self._call_("innerWidth");
-return self;},
+fn: function () {
+    var self = this;
+    return self._call_("innerWidth");
+    return self;
+},
 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%0A')}),
 smalltalk.JQuery);
 
@@ -184,10 +199,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'outerHeight',
 category: 'css',
-fn: function (){
-var self=this;
-return self._call_("outerHeight");
-return self;},
+fn: function () {
+    var self = this;
+    return self._call_("outerHeight");
+    return self;
+},
 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%0A')}),
 smalltalk.JQuery);
 
@@ -196,10 +212,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'outerWidth',
 category: 'css',
-fn: function (){
-var self=this;
-return self._call_("outerWidth");
-return self;},
+fn: function () {
+    var self = this;
+    return self._call_("outerWidth");
+    return self;
+},
 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%0A')}),
 smalltalk.JQuery);
 
@@ -208,10 +225,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'top',
 category: 'css',
-fn: function (){
-var self=this;
-return self._call_("position")._basicAt_("top");
-return self;},
+fn: function () {
+    var self = this;
+    return self._call_("position")._basicAt_("top");
+    return self;
+},
 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%0A')}),
 smalltalk.JQuery);
 
@@ -220,10 +238,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'left',
 category: 'css',
-fn: function (){
-var self=this;
-return self._call_("position")._basicAt_("left");
-return self;},
+fn: function () {
+    var self = this;
+    return self._call_("position")._basicAt_("left");
+    return self;
+},
 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%0A')}),
 smalltalk.JQuery);
 
@@ -232,10 +251,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'offsetLeft',
 category: 'css',
-fn: function (){
-var self=this;
-return self._call_("offset")._basicAt_("left");
-return self;},
+fn: function () {
+    var self = this;
+    return self._call_("offset")._basicAt_("left");
+    return self;
+},
 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%0A')}),
 smalltalk.JQuery);
 
@@ -244,10 +264,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'offsetTop',
 category: 'css',
-fn: function (){
-var self=this;
-return self._call_("offset")._basicAt_("top");
-return self;},
+fn: function () {
+    var self = this;
+    return self._call_("offset")._basicAt_("top");
+    return self;
+},
 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%0A')}),
 smalltalk.JQuery);
 
@@ -256,10 +277,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'scrollLeft',
 category: 'css',
-fn: function (){
-var self=this;
-return self._call_("scrollLeft");
-return self;},
+fn: function () {
+    var self = this;
+    return self._call_("scrollLeft");
+    return self;
+},
 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%0A')}),
 smalltalk.JQuery);
 
@@ -268,10 +290,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'scrollTop',
 category: 'css',
-fn: function (){
-var self=this;
-return self._call_("scrollTop");
-return self;},
+fn: function () {
+    var self = this;
+    return self._call_("scrollTop");
+    return self;
+},
 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%0A')}),
 smalltalk.JQuery);
 
@@ -280,10 +303,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'scrollLeft:',
 category: 'css',
-fn: function (anInteger){
-var self=this;
-self._call_withArgument_("scrollLeft",anInteger);
-return self;},
+fn: function (anInteger) {
+    var self = this;
+    self._call_withArgument_("scrollLeft", anInteger);
+    return self;
+},
 source: unescape('scrollLeft%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27scrollLeft%27%20withArgument%3A%20anInteger%0A')}),
 smalltalk.JQuery);
 
@@ -292,10 +316,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'scrollTop:',
 category: 'css',
-fn: function (anInteger){
-var self=this;
-self._call_withArgument_("scrollTop",anInteger);
-return self;},
+fn: function (anInteger) {
+    var self = this;
+    self._call_withArgument_("scrollTop", anInteger);
+    return self;
+},
 source: unescape('scrollTop%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27scrollTop%27%20withArgument%3A%20anInteger%0A')}),
 smalltalk.JQuery);
 
@@ -304,10 +329,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'focus',
 category: 'events',
-fn: function (){
-var self=this;
-self._call_("focus");
-return self;},
+fn: function () {
+    var self = this;
+    self._call_("focus");
+    return self;
+},
 source: unescape('focus%0A%20%20%20%20self%20call%3A%20%27focus%27%0A')}),
 smalltalk.JQuery);
 
@@ -316,10 +342,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'show',
 category: 'events',
-fn: function (){
-var self=this;
-self._call_("show");
-return self;},
+fn: function () {
+    var self = this;
+    self._call_("show");
+    return self;
+},
 source: unescape('show%0A%20%20%20%20self%20call%3A%20%27show%27%0A')}),
 smalltalk.JQuery);
 
@@ -328,10 +355,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'hide',
 category: 'events',
-fn: function (){
-var self=this;
-self._call_("hide");
-return self;},
+fn: function () {
+    var self = this;
+    self._call_("hide");
+    return self;
+},
 source: unescape('hide%0A%20%20%20%20self%20call%3A%20%27hide%27%0A')}),
 smalltalk.JQuery);
 
@@ -340,10 +368,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'remove',
 category: 'events',
-fn: function (){
-var self=this;
-self._call_("remove");
-return self;},
+fn: function () {
+    var self = this;
+    self._call_("remove");
+    return self;
+},
 source: unescape('remove%0A%20%20%20%20self%20call%3A%20%27remove%27%0A')}),
 smalltalk.JQuery);
 
@@ -352,11 +381,12 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'on:do:',
 category: 'events',
-fn: function (anEventString, aBlock){
-var self=this;
-(function(){self['@jquery'].bind(anEventString, function(e){aBlock(self)})})();
-return self;},
-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%7B%27self%5B%27%27@jquery%27%27%5D.bind%28anEventString%2C%20function%28e%29%7BaBlock%28self%29%7D%29%27%7D%0A')}),
+fn: function (anEventString, aBlock) {
+    var self = this;
+    (function () {self['@jquery'].bind(anEventString, function (e) {aBlock(e, self);});}());
+    return self;
+},
+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%7B%27self%5B%27%27@jquery%27%27%5D.bind%28anEventString%2C%20function%28e%29%7BaBlock%28e%2C%20self%29%7D%29%27%7D%0A')}),
 smalltalk.JQuery);
 
 smalltalk.addMethod(
@@ -364,10 +394,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'removeEvents:',
 category: 'events',
-fn: function (aString){
-var self=this;
-self._call_withArgument_("unbind",aString);
-return self;},
+fn: function (aString) {
+    var self = this;
+    self._call_withArgument_("unbind", aString);
+    return self;
+},
 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%0A')}),
 smalltalk.JQuery);
 
@@ -376,10 +407,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'append:',
 category: 'DOM insertion',
-fn: function (anObject){
-var self=this;
-anObject._appendToJQuery_(self);
-return self;},
+fn: function (anObject) {
+    var self = this;
+    anObject._appendToJQuery_(self);
+    return self;
+},
 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%0A')}),
 smalltalk.JQuery);
 
@@ -388,10 +420,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'appendElement:',
 category: 'DOM insertion',
-fn: function (anElement){
-var self=this;
-self._call_withArgument_("append",anElement);
-return self;},
+fn: function (anElement) {
+    var self = this;
+    self._call_withArgument_("append", anElement);
+    return self;
+},
 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%0A')}),
 smalltalk.JQuery);
 
@@ -400,10 +433,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'appendToJQuery:',
 category: 'DOM insertion',
-fn: function (aJQuery){
-var self=this;
-aJQuery._appendElement_(self['@jquery']);
-return self;},
+fn: function (aJQuery) {
+    var self = this;
+    aJQuery._appendElement_(self['@jquery']);
+    return self;
+},
 source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20aJQuery%20appendElement%3A%20jquery%0A')}),
 smalltalk.JQuery);
 
@@ -412,11 +446,12 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'contents:',
 category: 'DOM insertion',
-fn: function (anObject){
-var self=this;
-self._empty();
-self._append_(anObject);
-return self;},
+fn: function (anObject) {
+    var self = this;
+    self._empty();
+    self._append_(anObject);
+    return self;
+},
 source: unescape('contents%3A%20anObject%0A%20%20%20%20self%20empty.%0A%20%20%20%20self%20append%3A%20anObject%0A')}),
 smalltalk.JQuery);
 
@@ -425,10 +460,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'empty',
 category: 'DOM insertion',
-fn: function (){
-var self=this;
-self._call_("empty");
-return self;},
+fn: function () {
+    var self = this;
+    self._call_("empty");
+    return self;
+},
 source: unescape('empty%0A%20%20%20%20self%20call%3A%20%27empty%27%0A')}),
 smalltalk.JQuery);
 
@@ -437,10 +473,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'initializeWithJQueryObject:',
 category: 'initialization',
-fn: function (anObject){
-var self=this;
-self['@jquery']=anObject;
-return self;},
+fn: function (anObject) {
+    var self = this;
+    self['@jquery'] = anObject;
+    return self;
+},
 source: unescape('initializeWithJQueryObject%3A%20anObject%0A%20%20%20%20jquery%20%3A%3D%20anObject%0A')}),
 smalltalk.JQuery);
 
@@ -449,10 +486,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'call:',
 category: 'private',
-fn: function (aString){
-var self=this;
-return (function(){return self['@jquery'][aString]()})();
-return self;},
+fn: function (aString) {
+    var self = this;
+    return function () {return self['@jquery'][aString]();}();
+    return self;
+},
 source: unescape('call%3A%20aString%0A%20%20%20%20%5E%7B%27return%20self%5B%27%27@jquery%27%27%5D%5BaString%5D%28%29%27%7D%0A')}),
 smalltalk.JQuery);
 
@@ -461,10 +499,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'call:withArgument:',
 category: 'private',
-fn: function (aString, anObject){
-var self=this;
-return (function(){return self['@jquery'][aString](anObject)})();
-return self;},
+fn: function (aString, anObject) {
+    var self = this;
+    return function () {return self['@jquery'][aString](anObject);}();
+    return self;
+},
 source: unescape('call%3A%20aString%20withArgument%3A%20anObject%0A%20%20%20%20%5E%7B%27return%20self%5B%27%27@jquery%27%27%5D%5BaString%5D%28anObject%29%27%7D%0A')}),
 smalltalk.JQuery);
 
@@ -473,10 +512,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'hasClass:',
 category: 'testing',
-fn: function (aString){
-var self=this;
-return self._call_withArgument_("hasClass",aString);
-return self;},
+fn: function (aString) {
+    var self = this;
+    return self._call_withArgument_("hasClass", aString);
+    return self;
+},
 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%0A')}),
 smalltalk.JQuery);
 
@@ -486,12 +526,13 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'fromString:',
 category: 'instance creation',
-fn: function (aString){
-var self=this;
-var newJQuery=nil;
-(function(){newJQuery = jQuery(String(aString))})();
-return self._from_(newJQuery);
-return self;},
+fn: function (aString) {
+    var self = this;
+    var newJQuery = nil;
+    (function () {newJQuery = jQuery(String(aString));}());
+    return self._from_(newJQuery);
+    return self;
+},
 source: unescape('fromString%3A%20aString%0A%20%20%20%20%7C%20newJQuery%20%7C%0A%20%20%20%20%7B%27newJQuery%20%3D%20jQuery%28String%28aString%29%29%27%7D.%0A%20%20%20%20%5Eself%20from%3A%20newJQuery%0A')}),
 smalltalk.JQuery.klass);
 
@@ -500,10 +541,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'from:',
 category: 'instance creation',
-fn: function (anObject){
-var self=this;
-return (function($rec){$rec._initializeWithJQueryObject_(anObject);return $rec._yourself();})(self._new());
-return self;},
+fn: function (anObject) {
+    var self = this;
+    return function ($rec) {$rec._initializeWithJQueryObject_(anObject);return $rec._yourself();}(self._new());
+    return self;
+},
 source: unescape('from%3A%20anObject%0A%20%20%20%20%5Eself%20new%0A%09initializeWithJQueryObject%3A%20anObject%3B%0A%09yourself%0A')}),
 smalltalk.JQuery.klass);
 
@@ -515,11 +557,12 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'initialize',
 category: 'initialization',
-fn: function (){
-var self=this;
-self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
-self['@settings']=smalltalk.Dictionary._new();
-return self;},
+fn: function () {
+    var self = this;
+    self.klass.superclass.fn.prototype._initialize.apply(self, []);
+    self['@settings'] = smalltalk.Dictionary._new();
+    return self;
+},
 source: unescape('initialize%0A%20%20%20%20super%20initialize.%0A%20%20%20%20settings%20%3A%3D%20Dictionary%20new%0A')}),
 smalltalk.Ajax);
 
@@ -528,10 +571,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'at:',
 category: 'accessing',
-fn: function (aKey){
-var self=this;
-return self['@settings']._at_ifAbsent_(aKey,(function(){return nil;}));
-return self;},
+fn: function (aKey) {
+    var self = this;
+    return self['@settings']._at_ifAbsent_(aKey, function () {return nil;});
+    return self;
+},
 source: unescape('at%3A%20aKey%0A%20%20%20%20%5Esettings%20at%3A%20aKey%20ifAbsent%3A%20%5Bnil%5D%0A')}),
 smalltalk.Ajax);
 
@@ -540,10 +584,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'at:put:',
 category: 'accessing',
-fn: function (aKey, aValue){
-var self=this;
-self['@settings']._at_put_(aKey,aValue);
-return self;},
+fn: function (aKey, aValue) {
+    var self = this;
+    self['@settings']._at_put_(aKey, aValue);
+    return self;
+},
 source: unescape('at%3A%20aKey%20put%3A%20aValue%0A%20%20%20%20settings%20at%3A%20aKey%20put%3A%20aValue%0A')}),
 smalltalk.Ajax);
 
@@ -552,10 +597,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'url',
 category: 'accessing',
-fn: function (){
-var self=this;
-return self._at_("url");
-return self;},
+fn: function () {
+    var self = this;
+    return self._at_("url");
+    return self;
+},
 source: unescape('url%0A%20%20%20%20%5Eself%20at%3A%20%27url%27%0A')}),
 smalltalk.Ajax);
 
@@ -564,10 +610,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'url:',
 category: 'accessing',
-fn: function (aString){
-var self=this;
-self._at_put_("url",aString);
-return self;},
+fn: function (aString) {
+    var self = this;
+    self._at_put_("url", aString);
+    return self;
+},
 source: unescape('url%3A%20aString%0A%20%20%20%20self%20at%3A%20%27url%27%20put%3A%20aString%0A')}),
 smalltalk.Ajax);
 
@@ -576,10 +623,11 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'send',
 category: 'actions',
-fn: function (){
-var self=this;
-(function(){jQuery.ajax(self['@settings'])})();
-return self;},
+fn: function () {
+    var self = this;
+    (function () {jQuery.ajax(self['@settings']);}());
+    return self;
+},
 source: unescape('send%0A%20%20%20%20%7B%27jQuery.ajax%28self%5B%27%27@settings%27%27%5D%29%27%7D%0A')}),
 smalltalk.Ajax);
 
@@ -589,12 +637,12 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: 'url:',
 category: 'instance creation',
-fn: function (aString){
-var self=this;
-return (function($rec){$rec._url_(aString);return $rec._yourself();})(self._new());
-return self;},
+fn: function (aString) {
+    var self = this;
+    return function ($rec) {$rec._url_(aString);return $rec._yourself();}(self._new());
+    return self;
+},
 source: unescape('url%3A%20aString%0A%20%20%20%20%5Eself%20new%0A%09url%3A%20aString%3B%0A%09yourself%0A')}),
 smalltalk.Ajax.klass);
 
 
-

+ 457 - 1
js/Kernel.js

@@ -1751,6 +1751,462 @@ smalltalk.Boolean);
 
 
 
+smalltalk.addClass('Date', smalltalk.Object, [], 'Kernel');
+smalltalk.Date.comment=unescape('The%20Date%20class%20is%20used%20to%20work%20with%20dates%20and%20times.')
+smalltalk.addMethod(
+'_year',
+smalltalk.method({
+selector: 'year',
+category: 'accessing',
+fn: function () {
+    var self = this;
+    return function () {return self.getFullYear();}();
+    return self;
+},
+source: unescape('year%0A%09%5E%7B%27return%20self.getFullYear%28%29%27%7D')}),
+smalltalk.Date);
+
+smalltalk.addMethod(
+'_month',
+smalltalk.method({
+selector: 'month',
+category: 'accessing',
+fn: function () {
+    var self = this;
+    return function () {return self.getMonth() + 1;}();
+    return self;
+},
+source: unescape('month%0A%09%5E%7B%27return%20self.getMonth%28%29%20+%201%27%7D')}),
+smalltalk.Date);
+
+smalltalk.addMethod(
+'_month_',
+smalltalk.method({
+selector: 'month:',
+category: 'accessing',
+fn: function (aNumber) {
+    var self = this;
+    (function () {self.setMonth(aNumber - 1);}());
+    return self;
+},
+source: unescape('month%3A%20aNumber%0A%09%7B%27self.setMonth%28aNumber%20-%201%29%27%7D')}),
+smalltalk.Date);
+
+smalltalk.addMethod(
+'_day',
+smalltalk.method({
+selector: 'day',
+category: 'accessing',
+fn: function () {
+    var self = this;
+    return self._dayOfWeek();
+    return self;
+},
+source: unescape('day%0A%09%5Eself%20dayOfWeek')}),
+smalltalk.Date);
+
+smalltalk.addMethod(
+'_dayOfWeek',
+smalltalk.method({
+selector: 'dayOfWeek',
+category: 'accessing',
+fn: function () {
+    var self = this;
+    return function () {return self.getDay() + 1;}();
+    return self;
+},
+source: unescape('dayOfWeek%0A%09%5E%7B%27return%20self.getDay%28%29%20+%201%27%7D')}),
+smalltalk.Date);
+
+smalltalk.addMethod(
+'_dayOfWeek_',
+smalltalk.method({
+selector: 'dayOfWeek:',
+category: 'accessing',
+fn: function (aNumber) {
+    var self = this;
+    return function () {return self.setDay(aNumber - 1);}();
+    return self;
+},
+source: unescape('dayOfWeek%3A%20aNumber%0A%09%5E%7B%27return%20self.setDay%28aNumber%20-%201%29%27%7D')}),
+smalltalk.Date);
+
+smalltalk.addMethod(
+'_day_',
+smalltalk.method({
+selector: 'day:',
+category: 'accessing',
+fn: function (aNumber) {
+    var self = this;
+    self._day_(aNumber);
+    return self;
+},
+source: unescape('day%3A%20aNumber%0A%09self%20day%3A%20aNumber')}),
+smalltalk.Date);
+
+smalltalk.addMethod(
+'_year_',
+smalltalk.method({
+selector: 'year:',
+category: 'accessing',
+fn: function (aNumber) {
+    var self = this;
+    (function () {self.setFullYear(aNumber);}());
+    return self;
+},
+source: unescape('year%3A%20aNumber%0A%09%7B%27self.setFullYear%28aNumber%29%27%7D')}),
+smalltalk.Date);
+
+smalltalk.addMethod(
+'_dayOfMonth',
+smalltalk.method({
+selector: 'dayOfMonth',
+category: 'accessing',
+fn: function () {
+    var self = this;
+    return function () {return self.getDate();}();
+    return self;
+},
+source: unescape('dayOfMonth%0A%09%5E%7B%27return%20self.getDate%28%29%27%7D')}),
+smalltalk.Date);
+
+smalltalk.addMethod(
+'_dayOfMonth_',
+smalltalk.method({
+selector: 'dayOfMonth:',
+category: 'accessing',
+fn: function (aNumber) {
+    var self = this;
+    (function () {self.setDate(aNumber);}());
+    return self;
+},
+source: unescape('dayOfMonth%3A%20aNumber%0A%09%7B%27self.setDate%28aNumber%29%27%7D')}),
+smalltalk.Date);
+
+smalltalk.addMethod(
+'_asString',
+smalltalk.method({
+selector: 'asString',
+category: 'converting',
+fn: function () {
+    var self = this;
+    return function () {return self.toString();}();
+    return self;
+},
+source: unescape('asString%0A%09%5E%7B%27return%20self.toString%28%29%27%7D')}),
+smalltalk.Date);
+
+smalltalk.addMethod(
+'_printString',
+smalltalk.method({
+selector: 'printString',
+category: 'printing',
+fn: function () {
+    var self = this;
+    return self._asString();
+    return self;
+},
+source: unescape('printString%0A%09%5Eself%20asString')}),
+smalltalk.Date);
+
+smalltalk.addMethod(
+'_asMilliseconds',
+smalltalk.method({
+selector: 'asMilliseconds',
+category: 'converting',
+fn: function () {
+    var self = this;
+    return self._time();
+    return self;
+},
+source: unescape('asMilliseconds%0A%09%5Eself%20time')}),
+smalltalk.Date);
+
+smalltalk.addMethod(
+'_time',
+smalltalk.method({
+selector: 'time',
+category: 'accessing',
+fn: function () {
+    var self = this;
+    return function () {return self.getTime();}();
+    return self;
+},
+source: unescape('time%0A%09%5E%7B%27return%20self.getTime%28%29%27%7D')}),
+smalltalk.Date);
+
+smalltalk.addMethod(
+'_time_',
+smalltalk.method({
+selector: 'time:',
+category: 'accessing',
+fn: function (aNumber) {
+    var self = this;
+    (function () {self.setTime(aNumber);}());
+    return self;
+},
+source: unescape('time%3A%20aNumber%0A%09%7B%27self.setTime%28aNumber%29%27%7D')}),
+smalltalk.Date);
+
+smalltalk.addMethod(
+'_asDateString',
+smalltalk.method({
+selector: 'asDateString',
+category: 'converting',
+fn: function () {
+    var self = this;
+    return function () {return self.toDateString();}();
+    return self;
+},
+source: unescape('asDateString%0A%09%5E%7B%27return%20self.toDateString%28%29%27%7D')}),
+smalltalk.Date);
+
+smalltalk.addMethod(
+'_asTimeString',
+smalltalk.method({
+selector: 'asTimeString',
+category: 'converting',
+fn: function () {
+    var self = this;
+    return function () {return self.toTimeString();}();
+    return self;
+},
+source: unescape('asTimeString%0A%09%5E%7B%27return%20self.toTimeString%28%29%27%7D')}),
+smalltalk.Date);
+
+smalltalk.addMethod(
+'_asLocaleString',
+smalltalk.method({
+selector: 'asLocaleString',
+category: 'converting',
+fn: function () {
+    var self = this;
+    return function () {return self.toLocaleString();}();
+    return self;
+},
+source: unescape('asLocaleString%0A%09%5E%7B%27return%20self.toLocaleString%28%29%27%7D')}),
+smalltalk.Date);
+
+smalltalk.addMethod(
+'_asNumber',
+smalltalk.method({
+selector: 'asNumber',
+category: 'converting',
+fn: function () {
+    var self = this;
+    return self._asMilliseconds();
+    return self;
+},
+source: unescape('asNumber%0A%09%5Eself%20asMilliseconds')}),
+smalltalk.Date);
+
+smalltalk.addMethod(
+'_hours_',
+smalltalk.method({
+selector: 'hours:',
+category: 'accessing',
+fn: function (aNumber) {
+    var self = this;
+    (function () {self.setHours(aNumber);}());
+    return self;
+},
+source: unescape('hours%3A%20aNumber%0A%09%7B%27self.setHours%28aNumber%29%27%7D')}),
+smalltalk.Date);
+
+smalltalk.addMethod(
+'_minutes_',
+smalltalk.method({
+selector: 'minutes:',
+category: 'accessing',
+fn: function (aNumber) {
+    var self = this;
+    (function () {self.setMinutes(aNumber);}());
+    return self;
+},
+source: unescape('minutes%3A%20aNumber%0A%09%7B%27self.setMinutes%28aNumber%29%27%7D')}),
+smalltalk.Date);
+
+smalltalk.addMethod(
+'_seconds_',
+smalltalk.method({
+selector: 'seconds:',
+category: 'accessing',
+fn: function (aNumber) {
+    var self = this;
+    (function () {self.setSeconds(aNumber);}());
+    return self;
+},
+source: unescape('seconds%3A%20aNumber%0A%09%7B%27self.setSeconds%28aNumber%29%27%7D')}),
+smalltalk.Date);
+
+smalltalk.addMethod(
+'_milliseconds_',
+smalltalk.method({
+selector: 'milliseconds:',
+category: 'accessing',
+fn: function (aNumber) {
+    var self = this;
+    (function () {self.setMilliseconds(aNumber);}());
+    return self;
+},
+source: unescape('milliseconds%3A%20aNumber%0A%09%7B%27self.setMilliseconds%28aNumber%29%27%7D')}),
+smalltalk.Date);
+
+smalltalk.addMethod(
+'_hours',
+smalltalk.method({
+selector: 'hours',
+category: 'accessing',
+fn: function () {
+    var self = this;
+    return function () {return self.getHours();}();
+    return self;
+},
+source: unescape('hours%0A%09%5E%7B%27return%20self.getHours%28%29%27%7D')}),
+smalltalk.Date);
+
+smalltalk.addMethod(
+'_minutes',
+smalltalk.method({
+selector: 'minutes',
+category: 'accessing',
+fn: function () {
+    var self = this;
+    return function () {return self.getMinutes();}();
+    return self;
+},
+source: unescape('minutes%0A%09%5E%7B%27return%20self.getMinutes%28%29%27%7D')}),
+smalltalk.Date);
+
+smalltalk.addMethod(
+'_seconds',
+smalltalk.method({
+selector: 'seconds',
+category: 'accessing',
+fn: function () {
+    var self = this;
+    return function () {return self.getSeconds();}();
+    return self;
+},
+source: unescape('seconds%0A%09%5E%7B%27return%20self.getSeconds%28%29%27%7D')}),
+smalltalk.Date);
+
+smalltalk.addMethod(
+'_milliseconds',
+smalltalk.method({
+selector: 'milliseconds',
+category: 'accessing',
+fn: function () {
+    var self = this;
+    return function () {return self.getMilliseconds();}();
+    return self;
+},
+source: unescape('milliseconds%0A%09%5E%7B%27return%20self.getMilliseconds%28%29%27%7D')}),
+smalltalk.Date);
+
+smalltalk.addMethod(
+'_inspectOn_',
+smalltalk.method({
+selector: 'inspectOn:',
+category: '*IDE',
+fn: function (anInspector) {
+    var self = this;
+    var variables = nil;
+    variables = smalltalk.Dictionary._new();
+    variables._at_put_(unescape("%23self"), self);
+    variables._at_put_(unescape("%23year"), self._year());
+    variables._at_put_(unescape("%23month"), self._month());
+    variables._at_put_(unescape("%23day"), self._day());
+    variables._at_put_(unescape("%23hours"), self._hours());
+    variables._at_put_(unescape("%23minutes"), self._minutes());
+    variables._at_put_(unescape("%23seconds"), self._seconds());
+    variables._at_put_(unescape("%23milliseconds"), self._milliseconds());
+    (function ($rec) {$rec._setLabel_(self._printString());return $rec._setVariables_(variables);}(anInspector));
+    return self;
+},
+source: unescape('inspectOn%3A%20anInspector%0A%09%7C%20variables%20%7C%0A%09variables%20%3A%3D%20Dictionary%20new.%0A%09variables%20at%3A%20%27%23self%27%20put%3A%20self.%0A%09variables%20at%3A%20%27%23year%27%20put%3A%20self%20year.%0A%09variables%20at%3A%20%27%23month%27%20put%3A%20self%20month.%0A%09variables%20at%3A%20%27%23day%27%20put%3A%20self%20day.%0A%09variables%20at%3A%20%27%23hours%27%20put%3A%20self%20hours.%0A%09variables%20at%3A%20%27%23minutes%27%20put%3A%20self%20minutes.%0A%09variables%20at%3A%20%27%23seconds%27%20put%3A%20self%20seconds.%0A%09variables%20at%3A%20%27%23milliseconds%27%20put%3A%20self%20milliseconds.%0A%09anInspector%20%0A%09%09setLabel%3A%20self%20printString%3B%0A%09%09setVariables%3A%20variables%0A%09%0A%09')}),
+smalltalk.Date);
+
+
+smalltalk.addMethod(
+'_new_',
+smalltalk.method({
+selector: 'new:',
+category: 'instance creation',
+fn: function (anObject) {
+    var self = this;
+    return function () {return new Date(anObject);}();
+    return self;
+},
+source: unescape('new%3A%20anObject%0A%09%5E%7B%27return%20new%20Date%28anObject%29%27%7D')}),
+smalltalk.Date.klass);
+
+smalltalk.addMethod(
+'_fromString_',
+smalltalk.method({
+selector: 'fromString:',
+category: 'instance creation',
+fn: function (aString) {
+    var self = this;
+    return self._new_(aString);
+    return self;
+},
+source: unescape('fromString%3A%20aString%0A%09%22Example%3A%20Date%20fromString%28%272011/04/15%2000%3A00%3A00%27%29%22%0A%09%5Eself%20new%3A%20aString')}),
+smalltalk.Date.klass);
+
+smalltalk.addMethod(
+'_fromSeconds_',
+smalltalk.method({
+selector: 'fromSeconds:',
+category: 'instance creation',
+fn: function (aNumber) {
+    var self = this;
+    return self._fromMilliseconds_(aNumber.__star(1000));
+    return self;
+},
+source: unescape('fromSeconds%3A%20aNumber%0A%09%5Eself%20fromMilliseconds%3A%20aNumber%20*%201000')}),
+smalltalk.Date.klass);
+
+smalltalk.addMethod(
+'_fromMilliseconds_',
+smalltalk.method({
+selector: 'fromMilliseconds:',
+category: 'instance creation',
+fn: function (aNumber) {
+    var self = this;
+    return self._new_(aNumber);
+    return self;
+},
+source: unescape('fromMilliseconds%3A%20aNumber%0A%09%5Eself%20new%3A%20aNumber')}),
+smalltalk.Date.klass);
+
+smalltalk.addMethod(
+'_today',
+smalltalk.method({
+selector: 'today',
+category: 'instance creation',
+fn: function () {
+    var self = this;
+    return self._new();
+    return self;
+},
+source: unescape('today%0A%09%5Eself%20new')}),
+smalltalk.Date.klass);
+
+smalltalk.addMethod(
+'_now',
+smalltalk.method({
+selector: 'now',
+category: 'instance creation',
+fn: function () {
+    var self = this;
+    return self._today();
+    return self;
+},
+source: unescape('now%0A%09%5Eself%20today')}),
+smalltalk.Date.klass);
+
+
 smalltalk.addClass('UndefinedObject', smalltalk.Object, [], 'Kernel');
 smalltalk.addMethod(
 '_subclass_instanceVariableNames_',
@@ -3243,7 +3699,7 @@ selector: 'sort:',
 category: 'enumerating',
 fn: function (aBlock) {
     var self = this;
-    return function () {return self.sort(function (a, b) {if (aBlock(a, b)) {return 1;} else {return - 1;}});}();
+    return function () {return self.sort(function (a, b) {if (aBlock(a, b)) {return 1;} else {return -1;}});}();
     return self;
 },
 source: unescape('sort%3A%20aBlock%0A%09%5E%7B%27%0A%09%09return%20self.sort%28function%28a%2C%20b%29%20%7B%0A%09%09%09if%28aBlock%28a%2Cb%29%29%20%7Breturn%201%7D%20else%20%7Breturn%20-1%7D%0A%09%09%7D%29%0A%09%27%7D')}),

+ 1 - 1
js/boot.js

@@ -135,6 +135,7 @@ smalltalk.Object.klass.superclass = smalltalk.Class
 smalltalk.mapClassName("Number", "Kernel", Number, smalltalk.Object);
 smalltalk.mapClassName("BlockClosure", "Kernel", Function, smalltalk.Object);
 smalltalk.mapClassName("Boolean", "Kernel", Boolean, smalltalk.Object);
+smalltalk.mapClassName("Date", "Kernel", Date, smalltalk.Object);
 smalltalk.mapClassName("UndefinedObject", "Kernel", SmalltalkNil, smalltalk.Object);
 
 smalltalk.mapClassName("Collection", "Kernel", null, smalltalk.Object);
@@ -145,4 +146,3 @@ smalltalk.mapClassName("Array", "Kernel", Array, smalltalk.Collection);
 if(CanvasRenderingContext2D) {
     smalltalk.mapClassName("CanvasRenderingContext", "Canvas", CanvasRenderingContext2D, smalltalk.Object);
 }
-