From 665edead89bae019c9616cc865106fc04e2ca5d6 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Wed, 28 Mar 2018 15:54:19 +0200 Subject: [PATCH] update --- webpack/lib/content-controller.js | 25 +++++++++++++++++++++---- webpack/lib/room-controller.js | 6 +++++- webpack/scss/container.scss | 2 ++ webpack/vue/auth/channel.vue | 6 +++--- 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/webpack/lib/content-controller.js b/webpack/lib/content-controller.js index ebcd609..8b6e3fd 100644 --- a/webpack/lib/content-controller.js +++ b/webpack/lib/content-controller.js @@ -11,16 +11,33 @@ export default class ContentController{ ---------------------------------------------------------*/ get cid(){ return gs.get.channel.current; } + get cbuf(){ + + /* (1) Ignore: if no channel */ + if( gs.get.channel.list == null || gs.get.channel.list.length === 0 ) + return {}; + + /* (2) Search for current channel */ + for( let c of gs.get.channel.list ){ + + // Return if channel found // + if( c.id === this.cid ) + return c; + + } + + + /* (3) If nothing found */ + return {}; + + } + /* (3) Room ID binding * ---------------------------------------------------------*/ get rid(){ return gs.get.room.text.current; } - - /* (4) Room buffer binding - * - ---------------------------------------------------------*/ get rbuf(){ /* (1) Ignore: if no rooms empty */ diff --git a/webpack/lib/room-controller.js b/webpack/lib/room-controller.js index e1bbaa8..1ed7e0c 100644 --- a/webpack/lib/room-controller.js +++ b/webpack/lib/room-controller.js @@ -182,9 +182,13 @@ export default class RoomController{ if( rs.error !== 0 || rs.channel == null ) return; - /* (2) Dump data */ + /* (2) Dump rooms data */ this.dump(rs.channel.room); + /* (3) Store channel users */ + gs.get.content.cbuf.users = rs.channel.users; + + }.bind(this), auth.token); } diff --git a/webpack/scss/container.scss b/webpack/scss/container.scss index c3f389c..123a215 100644 --- a/webpack/scss/container.scss +++ b/webpack/scss/container.scss @@ -173,6 +173,8 @@ cursor: pointer; transition: opacity .2s ease-in-out; + background: url() center center no-repeat; + background-size: cover; &:hover{ opacity: .8; diff --git a/webpack/vue/auth/channel.vue b/webpack/vue/auth/channel.vue index 75732c2..42d5424 100644 --- a/webpack/vue/auth/channel.vue +++ b/webpack/vue/auth/channel.vue @@ -11,10 +11,10 @@
-
+
- {{ gs.content.user(m.uid).name || 'inconnu' }} - {{ new Date(m.ts*1000).toLocaleString('fr') || 'inconnu' }} + {{ gs.content.user(m.uid).username || `guest ${m.uid}` }} + {{ m.ts || 'inconnu' }} {{ m.msg }}