Ver código fonte

Rename side panels and implement toggle/untoggle policy

j8
yanas 8 anos atrás
pai
commit
b4c9816d9f

+ 25
- 24
css/_chat.scss Ver arquivo

@@ -1,4 +1,4 @@
1
-#chatspace * {
1
+#chat_container * {
2 2
     -webkit-user-select: text;
3 3
     user-select: text;
4 4
 }
@@ -16,8 +16,25 @@
16 16
     overflow-y: scroll;
17 17
     overflow-x: hidden;
18 18
     word-wrap: break-word;
19
+
20
+    a:link {
21
+        color: rgb(184, 184, 184);
22
+    }
23
+
24
+    a:visited {
25
+        color: white;
26
+    }
27
+
28
+    a:hover {
29
+        color: rgb(213, 213, 213);
30
+    }
31
+
32
+    a:active {
33
+        color: black;
34
+    }
19 35
 }
20
-#chatspace.is-conversation-mode #chatconversation {
36
+
37
+#chat_container.is-conversation-mode #chatconversation {
21 38
     visibility: visible;
22 39
 }
23 40
 
@@ -59,7 +76,7 @@
59 76
     box-shadow: none;
60 77
 }
61 78
 
62
-#chatspace.is-conversation-mode #usermsg {
79
+#chat_container.is-conversation-mode #usermsg {
63 80
     visibility: visible;
64 81
 }
65 82
 
@@ -74,7 +91,7 @@
74 91
     width: 95%;
75 92
 }
76 93
 
77
-#chatspace.is-conversation-mode #nickname {
94
+#chat_container.is-conversation-mode #nickname {
78 95
     visibility: hidden;
79 96
 }
80 97
 
@@ -92,19 +109,19 @@
92 109
     position: absolute;
93 110
 }
94 111
 
95
-#chatspace .username {
112
+#chat_container .username {
96 113
     float: left;
97 114
     padding-left: 5px;
98 115
     font-weight: bold;
99 116
 }
100 117
 
101
-#chatspace .timestamp {
118
+#chat_container .timestamp {
102 119
     float: right;
103 120
     padding-right: 5px;
104 121
     font-size: 11px;
105 122
 }
106 123
 
107
-#chatspace .usermessage {
124
+#chat_container .usermessage {
108 125
     padding-top: 20px;
109 126
     padding-left: 5px;
110 127
 }
@@ -165,7 +182,7 @@
165 182
     visibility: hidden;
166 183
 }
167 184
 
168
-#chatspace.is-conversation-mode #smileysarea {
185
+#chat_container.is-conversation-mode #smileysarea {
169 186
     visibility: visible;
170 187
 }
171 188
 
@@ -221,20 +238,4 @@
221 238
 
222 239
 #usermsg::-webkit-scrollbar-track-piece {
223 240
     background: #3a3a3a;
224
-}
225
-
226
-a:link {
227
-    color: rgb(184, 184, 184);
228
-}
229
-
230
-a:visited {
231
-    color: white;
232
-}
233
-
234
-a:hover {
235
-    color: rgb(213, 213, 213);
236
-}
237
-
238
-a:active {
239
-    color: black;
240 241
 }

+ 1
- 1
css/_contact_list.scss Ver arquivo

@@ -1,4 +1,4 @@
1
-#contactlist {
1
+#contacts_container {
2 2
     cursor: default;
3 3
 
4 4
     > ul#contacts {

+ 3
- 3
css/_settingsmenu.scss Ver arquivo

@@ -1,4 +1,4 @@
1
-#settingsmenu input, select {
1
+#settings_container input, select {
2 2
     margin-top: 10px;
3 3
     margin-left: 10%;
4 4
     width: 80%;
@@ -9,7 +9,7 @@
9 9
     color: #a7a7a7;
10 10
 }
11 11
 
12
-#settingsmenu .arrow-up {
12
+#settings_container .arrow-up {
13 13
     width: 0;
14 14
     height: 0;
15 15
     border-left: 5px solid transparent;
@@ -21,7 +21,7 @@
21 21
     margin-right: auto;
22 22
 }
23 23
 
24
-#settingsmenu #avatar {
24
+#settings_container #avatar {
25 25
     width: 24%;
26 26
     left: 38%;
27 27
     border-radius: 25px;

+ 33
- 92
css/_toolbars.scss Ver arquivo

@@ -43,16 +43,16 @@
43 43
     margin-right: auto;
44 44
     width: auto;
45 45
     border-radius: 4px;
46
-}
47 46
 
