Browse Source

Amberification of webOS hellojtalk example.

Göran Krampe 12 years ago
parent
commit
75b6e2254e

+ 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 - 36
examples/webos/hellojtalk/EnyoJtalk.st

@@ -1,36 +0,0 @@
-"This is a base class for Jtalk 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'!
-
-!EnyoFriend methodsFor: 'accessing'!
-
-ui
-	^ui
-!
-
-ui: aUI
-	ui := aUI
-!
-
-dollar
-	"Return the $ of ui for easy access to the components of the UI."
-	<return this['@ui'].$>
-!
-
-kind
-	^kind
-! !
-
-!EnyoFriend methodsFor: 'initializing'!
-initialize
-	"We make sure our JS functions can be used transparently from Jtalk,
-	at this moment we do not use it - trying to create Enyo kinds that are
-	at the same time Jtalk classes failed for me."
-	super initialize.
-	<this.allowJavaScriptCalls = true>
-! !

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


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

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