summaryrefslogtreecommitdiff
path: root/src/examples
diff options
context:
space:
mode:
authorStefan Schmidt <s.schmidt@samsung.com>2019-12-24 09:23:22 -0500
committerMike Blumenkrantz <zmike@samsung.com>2019-12-24 09:23:22 -0500
commit9144e4dae7a84d53ff6d69e43ef34ad13ba298d3 (patch)
treec8b0f2b273980665e5dd81abb0fa4076b838f01c /src/examples
parentf1144705ece4c94011078268262ff8c97bc302df (diff)
examples: js: make sure we declare all variables
Summary: Avoiding local variables to be declared global and shared automatically. Depends on D10882 Reported-By: https://lgtm.com/projects/g/Enlightenment/efl Reviewers: felipealmeida, zmike Reviewed By: zmike Subscribers: zmike, ProhtMeyhet, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10884
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/elementary/button_example_01.js2
-rw-r--r--src/examples/elementary/slider_example.js4
-rw-r--r--src/examples/elementary/twitter_example_01.js8
3 files changed, 7 insertions, 7 deletions
diff --git a/src/examples/elementary/button_example_01.js b/src/examples/elementary/button_example_01.js
index 2f540220d0..89a48867f3 100644
--- a/src/examples/elementary/button_example_01.js
+++ b/src/examples/elementary/button_example_01.js
@@ -1,7 +1,7 @@
1efl = require('efl'); 1efl = require('efl');
2 2
3function setIcon(widget, icon) { 3function setIcon(widget, icon) {
4 container = widget.part("icon").cast("Efl.Content"); 4 var container = widget.part("icon").cast("Efl.Content");
5 container.setContent(icon); 5 container.setContent(icon);
6} 6}
7 7
diff --git a/src/examples/elementary/slider_example.js b/src/examples/elementary/slider_example.js
index ec59ee1c81..f3125e5e01 100644
--- a/src/examples/elementary/slider_example.js
+++ b/src/examples/elementary/slider_example.js
@@ -91,13 +91,13 @@ sl.setVisible(true);
91 91
92sl.on('changed', function(obj) 92sl.on('changed', function(obj)
93 { 93 {
94 val = obj.getProgressValue(); 94 var val = obj.getProgressValue();
95 console.log("Changed to " + val); 95 console.log("Changed to " + val);
96 }); 96 });
97 97
98sl.on('delay_changed', function(obj) 98sl.on('delay_changed', function(obj)
99 { 99 {
100 val = obj.getProgressValue(); 100 var val = obj.getProgressValue();
101 console.log("Delay changed to " + val); 101 console.log("Delay changed to " + val);
102 }); 102 });
103 103
diff --git a/src/examples/elementary/twitter_example_01.js b/src/examples/elementary/twitter_example_01.js
index ba00b05900..b6c40915be 100644
--- a/src/examples/elementary/twitter_example_01.js
+++ b/src/examples/elementary/twitter_example_01.js
@@ -43,7 +43,7 @@ twit.get('statuses/user_timeline', {screen_name: user_acount, count:10}, functio
43 if (error) 43 if (error)
44 return; 44 return;
45 45
46 for(i=0; i < tweets.length; i++){ 46 for(var i=0; i < tweets.length; i++){
47 var user_name = tweets[i].user.name; 47 var user_name = tweets[i].user.name;
48 var screen_name = tweets[i].user.screen_name; 48 var screen_name = tweets[i].user.screen_name;
49 var text = tweets[i].text; 49 var text = tweets[i].text;
@@ -58,7 +58,7 @@ twit.get('statuses/user_timeline', {screen_name: user_acount, count:10}, functio
58 var entry = new efl.Elm.Entry(win); 58 var entry = new efl.Elm.Entry(win);
59 entry.setPartText("elm.text", text); 59 entry.setPartText("elm.text", text);
60 entry.setEditable(false); 60 entry.setEditable(false);
61 part = layout.part("tweet_text").cast("Efl.Content"); 61 var part = layout.part("tweet_text").cast("Efl.Content");
62 part.setContent(entry); 62 part.setContent(entry);
63 63
64 layout.setHintMin(127, 96); 64 layout.setHintMin(127, 96);
@@ -68,7 +68,7 @@ twit.get('statuses/user_timeline', {screen_name: user_acount, count:10}, functio
68 var icon = new efl.Efl.Ui.Image(win); 68 var icon = new efl.Efl.Ui.Image(win);
69 icon.fillInside = true; 69 icon.fillInside = true;
70 icon_array.push(icon); 70 icon_array.push(icon);
71 user_icon = layout.part("user_icon").cast("Efl.Content"); 71 var user_icon = layout.part("user_icon").cast("Efl.Content");
72 user_icon.setContent(icon); 72 user_icon.setContent(icon);
73 item = tweet_box.packEnd(layout); 73 item = tweet_box.packEnd(layout);
74 layout.setVisible(true); 74 layout.setVisible(true);
@@ -78,7 +78,7 @@ twit.get('statuses/user_timeline', {screen_name: user_acount, count:10}, functio
78 var file = fs.createWriteStream(icon_filename); 78 var file = fs.createWriteStream(icon_filename);
79 file.on('finish', function() { 79 file.on('finish', function() {
80 console.log("finished loading the icon file."); 80 console.log("finished loading the icon file.");
81 for (i=0; i < icon_array.length; i++) { 81 for (var i=0; i < icon_array.length; i++) {
82 icon_array[i].setFile(icon_filename, null); 82 icon_array[i].setFile(icon_filename, null);
83 } 83 }
84 }); 84 });