Ver código fonte

Merge remote branch 'upstream/master'

Göran Krampe 12 anos atrás
pai
commit
24a5505b6e
2 arquivos alterados com 52 adições e 0 exclusões
  1. 16 0
      examples/myproject/index.html
  2. 36 0
      examples/webos/helloamber/EnyoAmber.st

+ 16 - 0
examples/myproject/index.html

@@ -0,0 +1,16 @@
+<html>
+<head>
+<title>My Project</title>
+<script src="../../js/amber.js" type="text/javascript"></script>
+</head>
+<body>
+<script type="text/javascript"> 
+	loadAmber({
+		files: ['Banana.js'],
+		prefix: 'examples/myproject/js',
+		ready: function() {
+			smalltalk.Browser._open();
+		}}); 
+</script>
+</body>
+</html>

+ 36 - 0
examples/webos/helloamber/EnyoAmber.st

@@ -0,0 +1,36 @@
+"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>
+! !