added pebble-js-app.js in preparation for settings page
parent
ef66876379
commit
9ca7fd9f0e
|
@ -0,0 +1,23 @@
|
|||
Pebble.addEventListener('ready', function() {
|
||||
console.log('PebbleKit JS ready!');
|
||||
});
|
||||
|
||||
Pebble.addEventListener('showConfiguration', function() {
|
||||
var url='http://pebble.lastfuture.de/config/supersimple13/';
|
||||
console.log('Showing configuration page: '+url);
|
||||
Pebble.openURL(url);
|
||||
});
|
||||
|
||||
Pebble.addEventListener('webviewclosed', function(e) {
|
||||
var configData = JSON.parse(decodeURIComponent(e.response));
|
||||
console.log('Configuration page returned: '+JSON.stringify(configData));
|
||||
if (configData.colors) {
|
||||
Pebble.sendAppMessage({
|
||||
colors: configData.colors
|
||||
}, function() {
|
||||
console.log('Send successful!');
|
||||
}, function() {
|
||||
console.log('Send failed!');
|
||||
});
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue