[mockup.channels] update with 'local' data encapsuled [init.local-channels] removed [vue.menu] updated

This commit is contained in:
xdrm-brackets 2018-03-21 22:54:24 +01:00
parent 8c8acdaca7
commit cc062028aa
6 changed files with 41 additions and 28 deletions

View File

@ -24,7 +24,4 @@ gs.set('router', new VueRouter({
/* (2) Main components /* (2) Main components
---------------------------------------------------------*/ ---------------------------------------------------------*/
/* (1) Initialize channels & channel menu */ /* (1) Initialize channels & channel menu */
require('./init/channels.js'); require('./init/channels.js');
/* (2) Initialize local channels (for a specific channel) */
require('./init/local-channels.js');

View File

@ -8,10 +8,8 @@ gs.get.channel.current = null;
/* (3) Initialize list */ /* (3) Initialize list */
gs.get.channel.list = [ gs.get.channel.list = [
{ id: -1, link: 'me', label: 'My data', sub: '0 online', icon: 'group' }, { id: -1, link: 'me', label: 'My data', sub: '0 online', icon: 'group', local: [] },
{ id: 0, link: 'test-1', label: 'test 1', sub: null, icon: 'test1' }, { id: -2, link: null, label: 'add', sub: null, icon: 'add', local: [], add: 1 }
{ id: 1, link: 'test-2', label: 'test 2', sub: null, icon: 'test2' },
{ id: -2, link: null, label: 'add', sub: null, icon: 'add', add: 1 }
]; ];
/* (4) Initialize vue-router channel navigation */ /* (4) Initialize vue-router channel navigation */

View File

@ -1,17 +0,0 @@
/* (1) Initialisation
---------------------------------------------------------*/
/* (1) Init @channel object */
gs.set('lchannel', [
{
type: 'text',
visible: true,
list: [ 'general', 'test-text' ],
active: 0
},
{
type: 'voice',
visible: true,
list: [ 'general' , 'test-voice' ],
active: null
}
]);

View File

@ -24,5 +24,12 @@ new Vue({
render(h){ return h(wrapper); } render(h){ return h(wrapper); }
}) })
/* (3) Channel data gathering
---------------------------------------------------------*/
/* (1) Fetch channel data */
gs.get.channel.dump( require('./mockup/channels.json') );
/* (2) Initialize channel_id guess */ /* (2) Initialize channel_id guess */
gs.get.channel.nav(); gs.get.channel.nav();

View File

@ -2,11 +2,39 @@
{ {
"id": 0, "id": 0,
"link": "channel-1", "link": "channel-1",
"label": "first channel" "label": "first channel",
"local": [
{
"type": "text",
"visible": true,
"list": [ "general", "test-text" ],
"active": 0
},
{
"type": "voice",
"visible": true,
"list": [ "general" , "test-voice" ],
"active": null
}
]
}, },
{ {
"id": 1, "id": 1,
"link": "common-channel", "link": "common-channel",
"label": "Common Channel" "label": "Common Channel",
"local": [
{
"type": "text",
"visible": true,
"list": [ "general2", "test-text-common" ],
"active": 0
},
{
"type": "voice",
"visible": true,
"list": [ "general2" , "test-voice-common" ],
"active": null
}
]
} }
] ]

View File

@ -14,7 +14,7 @@
<div class='body'> <div class='body'>
<div v-for='c in gs.lchannel'> <div v-for='c in gs.channel.get().local' v-show='c.list.length>0'>
<div class='toggle' <div class='toggle'
:data-toggle='c.visible?1:0' :data-toggle='c.visible?1:0'
@click='c.visible=!c.visible'>{{ c.type }} channels</div> @click='c.visible=!c.visible'>{{ c.type }} channels</div>