diff --git a/app/app.ts b/app/app.ts index 0d276aa..ccc888a 100644 --- a/app/app.ts +++ b/app/app.ts @@ -1,6 +1,6 @@ import { Component, Type, ViewChild } from '@angular/core'; import { Nav, Platform, Loading } from 'ionic-angular'; -import { Keyboard, Splashscreen, StatusBar } from 'ionic-native'; +import { GoogleAnalytics, Keyboard, Splashscreen, StatusBar } from 'ionic-native'; import { Deploy } from '@ionic/cloud-angular'; import { AuthService } from './services/auth'; @@ -21,13 +21,17 @@ export class LustrumApp { private notifier: NotificationService, private deploy: Deploy ) { - this.initializeCordova(); this.initializeRootPage(); + if (this.platform.is('cordova')) { + this.initializeCordova(); + } } private initializeCordova() { this.platform.ready().then(() => { Keyboard.disableScroll(true); + GoogleAnalytics.startTrackerWithId('UA-79997582-1'); + GoogleAnalytics.enableUncaughtExceptionReporting(true); this.runDeploy(); }); } diff --git a/app/directives/maps-href.ts b/app/directives/maps-href.ts new file mode 100644 index 0000000..963e191 --- /dev/null +++ b/app/directives/maps-href.ts @@ -0,0 +1,37 @@ +import { Directive, ElementRef, Input, OnInit } from '@angular/core'; +import { Platform } from 'ionic-angular'; + + +@Directive({ + selector: '[csrMapsHref]' +}) +export class MapsHrefDirective implements OnInit { + @Input('csrMapsHref') mapsQuery: string; + + private el: HTMLElement; + + constructor( + el: ElementRef, + private platform: Platform + ) { + this.el = el.nativeElement; + } + + ngOnInit() { + let query = encodeURIComponent(this.mapsQuery); + let url = this.getPlatformMapsUrl(); + this.el.setAttribute('href', url + query); + } + + private getPlatformMapsUrl(): string { + if (this.platform.is('mobile')) { + if (this.platform.is('ios')) { + return 'maps://maps.apple.com/?q='; + } else { + return 'geo:0,0?q='; + } + } else { + return 'https://maps.google.com?q='; + } + } +} diff --git a/app/pages/about/about.ts b/app/pages/about/about.ts index 4b8d56f..21a93d7 100644 --- a/app/pages/about/about.ts +++ b/app/pages/about/about.ts @@ -1,5 +1,6 @@ import { Component } from '@angular/core'; import { Loading, NavController } from 'ionic-angular'; +import { GoogleAnalytics } from 'ionic-native'; import { SystemBrowserDirective } from '../../directives/system-browser'; import { AuthService } from '../../services/auth'; @@ -30,4 +31,8 @@ export class AboutPage { }, 1000); } + ionViewDidEnter() { + GoogleAnalytics.trackView('About'); + } + } diff --git a/app/pages/event-detail/event-detail.html b/app/pages/event-detail/event-detail.html index 4f0653a..0c65085 100644 --- a/app/pages/event-detail/event-detail.html +++ b/app/pages/event-detail/event-detail.html @@ -9,7 +9,7 @@
+
{{ getDateTimes(event._meta.start, event._meta.end) }} {{ member.huis.naam || 'adres' }}{{ member.email }}
{{ member.email }}
{{ member.mobiel }}
-
+
@@ -71,7 +71,7 @@
{{ member.studie.naam }} ({{ member.studie.sinds }})
-