forked from googlearchive/cloud-playground
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
76 lines (66 loc) · 1.95 KB
/
Copy pathapp.js
File metadata and controls
76 lines (66 loc) · 1.95 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
'use strict';
window.track = function(action, label, label_detail) {
var category = 'cloud-playground';
if (label_detail !== undefined) {
label = label + ':' + label_detail;
}
// console.log(action, label);
ga(function() {
var trackers = ga.getAll();
for (var index = 0; index < trackers.length; index++) {
trackers[index].send('event', category, action, label);
}
});
};
window.iframed = window.top != window.self;
angular.module('playgroundApp', [
'playgroundApp.filters',
'playgroundApp.services',
'playgroundApp.directives',
'ngRoute',
'ui.bootstrap',
'ui',
])
.config(function($locationProvider, $routeProvider, $httpProvider,
$dialogProvider) {
$locationProvider.html5Mode(true);
// TODO: add list of promises to be resolved for injection
// TODO: resolved promises are injected into controller
// TODO: see http://www.youtube.com/watch?v=P6KITGRQujQ
$routeProvider
.when('/playground/', {
templateUrl: '/playground/main.html',
controller: MainController,
resolve: {
'CookieFinder': 'CookieFinder',
'NeededByPageControllerConfigService': 'ConfigService',
'NeededByPageControllerProjectsFactory': 'ProjectsFactory',
'Projects': 'ProjectsFactory',
},
})
.when('/playground/p/:project_id/', {
templateUrl: '/playground/project.html',
controller: ProjectController,
reloadOnSearch: false,
resolve: {
'CookieFinder': 'CookieFinder',
'NeededByPageControllerConfigService': 'ConfigService',
'NeededByPageControllerProjectsFactory': 'ProjectsFactory',
'Projects': 'ProjectsFactory',
},
});
$httpProvider.interceptors.push('pgHttpInterceptor');
// TODO: test these defaults?
$dialogProvider.options({
backdropFade: true,
modalFade: true,
});
})
.value('ui.config', {
codemirror: {
lineNumbers: true,
matchBrackets: true,
autofocus: true,
undoDepth: 440, // default = 40
}
});