This repository has been archived by the owner on Mar 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
561 lines (520 loc) · 31.6 KB
/
index.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
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Solid Chat</title>
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.2/css/all.css" integrity="sha384-/rXc/GQVaYpyDdyxK+ecHPVYJSN9bmVFBvjA/9eOB+pb3F2w2N6fc5qB9Ew5yIns" crossorigin="anonymous">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css" type="text/css" rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet'>
<link rel="stylesheet" href="src/css/main.css">
<link rel="stylesheet" href="src/css/chat.css">
</head>
<body vocab="http://schema.org/">
<div class="container">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<span class="navbar-brand">Solid Chat</span>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<button id="goBack" type="button" class="btn btn-dark">Main page</button>
<div class="navbar-collapse collapse w-100 order-3 dual-collapse2" id="navbarSupportedContent">
<div class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Help</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<button id="showHelpBtn" class="dropdown-item btn btn-outline-danger my-2 my-sm-0" onclick="window.location.href='https://linomlt.github.io/dechat_es4b_help/'" type="button">Show help</button>
</div>
</div>
</div>
<div class="navbar-collapse collapse w-100 order-3 dual-collapse2" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li><button id="nav-login-btn" class="login-btn btn btn-dark my-2 my-sm-0" type="button">Log in</button></li>
<li id="user-menu" class="nav-item dropdown hidden">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-user"></i><span id='user-name'></span>
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<button id="clear-inbox-btn" class="dropdown-item btn btn-outline-danger my-2 my-sm-0" type="button">Clear inbox <i class="fas fa-exclamation-triangle"></i></button>
<button id="enable-emojis" class="dropdown-item btn btn-outline my-2 my-sm-0" type="button">
Enable emojis <b id="emojis-enabled" class="emojis-enabled">☑</b><b id="emojis-disabled" class="emojis-disabled hidden">☐</b>
</button>
<button id="enable-notifications" class="dropdown-item btn btn-outline my-2 my-sm-0" type="button">
Enable notifications <b id="notifications-enabled" class="notifications-enabled">☑</b><b id="notifications-disabled" class="notifications-disabled hidden">☐</b>
</button>
<button id="change-chat-image" class="dropdown-item btn btn-outline my-2 my-sm-0" type="button">
Change chat background
</button>
<button id="logout-btn" class="dropdown-item btn btn-outline-success my-2 my-sm-0" type="button">Log out</button>
</div>
</li>
</ul>
</div>
</nav>
<div id="content" class="row justify-content-center align-items-center">
<div id="loading-gif" class="col-6 text-center hidden">
<img src="/src/img/loading.gif" alt="Loading..." height="72" width="128"/>
</div>
<div id="chat-options" class="col-6 text-center">
<button id="new-btn" type="button" class="btn btn-dark btn-lg">Start chatting</button>
</div>
<div id="toHide" class="hidden">
<div id="new-chat-options" class="container-fluid">
<div id="center" class="form-group">
<div id="inboxPeople" class="inbox_people">
<div id="tocenter">
<span id="chatsText" class="navbar-brand">Chats</span>
<div id="optionsChat">
<a id="menuuu" class="nav-link dropdown-toggle" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-ellipsis-v"></i>
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<button id="create-group" type="button" class="dropdown-item btn btn-outline my-2 my-sm-0">
Create group</button>
<button id="add-friend-menu" class="dropdown-item btn btn-outline my-2 my-sm-0" type="button">
Add new friend</button>
</div>
</div>
</div>
<!-- <div class="srch_bar"> -->
<!-- <div class="stylish-input-group hidden"> -->
<!-- <input type="text" class="search-bar" placeholder="Search" > -->
<!-- <span class="input-group-addon"> -->
<!-- <button type="button"> <i class="fa fa-search" aria-hidden="true"></i> </button> -->
<!-- </span> </div> -->
<!-- </div> -->
<div class="inbox_chat" id="peopleToChat">
</div>
</div>
<!-- <label for="possible-people">Your conversation partner</label> -->
<!-- <div class="content-select"> -->
<!-- <select id="possible-people" class="cd-select"> -->
<!-- </select> -->
<!-- </div> -->
<!-- <button id="possible-people-btn" type="button" class="btn btn-dark">OK</button> -->
</div>
<div id="chatting" class="form-group">
<div id="tocenter">
<!-- Aqui iria la futura foto -->
<!--<img id="userPhoto" src="">-->
<span id="contactName" class="navbar-brand">Select a contact to start chatting</span>
<div id="urlContact" class="hidden"></div>
</div>
<div id="drop_zone" accept="image/*" class="container">
<div class="messaging" id="toChangeCSS">
<div class="inbox_msg">
<div class="mesgs" id="messages">
<div class="msg_history" id="addMessages">
</div>
<div class="msg_history" id="addMessagesGroup">
<div class="incoming_msg" id="incoming_msg">
<div class="received_msg">
<div class="received_withd_msg" id="addOurMessages">
</div>
</div>
</div>
<div class="outgoing_msg" id="outgoing_msg">
<div class="sent_msg" id="addOtherMessages">
</div>
</div>
</div>
<div class="type_msg">
<div id="emoji-panel" class="emoji-panel" hidden=true>
<input type="button" class="emoji-button" id="blush"/>
<input type="button" class="emoji-button" id="explodehead"/>
<input type="button" class="emoji-button" id="eyebrow"/>
<input type="button" class="emoji-button" id="facehearts"/>
<input type="button" class="emoji-button" id="hearteyes"/>
<input type="button" class="emoji-button" id="hugging"/>
<input type="button" class="emoji-button" id="kissing"/>
<input type="button" class="emoji-button" id="laughing"/>
<input type="button" class="emoji-button" id="neutral"/>
<input type="button" class="emoji-button" id="nomouth"/>
<input type="button" class="emoji-button" id="openmouth"/>
<input type="button" class="emoji-button" id="persevere"/>
<input type="button" class="emoji-button" id="poo"/>
<input type="button" class="emoji-button" id="rage"/>
<input type="button" class="emoji-button" id="rofl"/>
<input type="button" class="emoji-button" id="rolling"/>
<input type="button" class="emoji-button" id="sleeping"/>
<input type="button" class="emoji-button" id="smile"/>
<input type="button" class="emoji-button" id="smiley"/>
<input type="button" class="emoji-button" id="smirk"/>
<input type="button" class="emoji-button" id="stareyes"/>
<input type="button" class="emoji-button" id="sunglasses"/>
<input type="button" class="emoji-button" id="sweatsmile"/>
<input type="button" class="emoji-button" id="thinking"/>
<input type="button" class="emoji-button" id="thumbdown"/>
<input type="button" class="emoji-button" id="thumbup"/>
<input type="button" class="emoji-button" id="wink"/>
<input type="button" class="emoji-button" id="yum"/>
<input type="button" class="emoji-button" id="zipper"/>
</div>
<div class="input_msg_write">
<input type="text" name="data-name" id="data-name" class="write_msg" placeholder="Type a message">
<div id="btnMessagesSend">
<label for="sendFiles" id="anotherChatOption">
<input id="sendFiles" type="file" class="hidden" accept="image/png, .jpeg, .jpg, image/gif,video/mp4,audio/mp3">
<i id = "iconEmoticonos" class="fa fa-paperclip" aria-hidden="true"></i>
</label>
<button id="sendUbication" type="submit" class="emoji_open"><i id = "iconEmoticonos" class="fa fa-map-marker" aria-hidden="true"></i></button>
<button id="sendContact" type="submit" class="emoji_open"><i id = "iconEmoticonos" class="fa fa-id-card" aria-hidden="true"></i></button>
<button id="sendAudios" type="submit" class="emoji_open" onClick="recordStop()"><i id = "iconAudio" class="fa fa-microphone" aria-hidden="true"></i></button>
<button id="openEmojiBtn" type="submit" class="emoji_open"><i id = "iconEmoticonos" class="fa fa-smile-o" aria-hidden="true"></i></button>
<button id="start-new-chat-btn" type="submit" class="msg_send_btn"><i id = "iconMsg" class="fa fa-paper-plane-o" aria-hidden="true"></i></button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="form-group">
</div>
</div>
<div id="join-chat-options" class="col-6 hidden">
<div class="form-group">
<label for="people-invites">Your partner</label>
<select id="people-invites"></select>
</div>
<button id="accept-inv" type="submit" class="btn btn-dark">Accept it</button>
<button type="button" class="btn-cancel btn btn-dark">Cancel</button>
</div>
<div id='chat-loading' class="hidden">
<span>Loading your chat...</span>
</div>
<div id="chat" class="hidden" >
<p>Name: <span id="name-of-the-chat"></span></p>
<div id="conversation" style="width: 400px"></div>
<div id="chat-details">
<p>Status: <span id="status"></span></p>
<p>Partner: <span id="partner-name"></span></p>
</div>
<button id="send-message" type="button" class="btn btn-dark">Send message</button>
<button id="stop-chatting" type="button" class="btn btn-dark">Stop!</button>
</div>
</div>
</div>
<div id="how-it-works" class="row justify-content-center">
<div class="col-6" typeof="SoftwareApplication Chat" about="https://arquisoft.github.io/dechat_es4b/">
<h3>Start chatting</h3>
<p class="text-justify">
Do you want to the chat in your <b>browser</b>?
It's very simple, just log in with your solid
account (If you don't have a POD yet, create one at
<a href="https://solid.inrupt.com/get-a-solid-pod" >Solid</a>).
Once this is done click on start chatting, select any friend who uses SOLID
and that's it, you will be able to chat through the application.
If you prefer, you will have the option to create a group with several of your friends
and chat with all of them at once.
Enjoy the conversation! <img src="https://raw.githubusercontent.com/Arquisoft/dechat_es4b/master/src/img/emotes/wink.png" alt="Wink"/>
</p>
<h3>How it works</h3>
<p class="text-justify">
<span property="name">Solid Chat</span> is a decentralized Chat,
build on top of <a href="https://solid.inrupt.com/" property="storageRequirements">Solid</a>.
No central sever is required to run or set up a chat.
All personal data about the chat is stored on your POD.
Updates of a chat are sent to the inbox. Your partner will have permission to read the messages pertaining to your conversation.
</p>
<p class="text-justify">
The source of this app can be found on <a href="https://github.com/Arquisoft/dechat_es4b" target="_blank">Github</a>.
If you find a bug do not hesitate to create an issue in our project
</p>
</div>
</div>
<div class="modal fade" id="login-required" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Login required</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
Please login to start a chat.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="login-btn btn btn-dark">Login</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="inbox-files" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel" style="color: black">Your inbox</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body" style="color: black; margin-left: 20px;">
<p class="subtitle-centered">Select files to remove.</p>
<div class="all-inbox-to-remove" id="all-inbox-to-remove">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" id="select-all" class="btn btn-dark darkest">Select all</button>
<button type="button" id="remove-selected-files" class="btn btn-dark" data-dismiss="modal">Remove selected</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="write-permission" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel2" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel2">Write permission required</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
You don't have write permission for <span id="write-permission-url"></span>.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="invitation-response" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel3" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel3">Response to invitation</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body"></div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="create-new-group" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel4" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel" style="color: black">Select your friends!</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body" style="color: black; margin-left: 20px;">
<div id="tocenter2">
<input type="text" name="group-name" id="group-name" class="write_msg" placeholder="Group name">
</div>
<div id="check-people-group">
</div>
</div>
<div class="modal-footer">
<button id="create-button" type="button" class="btn btn-secondary" data-dismiss="modal">Create</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="manage-friends" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel5" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel" style="color: black">Enter friend name!</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body" style="color: black; margin-left: 20px;">
<h5>Select your platform</h5>
<div id="platforms">
<input id="inr2" type = "radio" name = "preg2" value = "inrupt" /> Inrupt
<input id="comm2" type = "radio" name = "preg2" value = "community" /> Community
<input id="oth2" type = "radio" name = "preg2" value = "other" /> Other
</div>
<div id="tocenter2">
<input type="text" name="friend-name" id="friend-name" class="write_msg hidden" placeholder="Enter friend username">
</div>
</div>
<div class="modal-footer">
<button id="add-friend-button" type="button" class="btn btn-secondary" data-dismiss="modal">Add friend</button>
<button type="button" id="cancel-manage-friend" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="share-friend" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel6" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel" style="color: black">Enter friend name!</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body" style="color: black; margin-left: 20px;">
<h5>Select your platform</h5>
<div id="platforms">
<input id="inr" type = "radio" name = "preg1" value = "inrupt" /> Inrupt
<input id="comm" type = "radio" name = "preg1" value = "community" /> Community
<input id="oth" type = "radio" name = "preg1" value = "other" /> Other
</div>
<div id="tocenter2">
<input type="text" name="friend-name" id="share-name" class="write_msg hidden" placeholder="Enter friend username">
</div>
</div>
<div class="modal-footer">
<button id="share-friend-button" type="button" class="btn btn-secondary" data-dismiss="modal">Share friend</button>
<button type="button" id="cancel-manage-friend" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="share-ubication" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel7" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel" style="color: black">Share your ubication!</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body" style="color: black; margin-left: 20px;">
<h5>You're here</h5>
<div id="tocenter2">
<div id="map" class="map"></div>
</div>
<div class="hidden" id="ubicationLongLat"></div>
</div>
<div class="modal-footer">
<button id="share-ubication-button" type="button" class="btn btn-secondary" data-dismiss="modal">Share my ubication</button>
<button type="button" id="cancel-send-ubication" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="changeeee" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel8" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel" style="color: black">Change chat background!!</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body" style="color: black; margin-left: 20px;">
<h5>Select your favourite:</h5>
<div id="backgrounds">
</div>
<div id="hiddenNumberBackground" class="hidden"></div>
</div>
<div class="modal-footer">
<button id="change-image-button" type="button" class="btn btn-secondary" data-dismiss="modal">Change</button>
<button type="button" id="cancel-change-background" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<script src="main/dist/main.js"></script>
</div>
<div class="notification-box" id="notification-box">
<!--
<div class="alert alert-success alert-dismissible">
<a id="xNotifications" href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<strong>New message 1!</strong><br>From linomlt<br>Holaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
</div>
<div class="alert alert-success alert-dismissible">
<a id="xNotifications" href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<strong>New message 2!</strong>
</div>
<div class="alert alert-danger alert-dismissible">
<a id="xNotifications" href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<strong>Removed from a chat!</strong>
</div>
<div class="alert alert-warning alert-dismissible">
<a id="xNotifications" href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<strong>New message 3!</strong>
</div>
<div class="alert alert-info alert-dismissible">
<a id="xNotifications" href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<strong>Removed from a chat!</strong>
</div>
<div class="alert alert-success alert-dismissible">
<a id="xNotifications" href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<strong>New message 3!</strong>
</div>
//-->
</div>
<!--
<audio controls="controls" autobuffer="autobuffer" autoplay="autoplay">
<source src="data:audio/wav;base64,UklGRhwMAABXQVZFZm10IBAAAAABAAEAgD4AAIA+AAABAAgAZGF0Ya4LAACAgICAgICAgICAgICAgICAgICAgICAgICAf3hxeH+AfXZ1eHx6dnR5fYGFgoOKi42aloubq6GOjI2Op7ythXJ0eYF5aV1AOFFib32HmZSHhpCalIiYi4SRkZaLfnhxaWptb21qaWBea2BRYmZTVmFgWFNXVVVhaGdbYGhZbXh1gXZ1goeIlot1k6yxtKaOkaWhq7KonKCZoaCjoKWuqqmurK6ztrO7tbTAvru/vb68vbW6vLGqsLOfm5yal5KKhoyBeHt2dXBnbmljVlJWUEBBPDw9Mi4zKRwhIBYaGRQcHBURGB0XFxwhGxocJSstMjg6PTc6PUxVV1lWV2JqaXN0coCHhIyPjpOenqWppK6xu72yxMu9us7Pw83Wy9nY29ve6OPr6uvs6ezu6ejk6erm3uPj3dbT1sjBzdDFuMHAt7m1r7W6qaCupJOTkpWPgHqAd3JrbGlnY1peX1hTUk9PTFRKR0RFQkRBRUVEQkdBPjs9Pzo6NT04Njs+PTxAPzo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goGCgYKBgoGCgYKBgoGCgoKDgoOCg4KDgoOCg4KDgoOCg4KDgoOCg4KDgoOCg4KDgoOCg4KDgoOCg4KDgoOCg4KDgoOCg4KDgoOCg4KCgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGBgYCBgIGAgYCBgIGAgYCBgIGAgYCBgIGAgYCBgIGAgYCAgICBgIGAgYCBgIGAgYCBgIGAgYCBgExJU1RCAAAASU5GT0lDUkQMAAAAMjAwOC0wOS0yMQAASUVORwMAAAAgAAABSVNGVBYAAABTb255IFNvdW5kIEZvcmdlIDguMAAA" />
</audio>
-->
<script>
const recordAudio = () =>
new Promise(async resolve => {
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
const mediaRecorder = new MediaRecorder(stream);
const audioChunks = [];
mediaRecorder.addEventListener("dataavailable", event => {
audioChunks.push(event.data);
});
const start = () => mediaRecorder.start();
const stop = () =>
new Promise(resolve => {
mediaRecorder.addEventListener("stop", () => {
const audioBlob = new Blob(audioChunks);
const audioUrl = URL.createObjectURL(audioBlob);
const audio = new Audio(audioUrl);
const play = () => audio.play();
resolve({ audioBlob, audioUrl, play });
});
mediaRecorder.stop();
});
resolve({ start, stop });
});
let recorder = null;
let audio = null;
const recordStop = async () => {
if (recorder) {
await recorder.stop().then((audio) => {
var reader = new FileReader();
reader.readAsDataURL(audio.audioBlob);
reader.onloadend = function() {
base64data = reader.result;
$("#data-name").val(base64data);
}
});
recorder = null;
$("#iconAudio").attr("class", "fa fa-microphone");
} else {
recorder = await recordAudio();
recorder.start();
$("#iconAudio").attr("class", "fa fa-stop");
}
};
const playAudio = () => {
if (audio && typeof audio.play === "function") {
var reader = new FileReader();
reader.readAsDataURL(audio.audioBlob);
reader.onloadend = function() {
base64data = reader.result;
$("#data-name").val(base64data);
}
}
};
</script>
</body>
</html>