48
-#mainToolbar .first {
49
-    border-bottom-left-radius: 4px;
50
-    border-top-left-radius: 4px;
51
-}
47
+    .first {
48
+        border-bottom-left-radius: 4px;
49
+        border-top-left-radius: 4px;
50
+    }
52 51
 
53
-#mainToolbar .last {
54
-    border-bottom-right-radius: 4px;
55
-    border-top-right-radius: 4px;
52
+    .last {
53
+        border-bottom-right-radius: 4px;
54
+        border-top-right-radius: 4px;
55
+    }
56 56
 }
57 57
 
58 58
 #extendedToolbar {
@@ -74,7 +74,7 @@
74 74
     -webkit-transform: translateX(-100%);
75 75
 }
76 76
 
77
-#extendedToolbarPanel {
77
+#sideToolbarContainer {
78 78
     display: inline-block;
79 79
     position:absolute;
80 80
     top: 0px;
@@ -86,7 +86,7 @@
86 86
     z-index: 800;
87 87
     overflow: hidden;
88 88
 
89
-    .extendedToolbarPanel__inner {
89
+    .sideToolbarContainer__inner {
90 90
         display: none;
91 91
         width: 200px;
92 92
         color: #FFF;
@@ -109,34 +109,6 @@
109 109
     display: none;
110 110
 }
111 111
 
112
-#toolbar_button_chat,
113
-#chatBottomButton,
114
-#contactListButton,
115
-#numberOfParticipants,
116
-#toolbar_button_record {
117
-    -webkit-transition: all .5s ease-in-out;
118
-    -moz-transition: all .5s ease-in-out;
119
-    transition: all .5s ease-in-out;
120
-}
121
-
122
-/*#ffde00*/
123
-#toolbar_button_chat.active,
124
-#contactListButton.glowing,
125
-#chatBottomButton.glowing {
126
-    -webkit-text-shadow:    -1px 0 10px #21B9FC,
127
-    0 1px 10px #21B9FC,
128
-    1px 0 10px #21B9FC,
129
-    0 -1px 10px #21B9FC;
130
-    -moz-text-shadow:   1px 0 10px #21B9FC,
131
-    0 1px 10px #21B9FC,
132
-    1px 0 10px #21B9FC,
133
-    0 -1px 10px #21B9FC;
134
-    text-shadow:    -1px 0 10px #21B9FC,
135
-    0 1px 10px #21B9FC,
136
-    1px 0 10px #21B9FC,
137
-    0 -1px 10px #21B9FC;
138
-}
139
-
140 112
 #numberOfParticipants {
141 113
   position: absolute;
142 114
   top: 5px;
@@ -145,61 +117,10 @@
145 117
   font-size: 11px;
146 118
 }
147 119
 
148
-#contactListButton.active #numberOfParticipants {
149
-  color: #21B9FC;
150
-}
151
-
152 120
 #mainToolbar a.button:last-child::after {
153 121
     content: none;
154 122
 }
155 123
 
156
-#bottomToolbar {
157
-    display:block;
158
-    position: absolute;
159
-    right: 0;
160
-    margin-right: 5px;
161
-    bottom: 40px;
162
-    width: 29px;
163
-    border-radius: 1px;
164
-    color: #FFF;
165
-    background: rgba(0,0,0,0.5);
166
-    z-index: 6; /*+1 from #remoteVideos*/
167
-}
168
-
169
-.bottomToolbarButton {
170
-    display: inline-block;
171
-    position: relative;
172
-    color: #FFFFFF;
173
-    top: 0;
174
-    padding-top: 6px;
175
-    margin: 2px;
176
-    width: 25px;
177
-    height: 20px;
178
-    cursor: pointer;
179
-    font-size: 10pt;
180
-    text-align: center;
181
-    text-shadow: 0px 1px 0px rgba(255,255,255,.3), 0px -1px 0px rgba(0,0,0,.7);
182
-    z-index: 1;
183
-}
184
-
185
-.toolbar_span>span {
186
-    display: inline-block;
187
-    position: absolute;
188
-    font-size: 7pt;
189
-    color: #ffffff;
190
-    text-align:center;
191
-    cursor: pointer;
192
-}
193
-
194
-.bottomToolbar_span>span {
195
-    display: inline-block;
196
-    position: absolute;
197
-    font-size: 7pt;
198
-    color: #ffffff;
199
-    text-align: center;
200
-    cursor: pointer;
201
-}
202
-
203 124
 .button {
204 125
     display: inline-block;
205 126
     position: relative;
@@ -220,9 +141,11 @@
220 141
 }
221 142
 
222 143
 a.button:hover,
223
-a.bottomToolbarButton:hover {
144
+a.button:active,
145
+a.button.selected {
224 146
     cursor: pointer;
225
-    background: rgba(0, 0, 0, 0.8);
147
+    // sum opacity with background layer should give us 0.8
148
+    background: rgba(0, 0, 0, 0.6);
226 149
 }
227 150
 
228 151
 a.button>#avatar {
@@ -236,6 +159,9 @@ a.button>#avatar {
236 159
     margin-top: auto;
237 160
 }
238 161
 
162
+/**
163
+ * START of slide in animation for extended toolbar.
164
+ */
239 165
 @include keyframes(slideInX) {
240 166
     100% { transform: translateX(0%); }
241 167
 }
@@ -252,7 +178,13 @@ a.button>#avatar {
252 178
 .slideOutX {
253 179
   @include animation('slideOutX .5s forwards');
254 180
 }
181
+/**
182
+ * END of slide out animation for extended toolbar.
183
+ */
255 184
 
185
+/**
186
+ * START of slide in / out animation for main toolbar.
187
+ */
256 188
 @include keyframes(slideInY) {
257 189
     100% { transform: translateY(0%); }
258 190
 }
@@ -269,7 +201,13 @@ a.button>#avatar {
269 201
 .slideOutY {
270 202
     @include animation('slideOutY .5s forwards');
271 203
 }
204
+/**
205
+ * END of slide in / out animation for main toolbar.
206
+ */
272 207
 
208
+/**
209
+ * START of slide in animation for extended toolbar panel.
210
+ */
273 211
 @include keyframes(slideInExt) {
274 212
     from { width: 0%; }
275 213
     to   { width: 20%; }
@@ -286,4 +224,7 @@ a.button>#avatar {
286 224
 
287 225
 .slideOutExt {
288 226
   @include animation("slideOutExt .5s forwards");
289
-}
227
+}
228
+/**
229
+ * END of slide in animation for extended toolbar panel.
230
+ */

+ 54
- 54
index.html Ver arquivo

@@ -191,66 +191,66 @@
191 191
                 <audio id="userLeft" src="sounds/left.wav" preload="auto"></audio>
192 192
             </div>
193 193
         </div>
194
-        <div id="extendedToolbarPanel">
195
-            <div id="chatspace" class="extendedToolbarPanel__inner">
196
-            <div id="nickname">
197
-                <span data-i18n="chat.nickname.title"></span>
198
-                <form>
199
-                    <input type='text' id="nickinput" data-i18n="[placeholder]chat.nickname.popover" autofocus>
200
-                </form>
201
-            </div>
194
+        <div id="sideToolbarContainer">
195
+            <div id="chat_container" class="sideToolbarContainer__inner">
196
+                <div id="nickname">
197
+                    <span data-i18n="chat.nickname.title"></span>
198
+                    <form>
199
+                        <input type='text' id="nickinput" data-i18n="[placeholder]chat.nickname.popover" autofocus>
200
+                    </form>
201
+                </div>
202 202
 
203
-            <div id="chatconversation"></div>
204
-            <audio id="chatNotification" src="sounds/incomingMessage.wav" preload="auto"></audio>
203
+                <div id="chatconversation"></div>
204
+                <audio id="chatNotification" src="sounds/incomingMessage.wav" preload="auto"></audio>
205 205
                 <textarea id="usermsg" data-i18n="[placeholder]chat.messagebox" autofocus></textarea>
206
-            <div id="smileysarea">
207
-                <div id="smileys" id="toggle_smileys">
208
-                    <img src="images/smile.svg"/>
206
+                <div id="smileysarea">
207
+                    <div id="smileys" id="toggle_smileys">
208
+                        <img src="images/smile.svg"/>
209
+                    </div>
209 210
                 </div>
210 211
             </div>
211
-        </div>
212
-        <div id="contactlist" class="extendedToolbarPanel__inner">
213
-            <div class="title" data-i18n="contactlist"></div>
214
-            <ul id="contacts"></ul>
215
-        </div>
216
-        <div id="settingsmenu" class="extendedToolbarPanel__inner">
217
-            <div class="title" data-i18n="settings.title"></div>
218
-            <div class="arrow-up"></div>
219
-            <input type="text" id="setDisplayName" data-i18n="[placeholder]settings.name" placeholder="Name">
220
-            <input type="text" id="setEmail" placeholder="E-Mail">
221
-            <select id="languages_selectbox"></select>
222
-            <div id = "startMutedOptions">
223
-                <label class = "startMutedLabel">
224
-                    <input type="checkbox" id="startAudioMuted">
225
-                    <span  data-i18n="settings.startAudioMuted"></span>
226
-                </label>
227
-                <label class = "startMutedLabel">
228
-                    <input type="checkbox" id="startVideoMuted">
229
-                    <span data-i18n="settings.startVideoMuted"></span>
230
-                </label>
231
-            </div>
232
-            <div id="devicesOptions">
233
-                <label className="devicesOptionsLabel">
234
-                    <span data-i18n="settings.selectCamera"></span>
235
-                    <select id="selectCamera"></select>
236
-                </label>
237
-                <label className="devicesOptionsLabel">
238
-                    <span data-i18n="settings.selectMic"></span>
239
-                    <select id="selectMic"></select>
240
-                </label>
241
-                <label className="devicesOptionsLabel">
242
-                    <span data-i18n="settings.selectAudioOutput"></span>
243
-                    <select id="selectAudioOutput"></select>
244
-                </label>
212
+            <div id="contacts_container" class="sideToolbarContainer__inner">
213
+                <div class="title" data-i18n="contactlist"></div>
214
+                <ul id="contacts"></ul>
245 215
             </div>
