Sfoglia il codice sorgente

Fixing class docs for platform interface & Co.

Herbert Vojčík 11 anni fa
parent
commit
0fa2bfea66
4 ha cambiato i file con 13 aggiunte e 10 eliminazioni
  1. 1 1
      js/Canvas.js
  2. 2 2
      js/Kernel-Objects.js
  3. 3 1
      st/Canvas.st
  4. 7 6
      st/Kernel-Objects.st

+ 1 - 1
js/Canvas.js

@@ -1,7 +1,7 @@
 (function(smalltalk,nil,_st){
 smalltalk.addPackage('Canvas');
 smalltalk.addClass('BrowserInterface', smalltalk.Object, [], 'Canvas');
-smalltalk.BrowserInterface.comment="I am superclass of all object that interface with user or environment. `Widget` and a few other classes are subclasses of me.\x0a\x0a## API\x0a\x0a    self alert: 'Hey, there is a problem'.\x0a    self confirm: 'Affirmative?'.\x0a    self prompt: 'Your name:'.\x0a\x0a    self ajax: #{\x0a        'url' -> '/patch.js'. 'type' -> 'GET'. dataType->'script'\x0a    }.\x0a";
+smalltalk.BrowserInterface.comment="I am platform interface class that tries to use window and jQuery; that is, one for browser environment.\x0a\x0a## API\x0a\x0a    self isAvailable. \x22true if window and jQuery exist\x22.\x0a\x0a    self alert: 'Hey, there is a problem'.\x0a    self confirm: 'Affirmative?'.\x0a    self prompt: 'Your name:'.\x0a\x0a    self ajax: #{\x0a        'url' -> '/patch.js'. 'type' -> 'GET'. dataType->'script'\x0a    }.\x0a";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "ajax:",

+ 2 - 2
js/Kernel-Objects.js

@@ -2887,7 +2887,7 @@ smalltalk.InspectorHandler.klass);
 
 
 smalltalk.addClass('InterfacingObject', smalltalk.Object, [], 'Kernel-Objects');
-smalltalk.InterfacingObject.comment="I am superclass of all object that interface with user or environment. `Widget` and a few other classes are subclasses of me.\x0a\x0a## API\x0a\x0a    self alert: 'Hey, there is a problem'.\x0a    self confirm: 'Affirmative?'.\x0a    self prompt: 'Your name:'.\x0a\x0a    self ajax: #{\x0a        'url' -> '/patch.js'. 'type' -> 'GET'. dataType->'script'\x0a    }.\x0a";
+smalltalk.InterfacingObject.comment="I am superclass of all object that interface with user or environment. `Widget` and a few other classes are subclasses of me. I delegate all of the above APIs to `PlatformInterface`.\x0a\x0a## API\x0a\x0a    self alert: 'Hey, there is a problem'.\x0a    self confirm: 'Affirmative?'.\x0a    self prompt: 'Your name:'.\x0a\x0a    self ajax: #{\x0a        'url' -> '/patch.js'. 'type' -> 'GET'. dataType->'script'\x0a    }.\x0a";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "ajax:",
@@ -4545,7 +4545,7 @@ smalltalk.Package.klass);
 
 
 smalltalk.addClass('PlatformInterface', smalltalk.Object, [], 'Kernel-Objects');
-smalltalk.PlatformInterface.comment="I am superclass of all object that interface with user or environment. `Widget` and a few other classes are subclasses of me.\x0a\x0a## API\x0a\x0a    self alert: 'Hey, there is a problem'.\x0a    self confirm: 'Affirmative?'.\x0a    self prompt: 'Your name:'.\x0a\x0a    self ajax: #{\x0a        'url' -> '/patch.js'. 'type' -> 'GET'. dataType->'script'\x0a    }.\x0a";
+smalltalk.PlatformInterface.comment="I am single entry point to UI and environment interface.\x0aMy `initialize` tries several options (for now, browser environment only) to set myself up.\x0a\x0a## API\x0a\x0a    PlatformInterface alert: 'Hey, there is a problem'.\x0a    PlatformInterface confirm: 'Affirmative?'.\x0a    PlatformInterface prompt: 'Your name:'.\x0a\x0a    PlatformInterface ajax: #{\x0a        'url' -> '/patch.js'. 'type' -> 'GET'. dataType->'script'\x0a    }.\x0a";
 
 smalltalk.PlatformInterface.klass.iVarNames = ['worker'];
 smalltalk.addMethod(

+ 3 - 1
st/Canvas.st

@@ -3,10 +3,12 @@ Object subclass: #BrowserInterface
 	instanceVariableNames: ''
 	package: 'Canvas'!
 !BrowserInterface commentStamp!
-I am superclass of all object that interface with user or environment. `Widget` and a few other classes are subclasses of me.
+I am platform interface class that tries to use window and jQuery; that is, one for browser environment.
 
 ## API
 
+    self isAvailable. "true if window and jQuery exist".
+
     self alert: 'Hey, there is a problem'.
     self confirm: 'Affirmative?'.
     self prompt: 'Your name:'.

+ 7 - 6
st/Kernel-Objects.st

@@ -924,7 +924,7 @@ Object subclass: #InterfacingObject
 	instanceVariableNames: ''
 	package: 'Kernel-Objects'!
 !InterfacingObject commentStamp!
-I am superclass of all object that interface with user or environment. `Widget` and a few other classes are subclasses of me.
+I am superclass of all object that interface with user or environment. `Widget` and a few other classes are subclasses of me. I delegate all of the above APIs to `PlatformInterface`.
 
 ## API
 
@@ -1569,15 +1569,16 @@ Object subclass: #PlatformInterface
 	instanceVariableNames: ''
 	package: 'Kernel-Objects'!
 !PlatformInterface commentStamp!
-I am superclass of all object that interface with user or environment. `Widget` and a few other classes are subclasses of me.
+I am single entry point to UI and environment interface.
+My `initialize` tries several options (for now, browser environment only) to set myself up.
 
 ## API
 
-    self alert: 'Hey, there is a problem'.
-    self confirm: 'Affirmative?'.
-    self prompt: 'Your name:'.
+    PlatformInterface alert: 'Hey, there is a problem'.
+    PlatformInterface confirm: 'Affirmative?'.
+    PlatformInterface prompt: 'Your name:'.
 
-    self ajax: #{
+    PlatformInterface ajax: #{
         'url' -> '/patch.js'. 'type' -> 'GET'. dataType->'script'
     }.!