mirror of https://github.com/espruino/BangleApps
Welcome: Allow welcome to run after a fresh install
+ More useful app menu + BTN2 now goes to menu on releasepull/422/head
parent
776fa29728
commit
2ed65f3ead
|
@ -78,7 +78,7 @@
|
||||||
{ "id": "welcome",
|
{ "id": "welcome",
|
||||||
"name": "Welcome",
|
"name": "Welcome",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"version":"0.08",
|
"version":"0.09",
|
||||||
"description": "Appears at first boot and explains how to use Bangle.js",
|
"description": "Appears at first boot and explains how to use Bangle.js",
|
||||||
"tags": "start,welcome",
|
"tags": "start,welcome",
|
||||||
"allow_emulator":true,
|
"allow_emulator":true,
|
||||||
|
@ -589,7 +589,7 @@
|
||||||
"id": "ncstart",
|
"id": "ncstart",
|
||||||
"name": "NCEU Startup",
|
"name": "NCEU Startup",
|
||||||
"icon": "start.png",
|
"icon": "start.png",
|
||||||
"version":"0.05",
|
"version":"0.06",
|
||||||
"description": "NodeConfEU 2019 'First Start' Sequence",
|
"description": "NodeConfEU 2019 'First Start' Sequence",
|
||||||
"tags": "start,welcome",
|
"tags": "start,welcome",
|
||||||
"storage": [
|
"storage": [
|
||||||
|
|
|
@ -6,3 +6,4 @@
|
||||||
Don't run again when settings app is updated (or absent)
|
Don't run again when settings app is updated (or absent)
|
||||||
Add "Run Now" option to settings
|
Add "Run Now" option to settings
|
||||||
0.05: Don't overwrite existing settings on app update
|
0.05: Don't overwrite existing settings on app update
|
||||||
|
0.06: Allow welcome to run after a fresh install
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
(function() {
|
(function() {
|
||||||
let s = require('Storage').readJSON('ncstart.json', 1)
|
let s = require('Storage').readJSON('ncstart.json', 1) || {};
|
||||||
|| require('Storage').readJSON('setting.json', 1)
|
if (!s.welcomed) {
|
||||||
|| {welcomed: true} // do NOT run if global settings are also absent
|
|
||||||
if (!s.welcomed && require('Storage').read('ncstart.app.js')) {
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
s.welcomed = true
|
require('Storage').write('ncstart.json', {welcomed: true})
|
||||||
require('Storage').write('ncstart.json', s)
|
|
||||||
load('ncstart.app.js')
|
load('ncstart.app.js')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,3 +8,6 @@
|
||||||
Don't run again when settings app is updated (or absent)
|
Don't run again when settings app is updated (or absent)
|
||||||
Add "Run Now" option to settings
|
Add "Run Now" option to settings
|
||||||
0.08: Don't overwrite existing settings on app update
|
0.08: Don't overwrite existing settings on app update
|
||||||
|
0.09: Allow welcome to run after a fresh install
|
||||||
|
More useful app menu
|
||||||
|
BTN2 now goes to menu on release
|
||||||
|
|
|
@ -285,7 +285,7 @@ setWatch(()=>{
|
||||||
if (sceneNumber == scenes.length-1) {
|
if (sceneNumber == scenes.length-1) {
|
||||||
load();
|
load();
|
||||||
}
|
}
|
||||||
}, BTN2, {repeat:true,edge:"rising"});
|
}, BTN2, {repeat:true,edge:"falling"});
|
||||||
setWatch(()=>move(-1), BTN1, {repeat:true});
|
setWatch(()=>move(-1), BTN1, {repeat:true});
|
||||||
|
|
||||||
(function migrateSettings(){
|
(function migrateSettings(){
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
(function() {
|
(function() {
|
||||||
let s = require('Storage').readJSON('welcome.json', 1)
|
let s = require('Storage').readJSON('welcome.json', 1) || {};
|
||||||
|| require('Storage').readJSON('setting.json', 1)
|
if (!s.welcomed) {
|
||||||
|| {welcomed: true} // do NOT run if global settings are also absent
|
|
||||||
if (!s.welcomed && require('Storage').read('welcome.app.js')) {
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
s.welcomed = true
|
require('Storage').write('welcome.json', {welcomed: true})
|
||||||
require('Storage').write('welcome.json', {welcomed: "yes"})
|
|
||||||
load('welcome.app.js')
|
load('welcome.app.js')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,12 +3,16 @@
|
||||||
|| require('Storage').readJSON('setting.json', 1) || {}
|
|| require('Storage').readJSON('setting.json', 1) || {}
|
||||||
E.showMenu({
|
E.showMenu({
|
||||||
'': { 'title': 'Welcome App' },
|
'': { 'title': 'Welcome App' },
|
||||||
'Run on Next Boot': {
|
'Run next boot': {
|
||||||
value: !settings.welcomed,
|
value: !settings.welcomed,
|
||||||
format: v => v ? 'OK' : 'No',
|
format: v => v ? 'Yes' : 'No',
|
||||||
onchange: v => require('Storage').write('welcome.json', {welcomed: !v}),
|
onchange: v => require('Storage').write('welcome.json', {welcomed: !v}),
|
||||||
},
|
},
|
||||||
'Run Now': () => load('welcome.app.js'),
|
'Run Now': () => load('welcome.app.js'),
|
||||||
|
'Turn off, run next boot': () => {
|
||||||
|
require('Storage').write('welcome.json', {welcomed: false});
|
||||||
|
Bangle.off();
|
||||||
|
},
|
||||||
'< Back': back,
|
'< Back': back,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue