From cc062028aae5e031f5bcfc32d1c7ad364323c9ab Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Wed, 21 Mar 2018 22:54:24 +0100 Subject: [PATCH] [mockup.channels] update with 'local' data encapsuled [init.local-channels] removed [vue.menu] updated --- webpack/common.js | 5 +---- webpack/init/channels.js | 6 ++---- webpack/init/local-channels.js | 17 ----------------- webpack/main.js | 7 +++++++ webpack/mockup/channels.json | 32 ++++++++++++++++++++++++++++++-- webpack/vue/dialog.vue | 2 +- 6 files changed, 41 insertions(+), 28 deletions(-) delete mode 100644 webpack/init/local-channels.js diff --git a/webpack/common.js b/webpack/common.js index ba071b3..b7f73ee 100644 --- a/webpack/common.js +++ b/webpack/common.js @@ -24,7 +24,4 @@ gs.set('router', new VueRouter({ /* (2) Main components ---------------------------------------------------------*/ /* (1) Initialize channels & channel menu */ -require('./init/channels.js'); - -/* (2) Initialize local channels (for a specific channel) */ -require('./init/local-channels.js'); \ No newline at end of file +require('./init/channels.js'); \ No newline at end of file diff --git a/webpack/init/channels.js b/webpack/init/channels.js index 75f66fa..129beb7 100644 --- a/webpack/init/channels.js +++ b/webpack/init/channels.js @@ -8,10 +8,8 @@ gs.get.channel.current = null; /* (3) Initialize list */ gs.get.channel.list = [ - { id: -1, link: 'me', label: 'My data', sub: '0 online', icon: 'group' }, - { id: 0, link: 'test-1', label: 'test 1', sub: null, icon: 'test1' }, - { id: 1, link: 'test-2', label: 'test 2', sub: null, icon: 'test2' }, - { id: -2, link: null, label: 'add', sub: null, icon: 'add', add: 1 } + { id: -1, link: 'me', label: 'My data', sub: '0 online', icon: 'group', local: [] }, + { id: -2, link: null, label: 'add', sub: null, icon: 'add', local: [], add: 1 } ]; /* (4) Initialize vue-router channel navigation */ diff --git a/webpack/init/local-channels.js b/webpack/init/local-channels.js deleted file mode 100644 index d492f1d..0000000 --- a/webpack/init/local-channels.js +++ /dev/null @@ -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 - } -]); \ No newline at end of file diff --git a/webpack/main.js b/webpack/main.js index 5cd07d4..ec13772 100644 --- a/webpack/main.js +++ b/webpack/main.js @@ -24,5 +24,12 @@ new Vue({ 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 */ gs.get.channel.nav(); \ No newline at end of file diff --git a/webpack/mockup/channels.json b/webpack/mockup/channels.json index 6e11480..338b50d 100644 --- a/webpack/mockup/channels.json +++ b/webpack/mockup/channels.json @@ -2,11 +2,39 @@ { "id": 0, "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, "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 + } + ] } ] \ No newline at end of file diff --git a/webpack/vue/dialog.vue b/webpack/vue/dialog.vue index 9b94113..109ff99 100644 --- a/webpack/vue/dialog.vue +++ b/webpack/vue/dialog.vue @@ -14,7 +14,7 @@
-
+
{{ c.type }} channels