update
This commit is contained in:
parent
912bf003b3
commit
665edead89
|
@ -11,16 +11,33 @@ export default class ContentController{
|
||||||
---------------------------------------------------------*/
|
---------------------------------------------------------*/
|
||||||
get cid(){ return gs.get.channel.current; }
|
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
|
/* (3) Room ID binding
|
||||||
*
|
*
|
||||||
---------------------------------------------------------*/
|
---------------------------------------------------------*/
|
||||||
get rid(){ return gs.get.room.text.current; }
|
get rid(){ return gs.get.room.text.current; }
|
||||||
|
|
||||||
|
|
||||||
/* (4) Room buffer binding
|
|
||||||
*
|
|
||||||
---------------------------------------------------------*/
|
|
||||||
get rbuf(){
|
get rbuf(){
|
||||||
|
|
||||||
/* (1) Ignore: if no rooms empty */
|
/* (1) Ignore: if no rooms empty */
|
||||||
|
|
|
@ -182,9 +182,13 @@ export default class RoomController{
|
||||||
if( rs.error !== 0 || rs.channel == null )
|
if( rs.error !== 0 || rs.channel == null )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* (2) Dump data */
|
/* (2) Dump rooms data */
|
||||||
this.dump(rs.channel.room);
|
this.dump(rs.channel.room);
|
||||||
|
|
||||||
|
/* (3) Store channel users */
|
||||||
|
gs.get.content.cbuf.users = rs.channel.users;
|
||||||
|
|
||||||
|
|
||||||
}.bind(this), auth.token);
|
}.bind(this), auth.token);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,6 +173,8 @@
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
transition: opacity .2s ease-in-out;
|
transition: opacity .2s ease-in-out;
|
||||||
|
background: url() center center no-repeat;
|
||||||
|
background-size: cover;
|
||||||
|
|
||||||
&:hover{
|
&:hover{
|
||||||
opacity: .8;
|
opacity: .8;
|
||||||
|
|
|
@ -11,10 +11,10 @@
|
||||||
<section class='message-stack'>
|
<section class='message-stack'>
|
||||||
|
|
||||||
<div class='message' v-for='m in gs.content.messages'>
|
<div class='message' v-for='m in gs.content.messages'>
|
||||||
<div class='icon'></div>
|
<div class='icon' :style='`background-image: url("https://picsum.photos/150/?random&nonce=${m.uid}");`'></div>
|
||||||
<span class='meta'>
|
<span class='meta'>
|
||||||
<span class='author'>{{ gs.content.user(m.uid).name || 'inconnu' }}</span>
|
<span class='author'>{{ gs.content.user(m.uid).username || `guest ${m.uid}` }}</span>
|
||||||
<span class='date' >{{ new Date(m.ts*1000).toLocaleString('fr') || 'inconnu' }}</span>
|
<span class='date' >{{ m.ts || 'inconnu' }}</span>
|
||||||
</span>
|
</span>
|
||||||
<span class='text'>{{ m.msg }}</span>
|
<span class='text'>{{ m.msg }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue