Skip to content
Snippets Groups Projects
Commit 90703f2c authored by wonko's avatar wonko
Browse files

info-button für programm

parent 9647cabe
No related branches found
No related tags found
No related merge requests found
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<widget id="de.night.of.science" version="0.0.11" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <widget id="de.night.of.science" version="0.0.12" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Night of Science</name> <name>Night of Science</name>
<description>An awesome Ionic/Cordova app.</description> <description>An awesome Ionic/Cordova app.</description>
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team <author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team
......
...@@ -6,7 +6,10 @@ ...@@ -6,7 +6,10 @@
<ion-title>Programm</ion-title> <ion-title>Programm</ion-title>
</ion-navbar> </ion-navbar>
<ion-toolbar> <ion-toolbar>
<ion-title text-center>{{room}}</ion-title> <ion-title text-center>{{room}}
<button ion-button clear icon-right (click)="showAlert()">
<ion-icon name='beer'></ion-icon>
</button></ion-title>
</ion-toolbar> </ion-toolbar>
</ion-header> </ion-header>
......
...@@ -3,7 +3,7 @@ import { NavController, NavParams, LoadingController } from 'ionic-angular'; ...@@ -3,7 +3,7 @@ import { NavController, NavParams, LoadingController } from 'ionic-angular';
import { LecturesProvider } from '../../providers/lectures-provider'; import { LecturesProvider } from '../../providers/lectures-provider';
import { ViewChild } from '@angular/core'; import { ViewChild } from '@angular/core';
import { Slides } from 'ionic-angular'; import { Slides } from 'ionic-angular';
import { AlertController } from 'ionic-angular';
@Component({ @Component({
selector: 'page-programme', selector: 'page-programme',
...@@ -16,14 +16,14 @@ export class Programme { ...@@ -16,14 +16,14 @@ export class Programme {
times: any[] = []; times: any[] = [];
loading: any; loading: any;
lecturesData: any; lecturesData: any;
constructor(public navCtrl: NavController, public navParams: NavParams, public lecturesProvider: LecturesProvider, public loadingCtrl: LoadingController) { constructor(public navCtrl: NavController, public navParams: NavParams,public alertCtrl: AlertController, public lecturesProvider: LecturesProvider, public loadingCtrl: LoadingController) {
this.loading = this.loadingCtrl.create({ this.loading = this.loadingCtrl.create({
content: ` content: `
<ion-spinner ></ion-spinner>` <ion-spinner ></ion-spinner>`
}); });
console.log("using lecturesprovider" + this.lecturesProvider); console.log("using lecturesprovider" + this.lecturesProvider);
this.lecturesData = this.lecturesProvider.lecturesData; //this.lecturesData = this.lecturesProvider.lecturesData;
this.room = this.lecturesProvider.lecturesData[0].name;
} }
...@@ -113,4 +113,13 @@ export class Programme { ...@@ -113,4 +113,13 @@ export class Programme {
let currentIndex = this.slides.getActiveIndex(); let currentIndex = this.slides.getActiveIndex();
this.room = this.lecturesProvider.lecturesData[currentIndex].name; this.room = this.lecturesProvider.lecturesData[currentIndex].name;
} }
showAlert() {
let alert = this.alertCtrl.create({
title: 'Programminformationen',
subTitle: 'Version: '+ this.lecturesProvider.lecturesVersion +'<br/>Source: '+ this.lecturesProvider.source,
buttons: ['OK']
});
alert.present();
}
} }
...@@ -12,6 +12,7 @@ export class LecturesProvider { ...@@ -12,6 +12,7 @@ export class LecturesProvider {
lecturesVersion: string; lecturesVersion: string;
lecturesData: any; lecturesData: any;
initial: any = null; initial: any = null;
source: String = "";
constructor(public http: Http, public storage: Storage) { constructor(public http: Http, public storage: Storage) {
console.log("Lectures Provider instatiated"); console.log("Lectures Provider instatiated");
if (!this.initial){ if (!this.initial){
...@@ -20,8 +21,10 @@ export class LecturesProvider { ...@@ -20,8 +21,10 @@ export class LecturesProvider {
storage.get("lecturesVersion").then((version) => { storage.get("lecturesVersion").then((version) => {
if (version){ if (version){
console.log('lectures version: '+ version); console.log('lectures version: '+ version);
this.lecturesVersion = version;
storage.get("lecturesData").then((schedule) => { storage.get("lecturesData").then((schedule) => {
this.lecturesData = JSON.parse(schedule); this.lecturesData = JSON.parse(schedule);
this.source = "localstorage"
}); });
} else { } else {
console.log('no lectures data: new install'); console.log('no lectures data: new install');
...@@ -33,7 +36,7 @@ export class LecturesProvider { ...@@ -33,7 +36,7 @@ export class LecturesProvider {
console.log("Lectures loaded from json"); console.log("Lectures loaded from json");
storage.set('lecturesData',JSON.stringify(this.lecturesData)); storage.set('lecturesData',JSON.stringify(this.lecturesData));
storage.set('lecturesVersion',this.lecturesVersion); storage.set('lecturesVersion',this.lecturesVersion);
this.source = "json"
}, },
err =>{ err =>{
console.error("Error : "+err); console.error("Error : "+err);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment