forked from owncloud-archive/chat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
integrated.html
327 lines (325 loc) · 10.4 KB
/
integrated.html
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
<div id="angular-wrapper">
<section id="app" ng-controller="ConvController">
<div
id="chat-sidebar"
ng-show="view.elements.sidebar"
>
<div id="filter-container">
<!-- Field to start an instant chat via XMPP -->
<form ng-submit="view.startInstantChat()">
<input type="text" placeholder="" ng-model="fields.jid" >
</form>
<!-- Field to search in the conversations -->
<input class="filter-field" type="text" placeholder="" ng-model="search.name">
</div>
<ul>
<!-- App-navigation entry representing a conversation -->
<li
ng-repeat="conv in convs | orderObjectBy:'order':true | filter:search "
ng-class="{heightInvite: view.elements.inviteInput, 'conv-list-active' : conv.id === $session.conv}"
ng-click="view.makeActive(conv.id, $event, 'invite-button');"
class="conv-list-item"
id="conv-list-{{::conv.id }}"
auto-height
data-item-count="{{::conv.users.length -1 }}"
data-item-height="50"
data-min-height="60"
data-conv-id="{{::conv.id }}"
>
<!--
This div shows the avatars + displayname of the conversation entry
This div is only visible when:
- the conversation isn't active
OR
- the conversation is active
- AND the conversation has only 2 users in it
-->
<div
ng-if="conv.id !== $parent.$session.conv || ( conv.id === $parent.$session.conv && conv.users.length === 2)"
class="conv-list-item-avatar"
>
<!--
This div shows the avatar of the Contact in the conversation + a green dot when it's online
This div is only visible when:
- the conversation has only 2 users in it
-->
<div
ng-if="conv.users.length === 2 && $parent.$parent.avatarsEnabled === 'true'"
class="avatar-list-container"
>
<div
class="online-dot-container"
>
<div
tipsy
title="{{::user.displayname }}"
ng-if="key < 4"
ng-repeat="(key, user) in conv.users | userFilter"
class="avatar-list-avatar-big"
avatar
data-size="40"
data-id="{{::user.id }}"
data-displayname="{{::user.displayname }}"
data-addressbook-backend="{{::user.address_book_backend }}"
data-addressbook-id="{{::user.address_book_id }}"
>
</div>
<div
online
ng-repeat="(key, user) in conv.users | userFilter"
data-id="{{::user.id }}"
>
<!--
This is a place holder div for the green dot which is used to indicate the online status of the contact
-->
</div>
</div>
</div>
<!--
This div shows the avatar of the Contacts in the conversation WITHOUT a green dot when it's online
This div is only visible when:
- the conversation has more than 2 users in it
There are maximum 4 avatars shown, which are all 1/4 size of the other avatars
-->
<div
ng-if="conv.users.length > 2 && $parent.$parent.avatarsEnabled === 'true'"
class="avatar-list-container"
>
<div
tipsy
title="{{::user.displayname }}"
ng-if="key < 4"
ng-repeat="(key, user) in conv.users | userFilter"
class="avatar-list-avatar"
avatar
data-size="20"
data-id="{{::user.id }}"
data-displayname="{{::user.displayname }}"
data-addressbook-backend="{{::user.address_book_backend }}"
data-addressbook-id="{{::user.address_book_id }}"
>
</div>
</div>
<!--
This div shows the displayname of the conversation
-->
<span
displayname
data-users="{{::conv.users }}"
class="left avatar-list-displayname"
ng-class="{bold : conv.new_msg === true}"
>
</span>
<div
ng-if="$parent.$parent.avatarsEnabled === 'false'"
online
ng-repeat="(key, user) in conv.users | userFilter"
data-id="{{::user.id }}"
class="online-dot-displayname-nav"
>
<!--
This is a place holder div for the green dot which is used to indicate the online status of the contact
-->
</div>
</div>
<!--
This div shows the avatars + displayname of the conversation entry
This div is only visible when:
- the conversation is active
- AND the conversation has more than 2 users in it
-->
<div
class="conv-list-item-avatar"
ng-if="conv.id === $parent.$session.conv && conv.users.length > 2"
>
<!-- This ul holds the list with avatars and the buttons -->
<ul>
<li
ng-repeat="(key, user) in conv.users | userFilter"
class="avatar-list-expanded-item"
>
<div
class="online-dot-container"
ng-if="$parent.$parent.avatarsEnabled === 'true'"
>
<div
tipsy
title="{{::user.displayname }}"
class="avatar-list-avatar"
avatar
data-size="40"
data-id="{{::user.id }}"
data-displayname="{{::user.displayname }}"
data-addressbook-backend="{{::user.address_book_backend }}"
data-addressbook-id="{{::user.address_book_id }}"
>
</div>
<div
online
ng-repeat="(key, user) in conv.users | userFilter"
data-id="{{::user.id }}"
>
<!--
This is a place holder div for the green dot which is used to indicate the online status of the contact
-->
</div>
</div>
<div
ng-if="$parent.$parent.avatarsEnabled === 'false'"
online
data-id="{{::user.id }}"
class="online-dot-displayname-nav online-dot-displayname-nav-expanded"
>
<!--
This is a place holder div for the green dot which is used to indicate the online status of the contact
-->
</div>
<div class="avatar-list-displayname">
{{::user.displayname }}
</div>
</li>
<li
class="avatar-list-expanded-button invite-button"
ng-click="$parent.view.inviteClick();"
>
<div
class="icon-add icon-20 avatar-list-avatar expanded-icon">
</div>
Add person
</li>
<li
class="avatar-list-expanded-button files-button"
ng-click="$parent.view.showFiles()"
>
<div
class="icon-file icon-20 avatar-list-avatar expanded-icon"
>
</div>
View attached files
</li>
</ul>
</div>
<!-- These buttons are shown on the right side of the enty -->
<div class="conv-list-item-buttons">
<div
ng-click="view.inviteClick();"
ng-if="conv.id == $session.conv && conv.users.length === 2"
class="icon-add right icon-20 invite-button"
>
</div>
<!-- The following 3 buttons are buttons used onyl by the XMPP backend -->
<div
title="Add Contact to roster"
ng-click="view.addContactToRoster(conv.id);"
ng-if="conv.id == $session.conv && conv.backend.id === 'xmpp' && !contactInRoster(conv.id)"
class="icon-download right icon-20 "
>
</div>
<div
title="Add Contact to contacts"
ng-click="view.saveContact(conv.id);"
ng-if="conv.id == $session.conv && conv.backend.id === 'xmpp' && !contactInContacts(conv.id)"
class="icon-download right icon-20 "
>
</div>
<div
title="Remove Contact from roster"
ng-click="view.removeContactFromRoster(conv.id);"
ng-if="conv.id == $session.conv && conv.backend.id === 'xmpp' && contactInRoster(conv.id)"
class="icon-delete right icon-20 "
>
</div>
<!-- END Specific for XMPP-->
<div title="Show attached files" ng-click="view.showFiles();" ng-if="conv.id == $session.conv && conv.users.length === 2" class="icon-file right icon-20 files-button">
</div>
</div>
</li>
</ul>
<div id="chat-window">
<div id="chat-window-msgs" scroll>
<!-- This div holds exactly one chat message -->
<div
class="chat-msg-container"
ng-repeat="(key, msg) in convs[$session.conv].msgs | orderBy:'timestamp'"
>
<!-- This div holds the time of the chat message -->
<div
ng-if="$parent.convs[$parent.$session.conv].msgs[key-1].contact.id !== msg.contact.id"
class="chat-msg-time"
>
{{::msg.time.hours }} : {{::msg.time.minutes }}
</div>
<!-- This div holds the Chat message and the avatar of the user which sends it-->
<div class="chat-msg">
<div
class="msg-avatar-container"
ng-if="avatarsEnabled === 'true'"
>
<div
ng-if="$parent.convs[$parent.$session.conv].msgs[key-1].contact.id !== msg.contact.id "
data-size="20"
data-id="{{::msg.contact.id }}"
data-displayname="{{::msg.contact.displayname }}"
data-addressbook-backend="{{::msg.contact.address_book_backend }}"
data-addressbook-id="{{::msg.contact.address_book_id }}"
avatar
tipsy
title="{{::msg.contact.displayname }}"
>
</div>
</div>
<div
class="msg-displayname-container"
ng-if="$parent.$parent.avatarsEnabled === 'false' && $parent.convs[$parent.$session.conv].msgs[key-1].contact.id !== msg.contact.id "
>
<div>
{{::msg.contact.displayname }}
</div>
</div>
<p
ng-class="{'chat-msg-margin-left': $parent.convs[$parent.$session.conv].msgs[key-1].contact.id === msg.contact.id}"
class="chat-msg-msg"
ng-bind-html="msg.msg | enhanceFiles | emoji | enhanceText"
>
</p>
</div>
</div>
</div>
</div>
<footer id="chat-window-footer">
<form id="chat-msg-form" >
<textarea
id="chat-msg-input-field"
autocomplete="off"
update
update-func="sendChatMsg"
></textarea>
<button type="submit">
<div class="icon-play">
</div>
</button>
</form>
</footer>
</div>
<div
ng-class="{'chat-sidebar-toggle-visible':view.elements.sidebar, 'chat-sidebar-toggle-hidden':!view.elements.sidebar}"
id="chat-sidebar-toggle"
ng-click="view.toggle('sidebar')"
>
</div>
</section>
</div>