1
|
|
|
/* |
2
|
|
|
* Circles - Bring cloud-users closer together. |
3
|
|
|
* |
4
|
|
|
* This file is licensed under the Affero General Public License version 3 or |
5
|
|
|
* later. See the COPYING file. |
6
|
|
|
* |
7
|
|
|
* @author Maxence Lange <[email protected]> |
8
|
|
|
* @copyright 2017 |
9
|
|
|
* @license GNU AGPL version 3 or any later version |
10
|
|
|
* |
11
|
|
|
* This program is free software: you can redistribute it and/or modify |
12
|
|
|
* it under the terms of the GNU Affero General Public License as |
13
|
|
|
* published by the Free Software Foundation, either version 3 of the |
14
|
|
|
* License, or (at your option) any later version. |
15
|
|
|
* |
16
|
|
|
* This program is distributed in the hope that it will be useful, |
17
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
18
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
19
|
|
|
* GNU Affero General Public License for more details. |
20
|
|
|
* |
21
|
|
|
* You should have received a copy of the GNU Affero General Public License |
22
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
23
|
|
|
* |
24
|
|
|
*/ |
25
|
|
|
|
26
|
|
|
/** global: OC */ |
27
|
|
|
/** global: OCA */ |
28
|
|
|
/** global: Notyf */ |
29
|
|
|
|
30
|
|
|
|
31
|
|
|
/** global: nav */ |
32
|
|
|
/** global: actions */ |
33
|
|
|
/** global: elements */ |
34
|
|
|
|
35
|
|
|
var api = OCA.Circles.api; |
36
|
|
|
var curr = { |
37
|
|
|
circlesType: '', |
38
|
|
|
circle: 0, |
39
|
|
|
circleLevel: 0, |
40
|
|
|
searchCircle: '', |
41
|
|
|
searchUser: '' |
42
|
|
|
}; |
43
|
|
|
|
44
|
|
|
|
45
|
|
|
$(document).ready(function () { |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @constructs Navigation |
49
|
|
|
*/ |
50
|
|
|
|
51
|
|
|
|
52
|
|
|
|
53
|
|
|
var Navigation = function () { |
54
|
|
|
|
55
|
|
|
$.extend(Navigation.prototype, curr); |
56
|
|
|
$.extend(Navigation.prototype, nav); |
57
|
|
|
$.extend(Navigation.prototype, elements); |
58
|
|
|
$.extend(Navigation.prototype, actions); |
59
|
|
|
|
60
|
|
|
this.init(); |
61
|
|
|
}; |
62
|
|
|
|
63
|
|
|
|
64
|
|
|
Navigation.prototype = { |
65
|
|
|
|
66
|
|
|
init: function () { |
67
|
|
|
elements.initElements(); |
68
|
|
|
elements.initUI(); |
69
|
|
|
elements.initTweaks(); |
70
|
|
|
elements.initAnimationNewCircle(); |
71
|
|
|
elements.initExperienceCirclesList(); |
72
|
|
|
actions.initActions(); |
73
|
|
|
|
74
|
|
|
} |
75
|
|
|
}; |
76
|
|
|
|
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @constructs Notification |
80
|
|
|
*/ |
81
|
|
|
var Notification = function () { |
82
|
|
|
this.initialize(); |
83
|
|
|
}; |
84
|
|
|
|
85
|
|
|
Notification.prototype = { |
86
|
|
|
|
87
|
|
|
initialize: function () { |
88
|
|
|
|
89
|
|
|
//noinspection SpellCheckingInspection |
90
|
|
|
var notyf = new Notyf({ |
91
|
|
|
delay: 5000 |
92
|
|
|
}); |
93
|
|
|
|
94
|
|
|
this.onSuccess = function (text) { |
95
|
|
|
notyf.confirm(text); |
96
|
|
|
}; |
97
|
|
|
|
98
|
|
|
this.onFail = function (text) { |
99
|
|
|
notyf.alert(text); |
100
|
|
|
}; |
101
|
|
|
|
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
}; |
105
|
|
|
|
106
|
|
|
OCA.Circles.Navigation = Navigation; |
107
|
|
|
OCA.Circles.navigation = new Navigation(); |
108
|
|
|
|
109
|
|
|
OCA.Notification = Notification; |
110
|
|
|
OCA.notification = new Notification(); |
111
|
|
|
|
112
|
|
|
}); |
113
|
|
|
|
114
|
|
|
|