mirror of
https://github.com/sensebox/blockly-app
synced 2025-06-09 03:05:51 +02:00
add SettingsPage & link to Blockly Book to menu
This commit is contained in:
parent
2817f1daf8
commit
0a02ee67e2
4 changed files with 56 additions and 7 deletions
|
@ -16,9 +16,29 @@ export class openSenseApp {
|
||||||
|
|
||||||
rootPage:any = BlocklyPage;
|
rootPage:any = BlocklyPage;
|
||||||
|
|
||||||
pages: Array<{title: string, component: any}> = [
|
pages: Array<AppPage> = [
|
||||||
{ title: 'MENU.BLOCKLY', component: 'BlocklyPage' },
|
{
|
||||||
{ title: 'MENU.ABOUT', component: 'AboutPage' },
|
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(
|
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
|
// Reset the content nav to have just this page
|
||||||
// we wouldn't want the back button to show in this scenario
|
// we wouldn't want the back button to show in this scenario
|
||||||
this.nav.setRoot(page.component);
|
this.nav.setRoot(page.component);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface AppPage {
|
||||||
|
title: string,
|
||||||
|
icon: string,
|
||||||
|
component?: string,
|
||||||
|
callback?: () => any,
|
||||||
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
<ion-content>
|
<ion-content>
|
||||||
<ion-list>
|
<ion-list>
|
||||||
<button menuClose ion-item *ngFor="let p of pages" (click)="openPage(p)">
|
<button menuClose ion-item *ngFor="let p of pages" (click)="openPage(p)">
|
||||||
|
<ion-icon [name]="p.icon"></ion-icon>
|
||||||
{{ p.title | translate }}
|
{{ p.title | translate }}
|
||||||
</button>
|
</button>
|
||||||
</ion-list>
|
</ion-list>
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
"MENU": {
|
"MENU": {
|
||||||
"TITLE": "Menü",
|
"TITLE": "Menü",
|
||||||
"ABOUT": "Über",
|
"ABOUT": "Über",
|
||||||
"BLOCKLY": "Blockly"
|
"BLOCKLY": "Blockly",
|
||||||
|
"DOCS": "Dokumentation",
|
||||||
|
"SETTINGS": "Einstellungen"
|
||||||
},
|
},
|
||||||
"ABOUT": {
|
"ABOUT": {
|
||||||
"TITLE": "Über",
|
"TITLE": "Über",
|
||||||
|
@ -22,6 +24,13 @@
|
||||||
"BTN_CODE": "Quellcode Ansicht",
|
"BTN_CODE": "Quellcode Ansicht",
|
||||||
"BTN_OTA": "OTA Programmierung"
|
"BTN_OTA": "OTA Programmierung"
|
||||||
},
|
},
|
||||||
|
"SETTINGS": {
|
||||||
|
"TITLE": "Einstellungen",
|
||||||
|
"LOG_OPTIN": {
|
||||||
|
"TITLE": "Sende uns automatisch Fehler-Berichte zu",
|
||||||
|
"TEXT": "Das hilft uns beim Beheben von Fehlern.<br/>Keine persönlichen Daten außer deinem Sketch werden übertragen."
|
||||||
|
}
|
||||||
|
},
|
||||||
"OTAWIZ": {
|
"OTAWIZ": {
|
||||||
"TITLE": "Over The Air Programmierung",
|
"TITLE": "Over The Air Programmierung",
|
||||||
"BTN_NEXT": "Weiter",
|
"BTN_NEXT": "Weiter",
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
"MENU": {
|
"MENU": {
|
||||||
"TITLE": "Menu",
|
"TITLE": "Menu",
|
||||||
"ABOUT": "About",
|
"ABOUT": "About",
|
||||||
"BLOCKLY": "Blockly"
|
"BLOCKLY": "Blockly",
|
||||||
|
"DOCS": "Documentation",
|
||||||
|
"SETTINGS": "Settings"
|
||||||
},
|
},
|
||||||
"ABOUT": {
|
"ABOUT": {
|
||||||
"TITLE": "About",
|
"TITLE": "About",
|
||||||
|
@ -22,6 +24,13 @@
|
||||||
"BTN_CODE": "Code View",
|
"BTN_CODE": "Code View",
|
||||||
"BTN_OTA": "OTA Programmer"
|
"BTN_OTA": "OTA Programmer"
|
||||||
},
|
},
|
||||||
|
"SETTINGS": {
|
||||||
|
"TITLE": "Settings",
|
||||||
|
"LOG_OPTIN": {
|
||||||
|
"TITLE": "Automatically send error reports to us",
|
||||||
|
"TEXT": "These reports help us in troubleshooting issues.<br/>No personal information is collected, except for your Sketch."
|
||||||
|
}
|
||||||
|
},
|
||||||
"OTAWIZ": {
|
"OTAWIZ": {
|
||||||
"TITLE": "Over The Air Programmer",
|
"TITLE": "Over The Air Programmer",
|
||||||
"BTN_NEXT": "Continue",
|
"BTN_NEXT": "Continue",
|
||||||
|
@ -66,7 +75,7 @@
|
||||||
"AUTO": {
|
"AUTO": {
|
||||||
"TITLE": "Select your senseBox",
|
"TITLE": "Select your senseBox",
|
||||||
"TEXT1": "All powered senseBoxes around you with OTA mode enabled are listed here.",
|
"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.",
|
"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",
|
"AVAILABLE": "Available senseBox WiFis",
|
||||||
"SCANNING": "searching...",
|
"SCANNING": "searching...",
|
||||||
|
|
Loading…
Add table
Reference in a new issue