|
|
@ -2,42 +2,43 @@
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<div id="roomList" class="roomList">
|
|
|
|
<div id="roomList" class="roomList">
|
|
|
|
<h1>[chat]</h1>
|
|
|
|
<h1>[chat]</h1>
|
|
|
|
<h2>rooms</h2>
|
|
|
|
<h2>{{session.rooms.length}} rooms:</h2>
|
|
|
|
<div class="roomListElement" v-for="(room, index) in rooms" :key="index">
|
|
|
|
<div v-for="(room, index) in session.rooms" :key="index" @click="openChat(room)" class="roomListElement">
|
|
|
|
<router-link @click="getRooms()" :to="`/rooms/${room.roomId}`">
|
|
|
|
<div class="roomImgPlaceholder">{{room.name.substr(0,2)}}</div>
|
|
|
|
<div class="roomListName">{{room.name}}</div>
|
|
|
|
<div class="roomListName">{{room.name}}</div>
|
|
|
|
</router-link>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<textbtn @click.native="getRooms()" text="update" />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<chat class="chat" v-if="this.$router.currentRoute.fullPath.split('/',3)[2]" />
|
|
|
|
<chat class="chat" v-if="session.currentRoom" />
|
|
|
|
<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>
|
|
|
|
|
|
|
|
<div class="roomListSmall">
|
|
|
|
|
|
|
|
<h1>[c]</h1>
|
|
|
|
|
|
|
|
<h2>—</h2>
|
|
|
|
|
|
|
|
<div v-for="(room, index) in session.rooms" :key="index" @click="openChat(room)" class="roomListElement" :title="room.name">
|
|
|
|
|
|
|
|
<div class="roomImgPlaceholder">{{room.name.substr(0,2)}}</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import matrix from '@/matrix.js';
|
|
|
|
import matrix from '@/matrix.js';
|
|
|
|
import textbtn from "@/components/textbtn";
|
|
|
|
|
|
|
|
import chat from '@/views/chat.vue'
|
|
|
|
import chat from '@/views/chat.vue'
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: "rooms",
|
|
|
|
name: "rooms",
|
|
|
|
props: {
|
|
|
|
|
|
|
|
rooms: String
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
components:{
|
|
|
|
components:{
|
|
|
|
textbtn,
|
|
|
|
|
|
|
|
chat
|
|
|
|
chat
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods:{
|
|
|
|
methods:{
|
|
|
|
getRooms(){
|
|
|
|
openChat(room){
|
|
|
|
//matrix.methods.getRooms()
|
|
|
|
this.session.currentRoom = room;
|
|
|
|
//console.log(matrix.methods.getRooms())
|
|
|
|
this.$router.push(`/rooms/${room.roomId}`)
|
|
|
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data(){
|
|
|
|
data(){
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
session: matrix.data().session
|
|
|
|
session: matrix.data().session,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -48,7 +49,7 @@ export default {
|
|
|
|
position: absolute;
|
|
|
|
position: absolute;
|
|
|
|
left: 0;
|
|
|
|
left: 0;
|
|
|
|
top: 0;
|
|
|
|
top: 0;
|
|
|
|
width: 20rem;
|
|
|
|
width: 18rem;
|
|
|
|
height: 100%;
|
|
|
|
height: 100%;
|
|
|
|
background-color: #222;
|
|
|
|
background-color: #222;
|
|
|
|
text-align: center;
|
|
|
|
text-align: center;
|
|
|
@ -58,19 +59,34 @@ export default {
|
|
|
|
position: absolute;
|
|
|
|
position: absolute;
|
|
|
|
right: 0;
|
|
|
|
right: 0;
|
|
|
|
top: 0;
|
|
|
|
top: 0;
|
|
|
|
width: calc(100% - 20rem);
|
|
|
|
width: calc(100% - 18rem);
|
|
|
|
height: 100%;
|
|
|
|
height: 100%;
|
|
|
|
background-color: #313131;
|
|
|
|
background-color: #313131;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.roomListElement{
|
|
|
|
.roomListElement{
|
|
|
|
position: relative;
|
|
|
|
position: relative;
|
|
|
|
height: 3rem;
|
|
|
|
height: 3rem;
|
|
|
|
margin-top: 1rem;
|
|
|
|
margin-top: 0.5rem;
|
|
|
|
font-size: 1.2rem;
|
|
|
|
font-size: 1.2rem;
|
|
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
background-color: #222;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.roomListName{
|
|
|
|
.roomListName{
|
|
|
|
position: absolute;
|
|
|
|
position: absolute;
|
|
|
|
left: 5rem;
|
|
|
|
left: 4.5rem;
|
|
|
|
|
|
|
|
top: 1rem;
|
|
|
|
|
|
|
|
color: #fff;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.roomListSmall{
|
|
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
|
|
left: 0;
|
|
|
|
|
|
|
|
top: 0;
|
|
|
|
|
|
|
|
width: 4rem;
|
|
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
|
|
background-color: #222;
|
|
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
|
|
display: none;
|
|
|
|
|
|
|
|
overflow-y: auto;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.noRoomSelected{
|
|
|
|
.noRoomSelected{
|
|
|
|
position: absolute;
|
|
|
|
position: absolute;
|
|
|
@ -79,15 +95,37 @@ export default {
|
|
|
|
left: 20rem;
|
|
|
|
left: 20rem;
|
|
|
|
text-align: center;
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.roomImgPlaceholder{
|
|
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
|
|
left: 1rem;
|
|
|
|
|
|
|
|
top: 0;
|
|
|
|
|
|
|
|
height: 2rem;
|
|
|
|
|
|
|
|
width: 3rem;
|
|
|
|
|
|
|
|
padding-top: 1rem;
|
|
|
|
|
|
|
|
background-color: #42a7b9;
|
|
|
|
|
|
|
|
border-radius: 1.5rem;
|
|
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
|
|
vertical-align: middle;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*@media (max-width: 45rem) {
|
|
|
|
@media (max-width: 48rem) {
|
|
|
|
.roomList{
|
|
|
|
.roomList{
|
|
|
|
width: 4rem;
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.chat{
|
|
|
|
.chat{
|
|
|
|
width: calc(100% - 4rem);
|
|
|
|
width: calc(100% - 4rem);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}*/
|
|
|
|
.roomListSmall{
|
|
|
|
|
|
|
|
display: block;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.roomImgPlaceholder{
|
|
|
|
|
|
|
|
left: 0.5rem;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.noRoomSelected{
|
|
|
|
|
|
|
|
left: 4rem;
|
|
|
|
|
|
|
|
width: calc(100% - 4rem);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@media (max-width: 30rem) {
|
|
|
|
@media (max-width: 30rem) {
|
|
|
|
.roomList{
|
|
|
|
.roomList{
|
|
|
@ -99,5 +137,11 @@ export default {
|
|
|
|
.noRoomSelected{
|
|
|
|
.noRoomSelected{
|
|
|
|
display: none;
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.roomListSmall{
|
|
|
|
|
|
|
|
display: none;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.roomList{
|
|
|
|
|
|
|
|
display: block;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|