246
-            <div id="followMeOptions">
247
-                <label class = "followMeLabel">
248
-                    <input type="checkbox" id="followMeCheckBox">
249
-                    <span  data-i18n="settings.followMe"></span>
250
-                </label>
216
+            <div id="settings_container" class="sideToolbarContainer__inner">
217
+                <div class="title" data-i18n="settings.title"></div>
218
+                <div class="arrow-up"></div>
219
+                <input type="text" id="setDisplayName" data-i18n="[placeholder]settings.name" placeholder="Name">
220
+                <input type="text" id="setEmail" placeholder="E-Mail">
221
+                <select id="languages_selectbox"></select>
222
+                <div id = "startMutedOptions">
223
+                    <label class = "startMutedLabel">
224
+                        <input type="checkbox" id="startAudioMuted">
225
+                        <span  data-i18n="settings.startAudioMuted"></span>
226
+                    </label>
227
+                    <label class = "startMutedLabel">
228
+                        <input type="checkbox" id="startVideoMuted">
229
+                        <span data-i18n="settings.startVideoMuted"></span>
230
+                    </label>
231
+                </div>
232
+                <div id="devicesOptions">
233
+                    <label className="devicesOptionsLabel">
234
+                        <span data-i18n="settings.selectCamera"></span>
235
+                        <select id="selectCamera"></select>
236
+                    </label>
237
+                    <label className="devicesOptionsLabel">
238
+                        <span data-i18n="settings.selectMic"></span>
239
+                        <select id="selectMic"></select>
240
+                    </label>
241
+                    <label className="devicesOptionsLabel">
242
+                        <span data-i18n="settings.selectAudioOutput"></span>
243
+                        <select id="selectAudioOutput"></select>
244
+                    </label>
245
+                </div>
246
+                <div id="followMeOptions">
247
+                    <label class = "followMeLabel">
248
+                        <input type="checkbox" id="followMeCheckBox">
249
+                        <span  data-i18n="settings.followMe"></span>
250
+                    </label>
251
+                </div>
252
+                <a id="downloadlog" data-container="body" data-toggle="popover" data-placement="right" data-i18n="[data-content]downloadlogs" ><i class="fa fa-cloud-download"></i></a>
251 253
             </div>
252
-            <a id="downloadlog" data-container="body" data-toggle="popover" data-placement="right" data-i18n="[data-content]downloadlogs" ><i class="fa fa-cloud-download"></i></a>
253
-        </div>
254 254
         </div>
255 255
     </div>
256 256
     <div id="keyboard-shortcuts" class="keyboard-shortcuts" style="display:none;">

+ 6
- 6
modules/UI/UI.js Ver arquivo

@@ -7,7 +7,7 @@ import Toolbar from "./toolbars/Toolbar";
7 7
 import ToolbarToggler from "./toolbars/ToolbarToggler";
8 8
 import ContactList from "./side_pannels/contactlist/ContactList";
9 9
 import Avatar from "./avatar/Avatar";
10
-import ExtendedToolbarToggler from "./side_pannels/ExtendedToolbarToggler";
10
+import SideContainerToggler from "./side_pannels/SideContainerToggler";
11 11
 import UIUtil from "./util/UIUtil";
12 12
 import UIEvents from "../../service/UI/UIEvents";
13 13
 import CQEvents from '../../service/connectionquality/CQEvents';
