mirror of
https://github.com/alinanorakari/Pebble-Time-Watchface-Arcangle.git
synced 2025-10-15 05:39:09 +02:00
added pebble-js-app.js in preparation for settings page
This commit is contained in:
parent
ef66876379
commit
9ca7fd9f0e
23
src/js/pebble-js-app.js
Normal file
23
src/js/pebble-js-app.js
Normal file
@ -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…
x
Reference in New Issue
Block a user