This repository has been archived by the owner on Sep 25, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapplication.js
executable file
·56 lines (50 loc) · 1.85 KB
/
application.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
'use strict';
angular.module('gdgVizApp', [
'ngCookies',
'ngResource',
'ngSanitize',
'ngRoute',
'ngAudio'
])
.config(function ($routeProvider, $compileProvider, $locationProvider) {
$locationProvider.html5Mode(true);
$routeProvider
.when('/', {
templateUrl: 'partials/startup.html',
controller: 'StartupCtrl'
}).when('/stage', {
templateUrl: 'partials/stage.html',
controller: 'StageCtrl'
}).when('/photobooth', {
templateUrl: 'partials/photobooth.html',
controller: 'PhotoboothCtrl'
}).otherwise({
redirectTo: '/'
});
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|chrome-extension):/);
})
.run(function ($rootScope, $location, $http, $window) {
$rootScope.user = {
logged_in: false
};
// You'll usually only ever have to create one service instance.
$rootScope.analytics = analytics.getService('ice_cream_app');
// You can create as many trackers as you want. Each tracker has its own state
// independent of other tracker instances.
$rootScope.analyticsTracker = $rootScope.analytics.getTracker('UA-42015512-6');
$rootScope.analyticsTracker.sendAppView('/');
$rootScope.$on("$routeChangeStart", function (event, next, current) {
if(next.$$route) {
$rootScope.analyticsTracker.sendAppView(next.$$route.originalPath);
}
});
angular.element(document.querySelector('webview')).bind('permissionrequest', function(e) {
if ( e.permission === 'geolocation' || e.permission === "media") {
console.log('Allowed permission '+ e.permission + ' requested by webview');
e.request.allow();
} else {
console.log('Denied permission '+e.permission+' requested by webview');
e.request.deny();
}
});
});