|
16 | 16 | */ |
17 | 17 | 'use strict'; |
18 | 18 | (function() { |
19 | | - var zeppelinWebApp = angular.module('zeppelinWebApp', [ |
20 | | - 'ngCookies', |
21 | | - 'ngAnimate', |
22 | | - 'ngRoute', |
23 | | - 'ngSanitize', |
24 | | - 'angular-websocket', |
25 | | - 'ui.ace', |
26 | | - 'ui.bootstrap', |
27 | | - 'as.sortable', |
28 | | - 'ngTouch', |
29 | | - 'ngDragDrop', |
30 | | - 'angular.filter', |
31 | | - 'monospaced.elastic', |
32 | | - 'puElasticInput', |
33 | | - 'xeditable', |
34 | | - 'ngToast', |
35 | | - 'focus-if', |
36 | | - 'ngResource' |
37 | | - ]) |
| 19 | + var zeppelinWebApp = angular.module('zeppelinWebApp', [ |
| 20 | + 'ngCookies', |
| 21 | + 'ngAnimate', |
| 22 | + 'ngRoute', |
| 23 | + 'ngSanitize', |
| 24 | + 'angular-websocket', |
| 25 | + 'ui.ace', |
| 26 | + 'ui.bootstrap', |
| 27 | + 'as.sortable', |
| 28 | + 'ngTouch', |
| 29 | + 'ngDragDrop', |
| 30 | + 'angular.filter', |
| 31 | + 'monospaced.elastic', |
| 32 | + 'puElasticInput', |
| 33 | + 'xeditable', |
| 34 | + 'ngToast', |
| 35 | + 'focus-if', |
| 36 | + 'ngResource' |
| 37 | + ]) |
38 | 38 | .filter('breakFilter', function() { |
39 | | - return function (text) { |
40 | | - if (!!text) { |
41 | | - return text.replace(/\n/g, '<br />'); |
42 | | - } |
43 | | - }; |
| 39 | + return function(text) { |
| 40 | + if (!!text) { |
| 41 | + return text.replace(/\n/g, '<br />'); |
| 42 | + } |
| 43 | + }; |
44 | 44 | }) |
45 | | - .config(function ($httpProvider, $routeProvider, ngToastProvider) { |
46 | | - // withCredentials when running locally via grunt |
47 | | - $httpProvider.defaults.withCredentials = true; |
| 45 | + .config(function($httpProvider, $routeProvider, ngToastProvider) { |
| 46 | + // withCredentials when running locally via grunt |
| 47 | + $httpProvider.defaults.withCredentials = true; |
48 | 48 |
|
49 | | - $routeProvider |
| 49 | + $routeProvider |
50 | 50 | .when('/', { |
51 | | - templateUrl: 'app/home/home.html' |
| 51 | + templateUrl: 'app/home/home.html' |
52 | 52 | }) |
53 | 53 | .when('/notebook/:noteId', { |
54 | | - templateUrl: 'app/notebook/notebook.html', |
55 | | - controller: 'NotebookCtrl' |
| 54 | + templateUrl: 'app/notebook/notebook.html', |
| 55 | + controller: 'NotebookCtrl' |
56 | 56 | }) |
57 | 57 | .when('/notebook/:noteId/paragraph?=:paragraphId', { |
58 | | - templateUrl: 'app/notebook/notebook.html', |
59 | | - controller: 'NotebookCtrl' |
| 58 | + templateUrl: 'app/notebook/notebook.html', |
| 59 | + controller: 'NotebookCtrl' |
60 | 60 | }) |
61 | 61 | .when('/notebook/:noteId/paragraph/:paragraphId?', { |
62 | | - templateUrl: 'app/notebook/notebook.html', |
63 | | - controller: 'NotebookCtrl' |
| 62 | + templateUrl: 'app/notebook/notebook.html', |
| 63 | + controller: 'NotebookCtrl' |
64 | 64 | }) |
65 | 65 | .when('/interpreter', { |
66 | | - templateUrl: 'app/interpreter/interpreter.html', |
67 | | - controller: 'InterpreterCtrl' |
| 66 | + templateUrl: 'app/interpreter/interpreter.html', |
| 67 | + controller: 'InterpreterCtrl' |
68 | 68 | }) |
69 | 69 | .when('/credential', { |
70 | | - templateUrl: 'app/credential/credential.html', |
71 | | - controller: 'CredentialCtrl' |
| 70 | + templateUrl: 'app/credential/credential.html', |
| 71 | + controller: 'CredentialCtrl' |
72 | 72 | }) |
73 | 73 | .when('/configuration', { |
74 | 74 | templateUrl: 'app/configuration/configuration.html', |
75 | 75 | controller: 'ConfigurationCtrl' |
76 | 76 | }) |
77 | 77 | .when('/search/:searchTerm', { |
78 | | - templateUrl: 'app/search/result-list.html', |
79 | | - controller: 'SearchResultCtrl' |
| 78 | + templateUrl: 'app/search/result-list.html', |
| 79 | + controller: 'SearchResultCtrl' |
80 | 80 | }) |
81 | 81 | .otherwise({ |
82 | | - redirectTo: '/' |
| 82 | + redirectTo: '/' |
83 | 83 | }); |
84 | 84 |
|
85 | | - ngToastProvider.configure({ |
86 | | - dismissButton: true, |
87 | | - dismissOnClick: false, |
88 | | - timeout: 6000 |
89 | | - }); |
| 85 | + ngToastProvider.configure({ |
| 86 | + dismissButton: true, |
| 87 | + dismissOnClick: false, |
| 88 | + timeout: 6000 |
| 89 | + }); |
90 | 90 | }); |
91 | 91 |
|
| 92 | + function auth() { |
| 93 | + var $http = angular.injector(['ng']).get('$http'); |
| 94 | + var baseUrlSrv = angular.injector(['zeppelinWebApp']).get('baseUrlSrv'); |
| 95 | + // withCredentials when running locally via grunt |
| 96 | + $http.defaults.withCredentials = true; |
92 | 97 |
|
93 | | - function auth() { |
94 | | - var $http = angular.injector(['ng']).get('$http'); |
95 | | - var baseUrlSrv = angular.injector(['zeppelinWebApp']).get('baseUrlSrv'); |
96 | | - // withCredentials when running locally via grunt |
97 | | - $http.defaults.withCredentials = true; |
98 | | - |
99 | | - return $http.get(baseUrlSrv.getRestApiBase()+'/security/ticket').then(function(response) { |
100 | | - zeppelinWebApp.run(function($rootScope) { |
101 | | - $rootScope.ticket = angular.fromJson(response.data).body; |
102 | | - }); |
103 | | - }, function(errorResponse) { |
104 | | - // Handle error case |
105 | | - }); |
106 | | - } |
107 | | - |
108 | | - function bootstrapApplication() { |
109 | | - angular.bootstrap(document, ['zeppelinWebApp']); |
110 | | - } |
| 98 | + return $http.get(baseUrlSrv.getRestApiBase() + '/security/ticket').then(function(response) { |
| 99 | + zeppelinWebApp.run(function($rootScope) { |
| 100 | + $rootScope.ticket = angular.fromJson(response.data).body; |
| 101 | + }); |
| 102 | + }, function(errorResponse) { |
| 103 | + // Handle error case |
| 104 | + }); |
| 105 | + } |
111 | 106 |
|
| 107 | + function bootstrapApplication() { |
| 108 | + angular.bootstrap(document, ['zeppelinWebApp']); |
| 109 | + } |
112 | 110 |
|
113 | | - angular.element(document).ready(function() { |
114 | | - auth().then(bootstrapApplication); |
115 | | - }); |
| 111 | + angular.element(document).ready(function() { |
| 112 | + auth().then(bootstrapApplication); |
| 113 | + }); |
116 | 114 |
|
117 | 115 | }()); |
118 | 116 |
|
0 commit comments