فهرست منبع

Merge pull request #31 from tomrake/remove-webos

Remove webos
Fixes #18
Herbert Vojčík 10 سال پیش
والد
کامیت
592a2b6490

+ 0 - 11
webos/README

@@ -1,11 +0,0 @@
-These are examples that can be run in webOS 3.0 using Enyo - the new UI framework that was released with 3.0.
-
-You can play with them:
-
-- In a real device (a Touchpad or Pre 3 at the moment), but then you would first need to install the webOS SDK 3.0. With your device connected through USB you should be able to do "make run" and it should get installed and started on your device!
-
-- In the emulator included in the SDK. Just start "palm-emulator" and then do "make run" in any of the examples.
-
-- In a WebKit based browser, like Chromium (on Linux, do "make chromium") or Safari on the Mac (yes, it works). But first you would need to ensure that you have a copy of the enyo directory (normally you find it in /opt/PalmSDK/0.1/share/refcode/framework/enyo on Linux, just copy that whole directory into the directory in which you have the jtalk clone from github. Then the relative path in the index.html file referencing Enyo should work.
-
-

BIN
webos/eris/DuckQwaq.wav


+ 0 - 36
webos/eris/EnyoAmber.st

@@ -1,36 +0,0 @@
-"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: 'EnyoAmber'!
-
-!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 Amber,
-	at this moment we do not use it - trying to create Enyo kinds that are
-	at the same time Amber classes failed for me."
-	super initialize.
-	<this.allowJavaScriptCalls = true>
-! !

+ 0 - 0
webos/eris/Eris.css


+ 0 - 86
webos/eris/Eris.st

@@ -1,86 +0,0 @@
-EnyoFriend subclass: #Eris
-        instanceVariableNames: ''
-        category: 'Eris'!
-
-!Eris methodsFor: 'actions'!
-
-doIt
-    | result |
-    [ result := self eval: self dollar richText getValue ]
-	on: Error
-	do: [:ex |
-		^self warn: ex messageText title: 'Error' button: 'Ooops...'].
-    ^result
-!
-
-clear
-	self dollar richText setValue: ''
-!
-
-eval: aString
-    | compiler node |
-    compiler := Compiler new.
-    node := compiler parseExpression: aString.
-    node isParseFailure ifTrue: [
-	^self warn: 'Ehrm, you are a Smalltalk n00b, right? That is not valid syntax.' title: 'Parsing Error' button: 'Okidoki...'].
-    ^compiler loadExpression: aString.
-!
-
-printString
-	^''
-!
-
-warn: aString title: aTitle button: caption
-	| block popup |
-	block := [popup close].
-	<props = {kind: 'ModalDialog', caption: aTitle, components: [
-			{kind: 'Control', content: aString, className: 'enyo-text-error warning-icon'},
-			{kind: 'Button', caption: caption, onclick: 'closePopup', style: 'margin-top:10px'}],
-		 closePopup: block}>.
-	popup := enyo create: props.
-	popup openAtCenter
-!
-
-print: aString
-    self dollar richText setValue: (self dollar richText getValue), ' ', aString
-!
-
-quack
-	"(self kind: 'Sound'; src: 'DuckQwaq.wav'; create) play"
-	(enyo create: (Dictionary new at: 'kind' put: 'Sound'; at: 'src' put: 'DuckQwaq.wav'; yourself)) play
-!
-
-printIt
-    self print: self doIt printString
-! !
-
-!Eris methodsFor: 'initialization'!
-initialize
-	| props doItBlock printItBlock quackBlock clearBlock |
-	super initialize.
-	doItBlock := [self doIt].
-	printItBlock := [self printIt].
-	quackBlock := [self quack].
-	clearBlock := [self clear].
-
-	<props = {kind: 'VFlexBox', components: [
-			{kind: 'PageHeader', content: 'Eris'},
- 			{kind: 'RowGroup', caption: 'Workspace', components: [
-				{kind: 'RichText', richContent: false,
-					value: 'Put some funky Amber code here...',
-					autoWordComplete: false, spellcheck: false, autocorrect: false,
-					autoCapitalize: 'lowercase', alwaysLooksFocused: true
-				},
-				{kind: 'Toolbar', components: [
-					{caption: 'Do it', onclick: 'doit'},
-					{caption: 'Print it', onclick: 'printit'},
-					{caption: 'Clear', onclick: 'clear'},
-					{kind: 'Spacer'},
-					{caption: 'Quack!!', onclick: 'quack'}]}]}],
-		doit: doItBlock,
-		printit: printItBlock,
-		quack: quackBlock,
-		clear: clearBlock}>.
-	ui := enyo create: props.
-! !
-

+ 0 - 37
webos/eris/Makefile

@@ -1,37 +0,0 @@
-#
-# If you copy this file for an Enyo/Amber project, just
-# modify these first three lines
-# and then add .st files as you please. This Makefile
-# should pick them all up and compile into Program.js.
-#
-PACKAGE  := amber.eris
-VERSION  := 0.0.1
-FLAGS    := -l Compiler
-
-IPK      := $(PACKAGE)_$(VERSION)_all.ipk
-FILE     := Program
-SOURCES  := $(wildcard *.st)
-OBJECTS  := $(patsubst %.st,%.js,$(wildcard *.st))
-FILEJS   := $(FILE).js
-
-$(FILEJS): $(SOURCES)
-	../../../bin/amberc $(FLAGS) $(SOURCES) $(FILE)
-
-$(IPK): $(FILEJS)
-	palm-package .
-
-clean:
-	rm -f $(FILEJS) $(OBJECTS) $(IPK)
-#	palm-install -r $(PACKAGE)
-
-install: $(IPK)
-	palm-install $(IPK)
-
-# If you want to run it in the emulator, start the emulator first with palm-emulator
-run:    $(IPK)
-	palm-install $(IPK)
-	palm-launch $(PACKAGE)
-
-# This should fire it up in Chromium (at least under Ubuntu)
-chromium: $(FILEJS)
-	chromium-browser --allow-file-access-from-files index.html

+ 0 - 3
webos/eris/README

@@ -1,3 +0,0 @@
-This is an example that was shown at ESUG 2011 running on a HP Touhpad with webOS 3.0.2.
-It shows the minimal beginning of a Jtalk development environment that dynamically can run and build Enyo applications.
-

+ 0 - 10
webos/eris/appinfo.json

@@ -1,10 +0,0 @@
-{
-	"id": "jtalk.eris",
-	"version": "0.0.1",
-	"vendor": "Krampe Dynamic Development",
-	"type": "web",
-	"main": "index.html",
-	"title": "Eris",
-	"icon": "icon.png",
-	"uiRevision": 2
-}

+ 0 - 4
webos/eris/depends.js

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

+ 0 - 12
webos/eris/index.html

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

+ 0 - 36
webos/helloamber/EnyoAmber.st

@@ -1,36 +0,0 @@
-"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: 'EnyoAmber'!
-
-!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 Amber,
-	at this moment we do not use it - trying to create Enyo kinds that are
-	at the same time Amber classes failed for me."
-	super initialize.
-	<this.allowJavaScriptCalls = true>
-! !

+ 0 - 86
webos/helloamber/HelloAmber.st

@@ -1,86 +0,0 @@
-EnyoFriend subclass: #HelloAmber
-        instanceVariableNames: 'count popup'
-        category: 'HelloAmber'!
-
-!HelloAmber methodsFor: 'accessing'!
-count
-	^count
-! !
-
-!HelloAmber methodsFor: 'actions'!
-buttonClicked
-	count := count + 1.
-	self dollar input setValue: (self dollar input getValue, 'You clicked the button ', count asString, ' times so far').
-
-	"Okidoki, why not throw up a popup?"
-	popup openAtCenter
-!
-
-popupSelected: value
-	"The user picked a value in the popup."
-	self dollar input setValue: (self dollar input getValue, ' ', value)
-! !
-
-!HelloAmber methodsFor: 'initialization'!
-initialize
-	"Create Enyo stuff and hook in callback blocks calling our action methods,
-	very similar to how Seaside does it.
-	Creating the templates for component construction
-	is clearly simpler to do in js. Yes, we can use
-	method temps inside the js code and ivars are accessed
-	using this syntax:
-
-		this['@ivarname']
-
-	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._amberMessage()
-
-	to send messages to self for embedding the result."
-
-	| props block block2 |
-	super initialize.
-	count := 0.
-
-	"Create a callback block to embed below."
-	block := [self buttonClicked].
-
-	"We need to go through a method temp (props) for doing js, just inlining it
-	after 'enyo create:' does not work so js escaping is on the statement level
-	and not on the expression level."
-	<props = {
-		kind: 'VFlexBox',
-		components: [
-			{kind: 'PageHeader', content: 'Amber Live'},
- 			{kind: "RowGroup", caption: "Rock on", components: [
-				{kind: 'Input', components: [
-					{kind: 'Button', caption: 'Click me', onclick: 'ablock'}]
-				}]
-			}],
-		ablock: block}>.
-	self ui: (enyo create: props).
-
-	"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 EnyoHelloAmber()>"
-
-	"This Enyo popup instance is created and held in an ivar for later use."
-	block2 := [:sender :value :old | self popupSelected: value].
-
-	<props = {kind: "Popup", components: [
-	    		{content: "Pick something you like a lot"},
-	    		{kind: "ListSelector", onChange: "popupSelected", value: "Foo", items: ["Foo", "Bar", "Bot"]
-			}],
-		popupSelected: block2}>.
-	popup := enyo create: props
-	
-! !
-
-!HelloAmber class methodsFor: 'initialization'!
-initialize
-
-	enyo log: 'Class initialized'
-! !

+ 0 - 38
webos/helloamber/Makefile

@@ -1,38 +0,0 @@
-#
-# If you copy this file for an Enyo/Amber project, just
-# modify these first two lines
-# and then add .st files as you please. This Makefile
-# should pick them all up and compile into Program.js.
-#
-PACKAGE  := amber.helloamber
-VERSION  := 1.0.0
-
-# -O for Closure optimization of js code.
-FLAGS    := 
-IPK      := $(PACKAGE)_$(VERSION)_all.ipk
-FILE     := Program
-SOURCES  := $(wildcard *.st)
-OBJECTS  := $(patsubst %.st,%.js,$(wildcard *.st))
-FILEJS   := $(FILE).js
-
-$(FILEJS): $(SOURCES)
-	../../../bin/amberc $(FLAGS) $(SOURCES) $(FILE)
-
-$(IPK): $(FILEJS)
-	palm-package .
-
-clean:
-	rm -f $(FILEJS) $(OBJECTS) $(IPK)
-#	palm-install -r $(PACKAGE)
-
-install: $(IPK)
-	palm-install $(IPK)
-
-# If you want to run it in the emulator, start the emulator first with palm-emulator
-run:    $(IPK)
-	palm-install $(IPK)
-	palm-launch $(PACKAGE)
-
-# This should fire it up in Chromium (at least under Ubuntu)
-chromium: $(FILEJS)
-	chromium-browser --allow-file-access-from-files index.html

+ 0 - 5
webos/helloamber/README

@@ -1,5 +0,0 @@
-This is just a first kinda messy experiment with Enyo, doesn't do anything sensible. If you have Chromium installed and also the Enyo framework accessible in your home directory as it is referenced in index.html - then you could probably do:
-
-	make chromium
-
-...to start the app in Chromium.

+ 0 - 10
webos/helloamber/appinfo.json

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

+ 0 - 3
webos/helloamber/depends.js

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

+ 0 - 12
webos/helloamber/index.html

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