aboutsummaryrefslogtreecommitdiffhomepage
path: root/public
diff options
context:
space:
mode:
authorMarvin Borner2019-02-11 20:51:55 +0100
committerMarvin Borner2019-02-11 20:51:55 +0100
commit8b9695970ece3f5f123019cde4e32e4978f94b57 (patch)
tree8bcf7d12ecaf8f381342c4878cb9078ded5f6491 /public
parent316d1ad38405bd421c4d8c4d66264584d464832f (diff)
Added anonymize option
Diffstat (limited to 'public')
-rw-r--r--public/scripts/chat.js6
-rw-r--r--public/styles/style.sass1
2 files changed, 6 insertions, 1 deletions
diff --git a/public/scripts/chat.js b/public/scripts/chat.js
index fa70606..0cb5449 100644
--- a/public/scripts/chat.js
+++ b/public/scripts/chat.js
@@ -173,7 +173,7 @@ function chat() {
if (message.type === 'text') {
await encryption.storeMsg(connectedPeer.peer, message.data, passphrase);
await encryption.decrypt(message.data, await encryption.get(connectedPeer.peer), await encryption.getPrivate(), passphrase)
- .then(plaintext => $('#messages').append(`${plaintext}<br>`));
+ .then(plaintext => $('#messages').append(`<span>${plaintext}</span><br>`));
} else if (message.type === 'key') {
await encryption.store(connectedPeer.peer, message.data)
}
@@ -243,6 +243,10 @@ function chat() {
$('#add_contact').on('click', () => addContact());
$('#logout').on('click', () => location.reload(true));
$('#delete').on('click', () => deleteAccount());
+ $('#anonymize').on('click', () => {
+ peer.disconnect();
+ swal('Disconnected from broker server!', 'You will still be able to send and receive messages.', 'success')
+ });
$('#call').on('click', () => getMediaStream(stream => {
call = peer.call(peerId, stream); // TODO: Encrypt call
initCall(call)
diff --git a/public/styles/style.sass b/public/styles/style.sass
index 6019deb..a7feeac 100644
--- a/public/styles/style.sass
+++ b/public/styles/style.sass
@@ -35,6 +35,7 @@ html, body
width: 50px
margin: 20px
border-radius: 100%
+ transition: background-color .3s linear
.message-input
width: 100%