-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
55 lines (44 loc) · 1.19 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
var controller = require('lib/controller'),
config = require('config');
simply.title("welcome");
function showMap(position) {
Pebble.showSimpleNotificationOnPebble('location!',
position.coords.latitude + "," + position.coords.longitude
);
}
//navigator.geolocation.getCurrentPosition(showMap);
simply.scrollable(true);
var myVar;
var flag = true;
simply.on('singleClick', function (e) {
if (e.button === 'up') {
}
else if (e.button === 'down') {
}
else if (e.button === 'select') {
simply.title("refreshed")
controller.refresh();
}
});
simply.on('longClick', function (e) {
if (e.button === 'select') {
if (flag) {
simply.title("live on")
setTimeout(function () {
controller.refresh();
myVar = setInterval(function () {
controller.refresh();
}, 30000);
}, 1000);
flag = false;
}
else {
simply.title("live off")
clearInterval(myVar);
flag = true;
setTimeout(function () {
controller.refresh();
}, 1000);
}
}
});