@@ -360,7 +360,7 @@ function registerListeners() {
360 360
     UI.addListener(UIEvents.TOGGLE_CHAT, UI.toggleChat);
361 361
 
362 362
     UI.addListener(UIEvents.TOGGLE_SETTINGS, function () {
363
-        ExtendedToolbarToggler.toggle("settingsmenu");
363
+        SideContainerToggler.toggle("settings_container");
364 364
     });
365 365
 
366 366
     UI.addListener(UIEvents.TOGGLE_CONTACT_LIST, UI.toggleContactList);
@@ -378,7 +378,7 @@ function registerListeners() {
378 378
  */
379 379
 function bindEvents() {
380 380
     function onResize() {
381
-        ExtendedToolbarToggler.resize();
381
+        SideContainerToggler.resize();
382 382
     }
383 383
 
384 384
     // Resize and reposition videos in full screen mode.
@@ -427,7 +427,7 @@ UI.start = function () {
427 427
     registerListeners();
428 428
 
429 429
     ToolbarToggler.init();
430
-    ExtendedToolbarToggler.init();
430
+    SideContainerToggler.init(eventEmitter);
431 431
     FilmStrip.init(eventEmitter);
432 432
 
433 433
     VideoLayout.init(eventEmitter);
@@ -716,14 +716,14 @@ UI.isFilmStripVisible = function () {
716 716
  * Toggles chat panel.
717 717
  */
718 718
 UI.toggleChat = function () {
719
-    ExtendedToolbarToggler.toggle("chatspace");
719
+    SideContainerToggler.toggle("chat_container");
720 720
 };
721 721
 
722 722
 /**
723 723
  * Toggles contact list panel.
724 724
  */
725 725
 UI.toggleContactList = function () {
726
-    ExtendedToolbarToggler.toggle("contactlist");
726
+    SideContainerToggler.toggle("contacts_container");
727 727
 };
728 728
 
729 729
 /**

+ 0
- 70
modules/UI/side_pannels/ExtendedToolbarToggler.js Ver arquivo

@@ -1,70 +0,0 @@
1
-/* global $ */
2
-
3
-const ExtendedToolbarToggler = {
4
-    init() {
5
-        document.getElementById("extendedToolbarPanel")
6
-            .addEventListener("animationend", function(e) {
7
-                console.log("ANIM NAME", e.animationName);
8
-                if(e.animationName === "slideOutExt")
9
-                    $("#extendedToolbarPanel").children().each(function() {
10
-                        if ($(this).hasClass("show"))
11
-                            $(this).removeClass("show").addClass("hide");
12
-                    });
13
-            }, false);
14
-    },
15
-
16
-    toggle(elementId) {
17
-        let elementSelector = $(`#${elementId}`);
18
-        let isSelectorVisible = elementSelector.hasClass("show");
19
-
20
-        if (isSelectorVisible) {
21
-            this.hide();
22
-        }
23
-        else {
24
-            if (this.isVisible())
25
-                $("#extendedToolbarPanel").children().each(function() {
26
-                    if ($(this).id !== elementId && $(this).hasClass("show"))
27
-                        $(this).removeClass("show").addClass("hide");
28
-                });
29
-
30
-            if (!this.isVisible())
31
-                this.show();
32
-
33
-            elementSelector.removeClass("hide").addClass("show");
34
-        }
35
-    },
36
-
37
-    /**
38
-     * Returns true if this toolbar is currently visible, or false otherwise.
39
-     * @return <tt>true</tt> if currently visible, <tt>false</tt> - otherwise
40
-     */
41
-    isVisible() {
42
-        return $("#extendedToolbarPanel").hasClass("slideInExt");
43
-    },
44
-
45
-    /**
46
-     * Hides the toolbar with animation or not depending on the animate
47
-     * parameter.
48
-     */
49
-    hide(elementId) {
50
-        $("#extendedToolbarPanel")
51
-            .removeClass("slideInExt").addClass("slideOutExt");
52
-    },
53
-
54
-    /**
55
-     * Shows the toolbar with animation or not depending on the animate
56
-     * parameter.
57
-     */
58
-    show(elementId) {
59
-        if (!this.isVisible())
60
-            $("#extendedToolbarPanel")
61
-                .removeClass("slideOutExt").addClass("slideInExt");
62
-    },
63
-
64
-    resize () {
65
-        //let [width, height] = UIUtil.getSidePanelSize();
66
-        //Chat.resizeChat(width, height);
67
-    }
68
-};
69
-
70
-export default ExtendedToolbarToggler;

+ 107
- 0
modules/UI/side_pannels/SideContainerToggler.js Ver arquivo

@@ -0,0 +1,107 @@
1
+/* global $ */
2
+import UIEvents from "../../../service/UI/UIEvents";
3
+
4
+/**
5
+ * Handles open and close of the extended toolbar side panel
6
+ * (chat, settings, etc.).
7
+ *
8
+ * @type {{init, toggle, isVisible, hide, show, resize}}
9
+ */
10
+const SideContainerToggler = {
11
+    /**
12
+     * Initialises this toggler by registering the listeners.
13
+     *
14
+     * @param eventEmitter
15
+     */
16
+    init(eventEmitter) {
17
+        this.eventEmitter = eventEmitter;
18
+
19
+        // Adds a listener for the animation end event that would take care
20
+        // of hiding all internal containers when the extendedToolbarPanel is
21
+        // closed.
22
+        document.getElementById("sideToolbarContainer")
23
+            .addEventListener("animationend", function(e) {
24
+                if(e.animationName === "slideOutExt")
25
+                    $("#sideToolbarContainer").children().each(function() {
26
+                        if ($(this).hasClass("show"))
27
+                            SideContainerToggler.hideInnerContainer($(this));
28
+                    });
29
+            }, false);
30
+    },
31
+
32
+    /**
33
+     * Toggles the container with the given element id.
34
+     *
35
+     * @param {String} elementId the identifier of the container element to
36
+     * toggle
37
+     */
38
+    toggle(elementId) {
39
+        let elementSelector = $(`#${elementId}`);
40
+        let isSelectorVisible = elementSelector.hasClass("show");
41
+
42
+        if (isSelectorVisible) {
43
+            this.hide();
44
+        }
45
+        else {
46
+            if (this.isVisible())
47
+                $("#sideToolbarContainer").children().each(function() {
48
+                    if ($(this).id !== elementId && $(this).hasClass("show"))
49
+                        SideContainerToggler.hideInnerContainer($(this));
50
+                });
51
+
52
+            if (!this.isVisible())
53
+                this.show();
54
+
55
+            this.showInnerContainer(elementSelector);
56
+        }
57
+    },
58
+
59
+    /**
60
+     * Returns {true} if the extended toolbar panel is currently visible,
61
+     * otherwise returns {false}.
62
+     */
63
+    isVisible() {
64
+        return $("#sideToolbarContainer").hasClass("slideInExt");
65
+    },
66
+
67
+    /**
68
+     * Hides the extended toolbar panel with a slide out animation.
69
+     */
70
+    hide() {
71
+        $("#sideToolbarContainer")
72
+            .removeClass("slideInExt").addClass("slideOutExt");
73
+    },
74
+
75
+    /**
76
+     * Shows the extended toolbar panel with a slide in animation.
77
+     */
78
+    show() {
79
+        if (!this.isVisible())
80
+            $("#sideToolbarContainer")
81
+                .removeClass("slideOutExt").addClass("slideInExt");
82
+    },
83
+
84
+    hideInnerContainer(containerSelector) {
85
+        containerSelector.removeClass("show").addClass("hide");
86
+
87
+        this.eventEmitter.emit(UIEvents.SIDE_TOOLBAR_CONTAINER_TOGGLED,
88
+            containerSelector.attr('id'), false);
89
+    },
90
+
91
+    showInnerContainer(containerSelector) {
92
+        containerSelector.removeClass("hide").addClass("show");
93
+
94
+        this.eventEmitter.emit(UIEvents.SIDE_TOOLBAR_CONTAINER_TOGGLED,
95
+            containerSelector.attr('id'), true);
96
+    },
97
+
98
+    /**
99
+     * TO FIX: do we need to resize the chat?
100
+     */
101
+    resize () {
102
+        //let [width, height] = UIUtil.getSidePanelSize();
103
+        //Chat.resizeChat(width, height);
104
+    }
105
+};
106
+
107
+export default SideContainerToggler;

+ 8
- 6
modules/UI/side_pannels/chat/Chat.js Ver arquivo

@@ -123,7 +123,7 @@ function addSmileys() {
123 123
         smileysContainer.appendChild(smileyContainer);
124 124
     }
125 125
 
126
-    $("#chatspace").append(smileysContainer);
126
+    $("#chat_container").append(smileysContainer);
127 127
 }
128 128
 
129 129
 /**
@@ -131,7 +131,7 @@ function addSmileys() {
131 131
  */
132 132
 function resizeChatConversation() {
133 133
     var msgareaHeight = $('#usermsg').outerHeight();
134
-    var chatspace = $('#chatspace');
134
+    var chatspace = $('#chat_container');
135 135
     var width = chatspace.width();
136 136
     var chat = $('#chatconversation');
137 137
     var smileys = $('#smileysarea');
@@ -187,7 +187,7 @@ var Chat = {
187 187
         };
188 188
         usermsg.autosize({callback: onTextAreaResize});
189 189
 
190
-        $("#chatspace").bind("shown",
190
+        $("#chat_container").bind("shown",
191 191
             function () {
192 192
                 unreadMessages = 0;
193 193
                 setVisualNotification(false);
@@ -275,7 +275,8 @@ var Chat = {
275 275
      * conversation mode or not.
276 276
      */
277 277
     setChatConversationMode (isConversationMode) {
278
-        $('#chatspace').toggleClass('is-conversation-mode', isConversationMode);
278
+        $('#chat_container')
279
+            .toggleClass('is-conversation-mode', isConversationMode);
279 280
         if (isConversationMode) {
280 281
             $('#usermsg').focus();
281 282
         }
@@ -285,7 +286,7 @@ var Chat = {
285 286
      * Resizes the chat area.
286 287
      */
287 288
     resizeChat (width, height) {
288
-        $('#chatspace').width(width).height(height);
289
+        $('#chat_container').width(width).height(height);
289 290
 
290 291
         resizeChatConversation();
291 292
     },
@@ -294,7 +295,8 @@ var Chat = {
294 295
      * Indicates if the chat is currently visible.
295 296
      */
296 297
     isVisible () {
297
-        return UIUtil.isVisible(document.getElementById("chatspace"));
298
+        return UIUtil.isVisible(
299
+            document.getElementById("chat_container"));
298 300
     },
299 301
     /**
300 302
      * Shows and hides the window with the smileys

+ 1
- 22
modules/UI/side_pannels/contactlist/ContactList.js Ver arquivo

@@ -23,11 +23,7 @@ function updateNumberOfParticipants(delta) {
23 23
     let buttonIndicatorText = (numberOfContacts === 1) ? '' : numberOfContacts;
24 24
     $("#numberOfParticipants").text(buttonIndicatorText);
25 25
 
26
-    let showVisualNotification
27
-        = (numberOfContacts === 1) ? false : !ContactList.isVisible();
28
-    ContactList.setVisualNotification(showVisualNotification);
29
-
30
-    $("#contactlist>div.title").text(
26
+    $("#contacts_container>div.title").text(
31 27
         APP.translation.translateString(
32 28
             "contactlist", {participants: numberOfContacts}
33 29
         ));
@@ -138,23 +134,6 @@ var ContactList = {
138 134
         }
139 135
     },
140 136
 
141
-    setVisualNotification (show, stopGlowingIn) {
142
-        let glower = $('#contactListButton');
143
-
144
-        if (show && !notificationInterval) {
145
-            notificationInterval = window.setInterval(function () {
146
-                glower.toggleClass('active glowing');
147
-            }, 800);
148
-        } else if (!show && notificationInterval) {
149
-            stopGlowing(glower);
150
-        }
151
-        if (stopGlowingIn) {
152
-            setTimeout(function () {
153
-                stopGlowing(glower);
154
-            }, stopGlowingIn);
155
-        }
156
-    },
157
-
158 137
     setClickable (id, isClickable) {
159 138
         getContactEl(id).toggleClass('clickable', isClickable);
160 139
     },

+ 2
- 2
modules/UI/side_pannels/settings/SettingsMenu.js Ver arquivo

@@ -191,7 +191,7 @@ export default {
191 191
      * @returns {boolean}
192 192
      */
193 193
     isVisible () {
194
-        return UIUtil.isVisible(document.getElementById("settingsmenu"));
194
+        return UIUtil.isVisible(document.getElementById("settings_container"));
195 195
     },
196 196
 
197 197
     /**
@@ -290,6 +290,6 @@ export default {
290 290
 
291 291
         $('#devicesOptions').show();
292 292
 
293
-        APP.translation.translateElement($('#settingsmenu option'));
293
+        APP.translation.translateElement($('#settings_container option'));
294 294
     }
295 295
 };

+ 34
- 5
modules/UI/toolbars/Toolbar.js Ver arquivo

@@ -2,7 +2,7 @@
2 2
 /* jshint -W101 */
3 3
 import UIUtil from '../util/UIUtil';
4 4
 import UIEvents from '../../../service/UI/UIEvents';
5
-import ExtendedToolbarToggler from "../side_pannels/ExtendedToolbarToggler.js";
5
+import SideContainerToggler from "../side_pannels/SideContainerToggler";
6 6
 
7 7
 let roomUrl = null;
8 8
 let emitter = null;
@@ -208,10 +208,12 @@ const defaultToolbarButtons = {
208 208
             JitsiMeetJS.analytics.sendEvent('shortcut.chat.toggled');
209 209
             APP.UI.toggleChat();
210 210
         },
211
-        shortcutDescription: "keyboardShortcuts.toggleChat"
211
+        shortcutDescription: "keyboardShortcuts.toggleChat",
212
+        sideContainerId: "chat_container"
212 213
     },
213 214
     'contacts': {
214
-        id: '#toolbar_contact_list'
215
+        id: '#toolbar_contact_list',
216
+        sideContainerId: "contacts_container"
215 217
     },
216 218
     'etherpad': {
217 219
         id: '#toolbar_button_etherpad'
@@ -220,7 +222,8 @@ const defaultToolbarButtons = {
220 222
         id: '#toolbar_button_fullScreen'
221 223
     },
222 224
     'settings': {
223
-        id: '#toolbar_button_settings'
225
+        id: '#toolbar_button_settings',
226
+        sideContainerId: "settings_container"
224 227
     },
225 228
     'hangup': {
226 229
         id: '#toolbar_button_hangup'
@@ -292,6 +295,13 @@ const Toolbar = {
292 295
                 !$(this).prop('disabled') && buttonHandlers[buttonId](event);
293 296
             })
294 297
         );
298
+
299
+        APP.UI.addListener(UIEvents.SIDE_TOOLBAR_CONTAINER_TOGGLED,
300
+            function(containerId, isVisible) {
301
+                console.log("TOGGLED", containerId, isVisible);
302
+                Toolbar.handleSideToolbarContainerToggled(  containerId,
303
+                                                            isVisible);
304
+            });
295 305
     },
296 306
     /**
297 307
      * Enables / disables the toolbar.
@@ -534,7 +544,7 @@ const Toolbar = {
534 544
             return true;
535 545
         if ($("#bottomToolbar:hover").length > 0
536 546
             || $("#extendedToolbar:hover").length > 0
537
-            || ExtendedToolbarToggler.isVisible()) {
547
+            || SideContainerToggler.isVisible()) {
538 548
             return true;
539 549
         }
540 550
         return false;
@@ -571,6 +581,25 @@ const Toolbar = {
571 581
 
572 582
         this.toolbarSelector.toggleClass("slideInY");
573 583
         this.extendedToolbarSelector.toggleClass("slideInX");
584
+    },
585
+
586
+    /**
587
+     *
588
+     */
589
+    handleSideToolbarContainerToggled(containerId, isVisible) {
590
+        Object.keys(defaultToolbarButtons).forEach(
591
+            id => {
592
+                if (!UIUtil.isButtonEnabled(id))
593
+                    return;
594
+
595
+                var button = defaultToolbarButtons[id];
596
+
597
+                if (button.sideContainerId
598
+                    && button.sideContainerId === containerId) {
599
+                    UIUtil.buttonClick(button.id, "selected");
600
+                }
601
+            }
602
+        );
574 603
     }
575 604
 };
576 605
 

+ 13
- 1
service/UI/UIEvents.js Ver arquivo

@@ -68,26 +68,38 @@ export default {
68 68
     VIDEO_DEVICE_CHANGED: "UI.video_device_changed",
69 69
     AUDIO_DEVICE_CHANGED: "UI.audio_device_changed",
70 70
     AUDIO_OUTPUT_DEVICE_CHANGED: "UI.audio_output_device_changed",
71
+
71 72
     /**
72 73
      * Notifies interested listeners that the follow-me feature is enabled or
73 74
      * disabled.
74 75
      */
75 76
     FOLLOW_ME_ENABLED: "UI.follow_me_enabled",
77
+
76 78
     /**
77 79
      * Notifies that flipX property of the local video is changed.
78 80
      */
79 81
     LOCAL_FLIPX_CHANGED: "UI.local_flipx_changed",
82
+
80 83
     // An event which indicates that the resolution of a remote video has
81 84
     // changed.
82 85
     RESOLUTION_CHANGED: "UI.resolution_changed",
86
+
83 87
     /**
84 88
      * Notifies that the button "Go to webstore" is pressed on the dialog for
85 89
      * external extension installation.
86 90
      */
87 91
     OPEN_EXTENSION_STORE: "UI.open_extension_store",
92
+
88 93
     /**
89 94
      * Notifies that the button "Cancel" is pressed on the dialog for
90 95
      * external extension installation.
91 96
      */
92
-    EXTERNAL_INSTALLATION_CANCELED: "UI.external_installation_canceled"
97
+    EXTERNAL_INSTALLATION_CANCELED: "UI.external_installation_canceled",
98
+
99
+    /**
100
+     * Notifies that the side toolbar container has been toggled. The actual
101
+     * event must contain the identifier of the container that has been toggled
102
+     * and information about toggle on or off.
103
+     */
104
+    SIDE_TOOLBAR_CONTAINER_TOGGLED: "UI.side_container_toggled"
93 105
 };

Carregando…
Cancelar
Salvar