From 0a02ee67e243d6f4937f75800740ffbb1933158e Mon Sep 17 00:00:00 2001 From: Norwin Roosen Date: Mon, 18 Feb 2019 13:18:25 +0100 Subject: [PATCH] add SettingsPage & link to Blockly Book to menu --- src/app/app.component.ts | 38 ++++++++++++++++++++++++++++++++++---- src/app/app.html | 1 + src/assets/i18n/de.json | 11 ++++++++++- src/assets/i18n/en.json | 13 +++++++++++-- 4 files changed, 56 insertions(+), 7 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 6d39d53..7a7e15c 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -16,9 +16,29 @@ export class openSenseApp { rootPage:any = BlocklyPage; - pages: Array<{title: string, component: any}> = [ - { title: 'MENU.BLOCKLY', component: 'BlocklyPage' }, - { title: 'MENU.ABOUT', component: 'AboutPage' }, + pages: Array = [ + { + title: 'MENU.BLOCKLY', + icon: 'code', + component: 'BlocklyPage' + }, + { + title: 'MENU.DOCS', + icon: 'book', + callback: () => { + window.open('https://sensebox.github.io/books-v2/blockly/' + this.translate.currentLang) + } + }, + { + title: 'MENU.ABOUT', + icon: 'at', + component: 'AboutPage' + }, + { + title: 'MENU.SETTINGS', + icon: 'settings', + component: 'SettingsPage' + }, ]; constructor( @@ -40,9 +60,19 @@ export class openSenseApp { }) } - openPage(page) { + openPage(page: AppPage) { + if (page.callback) + return page.callback() + // Reset the content nav to have just this page // we wouldn't want the back button to show in this scenario this.nav.setRoot(page.component); } } + +interface AppPage { + title: string, + icon: string, + component?: string, + callback?: () => any, +} diff --git a/src/app/app.html b/src/app/app.html index 51c722b..0c0633b 100644 --- a/src/app/app.html +++ b/src/app/app.html @@ -8,6 +8,7 @@ diff --git a/src/assets/i18n/de.json b/src/assets/i18n/de.json index 704544c..7d74adc 100644 --- a/src/assets/i18n/de.json +++ b/src/assets/i18n/de.json @@ -2,7 +2,9 @@ "MENU": { "TITLE": "Menü", "ABOUT": "Über", - "BLOCKLY": "Blockly" + "BLOCKLY": "Blockly", + "DOCS": "Dokumentation", + "SETTINGS": "Einstellungen" }, "ABOUT": { "TITLE": "Über", @@ -22,6 +24,13 @@ "BTN_CODE": "Quellcode Ansicht", "BTN_OTA": "OTA Programmierung" }, + "SETTINGS": { + "TITLE": "Einstellungen", + "LOG_OPTIN": { + "TITLE": "Sende uns automatisch Fehler-Berichte zu", + "TEXT": "Das hilft uns beim Beheben von Fehlern.
Keine persönlichen Daten außer deinem Sketch werden übertragen." + } + }, "OTAWIZ": { "TITLE": "Over The Air Programmierung", "BTN_NEXT": "Weiter", diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index be6e833..e7c4614 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -2,7 +2,9 @@ "MENU": { "TITLE": "Menu", "ABOUT": "About", - "BLOCKLY": "Blockly" + "BLOCKLY": "Blockly", + "DOCS": "Documentation", + "SETTINGS": "Settings" }, "ABOUT": { "TITLE": "About", @@ -22,6 +24,13 @@ "BTN_CODE": "Code View", "BTN_OTA": "OTA Programmer" }, + "SETTINGS": { + "TITLE": "Settings", + "LOG_OPTIN": { + "TITLE": "Automatically send error reports to us", + "TEXT": "These reports help us in troubleshooting issues.
No personal information is collected, except for your Sketch." + } + }, "OTAWIZ": { "TITLE": "Over The Air Programmer", "BTN_NEXT": "Continue", @@ -66,7 +75,7 @@ "AUTO": { "TITLE": "Select your senseBox", "TEXT1": "All powered senseBoxes around you with OTA mode enabled are listed here.", - "TEXT2": "Please check the last digits of MAC-Adress on your WiFi Bee to identify your senseBox. You can find it printed on the bottom of the WiFi Bee.", + "TEXT2": "Please check the last digits of the MAC-Adress on your WiFi Bee to identify your senseBox. You can find it printed on the bottom of the WiFi Bee.", "TEXT3": "If you can't find your senseBox, please make sure that your WiFi Bee is mounted correctly, OTA mode is enabled and GPS is enabled on this device.", "AVAILABLE": "Available senseBox WiFis", "SCANNING": "searching...",