Compare commits
14 Commits
4a28e22b82
...
2c22cae07f
Author | SHA1 | Date | |
---|---|---|---|
2c22cae07f | |||
550d79af28 | |||
289a230207 | |||
fda133486a | |||
72c7886fc9 | |||
f237f7bf7a | |||
bbad002cec | |||
57d6238ed6 | |||
8dd34b58ee | |||
d66f2c990e | |||
3b70b5b37c | |||
35e6bf86df | |||
f1967d4189 | |||
a67fa94447 |
@ -4,7 +4,7 @@
|
|||||||
"bundledWebRuntime": false,
|
"bundledWebRuntime": false,
|
||||||
"npmClient": "npm",
|
"npmClient": "npm",
|
||||||
"webDir": "./dist",
|
"webDir": "./dist",
|
||||||
"linuxAndroidStudioPath": "~/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.7199119/bin/studio.sh",
|
"linuxAndroidStudioPath": "/home/alban/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.7199119/bin/studio.sh",
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"SplashScreen": {
|
"SplashScreen": {
|
||||||
"launchShowDuration": 0
|
"launchShowDuration": 0
|
||||||
|
@ -28,7 +28,7 @@ input{
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
background-color: #1d1d1d;
|
background-color: #1d1d1d;
|
||||||
border-radius: 1.25rem;
|
border-radius: 1.25rem;
|
||||||
border: 1px solid #fff;
|
border: 0.1rem solid #fff;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 1.1rem;
|
font-size: 1.1rem;
|
||||||
margin: 0.5rem;
|
margin: 0.5rem;
|
||||||
|
@ -1,36 +1,30 @@
|
|||||||
<template>
|
<template>
|
||||||
<img v-if="mxcURL" :src="thumbnailUrl()" class="userThumbnail image"/>
|
<img v-if="mxcURL" :src="getAvatarUrl(mxcURL)" class="userThumbnail image"/>
|
||||||
<div v-else v-html="getJdenticon()" class="userThumbnail identicon"/>
|
<div v-else v-html="getJdenticon()" class="userThumbnail identicon"/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import parseMXC from '@modular-matrix/parse-mxc';
|
|
||||||
import {matrix} from "@/main";
|
|
||||||
import {toSvg} from 'jdenticon';
|
import {toSvg} from 'jdenticon';
|
||||||
|
import {getAvatarUrl} from '@/lib/getMxc';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "userThumbnail.vue",
|
name: 'userThumbnail.vue',
|
||||||
components: {
|
components: {
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
mxcURL: String,
|
mxcURL: String,
|
||||||
username: String,
|
username: String,
|
||||||
fallback: String,
|
fallback: String,
|
||||||
homeserver: String,
|
|
||||||
size: Number
|
size: Number
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
thumbnailUrl(){
|
|
||||||
let mxc = parseMXC.parse(this.mxcURL);
|
|
||||||
return `${this.homeserver||matrix.baseUrl}/_matrix/media/v1/thumbnail/${
|
|
||||||
mxc.homeserver}/${mxc.id}?width=${this.imageSize}&height=${this.imageSize}&method=${this.resizeMethod}`;
|
|
||||||
},
|
|
||||||
getFontSize(){
|
getFontSize(){
|
||||||
return window.getComputedStyle(document.body,null).fontSize.split("px", 1)||16;
|
return window.getComputedStyle(document.body,null).fontSize.split('px', 1)||16;
|
||||||
},
|
},
|
||||||
getJdenticon(){
|
getJdenticon(){
|
||||||
return toSvg(this.fallback, this.getFontSize()*this.size);
|
return toSvg(this.fallback, this.getFontSize()*this.size);
|
||||||
}
|
},
|
||||||
|
getAvatarUrl
|
||||||
},
|
},
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
|
@ -18,15 +18,15 @@
|
|||||||
<p v-if="members.length>20">and {{members.length-20}} other members</p>
|
<p v-if="members.length>20">and {{members.length-20}} other members</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<icon class="closeBtn" @click.native="closeChatInfo()" ic="./sym/ic_close_white_24px.svg" />
|
<icon class="closeBtn" @click.native="closeChatInfo()" ic="./sym/ic_close_white.svg" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import icon from './icon.vue';
|
import icon from './icon.vue';
|
||||||
import {matrix} from "@/main";
|
|
||||||
import UserListElement from "@/components/userListElement";
|
import UserListElement from "@/components/userListElement";
|
||||||
import avatar from "@/components/avatar";
|
import avatar from "@/components/avatar";
|
||||||
import {getMxcFromRoom} from "@/lib/getMxc";
|
import {getMxcFromRoom} from "@/lib/getMxc";
|
||||||
|
import {getUser} from "@/lib/matrixUtils";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "chatInformation",
|
name: "chatInformation",
|
||||||
@ -40,12 +40,10 @@ export default {
|
|||||||
closeChatInfo: Function
|
closeChatInfo: Function
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getUser(userId){
|
|
||||||
return matrix.client.getUser(userId);
|
|
||||||
},
|
|
||||||
getMembers(){
|
getMembers(){
|
||||||
return Object.keys(this.room.currentState.members)
|
return Object.keys(this.room.currentState.members)
|
||||||
},
|
},
|
||||||
|
getUser,
|
||||||
getMxcFromRoom
|
getMxcFromRoom
|
||||||
},
|
},
|
||||||
data(){
|
data(){
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :class="type==='send'?'messageSend':'messageReceive'" class="message">
|
<div :class="type==='send'?'messageSend':'messageReceive'" class="message">
|
||||||
<div v-if="replyEvent" class="reply">
|
<div v-if="replyEvent" class="reply">
|
||||||
{{replyEvent.sender}}<br>
|
<span class="username">{{calcUserName(replyEvent.sender)}}</span><br>
|
||||||
{{replyEvent.type==='m.room.message'?replyEvent.content.body:'unkown event'}}
|
<span v-html="replyEvent.type==='m.room.message'?parseMessage(replyEvent.content.body):'unkown event'"></span>
|
||||||
</div>
|
</div>
|
||||||
<div v-html="parseMessage(msg)"></div>
|
<div v-html="parseMessage(msg)"></div>
|
||||||
<div class="time">{{time}}</div>
|
<div class="time">{{time}}</div>
|
||||||
@ -10,10 +10,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {matrix} from "@/main";
|
import {matrix} from '@/main';
|
||||||
|
import {calcUserName} from '@/lib/matrixUtils';
|
||||||
|
import {parseMessage} from '@/lib/eventUtils';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "message",
|
name: 'message',
|
||||||
props: {
|
props: {
|
||||||
msg: String,
|
msg: String,
|
||||||
time: String,
|
time: String,
|
||||||
@ -22,18 +24,6 @@ export default {
|
|||||||
roomId: String
|
roomId: String
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
solveTextLinks(text){
|
|
||||||
return (text || "").replace(
|
|
||||||
/([^\S]|^)(((https?:\/\/)|(www\.))(\S+))/gi,
|
|
||||||
(match, space, url)=>{
|
|
||||||
let hyperlink = url;
|
|
||||||
if (!hyperlink.match('^https?://')) {
|
|
||||||
hyperlink = 'http://' + hyperlink;
|
|
||||||
}
|
|
||||||
return `${space}<a href="${hyperlink}" target="_blank">${url}</a>`;
|
|
||||||
}
|
|
||||||
)
|
|
||||||
},
|
|
||||||
async getReplyEvent(content) {
|
async getReplyEvent(content) {
|
||||||
let replyId = this.getReplyId(content);
|
let replyId = this.getReplyId(content);
|
||||||
if (replyId === undefined) return undefined;
|
if (replyId === undefined) return undefined;
|
||||||
@ -43,15 +33,11 @@ export default {
|
|||||||
},
|
},
|
||||||
getReplyId(content){
|
getReplyId(content){
|
||||||
if(!content['m.relates_to']) return undefined;
|
if(!content['m.relates_to']) return undefined;
|
||||||
return content['m.relates_to']['m.in_reply_to'].event_id || undefined;
|
if(!content['m.relates_to']['m.in_reply_to']) return undefined;
|
||||||
|
return content['m.relates_to']['m.in_reply_to'].event_id;
|
||||||
},
|
},
|
||||||
parseMessage(msg){
|
calcUserName,
|
||||||
return this.solveTextLinks(
|
parseMessage
|
||||||
msg.replace(/>.*\n/gm, '').trim()
|
|
||||||
.replace(/</g, '<')
|
|
||||||
.replace(/>/g, '>')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
data(){
|
data(){
|
||||||
return{
|
return{
|
||||||
@ -79,13 +65,13 @@ export default {
|
|||||||
margin-top: 0.25rem;
|
margin-top: 0.25rem;
|
||||||
}
|
}
|
||||||
.messageReceive{
|
.messageReceive{
|
||||||
background-color: #42b983;
|
background-color: #424141;
|
||||||
border-radius: 1rem 1rem 1rem 0;
|
border-radius: 1rem 1rem 1rem 0;
|
||||||
}
|
}
|
||||||
.messageSend{
|
.messageSend{
|
||||||
margin-left:auto;
|
margin-left:auto;
|
||||||
margin-right:0;
|
margin-right:0;
|
||||||
background-color: #42a7b9;
|
background-color: #357882;
|
||||||
border-radius: 1rem 1rem 0 1rem;
|
border-radius: 1rem 1rem 0 1rem;
|
||||||
}
|
}
|
||||||
.time{
|
.time{
|
||||||
@ -99,4 +85,7 @@ export default {
|
|||||||
padding-left: 0.5rem;
|
padding-left: 0.5rem;
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.5rem;
|
||||||
}
|
}
|
||||||
|
.username{
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
@ -1,16 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<form class="newMessageBanner" ref="newMessageBanner" v-on:submit.prevent="sendMessage()">
|
<div class="newMessageBanner" ref="newMessageBanner">
|
||||||
<label for="newMessageInput"></label>
|
<div class="reply" v-if="replyTo" @click="resetReplyTo">
|
||||||
|
<span class="username">{{calcUserName(replyTo.sender)}}</span><br>
|
||||||
|
{{parseMessage(replyTo.content.body)}}
|
||||||
|
</div>
|
||||||
|
<form v-on:submit.prevent="sendMessage()">
|
||||||
<textarea
|
<textarea
|
||||||
@keyup.enter.exact="sendMessage()"
|
@keyup.enter.exact="sendMessage()"
|
||||||
@input="resizeMessageBanner()"
|
@input="resizeMessageBanner(); sendTyping(2000);"
|
||||||
v-model="msg.content.body"
|
v-model="event.content.body"
|
||||||
ref="newMessageInput"
|
ref="newMessageInput" class="newMessageInput"
|
||||||
id="newMessageInput"
|
rows="1" placeholder="type a message ..."
|
||||||
class="newMessageInput"
|
|
||||||
autocomplete="off"
|
|
||||||
rows="1"
|
|
||||||
placeholder="type a message ..."
|
|
||||||
/>
|
/>
|
||||||
<icon
|
<icon
|
||||||
type="submit"
|
type="submit"
|
||||||
@ -19,55 +19,76 @@
|
|||||||
ic="./sym/ic_send_white.svg"
|
ic="./sym/ic_send_white.svg"
|
||||||
/>
|
/>
|
||||||
</form>
|
</form>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import icon from '@/components/icon.vue';
|
import icon from '@/components/icon.vue';
|
||||||
import {matrix} from '@/main.js';
|
import {matrix} from '@/main.js';
|
||||||
|
import {parseMessage} from '@/lib/eventUtils';
|
||||||
|
import {calcUserName} from '@/lib/matrixUtils';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "newMessage",
|
name: 'newMessage',
|
||||||
components: {
|
components: {
|
||||||
icon
|
icon
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
onResize: Function,
|
onResize: Function,
|
||||||
roomId: String
|
roomId: String,
|
||||||
|
replyTo: Object,
|
||||||
|
resetReplyTo: Function
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
sendMessage(){
|
sendMessage(){
|
||||||
let content = this.msg.content;
|
let content = this.event.content;
|
||||||
if (!content.body.trim()) return;
|
if (!content.body.trim()) return;
|
||||||
let msgSend = Object.assign({}, this.msg);
|
matrix.sendEvent(this.event, this.roomId, this.replyTo);
|
||||||
matrix.sendEvent(msgSend, this.roomId);
|
content.body = '';
|
||||||
content.body = "";
|
this.resetReplyTo();
|
||||||
let id = this.$refs.newMessageInput;
|
let id = this.$refs.newMessageInput;
|
||||||
id.style.height = "1.25rem";
|
id.style.height = '1.25rem';
|
||||||
this.onResize(id.parentElement.clientHeight);
|
this.onResize(id.parentElement.clientHeight);
|
||||||
},
|
},
|
||||||
|
sendTyping(timeout){
|
||||||
|
if (this.waitForSendTyping) return;
|
||||||
|
matrix.client.sendTyping(this.roomId, true, timeout+100);
|
||||||
|
setTimeout(()=>this.waitForSendTyping=false, timeout);
|
||||||
|
},
|
||||||
resizeMessageBanner(){
|
resizeMessageBanner(){
|
||||||
let id = this.$refs.newMessageInput;
|
let id = this.$refs.newMessageInput;
|
||||||
id.style.height = '1.25rem';
|
id.style.height = '1.25rem';
|
||||||
id.style.height = `${id.scrollHeight}px`;
|
id.style.height = `${id.scrollHeight}px`;
|
||||||
this.onResize(id.parentElement.clientHeight);
|
this.onResize(this.$refs.newMessageBanner.clientHeight);
|
||||||
|
},
|
||||||
|
focusInput(){
|
||||||
|
this.$refs.newMessageInput.focus();
|
||||||
},
|
},
|
||||||
toggleEmojiPicker() {
|
toggleEmojiPicker() {
|
||||||
this.showEmojiPicker = !this.showEmojiPicker;
|
this.showEmojiPicker = !this.showEmojiPicker;
|
||||||
},
|
},
|
||||||
onSelectEmoji(emoji) {
|
onSelectEmoji(emoji) {
|
||||||
this.msg.content.body += emoji.data;
|
this.event.content.body += emoji.data;
|
||||||
}
|
},
|
||||||
|
parseMessage,
|
||||||
|
calcUserName
|
||||||
},
|
},
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
msg: {
|
event: {
|
||||||
type: "m.room.message",
|
type: 'm.room.message',
|
||||||
content: {
|
content: {
|
||||||
body: "",
|
body: '',
|
||||||
msgtype: "m.text"
|
msgtype: 'm.text',
|
||||||
|
'm.relates_to': {
|
||||||
|
'm.in_reply_to': {
|
||||||
|
event_id: undefined
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showEmojiPicker: false
|
showEmojiPicker: false,
|
||||||
|
waitForSendTyping: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -89,7 +110,7 @@ export default {
|
|||||||
margin-top: 1.25rem;
|
margin-top: 1.25rem;
|
||||||
margin-bottom: 0.75rem;
|
margin-bottom: 0.75rem;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
left: 2rem;
|
left: 1rem;
|
||||||
min-height: 1.5rem;
|
min-height: 1.5rem;
|
||||||
max-height: 10rem;
|
max-height: 10rem;
|
||||||
width: calc(100% - 7rem);
|
width: calc(100% - 7rem);
|
||||||
@ -110,4 +131,18 @@ export default {
|
|||||||
bottom: 0.25rem;
|
bottom: 0.25rem;
|
||||||
background-color: unset;
|
background-color: unset;
|
||||||
}
|
}
|
||||||
|
.reply{
|
||||||
|
position: relative;
|
||||||
|
width: calc(100% - 7rem);
|
||||||
|
left: 1rem;
|
||||||
|
border-left: 2px solid #fff;
|
||||||
|
padding-left: 0.5rem;
|
||||||
|
margin-top: 0.75rem;
|
||||||
|
margin-right: 0.5rem;
|
||||||
|
word-break: break-word;
|
||||||
|
white-space: pre-line;
|
||||||
|
}
|
||||||
|
.username{
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
@ -17,7 +17,7 @@
|
|||||||
import avatar from "@/components/avatar";
|
import avatar from "@/components/avatar";
|
||||||
import {getMxcFromRoom} from "@/lib/getMxc";
|
import {getMxcFromRoom} from "@/lib/getMxc";
|
||||||
import {getTime} from "@/lib/getTimeStrings";
|
import {getTime} from "@/lib/getTimeStrings";
|
||||||
import {matrix} from "@/main";
|
import {calcUserName} from "@/lib/matrixUtils";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "userListElement",
|
name: "userListElement",
|
||||||
@ -37,10 +37,7 @@ export default {
|
|||||||
if (!room.timeline[room.timeline.length-1]) return undefined;
|
if (!room.timeline[room.timeline.length-1]) return undefined;
|
||||||
return room.timeline[room.timeline.length-1].event;
|
return room.timeline[room.timeline.length-1].event;
|
||||||
},
|
},
|
||||||
calcUserName(userId) {
|
calcUserName,
|
||||||
if (matrix.user === userId) return 'you';
|
|
||||||
return matrix.client.getUser(userId).displayName || userId;
|
|
||||||
},
|
|
||||||
getMxcFromRoom
|
getMxcFromRoom
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,13 +22,14 @@
|
|||||||
:class="groupTimeline?'indent username':'username'"
|
:class="groupTimeline?'indent username':'username'"
|
||||||
v-if="group[0].sender !== user && groupTimeline"
|
v-if="group[0].sender !== user && groupTimeline"
|
||||||
>
|
>
|
||||||
{{getUser(group[0].sender).displayName || group[0].sender}}
|
{{calcUserName(group[0].sender)}}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
:class="groupTimeline?'indent event':'event'"
|
:class="groupTimeline?'indent event':'event'"
|
||||||
v-for="event in group"
|
v-for="event in group"
|
||||||
:key="event.origin_server_ts"
|
:key="event.origin_server_ts"
|
||||||
:title="`${group[0].sender} at ${getTime(event.origin_server_ts)}`"
|
:title="`${group[0].sender} at ${getTime(event.origin_server_ts)}`"
|
||||||
|
@contextmenu.prevent="setReplyTo(event)"
|
||||||
>
|
>
|
||||||
<message
|
<message
|
||||||
v-if="event.content.msgtype==='m.text'"
|
v-if="event.content.msgtype==='m.text'"
|
||||||
@ -37,6 +38,10 @@
|
|||||||
:content="event.content"
|
:content="event.content"
|
||||||
:roomId="roomId"
|
:roomId="roomId"
|
||||||
/>
|
/>
|
||||||
|
<div v-else-if="event.content.msgtype==='m.notice'" class="notice">
|
||||||
|
{{event.content.body}}
|
||||||
|
<span class="time">{{getTime(event.origin_server_ts)}}</span>
|
||||||
|
</div>
|
||||||
<div v-else-if="event.type==='m.room.member'" class="info">
|
<div v-else-if="event.type==='m.room.member'" class="info">
|
||||||
{{membershipEvents[event.content.membership]}}
|
{{membershipEvents[event.content.membership]}}
|
||||||
<span class="time">{{getTime(event.origin_server_ts)}}</span>
|
<span class="time">{{getTime(event.origin_server_ts)}}</span>
|
||||||
@ -50,11 +55,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import message from "@/components/message";
|
import message from '@/components/message';
|
||||||
import avatar from "@/components/avatar";
|
import avatar from '@/components/avatar';
|
||||||
import {matrix} from "@/main";
|
import splitArray from '@/lib/splitArray';
|
||||||
import splitArray from "@/lib/splitArray";
|
import {getDate, getTime} from '@/lib/getTimeStrings';
|
||||||
import {getDate, getTime} from "@/lib/getTimeStrings";
|
import {getUser, calcUserName} from '@/lib/matrixUtils';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'eventGroup',
|
name: 'eventGroup',
|
||||||
components: {
|
components: {
|
||||||
@ -65,12 +71,12 @@ export default {
|
|||||||
timeline: Array,
|
timeline: Array,
|
||||||
user: String,
|
user: String,
|
||||||
groupTimeline: Boolean,
|
groupTimeline: Boolean,
|
||||||
roomId: String
|
roomId: String,
|
||||||
|
setReplyTo: Function
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getUser(userId) {
|
getUser,
|
||||||
return matrix.client.getUser(userId);
|
calcUserName,
|
||||||
},
|
|
||||||
splitArray,
|
splitArray,
|
||||||
getDate,
|
getDate,
|
||||||
getTime
|
getTime
|
||||||
@ -141,6 +147,13 @@ export default {
|
|||||||
font-size: 0.7rem;
|
font-size: 0.7rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.notice{
|
||||||
|
margin-top: 0.5rem;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
.time{
|
||||||
|
font-size: 0.7rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.indent{
|
.indent{
|
||||||
margin-left: 2.5rem;
|
margin-left: 2.5rem;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="topBanner">
|
<div class="topBanner">
|
||||||
<div>
|
<div>
|
||||||
<icon @click.native="closeChat()" class="topIcon" ic="./sym/arrow_back-24px.svg" />
|
<icon @click.native="closeChat()" class="topIcon" ic="./sym/ic_arrow_back_white.svg" />
|
||||||
<div @click="openChatInfo()" class="container">
|
<div @click="openChatInfo()" class="container">
|
||||||
<avatar class="topIcon avatar" :mxcURL="getMxcFromRoom(room)" :fallback="room.roomId" :size="3"/>
|
<avatar class="topIcon avatar" :mxcURL="getMxcFromRoom(room)" :fallback="room.roomId" :size="3"/>
|
||||||
<div class="chatName">{{room.name}}</div>
|
<div class="chatName">{{room.name}}</div>
|
||||||
|
47
src/lib/NotificationHandler.js
Normal file
47
src/lib/NotificationHandler.js
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
import {getMxcFromUserId, getAvatarUrl} from '@/lib/getMxc';
|
||||||
|
import {calcUserName} from '@/lib/matrixUtils';
|
||||||
|
import {getRoom} from '@/lib/matrixUtils';
|
||||||
|
import {router} from '@/router';
|
||||||
|
import {Capacitor, Plugins} from '@capacitor/core';
|
||||||
|
const {LocalNotifications} = Plugins;
|
||||||
|
|
||||||
|
export class NotificationHandler{
|
||||||
|
constructor() {
|
||||||
|
this.activateNotification();
|
||||||
|
}
|
||||||
|
async activateNotification(){
|
||||||
|
if (!window.Notification){
|
||||||
|
console.log('notifications are unsupported')
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (Notification.permission === 'granted') return true;
|
||||||
|
return await Notification.requestPermission()
|
||||||
|
.then(permission => {return permission === 'granted'});
|
||||||
|
}
|
||||||
|
showNotification(event){
|
||||||
|
if (Capacitor.isNative) return this.showNativeNotification(event);
|
||||||
|
if (Notification.permission !== 'granted') return false;
|
||||||
|
console.log(event);
|
||||||
|
let mxc = getMxcFromUserId(event.sender);
|
||||||
|
new Notification(`${calcUserName(event.sender)} in ${getRoom(event.room_id).name}`, {
|
||||||
|
body: event.content.body,
|
||||||
|
icon: mxc?getAvatarUrl(mxc):undefined
|
||||||
|
}).onclick = ()=>router.push(`/rooms/${event.room_id}`);
|
||||||
|
}
|
||||||
|
showNativeNotification(event){
|
||||||
|
LocalNotifications.schedule({
|
||||||
|
notifications: [
|
||||||
|
{
|
||||||
|
title: `${calcUserName(event.sender)} in ${getRoom(event.room_id).name}`,
|
||||||
|
body: event.content.body,
|
||||||
|
id: 1,
|
||||||
|
schedule: { at: new Date(Date.now() + 1000 * 5) },
|
||||||
|
sound: null,
|
||||||
|
attachments: null,
|
||||||
|
actionTypeId: '',
|
||||||
|
extra: null
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
19
src/lib/eventUtils.js
Normal file
19
src/lib/eventUtils.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
export function solveTextLinks(text){
|
||||||
|
return (text || '').replace(
|
||||||
|
/([^\S]|^)(((https?:\/\/)|(www\.))(\S+))/gi,
|
||||||
|
(match, space, url)=>{
|
||||||
|
let hyperlink = url;
|
||||||
|
if (!hyperlink.match('^https?://')) {
|
||||||
|
hyperlink = 'http://' + hyperlink;
|
||||||
|
}
|
||||||
|
return `${space}<a href="${hyperlink}" target="_blank">${url}</a>`;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export function parseMessage(msg){
|
||||||
|
return solveTextLinks(
|
||||||
|
msg.replace(/>.*\n/gm, '').trim()
|
||||||
|
.replace(/</g, '<')
|
||||||
|
.replace(/>/g, '>')
|
||||||
|
);
|
||||||
|
}
|
@ -1,5 +1,6 @@
|
|||||||
import sdk from 'matrix-js-sdk'
|
import sdk from 'matrix-js-sdk'
|
||||||
import {matrix} from "@/main";
|
import {matrix} from '@/main';
|
||||||
|
import parseMXC from '@modular-matrix/parse-mxc';
|
||||||
|
|
||||||
export function getMxcFromUser(user){
|
export function getMxcFromUser(user){
|
||||||
return user.avatarUrl;
|
return user.avatarUrl;
|
||||||
@ -10,10 +11,16 @@ export function getMxcFromUserId(userId){
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getMxcFromRoom(room){
|
export function getMxcFromRoom(room){
|
||||||
let avatarState = room.getLiveTimeline().getState(sdk.EventTimeline.FORWARDS).getStateEvents("m.room.avatar");
|
let avatarState = room.getLiveTimeline().getState(sdk.EventTimeline.FORWARDS).getStateEvents('m.room.avatar');
|
||||||
return avatarState.length>0?avatarState[avatarState.length-1].getContent().url:undefined;
|
return avatarState.length>0?avatarState[avatarState.length-1].getContent().url:undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getMxcFromRoomId(roomId){
|
export function getMxcFromRoomId(roomId){
|
||||||
return getMxcFromRoom(matrix.client.getRoom(roomId));
|
return getMxcFromRoom(matrix.client.getRoom(roomId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getAvatarUrl(mxcUrl, size = 64, resizeMethod = 'crop'){
|
||||||
|
let mxc = parseMXC.parse(mxcUrl);
|
||||||
|
return `${matrix.baseUrl}/_matrix/media/v1/thumbnail/${
|
||||||
|
mxc.homeserver}/${mxc.id}?width=${size}&height=${size}&method=${resizeMethod}`;
|
||||||
|
}
|
@ -1,4 +1,5 @@
|
|||||||
import matrix from 'matrix-js-sdk';
|
import matrix from 'matrix-js-sdk';
|
||||||
|
import {NotificationHandler} from "@/lib/NotificationHandler";
|
||||||
|
|
||||||
export class MatrixHandler {
|
export class MatrixHandler {
|
||||||
constructor(clientDisplayName = 'matrix-chat') {
|
constructor(clientDisplayName = 'matrix-chat') {
|
||||||
@ -9,6 +10,7 @@ export class MatrixHandler {
|
|||||||
this.loading = undefined;
|
this.loading = undefined;
|
||||||
this.user = undefined;
|
this.user = undefined;
|
||||||
this.baseUrl = undefined;
|
this.baseUrl = undefined;
|
||||||
|
this.notify = new NotificationHandler();
|
||||||
}
|
}
|
||||||
login(user, password, baseUrl, onError, callback = ()=>{}){
|
login(user, password, baseUrl, onError, callback = ()=>{}){
|
||||||
if (this.client){ console.log('there is already an active session'); return; }
|
if (this.client){ console.log('there is already an active session'); return; }
|
||||||
@ -57,29 +59,35 @@ export class MatrixHandler {
|
|||||||
await this.client.stopClient();
|
await this.client.stopClient();
|
||||||
this.client = undefined;
|
this.client = undefined;
|
||||||
}
|
}
|
||||||
startSync(callback = ()=>{}){
|
async startSync(callback = ()=>{}){
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.client.startClient();
|
await this.client.startClient();
|
||||||
this.client.once('sync', (state) => {
|
this.client.once('sync', (state) => {
|
||||||
console.log(state);
|
console.log(state);
|
||||||
this.rooms = this.client.getRooms();
|
this.rooms = this.client.getRooms();
|
||||||
console.log(this.rooms)
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
callback();
|
callback();
|
||||||
|
this.listenToPushEvents()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
async sendEvent(msg, roomId){
|
listenToPushEvents(){
|
||||||
const msgSend = {
|
this.client.on('event', event => {
|
||||||
type: msg.type,
|
if (this.client.getPushActionsForEvent(event).notify){
|
||||||
content: {
|
this.notify.showNotification(event.event);
|
||||||
body: msg.content.body.trim(),
|
}
|
||||||
msgtype: msg.content.msgtype,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
await this.client.sendEvent(roomId, msgSend.type, msgSend.content, '').then(() => {
|
|
||||||
console.log('message sent successfully');
|
|
||||||
}).catch((err) => {
|
|
||||||
console.log(`error while sending message => ${err}`);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
async sendEvent({content, type}, roomId, replyTo = undefined){
|
||||||
|
await this.client.sendEvent(roomId, type, {
|
||||||
|
body: content.body.trim(),
|
||||||
|
msgtype: content.msgtype,
|
||||||
|
'm.relates_to': {
|
||||||
|
'm.in_reply_to': {
|
||||||
|
event_id: replyTo?replyTo.event_id:undefined
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).then(() => console.log('message sent successfully'))
|
||||||
|
.catch((err) => console.log(`error while sending message => ${err}`)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
12
src/lib/matrixUtils.js
Normal file
12
src/lib/matrixUtils.js
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import {matrix} from '@/main';
|
||||||
|
|
||||||
|
export function getUser(userId) {
|
||||||
|
return matrix.client.getUser(userId);
|
||||||
|
}
|
||||||
|
export function calcUserName(userId){
|
||||||
|
if (matrix.user === userId) return 'you';
|
||||||
|
return matrix.client.getUser(userId).displayName || userId;
|
||||||
|
}
|
||||||
|
export function getRoom(roomId){
|
||||||
|
return matrix.client.getRoom(roomId);
|
||||||
|
}
|
@ -1,7 +1,7 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import VueRouter from 'vue-router'
|
import VueRouter from 'vue-router'
|
||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
import {router} from './router.js'
|
import {router} from '@/router'
|
||||||
import {MatrixHandler} from './lib/matrixHandler.js'
|
import {MatrixHandler} from './lib/matrixHandler.js'
|
||||||
import {cookieHandler} from './lib/cookieHandler.js';
|
import {cookieHandler} from './lib/cookieHandler.js';
|
||||||
|
|
||||||
|
@ -1,40 +0,0 @@
|
|||||||
import VueRouter from 'vue-router';
|
|
||||||
import login from '@/views/login';
|
|
||||||
import chat from '@/views/chat';
|
|
||||||
import rooms from '@/views/rooms';
|
|
||||||
import admin from '@/views/admin';
|
|
||||||
|
|
||||||
export const router = new VueRouter({
|
|
||||||
routes: [
|
|
||||||
{
|
|
||||||
path: '/',
|
|
||||||
name: 'home',
|
|
||||||
component: login
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/login',
|
|
||||||
name: 'login',
|
|
||||||
component: login
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/chat/*',
|
|
||||||
name: 'chat',
|
|
||||||
component: chat
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/rooms/*',
|
|
||||||
name: 'room',
|
|
||||||
component: rooms
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/rooms',
|
|
||||||
name: 'rooms',
|
|
||||||
component: rooms
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/admin',
|
|
||||||
name: 'admin',
|
|
||||||
component: admin
|
|
||||||
}
|
|
||||||
]
|
|
||||||
})
|
|
@ -0,0 +1,40 @@
|
|||||||
|
import VueRouter from 'vue-router';
|
||||||
|
import login from '@/views/login';
|
||||||
|
import chat from '@/views/chat';
|
||||||
|
import rooms from '@/views/rooms';
|
||||||
|
import admin from '@/views/admin';
|
||||||
|
|
||||||
|
export const router = new VueRouter({
|
||||||
|
routes: [
|
||||||
|
{
|
||||||
|
path: '/',
|
||||||
|
name: 'home',
|
||||||
|
component: login
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/login',
|
||||||
|
name: 'login',
|
||||||
|
component: login
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/chat/*',
|
||||||
|
name: 'chat',
|
||||||
|
component: chat
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/rooms/*',
|
||||||
|
name: 'room',
|
||||||
|
component: rooms
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/rooms',
|
||||||
|
name: 'rooms',
|
||||||
|
component: rooms
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/admin',
|
||||||
|
name: 'admin',
|
||||||
|
component: admin
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
@ -1,14 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div ref="chatContainer" class="chatContainer">
|
<div ref="chatContainer" class="chatContainer">
|
||||||
<div @scroll="onScroll()" ref="msgContainer" id="messagesContainer" class="messagesContainer">
|
<div @scroll="onScroll()" ref="timelineContainer" class="timelineContainer">
|
||||||
<div v-if="loadingStatus" @click="loadEvents()" class="loadMore">{{loadingStatus}}</div>
|
<div v-if="loadingStatus" @click="loadEvents()" class="loadMore">{{loadingStatus}}</div>
|
||||||
<p v-if="room.timeline.length === 0" class="chatInfo">this room is empty</p>
|
<p v-if="room.timeline.length === 0" class="chatInfo">this room is empty</p>
|
||||||
<timeline :timeline="room.timeline" :group-timeline="isGroup()" :user="user" :roomId="room.roomId" />
|
<timeline
|
||||||
|
:timeline="room.timeline" :group-timeline="isGroup()"
|
||||||
|
:user="user" :roomId="room.roomId"
|
||||||
|
:setReplyTo="event=>{replyTo=event; resize();}"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<icon v-if="showScrollBtn" @click.native="scroll.scrollToBottom()" id="scrollDown" ic="./sym/ic_expand_more_black.svg" />
|
<icon v-if="showScrollBtn" @click.native="scroll.scrollToBottom()" id="scrollDown" ic="./sym/ic_expand_more_black.svg" />
|
||||||
</div>
|
</div>
|
||||||
<newMessage :onResize="height=>resize(height)" :roomId="room.roomId"/>
|
<newMessage
|
||||||
|
:onResize="height=>resize(height)" :roomId="room.roomId" ref="newMessage"
|
||||||
|
:replyTo="replyTo" :resetReplyTo="()=>replyTo=undefined"
|
||||||
|
/>
|
||||||
<topBanner :room="room" :close-chat="()=>closeChat()" :open-chat-info="()=>openChatInfo()"/>
|
<topBanner :room="room" :close-chat="()=>closeChat()" :open-chat-info="()=>openChatInfo()"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -20,7 +27,7 @@ import Icon from '@/components/icon';
|
|||||||
import {matrix} from '@/main';
|
import {matrix} from '@/main';
|
||||||
import splitArray from '@/lib/splitArray.js'
|
import splitArray from '@/lib/splitArray.js'
|
||||||
import timeline from '@/components/timeline';
|
import timeline from '@/components/timeline';
|
||||||
import scrollHandler from "@/lib/scrollHandler";
|
import scrollHandler from '@/lib/scrollHandler';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'chat',
|
name: 'chat',
|
||||||
@ -38,10 +45,10 @@ export default {
|
|||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
onScroll(){
|
onScroll(){
|
||||||
if (this.$refs.msgContainer.scrollTop === 0) this.loadEvents();
|
if (this.$refs.timelineContainer.scrollTop < 400 && this.loadingStatus !== 'loading') this.loadEvents();
|
||||||
this.showScrollBtn = this.scroll.getScrollBottom() > 400;
|
this.showScrollBtn = this.scroll.getScrollBottom() > 500;
|
||||||
},
|
},
|
||||||
resize(height){
|
resize(height = this.$refs.newMessage.clientHeight){
|
||||||
this.$refs.chatContainer.style.height = `calc(100% - ${height}px - 3.5rem)`;
|
this.$refs.chatContainer.style.height = `calc(100% - ${height}px - 3.5rem)`;
|
||||||
},
|
},
|
||||||
isGroup(){
|
isGroup(){
|
||||||
@ -49,10 +56,10 @@ export default {
|
|||||||
},
|
},
|
||||||
async loadEvents(){
|
async loadEvents(){
|
||||||
let scrollBottom = this.scroll.getScrollBottom();
|
let scrollBottom = this.scroll.getScrollBottom();
|
||||||
this.loadingStatus = 'loading ...';
|
this.loadingStatus = 'loading';
|
||||||
await matrix.client.paginateEventTimeline(this.room.getLiveTimeline(), {backwards: true})
|
await matrix.client.scrollback(this.room, 30);
|
||||||
.then(state => this.loadingStatus = state?'load more':false);
|
this.loadingStatus = 'load more';
|
||||||
this.scroll.setScrollBottom(scrollBottom);
|
this.scroll.setScrollBottom(scrollBottom)
|
||||||
},
|
},
|
||||||
getUser(userId){
|
getUser(userId){
|
||||||
return matrix.client.getUser(userId);
|
return matrix.client.getUser(userId);
|
||||||
@ -64,15 +71,22 @@ export default {
|
|||||||
showScrollBtn: false,
|
showScrollBtn: false,
|
||||||
scrollOnUpdate: true,
|
scrollOnUpdate: true,
|
||||||
loadingStatus: 'load more',
|
loadingStatus: 'load more',
|
||||||
scroll: ()=>{}
|
scroll: ()=>{},
|
||||||
|
replyTo: undefined
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
updated(){
|
updated(){
|
||||||
if(this.scroll.getScrollBottom() < 350) this.scroll.scrollToBottom();
|
if(this.scroll.getScrollBottom() < 400 && this.loadingStatus !== 'loading') this.scroll.scrollToBottom();
|
||||||
},
|
},
|
||||||
mounted(){
|
mounted(){
|
||||||
this.scroll = new scrollHandler(this.$refs.msgContainer);
|
this.scroll = new scrollHandler(this.$refs.timelineContainer);
|
||||||
this.scroll.scrollToBottom();
|
this.scroll.scrollToBottom();
|
||||||
|
this.onScroll();
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
'$route'(){
|
||||||
|
this.scroll.scrollToBottom();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -85,7 +99,7 @@ export default {
|
|||||||
top: 3.5rem;
|
top: 3.5rem;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: calc(100% - 7rem);
|
height: calc(100% - 7rem);
|
||||||
.messagesContainer{
|
.timelineContainer{
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,11 @@
|
|||||||
<div id="roomList" class="roomList">
|
<div id="roomList" class="roomList">
|
||||||
<h1 class="wideElement">[chat]</h1><h1 class="smallElement">[c]</h1>
|
<h1 class="wideElement">[chat]</h1><h1 class="smallElement">[c]</h1>
|
||||||
<input v-model="search" class="input wideElement" type="text" maxlength="50" placeholder="search">
|
<input v-model="search" class="input wideElement" type="text" maxlength="50" placeholder="search">
|
||||||
<div v-for="room in matrix.rooms" :key="room.roomId" @click="openChat(room)" >
|
<div
|
||||||
|
v-for="room in Object.assign([], matrix.rooms)
|
||||||
|
.sort(obj => obj.timeline[obj.timeline.length-1].event.origin_server_ts)"
|
||||||
|
:key="room.roomId" @click="openChat(room)"
|
||||||
|
>
|
||||||
<room-list-element
|
<room-list-element
|
||||||
v-if="!search || room.name.toLowerCase().includes(search.toLowerCase().trim())"
|
v-if="!search || room.name.toLowerCase().includes(search.toLowerCase().trim())"
|
||||||
:room="room"
|
:room="room"
|
||||||
@ -16,14 +20,14 @@
|
|||||||
</div>
|
</div>
|
||||||
<chat
|
<chat
|
||||||
class="chat"
|
class="chat"
|
||||||
v-if="currentRoom"
|
v-if="showRoom && getCurrentRoom()"
|
||||||
:room="currentRoom"
|
:room="getCurrentRoom()"
|
||||||
:user="matrix.user"
|
:user="matrix.user"
|
||||||
:close-chat="()=>currentRoom=undefined"
|
:close-chat="closeChat"
|
||||||
:open-chat-info="()=>showChatInfo=true"
|
:open-chat-info="()=>showChatInfo=true"
|
||||||
/>
|
/>
|
||||||
<div class="noRoomSelected" v-else>Please select a room to be displayed.</div>
|
<div class="noRoomSelected" v-else>Please select a room to be displayed.</div>
|
||||||
<chatInformation v-if="currentRoom && showChatInfo" :room="currentRoom" :close-chat-info="()=>showChatInfo=false"/>
|
<chatInformation v-if="showRoom && showChatInfo" :room="getCurrentRoom()" :close-chat-info="()=>showChatInfo=false"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -34,6 +38,7 @@ import {matrix} from "@/main";
|
|||||||
import ThrobberOverlay from "@/components/throbberOverlay";
|
import ThrobberOverlay from "@/components/throbberOverlay";
|
||||||
import {getMxcFromRoom} from "@/lib/getMxc";
|
import {getMxcFromRoom} from "@/lib/getMxc";
|
||||||
import roomListElement from "@/components/roomListElement";
|
import roomListElement from "@/components/roomListElement";
|
||||||
|
import {getRoom} from "@/lib/matrixUtils";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "rooms",
|
name: "rooms",
|
||||||
@ -46,18 +51,25 @@ export default {
|
|||||||
methods:{
|
methods:{
|
||||||
openChat(room){
|
openChat(room){
|
||||||
this.showChatInfo = false;
|
this.showChatInfo = false;
|
||||||
this.currentRoom = undefined
|
this.showRoom = false;
|
||||||
this.$nextTick(() => this.currentRoom = room);
|
|
||||||
this.$router.push(`/rooms/${room.roomId}`);
|
this.$router.push(`/rooms/${room.roomId}`);
|
||||||
|
this.$nextTick(() => this.showRoom = true);
|
||||||
this.search = '';
|
this.search = '';
|
||||||
},
|
},
|
||||||
getMxcFromRoom
|
getMxcFromRoom,
|
||||||
|
getRoom,
|
||||||
|
getCurrentRoom(){
|
||||||
|
return getRoom(this.$route.path.split('/')[2]);
|
||||||
|
},
|
||||||
|
closeChat(){
|
||||||
|
this.$router.push('/rooms');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
matrix,
|
matrix,
|
||||||
currentRoom: undefined,
|
|
||||||
showChatInfo: false,
|
showChatInfo: false,
|
||||||
|
showRoom: true,
|
||||||
search: ''
|
search: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -102,7 +114,7 @@ export default {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
input{
|
input{
|
||||||
width: calc(100% - 5rem);
|
width: calc(100% - 5.2rem);
|
||||||
}
|
}
|
||||||
.wideElement{
|
.wideElement{
|
||||||
display: block;
|
display: block;
|
||||||
|
Loading…
Reference in New Issue
Block a user