-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
58 lines (51 loc) · 1.42 KB
/
app.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
57
58
const app = angular.module("homeDashboard", ["ngSanitize", "ngRoute", "ngResource", "ngIdle", "NgModel", "angularModalService", "ui.bootstrap", "ngAnimate"]);
app.config([
"$routeProvider",
"$controllerProvider",
"KeepaliveProvider",
"IdleProvider",
"$compileProvider",
"$sceProvider",
function ($routeProvider, $controllerProvider, KeepaliveProvider, IdleProvider, $compileProvider, $sceProvider) {
$routeProvider.when("/home", {
templateUrl: "components/home.html",
option: "default"
});
$routeProvider.when("/frame", {
templateUrl: "components/frame.html",
option: "default"
});
$routeProvider.otherwise({ redirectTo: "/home" });
/* ngidle settings */
IdleProvider.idle(360);
IdleProvider.timeout(0);
KeepaliveProvider.interval(10);
/* custom defaults */
window.oncontextmenu = function (event) {
event.preventDefault();
event.stopPropagation();
return false;
};
window.addEventListener(
"dragover",
function (e) {
e = e || event;
e.preventDefault();
},
false
);
window.addEventListener(
"drop",
function (e) {
e = e || event;
e.preventDefault();
},
false
);
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|data):/);
}
]);
app.run(function ($rootScope, $location, Idle) {
/* start idle check */
Idle.watch();
});