From 9d8d052d6da6b7019fe493bf1211467862531641 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Wed, 28 Mar 2018 21:51:04 +0200 Subject: [PATCH] [popup] added 'channel.remove' 'channel.remove' + fixed icons in [dialog] --- public_html/asset/svg/minipopup.invite.svg | 59 ++++++++++++++++++-- public_html/asset/svg/minipopup.leave.svg | 56 +++++++++++++++++++ public_html/asset/svg/minipopup.logout.svg | 2 +- public_html/asset/svg/minipopup.remove.svg | 63 ++++++++++++++++++++++ webpack/lib/channel-controller.js | 12 +++-- webpack/lib/content-controller.js | 4 +- webpack/lib/popup-controller.js | 13 +++++ webpack/lib/room-controller.js | 6 +-- webpack/scss/global.scss | 7 +++ webpack/vue/auth/dialog.vue | 23 +++++--- webpack/vue/auth/menu.vue | 2 +- webpack/vue/auth/wrapper.vue | 30 ++++++++++- 12 files changed, 253 insertions(+), 24 deletions(-) create mode 100644 public_html/asset/svg/minipopup.leave.svg create mode 100644 public_html/asset/svg/minipopup.remove.svg diff --git a/public_html/asset/svg/minipopup.invite.svg b/public_html/asset/svg/minipopup.invite.svg index 6e0f899..5819331 100644 --- a/public_html/asset/svg/minipopup.invite.svg +++ b/public_html/asset/svg/minipopup.invite.svg @@ -1,3 +1,56 @@ - - - \ No newline at end of file + + + + + + image/svg+xml + + + + + + + + + diff --git a/public_html/asset/svg/minipopup.leave.svg b/public_html/asset/svg/minipopup.leave.svg new file mode 100644 index 0000000..e11c7f3 --- /dev/null +++ b/public_html/asset/svg/minipopup.leave.svg @@ -0,0 +1,56 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/public_html/asset/svg/minipopup.logout.svg b/public_html/asset/svg/minipopup.logout.svg index 9e69d37..1c2e3ee 100644 --- a/public_html/asset/svg/minipopup.logout.svg +++ b/public_html/asset/svg/minipopup.logout.svg @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/public_html/asset/svg/minipopup.remove.svg b/public_html/asset/svg/minipopup.remove.svg new file mode 100644 index 0000000..56dfea0 --- /dev/null +++ b/public_html/asset/svg/minipopup.remove.svg @@ -0,0 +1,63 @@ + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/webpack/lib/channel-controller.js b/webpack/lib/channel-controller.js index e166690..8c25fbe 100644 --- a/webpack/lib/channel-controller.js +++ b/webpack/lib/channel-controller.js @@ -12,7 +12,7 @@ export default class ChannelController{ this.list = []; /* (3) Current channel buffer */ - this.buffer = {}; + this._buffer = {}; } @@ -39,10 +39,12 @@ export default class ChannelController{ this.current = channel.id; /* (4) Update buffer */ - this.buffer = {}; - for( let c in this.list ) - if( c.id === this.current ) - this.buffer = c; + this._buffer = {}; + for( let c of this.list ) + if( c.id === this.current ){ + console.warn(c); + this._buffer = c; + } /* (5) Load rooms */ gs.get.room.fetch(); diff --git a/webpack/lib/content-controller.js b/webpack/lib/content-controller.js index d064b10..d080f2e 100644 --- a/webpack/lib/content-controller.js +++ b/webpack/lib/content-controller.js @@ -11,14 +11,14 @@ export default class ContentController{ ---------------------------------------------------------*/ get cid(){ return gs.get.channel.current; } - get cbuf(){ return gs.get.channel.buffer; } + get cbuf(){ return gs.get.channel._buffer; } /* (3) Room ID binding * ---------------------------------------------------------*/ get rid(){ return gs.get.room.text.current; } - get rbuf(){ return gs.get.room.buffer.text; } + get rbuf(){ return gs.get.room._buffer.text; } get messages(){ return this.rbuf.messages; } get members(){ return this.rbuf.members; } diff --git a/webpack/lib/popup-controller.js b/webpack/lib/popup-controller.js index 1e33985..e2908f3 100644 --- a/webpack/lib/popup-controller.js +++ b/webpack/lib/popup-controller.js @@ -54,6 +54,19 @@ export default class PopupController{ reset(){ this.data.username = ''; }, submit(){ gs.get.channel.invite(this.data.username) && this.parent.hide(); } }); + /* (5) Remove channel */ + this.register('channel.remove', { + data: {}, + reset(){ }, + submit(){ gs.get.channel.remove() && this.parent.hide(); } + }); + /* (6) Leave channel */ + this.register('channel.leave', { + data: {}, + reset(){ }, + submit(){ gs.get.channel.remove() && this.parent.hide(); } + }); + } diff --git a/webpack/lib/room-controller.js b/webpack/lib/room-controller.js index de7faca..5a4e2e6 100644 --- a/webpack/lib/room-controller.js +++ b/webpack/lib/room-controller.js @@ -11,7 +11,7 @@ export default class RoomController{ this.voice = { list: [], current: null, visible: true }; /* (2) Current room buffer */ - this.buffer = { + this._buffer = { text: {}, voice: {} }; @@ -46,10 +46,10 @@ export default class RoomController{ this[type].current = room.id; /* (6) Update buffer */ - this.buffer[type] = {}; + this._buffer[type] = {}; for( let r of this[type].list ) if( r.id === this[type].current ) - this.buffer[type] = r; + this._buffer[type] = r; console.log(`[room.${type}.opened] ${room.name} (${room.id})`, room.id); diff --git a/webpack/scss/global.scss b/webpack/scss/global.scss index 53ede3d..9ff75da 100644 --- a/webpack/scss/global.scss +++ b/webpack/scss/global.scss @@ -146,6 +146,13 @@ &:hover{ background-color: darken($main, 5%);} &:active{ background-color: darken($main, 10%);} + + &.invalid{ + $main: #e65835; + background-color: $main; + &:hover{ background-color: darken($main, 5%);} + &:active{ background-color: darken($main, 10%);} + } } } diff --git a/webpack/vue/auth/dialog.vue b/webpack/vue/auth/dialog.vue index 5a78d63..3eefb55 100644 --- a/webpack/vue/auth/dialog.vue +++ b/webpack/vue/auth/dialog.vue @@ -57,7 +57,10 @@ &[data-icon='create']{ background-image: url('/asset/svg/minipopup.create.svg'); } &[data-icon='category']{ background-image: url('/asset/svg/minipopup.category.svg'); } &[data-icon='edit']{ background-image: url('/asset/svg/minipopup.edit.svg'); } + &[data-icon='remove']{ background-image: url('/asset/svg/minipopup.remove.svg'); } + &[data-icon='remove']{ background-image: url('/asset/svg/minipopup.remove.svg'); } &[data-icon='logout']{ background-image: url('/asset/svg/minipopup.logout.svg'); } + &[data-icon='leave']{ background-image: url('/asset/svg/minipopup.leave.svg'); } &:hover{ background-color: #f9f9f9; color: #737f8d; } @@ -71,7 +74,9 @@ &:hover{ color: #677bc4; } } - &.invalid:hover{ color: #e65835; } + &.invalid{ color: #e65835; } + + &.invalid-h:hover{ color: #e65835; } } @@ -88,20 +93,22 @@
-
{{ gs.auth.user.username }}
+
{{ gs.content.cbuf.label }}
- Invite people - Create channel - Create room - Change nickname - Logout + Invite people + Create channel + Remove channel + Create room + Change nickname + Leave channel + Logout
-
+
diff --git a/webpack/vue/auth/menu.vue b/webpack/vue/auth/menu.vue index 7a2cc7b..3f90b96 100644 --- a/webpack/vue/auth/menu.vue +++ b/webpack/vue/auth/menu.vue @@ -5,7 +5,7 @@