From 68a373cbe5ff9523d84a306d6c30a122103a6d4d Mon Sep 17 00:00:00 2001 From: adb Date: Sun, 22 Nov 2020 19:55:30 +0100 Subject: [PATCH] show time and date of messages --- src/components/message.vue | 12 ++++++++++-- src/components/messageReceive.vue | 12 ++++++++++-- src/components/newMessage.vue | 2 ++ src/matrix.js | 5 ++--- src/views/chat.vue | 32 ++++++++++++++++++++++++------- src/views/login.vue | 2 ++ src/views/rooms.vue | 2 +- 7 files changed, 52 insertions(+), 15 deletions(-) diff --git a/src/components/message.vue b/src/components/message.vue index 7df2218..bac9d41 100644 --- a/src/components/message.vue +++ b/src/components/message.vue @@ -1,7 +1,8 @@ @@ -10,7 +11,8 @@ export default { name: "message", props: { - msg: String + msg: String, + time: String, } } @@ -36,4 +38,10 @@ export default { word-break: break-word; white-space: pre-line; } + .time{ + position: relative; + bottom: -0.2rem; + font-size: 0.7rem; + text-align: right; + } \ No newline at end of file diff --git a/src/components/messageReceive.vue b/src/components/messageReceive.vue index 8ab5d12..8a3f63c 100644 --- a/src/components/messageReceive.vue +++ b/src/components/messageReceive.vue @@ -1,7 +1,8 @@ @@ -10,7 +11,8 @@ export default { name: "messageReceive", props: { - msg: String + msg: String, + time: String } } @@ -35,4 +37,10 @@ export default { word-break: break-word; white-space: pre-line; } + .time{ + position: relative; + bottom: -0.2rem; + font-size: 0.7rem; + text-align: right; + } \ No newline at end of file diff --git a/src/components/newMessage.vue b/src/components/newMessage.vue index f83067e..65eca55 100644 --- a/src/components/newMessage.vue +++ b/src/components/newMessage.vue @@ -79,6 +79,8 @@ export default { height: 1.25rem; background-color: #fff0; border: 0 solid #fff0; + appearance: none; + outline: none; color: #fff; font-size: 1rem; resize: none; diff --git a/src/matrix.js b/src/matrix.js index 363ce78..0a9490f 100644 --- a/src/matrix.js +++ b/src/matrix.js @@ -105,9 +105,8 @@ export default { function getCookie(key) { let cookie = document.cookie.replace(/ /g, '').split(';') - .find(cookie => cookie.split('=')[0] === key); - if (cookie) return cookie.split('=')[1]; - return false; + .find(cookie => cookie.split('=')[0] === key); + return cookie?cookie.split('=')[1]:false; } matrix_cli.on("event", event => { diff --git a/src/views/chat.vue b/src/views/chat.vue index 04d9c76..945112c 100644 --- a/src/views/chat.vue +++ b/src/views/chat.vue @@ -1,15 +1,18 @@