Browse Source

renames the Canvas package to Web

Nicolas Petton 10 years ago
parent
commit
89c2c200a4
9 changed files with 40 additions and 40 deletions
  1. 4 4
      Gruntfile.js
  2. 1 1
      grunt/tasks/grunt-amberc.js
  3. 1 1
      src/Examples.js
  4. 1 1
      src/Helios-Core.js
  5. 1 1
      src/Helios-Layout.js
  6. 1 1
      src/IDE.js
  7. 19 19
      src/Web.js
  8. 11 11
      src/Web.st
  9. 1 1
      support/deploy.js

+ 4 - 4
Gruntfile.js

@@ -35,7 +35,7 @@ module.exports = function(grunt) {
               'src/Kernel-Infrastructure.st', 'src/Kernel-Exceptions.st', 'src/Kernel-Transcript.st', 'src/Kernel-Announcements.st',
               'src/Kernel-ImportExport.st', 'src/Compiler-Exceptions.st', 'src/Compiler-Core.st', 'src/Compiler-AST.st',
               'src/Compiler-IR.st', 'src/Compiler-Inlining.st', 'src/Compiler-Semantic.st', 'src/Compiler-Interpreter.st',
-              'src/Canvas.st', 'src/SUnit.st', 'src/IDE.st',
+              'src/Web.st', 'src/SUnit.st', 'src/IDE.st',
               'src/Kernel-Tests.st', 'src/Compiler-Tests.st', 'src/SUnit-Tests.st',
               'src/Helios-Core.st', 'src/Helios-Exceptions.st', 'src/Helios-Announcements.st',
               'src/Helios-KeyBindings.st', 'src/Helios-Layout.st',
@@ -52,14 +52,14 @@ module.exports = function(grunt) {
         src: ['src/Kernel-Objects.st', 'src/Kernel-Classes.st', 'src/Kernel-Methods.st', 'src/Kernel-Collections.st',
               'src/Kernel-Infrastructure.st', 'src/Kernel-Exceptions.st', 'src/Kernel-Transcript.st', 'src/Kernel-Announcements.st']
       },
-      amber_canvas: {
+      amber_web: {
         output_dir : 'src',
-        src: ['src/Canvas.st', 'src/SUnit.st']
+        src: ['src/Web.st', 'src/SUnit.st']
       },
       amber_IDE: {
         output_dir : 'src',
         src: ['src/IDE.st'],
-        libraries: ['Canvas']
+        libraries: ['Web']
       },
       amber_tests: {
         output_dir : 'src',

+ 1 - 1
grunt/tasks/grunt-amberc.js

@@ -28,7 +28,7 @@ module.exports = function(grunt) {
          },
          src: ['projects/HelloWorld/src/HelloWorld.st'], // REQUIRED
          output_dir: 'projects/HelloWorld/src',  // optional
-         libraries: 'Canvas',                   // optional
+         libraries: 'Web',                       // optional
          jsGlobals: ['global1', 'global2'],     // optional
          main_class: 'HelloWorld',              // optional
          output_name: 'helloWorld',             // optional

+ 1 - 1
src/Examples.js

@@ -1,4 +1,4 @@
-define("amber_core/Examples", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Canvas"], function(smalltalk,nil,_st, globals){
+define("amber_core/Examples", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Web"], function(smalltalk,nil,_st, globals){
 smalltalk.addPackage('Examples');
 smalltalk.packages["Examples"].transport = {"type":"amd","amdNamespace":"amber_core"};
 

+ 1 - 1
src/Helios-Core.js

@@ -1,4 +1,4 @@
-define("amber_core/Helios-Core", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Kernel-Infrastructure", "amber_core/Kernel-Objects", "amber_core/Canvas"], function(smalltalk,nil,_st, globals){
+define("amber_core/Helios-Core", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Kernel-Infrastructure", "amber_core/Kernel-Objects", "amber_core/Web"], function(smalltalk,nil,_st, globals){
 smalltalk.addPackage('Helios-Core');
 smalltalk.packages["Helios-Core"].transport = {"type":"amd","amdNamespace":"amber_core"};
 

+ 1 - 1
src/Helios-Layout.js

@@ -1,4 +1,4 @@
-define("amber_core/Helios-Layout", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Helios-Core", "amber_core/Canvas", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st, globals){
+define("amber_core/Helios-Layout", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Helios-Core", "amber_core/Web", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st, globals){
 smalltalk.addPackage('Helios-Layout');
 smalltalk.packages["Helios-Layout"].transport = {"type":"amd","amdNamespace":"amber_core"};
 

+ 1 - 1
src/IDE.js

@@ -1,4 +1,4 @@
-define("amber_core/IDE", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Canvas", "amber_core/Kernel-Objects", "amber_core/Kernel-Collections", "amber_core/Kernel-Methods"], function(smalltalk,nil,_st, globals){
+define("amber_core/IDE", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Web", "amber_core/Kernel-Objects", "amber_core/Kernel-Collections", "amber_core/Kernel-Methods"], function(smalltalk,nil,_st, globals){
 smalltalk.addPackage('IDE');
 smalltalk.packages["IDE"].transport = {"type":"amd","amdNamespace":"amber_core"};
 

+ 19 - 19
src/Canvas.js → src/Web.js

@@ -1,8 +1,8 @@
-define("amber_core/Canvas", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Kernel-Objects", "amber_core/Kernel-Infrastructure", "amber_core/Kernel-Methods", "amber_core/Kernel-Collections"], function(smalltalk,nil,_st, globals){
-smalltalk.addPackage('Canvas');
-smalltalk.packages["Canvas"].transport = {"type":"amd","amdNamespace":"amber_core"};
+define("amber_core/Web", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Kernel-Objects", "amber_core/Kernel-Infrastructure", "amber_core/Kernel-Methods", "amber_core/Kernel-Collections"], function(smalltalk,nil,_st, globals){
+smalltalk.addPackage('Web');
+smalltalk.packages["Web"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
-smalltalk.addClass('BrowserInterface', globals.Object, [], 'Canvas');
+smalltalk.addClass('BrowserInterface', globals.Object, [], 'Web');
 globals.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    }.";
 smalltalk.addMethod(
 smalltalk.method({
@@ -94,7 +94,7 @@ globals.BrowserInterface);
 
 
 
-smalltalk.addClass('HTMLCanvas', globals.Object, ['root'], 'Canvas');
+smalltalk.addClass('HTMLCanvas', globals.Object, ['root'], 'Web');
 globals.HTMLCanvas.comment="I am a canvas for building HTML.\x0a\x0aI provide the `#tag:` method to create a `TagBrush` (wrapping a DOM element) and convenience methods in the `tags` protocol.\x0a\x0a## API\x0a\x0aMy instances are used as the argument of the `#renderOn:` method of `Widget` objects.\x0a\x0aThe `#with:` method is used to compose HTML, nesting tags. `#with:` can take a `TagBrush`, a `String`, a `BlockClosure` or a `Widget` as argument.\x0a\x0a## Usage example:\x0a\x0a    aCanvas a \x0a        with: [ aCanvas span with: 'click me' ];\x0a        onClick: [ window alert: 'clicked!' ]";
 smalltalk.addMethod(
 smalltalk.method({
@@ -2217,7 +2217,7 @@ referencedClasses: []
 globals.HTMLCanvas.klass);
 
 
-smalltalk.addClass('HTMLSnippet', globals.Object, ['snippets'], 'Canvas');
+smalltalk.addClass('HTMLSnippet', globals.Object, ['snippets'], 'Web');
 globals.HTMLSnippet.comment="My sole instance is the registry of html snippets.\x0a`HTMLSnippet current` is the public singleton instance.\x0a\x0aOn startup, it scans the document for any html elements\x0awith `'data-snippet=\x22foo\x22'` attribute and takes them off the document,\x0aremembering them in the store under the specified name.\x0aIt also install method #foo into HTMLCanvas dynamically.\x0a\x0aEvery html snippet should mark a 'caret', a place where contents\x0acan be inserted, by 'data-snippet=\x22*\x22' (a special name for caret).\x0aFor example:\x0a\x0a`<li data-snippet='menuelement' class='...'><a data-snippet='*'></a></li>`\x0a\x0adefines a list element with a link inside; the link itself is marked as a caret.\x0a\x0aYou can later issue\x0a\x0a`html menuelement href: '/foo'; with: 'A foo'`\x0a\x0ato insert the whole snippet and directly manipulate the caret, so it renders:\x0a\x0a`<li class='...'><a href='/foo'>A foo</a></li>`\x0a\x0aFor a self-careting tags (not very useful, but you do not need to fill class etc.\x0ayou can use\x0a\x0a`<div class='lots of classes' attr1='one' attr2='two' data-snippet='*bar'></div>`\x0a\x0aand in code later do:\x0a\x0a`html bar with: [ xxx ]`\x0a\x0ato render\x0a\x0a`<div class='lots of classes' attr1='one' attr2='two'>...added by xxx...</div>`";
 smalltalk.addMethod(
 smalltalk.method({
@@ -2465,7 +2465,7 @@ referencedClasses: []
 globals.HTMLSnippet.klass);
 
 
-smalltalk.addClass('TagBrush', globals.Object, ['canvas', 'element'], 'Canvas');
+smalltalk.addClass('TagBrush', globals.Object, ['canvas', 'element'], 'Web');
 globals.TagBrush.comment="I am a brush for building a single DOM element (which I hold onto).\x0a\x0aAll tags but `<style>` are instances of me (see the `StyleBrush` class).\x0a\x0a## API\x0a\x0a1. Nesting\x0a\x0a    Use `#with:` to nest tags. `#with:` can take aString, `TagBrush` instance, a `Widget` or block closure as parameter.\x0a\x0a    Example: `aTag with: aString with: aCanvas div`\x0a\x0a2. Events\x0a\x0a    The `events` protocol contains all methods related to events (delegating event handling to jQuery).\x0a\x0a    Example: `aTag onClick: [ window alert: 'clicked' ]`\x0a\x0a3. Attributes\x0a\x0a    The `attribute` protocol contains methods for attribute manipulation (delegating to jQuery too).\x0a\x0a    Example: `aTag at: 'value' put: 'hello world'`\x0a\x0a4. Raw access and jQuery\x0a\x0a    The `#element` method can be used to access to JavaScript DOM element object.\x0a\x0a    Example: `aTag element cssStyle`\x0a\x0a    Use `#asJQuery` to access to the receiver converted into a jQuery object.\x0a\x0a    Example: `aTag asJQuery css: 'color' value: 'red'`";
 smalltalk.addMethod(
 smalltalk.method({
@@ -3673,7 +3673,7 @@ referencedClasses: []
 globals.TagBrush.klass);
 
 
-smalltalk.addClass('Widget', globals.InterfacingObject, [], 'Canvas');
+smalltalk.addClass('Widget', globals.InterfacingObject, [], 'Web');
 globals.Widget.comment="I am a presenter building HTML. Subclasses are typically reusable components.\x0a\x0a## API\x0a\x0aUse `#renderContentOn:` to build HTML. (See `HTMLCanvas` and `TagBrush` classes for more about building HTML).\x0a\x0aTo add a widget to the page, the convenience method `#appendToJQuery:` is very useful.\x0a\x0aExemple: \x0a\x0a    Counter new appendToJQuery: 'body' asJQuery";
 smalltalk.addMethod(
 smalltalk.method({
@@ -3741,7 +3741,7 @@ globals.Widget.klass);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "appendToBrush:",
-protocol: '*Canvas',
+protocol: '*Web',
 fn: function (aTagBrush){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -3757,7 +3757,7 @@ globals.BlockClosure);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "appendToJQuery:",
-protocol: '*Canvas',
+protocol: '*Web',
 fn: function (aJQuery){
 var self=this;
 function $HTMLCanvas(){return globals.HTMLCanvas||(typeof HTMLCanvas=="undefined"?nil:HTMLCanvas)}
@@ -3774,7 +3774,7 @@ globals.BlockClosure);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "asSnippet",
-protocol: '*Canvas',
+protocol: '*Web',
 fn: function (){
 var self=this;
 function $HTMLSnippet(){return globals.HTMLSnippet||(typeof HTMLSnippet=="undefined"?nil:HTMLSnippet)}
@@ -3793,7 +3793,7 @@ globals.CharacterArray);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "asJQuery",
-protocol: '*Canvas',
+protocol: '*Web',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -3809,7 +3809,7 @@ globals.JSObjectProxy);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "asJQueryInContext:",
-protocol: '*Canvas',
+protocol: '*Web',
 fn: function (aContext){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -3825,7 +3825,7 @@ globals.JSObjectProxy);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "appendToBrush:",
-protocol: '*Canvas',
+protocol: '*Web',
 fn: function (aTagBrush){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -3841,7 +3841,7 @@ globals.Object);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "appendToJQuery:",
-protocol: '*Canvas',
+protocol: '*Web',
 fn: function (aJQuery){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -3857,7 +3857,7 @@ globals.Object);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "appendToBrush:",
-protocol: '*Canvas',
+protocol: '*Web',
 fn: function (aTagBrush){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -3873,7 +3873,7 @@ globals.String);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "appendToJQuery:",
-protocol: '*Canvas',
+protocol: '*Web',
 fn: function (aJQuery){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -3889,7 +3889,7 @@ globals.String);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "asJQuery",
-protocol: '*Canvas',
+protocol: '*Web',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -3905,7 +3905,7 @@ globals.String);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "asJQueryInContext:",
-protocol: '*Canvas',
+protocol: '*Web',
 fn: function (aContext){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 

+ 11 - 11
src/Canvas.st → src/Web.st

@@ -1,7 +1,7 @@
-Smalltalk createPackage: 'Canvas'!
+Smalltalk createPackage: 'Web'!
 Object subclass: #BrowserInterface
 	instanceVariableNames: ''
-	package: 'Canvas'!
+	package: 'Web'!
 !BrowserInterface commentStamp!
 I am platform interface class that tries to use window and jQuery; that is, one for browser environment.
 
@@ -43,7 +43,7 @@ isAvailable
 
 Object subclass: #HTMLCanvas
 	instanceVariableNames: 'root'
-	package: 'Canvas'!
+	package: 'Web'!
 !HTMLCanvas commentStamp!
 I am a canvas for building HTML.
 
@@ -565,7 +565,7 @@ onJQuery: aJQuery
 
 Object subclass: #HTMLSnippet
 	instanceVariableNames: 'snippets'
-	package: 'Canvas'!
+	package: 'Web'!
 !HTMLSnippet commentStamp!
 My sole instance is the registry of html snippets.
 `HTMLSnippet current` is the public singleton instance.
@@ -696,7 +696,7 @@ new
 
 Object subclass: #TagBrush
 	instanceVariableNames: 'canvas element'
-	package: 'Canvas'!
+	package: 'Web'!
 !TagBrush commentStamp!
 I am a brush for building a single DOM element (which I hold onto).
 
@@ -1061,7 +1061,7 @@ fromString: aString canvas: aCanvas
 
 InterfacingObject subclass: #Widget
 	instanceVariableNames: ''
-	package: 'Canvas'!
+	package: 'Web'!
 !Widget commentStamp!
 I am a presenter building HTML. Subclasses are typically reusable components.
 
@@ -1097,7 +1097,7 @@ heliosClass
 	^ 'widget'
 ! !
 
-!BlockClosure methodsFor: '*Canvas'!
+!BlockClosure methodsFor: '*Web'!
 
 appendToBrush: aTagBrush
 	aTagBrush appendBlock: self
@@ -1107,13 +1107,13 @@ appendToJQuery: aJQuery
 	self value: (HTMLCanvas onJQuery: aJQuery)
 ! !
 
-!CharacterArray methodsFor: '*Canvas'!
+!CharacterArray methodsFor: '*Web'!
 
 asSnippet
 	^ HTMLSnippet current snippetAt: self asString
 ! !
 
-!JSObjectProxy methodsFor: '*Canvas'!
+!JSObjectProxy methodsFor: '*Web'!
 
 asJQuery
 	<return jQuery(self['@jsObject'])>
@@ -1123,7 +1123,7 @@ asJQueryInContext: aContext
 	<return jQuery(self['@jsObject'], aContext)>
 ! !
 
-!Object methodsFor: '*Canvas'!
+!Object methodsFor: '*Web'!
 
 appendToBrush: aTagBrush
 	aTagBrush append: self asString
@@ -1133,7 +1133,7 @@ appendToJQuery: aJQuery
 	aJQuery append: self asString
 ! !
 
-!String methodsFor: '*Canvas'!
+!String methodsFor: '*Web'!
 
 appendToBrush: aTagBrush
 	aTagBrush appendString: self

+ 1 - 1
support/deploy.js

@@ -9,5 +9,5 @@ define([
     'amber_core/Kernel-Exceptions',
     'amber_core/Kernel-Transcript',
     'amber_core/Kernel-Announcements',
-    'amber_core/Canvas'
+    'amber_core/Web'
 ], function (smalltalk) { return smalltalk; });