summaryrefslogtreecommitdiff
path: root/src/examples
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-05-17 11:22:42 +0200
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-05-18 17:52:47 +0200
commit5d5c04fd66b88c96de57f5b6421758c7d3f3f5a7 (patch)
tree98458b68e27b62639fbc63a7f6d26e4d9b2f1f75 /src/examples
parent75a53ece1007d927b8f0b6c5d3f269726afb9108 (diff)
js fixes
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/elementary/button_example_00.js5
-rw-r--r--src/examples/elementary/twitter_example_01.js39
2 files changed, 21 insertions, 23 deletions
diff --git a/src/examples/elementary/button_example_00.js b/src/examples/elementary/button_example_00.js
index 64d7c8f6f5..f122bf1994 100644
--- a/src/examples/elementary/button_example_00.js
+++ b/src/examples/elementary/button_example_00.js
@@ -1,12 +1,11 @@
1 1
2efl = require('efl'); 2efl = require('efl');
3elm = require('elm');
4 3
5win = new elm.Elm.WinStandard(null); 4win = new efl.Elm.Win.Standard(null);
6win.setTitle("Hello, World!"); 5win.setTitle("Hello, World!");
7win.setAutohide(true); 6win.setAutohide(true);
8 7
9btn = new elm.Elm.Button(win); 8btn = new efl.Elm.Button(win);
10btn.setText(null, "Good-Bye, World!"); 9btn.setText(null, "Good-Bye, World!");
11btn.setSize(120, 30); 10btn.setSize(120, 30);
12btn.setPosition(60, 15); 11btn.setPosition(60, 15);
diff --git a/src/examples/elementary/twitter_example_01.js b/src/examples/elementary/twitter_example_01.js
index 84d1d7d768..34d32d969b 100644
--- a/src/examples/elementary/twitter_example_01.js
+++ b/src/examples/elementary/twitter_example_01.js
@@ -1,6 +1,5 @@
1 1
2efl = require('efl'); 2efl = require('efl');
3elm = require('elm');
4 3
5util = require('util'); 4util = require('util');
6fs = require('fs'); 5fs = require('fs');
@@ -17,16 +16,16 @@ var twit = new Twitter({
17 access_token_secret: 'l7ccNKXTVv6cymfSD1gQH61tmfixkdna2QmOjPtpVxSHD' 16 access_token_secret: 'l7ccNKXTVv6cymfSD1gQH61tmfixkdna2QmOjPtpVxSHD'
18}); 17});
19 18
20win = new elm.Elm.WinStandard(null); 19win = new efl.ui.WinStandard(null);
21win.setTitle("Twitter App"); 20win.title = "Twitter App";
22win.setAutohide(true); 21win.autohide = true;
23 22
24box = new elm.Elm.Box(win); 23box = new efl.ui.Box(win);
25box.setSizeHintWeight(1.0, 1.0); 24box.setSizeHintWeight(1.0, 1.0);
26win.resizeObjectAdd(box); 25win.resizeObjectAdd(box);
27box.setVisible(true); 26box.setVisible(true);
28 27
29list = new elm.Elm.List(win); 28list = new efl.List(win);
30list.setSizeHintWeight(1.0, 1.0); 29list.setSizeHintWeight(1.0, 1.0);
31list.setSizeHintAlign(-1.0, -1.0); 30list.setSizeHintAlign(-1.0, -1.0);
32box.packEnd(list); 31box.packEnd(list);
@@ -41,7 +40,7 @@ twit.get('statuses/user_timeline', {screen_name: user_acount, count:10}, functio
41 console.log("finished"); 40 console.log("finished");
42 for (i=0; i < icon_array.length; i++) { 41 for (i=0; i < icon_array.length; i++) {
43 console.log(i); 42 console.log(i);
44 icon_array[i].setFile("/tmp/twitter_pic.jpg", null); 43 icon_array[i].file = "/tmp/twitter_pic.jpg";
45 } 44 }
46 }); 45 });
47 if (tweets.length > 0) { 46 if (tweets.length > 0) {
@@ -49,8 +48,8 @@ twit.get('statuses/user_timeline', {screen_name: user_acount, count:10}, functio
49 } 48 }
50 49
51 for(i=0; i < tweets.length; i++){ 50 for(i=0; i < tweets.length; i++){
52 var layout = new elm.Elm.Layout(win); 51 var layout = new efl.ui.Layout(win);
53 layout.setFile("twitter_example_01.edj", "tweet"); 52 layout.file["tweet"] = "twitter_example_01.edj";
54 53
55 var user_name = tweets[i].user.name; 54 var user_name = tweets[i].user.name;
56 var screen_name = tweets[i].user.screen_name; 55 var screen_name = tweets[i].user.screen_name;
@@ -59,24 +58,24 @@ twit.get('statuses/user_timeline', {screen_name: user_acount, count:10}, functio
59 58
60 layout.setText("user_name", screen_name); 59 layout.setText("user_name", screen_name);
61 layout.setText("screen_name", " - @"+screen_name); 60 layout.setText("screen_name", " - @"+screen_name);
62 var entry = new elm.Elm.Entry(win); 61 var entry = new efl.ui.Entry(win);
63 entry.setText("elm.text", text); 62 entry.text["elm.text"] = text;
64 console.log(text); 63 console.log(text);
65 layout.contentSet("tweet_text", entry); 64 layout.content["tweet_text"] = entry;
66 65
67 layout.setSizeHintMin(127, 96); 66 layout.sizeHintMin = {127, 96};
68 layout.setSizeHintWeight(1.0, 1.0); 67 layout.sizeHintWeight = {1.0, 1.0};
69 layout.setSizeHintAlign(-1.0, -1.0); 68 layout.sizeHintAlign = {-1.0, -1.0};
70 69
71 var icon = new elm.Elm.Image(win); 70 var icon = new efl.ui.Image(win);
72 icon.setFillInside(true); 71 icon.fillInside = true;
73 icon_array.push(icon); 72 icon_array.push(icon);
74 layout.contentSet("user_icon", icon); 73 layout.content["user_icon"] = icon;
75 item = list.itemAppend("", layout, null, null, null); 74 item = list.itemAppend("", layout, null, null, null);
76 } 75 }
77 list.go(); 76 list.go();
78 } 77 }
79}); 78});
80 79
81win.setSize(380,400); 80win.size = {380,400};
82win.setVisible(true); 81win.visible = {true};