Browse Source

Rename side panels and implement toggle/untoggle policy

j8
yanas 8 years ago
parent
commit
b4c9816d9f

+ 25
- 24
css/_chat.scss View File

1
-#chatspace * {
1
+#chat_container * {
2
     -webkit-user-select: text;
2
     -webkit-user-select: text;
3
     user-select: text;
3
     user-select: text;
4
 }
4
 }
16
     overflow-y: scroll;
16
     overflow-y: scroll;
17
     overflow-x: hidden;
17
     overflow-x: hidden;
18
     word-wrap: break-word;
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
     visibility: visible;
38
     visibility: visible;
22
 }
39
 }
23
 
40
 
59
     box-shadow: none;
76
     box-shadow: none;
60
 }
77
 }
61
 
78
 
62
-#chatspace.is-conversation-mode #usermsg {
79
+#chat_container.is-conversation-mode #usermsg {
63
     visibility: visible;
80
     visibility: visible;
64
 }
81
 }
65
 
82
 
74
     width: 95%;
91
     width: 95%;
75
 }
92
 }
76
 
93
 
77
-#chatspace.is-conversation-mode #nickname {
94
+#chat_container.is-conversation-mode #nickname {
78
     visibility: hidden;
95
     visibility: hidden;
79
 }
96
 }
80
 
97
 
92
     position: absolute;
109
     position: absolute;
93
 }
110
 }
94
 
111
 
95
-#chatspace .username {
112
+#chat_container .username {
96
     float: left;
113
     float: left;
97
     padding-left: 5px;
114
     padding-left: 5px;
98
     font-weight: bold;
115
     font-weight: bold;
99
 }
116
 }
100
 
117
 
101
-#chatspace .timestamp {
118
+#chat_container .timestamp {
102
     float: right;
119
     float: right;
103
     padding-right: 5px;
120
     padding-right: 5px;
104
     font-size: 11px;
121
     font-size: 11px;
105
 }
122
 }
106
 
123
 
107
-#chatspace .usermessage {
124
+#chat_container .usermessage {
108
     padding-top: 20px;
125
     padding-top: 20px;
109
     padding-left: 5px;
126
     padding-left: 5px;
110
 }
127
 }
165
     visibility: hidden;
182
     visibility: hidden;
166
 }
183
 }
167
 
184
 
168
-#chatspace.is-conversation-mode #smileysarea {
185
+#chat_container.is-conversation-mode #smileysarea {
169
     visibility: visible;
186
     visibility: visible;
170
 }
187
 }
171
 
188
 
221
 
238
 
222
 #usermsg::-webkit-scrollbar-track-piece {
239
 #usermsg::-webkit-scrollbar-track-piece {
223
     background: #3a3a3a;
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 View File

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

+ 3
- 3
css/_settingsmenu.scss View File

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

+ 33
- 92
css/_toolbars.scss View File

43
     margin-right: auto;
43
     margin-right: auto;
44
     width: auto;
44
     width: auto;
45
     border-radius: 4px;
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
 #extendedToolbar {
58
 #extendedToolbar {
74
     -webkit-transform: translateX(-100%);
74
     -webkit-transform: translateX(-100%);
75
 }
75
 }
76
 
76
 
77
-#extendedToolbarPanel {
77
+#sideToolbarContainer {
78
     display: inline-block;
78
     display: inline-block;
79
     position:absolute;
79
     position:absolute;
80
     top: 0px;
80
     top: 0px;
86
     z-index: 800;
86
     z-index: 800;
87
     overflow: hidden;
87
     overflow: hidden;
88
 
88
 
89
-    .extendedToolbarPanel__inner {
89
+    .sideToolbarContainer__inner {
90
         display: none;
90
         display: none;
91
         width: 200px;
91
         width: 200px;
92
         color: #FFF;
92
         color: #FFF;
109
     display: none;
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
 #numberOfParticipants {
112
 #numberOfParticipants {
141
   position: absolute;
113
   position: absolute;
142
   top: 5px;
114
   top: 5px;
145
   font-size: 11px;
117
   font-size: 11px;
146
 }
118
 }
147
 
119
 
148
-#contactListButton.active #numberOfParticipants {
149
-  color: #21B9FC;
150
-}
151
-
152
 #mainToolbar a.button:last-child::after {
120
 #mainToolbar a.button:last-child::after {
153
     content: none;
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
 .button {
124
 .button {
204
     display: inline-block;
125
     display: inline-block;
205
     position: relative;
126
     position: relative;
220
 }
141
 }
221
 
142
 
222
 a.button:hover,
143
 a.button:hover,
223
-a.bottomToolbarButton:hover {
144
+a.button:active,
145
+a.button.selected {
224
     cursor: pointer;
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
 a.button>#avatar {
151
 a.button>#avatar {
236
     margin-top: auto;
159
     margin-top: auto;
237
 }
160
 }
238
 
161
 
162
+/**
163
+ * START of slide in animation for extended toolbar.
164
+ */
239
 @include keyframes(slideInX) {
165
 @include keyframes(slideInX) {
240
     100% { transform: translateX(0%); }
166
     100% { transform: translateX(0%); }
241
 }
167
 }
252
 .slideOutX {
178
 .slideOutX {
253
   @include animation('slideOutX .5s forwards');
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
 @include keyframes(slideInY) {
188
 @include keyframes(slideInY) {
257
     100% { transform: translateY(0%); }
189
     100% { transform: translateY(0%); }
258
 }
190
 }
269
 .slideOutY {
201
 .slideOutY {
270
     @include animation('slideOutY .5s forwards');
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
 @include keyframes(slideInExt) {
211
 @include keyframes(slideInExt) {
274
     from { width: 0%; }
212
     from { width: 0%; }
275
     to   { width: 20%; }
213
     to   { width: 20%; }
286
 
224
 
287
 .slideOutExt {
225
 .slideOutExt {
288
   @include animation("slideOutExt .5s forwards");
226
   @include animation("slideOutExt .5s forwards");
289
-}
227
+}
228
+/**
229
+ * END of slide in animation for extended toolbar panel.
230
+ */

+ 54
- 54
index.html View File

191
                 <audio id="userLeft" src="sounds/left.wav" preload="auto"></audio>
191
                 <audio id="userLeft" src="sounds/left.wav" preload="auto"></audio>
192
             </div>
192
             </div>
193
         </div>
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
                 <textarea id="usermsg" data-i18n="[placeholder]chat.messagebox" autofocus></textarea>
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
                 </div>
210
                 </div>
210
             </div>
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
             </div>
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
             </div>
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
         </div>
254
         </div>
255
     </div>
255
     </div>
256
     <div id="keyboard-shortcuts" class="keyboard-shortcuts" style="display:none;">
256
     <div id="keyboard-shortcuts" class="keyboard-shortcuts" style="display:none;">

+ 6
- 6
modules/UI/UI.js View File

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

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 View File

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 View File

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

+ 1
- 22
modules/UI/side_pannels/contactlist/ContactList.js View File

23
     let buttonIndicatorText = (numberOfContacts === 1) ? '' : numberOfContacts;
23
     let buttonIndicatorText = (numberOfContacts === 1) ? '' : numberOfContacts;
24
     $("#numberOfParticipants").text(buttonIndicatorText);
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
         APP.translation.translateString(
27
         APP.translation.translateString(
32
             "contactlist", {participants: numberOfContacts}
28
             "contactlist", {participants: numberOfContacts}
33
         ));
29
         ));
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
     setClickable (id, isClickable) {
137
     setClickable (id, isClickable) {
159
         getContactEl(id).toggleClass('clickable', isClickable);
138
         getContactEl(id).toggleClass('clickable', isClickable);
160
     },
139
     },

+ 2
- 2
modules/UI/side_pannels/settings/SettingsMenu.js View File

191
      * @returns {boolean}
191
      * @returns {boolean}
192
      */
192
      */
193
     isVisible () {
193
     isVisible () {
194
-        return UIUtil.isVisible(document.getElementById("settingsmenu"));
194
+        return UIUtil.isVisible(document.getElementById("settings_container"));
195
     },
195
     },
196
 
196
 
197
     /**
197
     /**
290
 
290
 
291
         $('#devicesOptions').show();
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 View File

2
 /* jshint -W101 */
2
 /* jshint -W101 */
3
 import UIUtil from '../util/UIUtil';
3
 import UIUtil from '../util/UIUtil';
4
 import UIEvents from '../../../service/UI/UIEvents';
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
 let roomUrl = null;
7
 let roomUrl = null;
8
 let emitter = null;
8
 let emitter = null;
208
             JitsiMeetJS.analytics.sendEvent('shortcut.chat.toggled');
208
             JitsiMeetJS.analytics.sendEvent('shortcut.chat.toggled');
209
             APP.UI.toggleChat();
209
             APP.UI.toggleChat();
210
         },
210
         },
211
-        shortcutDescription: "keyboardShortcuts.toggleChat"
211
+        shortcutDescription: "keyboardShortcuts.toggleChat",
212
+        sideContainerId: "chat_container"
212
     },
213
     },
213
     'contacts': {
214
     'contacts': {
214
-        id: '#toolbar_contact_list'
215
+        id: '#toolbar_contact_list',
216
+        sideContainerId: "contacts_container"
215
     },
217
     },
216
     'etherpad': {
218
     'etherpad': {
217
         id: '#toolbar_button_etherpad'
219
         id: '#toolbar_button_etherpad'
220
         id: '#toolbar_button_fullScreen'
222
         id: '#toolbar_button_fullScreen'
221
     },
223
     },
222
     'settings': {
224
     'settings': {
223
-        id: '#toolbar_button_settings'
225
+        id: '#toolbar_button_settings',
226
+        sideContainerId: "settings_container"
224
     },
227
     },
225
     'hangup': {
228
     'hangup': {
226
         id: '#toolbar_button_hangup'
229
         id: '#toolbar_button_hangup'
292
                 !$(this).prop('disabled') && buttonHandlers[buttonId](event);
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
      * Enables / disables the toolbar.
307
      * Enables / disables the toolbar.
534
             return true;
544
             return true;
535
         if ($("#bottomToolbar:hover").length > 0
545
         if ($("#bottomToolbar:hover").length > 0
536
             || $("#extendedToolbar:hover").length > 0
546
             || $("#extendedToolbar:hover").length > 0
537
-            || ExtendedToolbarToggler.isVisible()) {
547
+            || SideContainerToggler.isVisible()) {
538
             return true;
548
             return true;
539
         }
549
         }
540
         return false;
550
         return false;
571
 
581
 
572
         this.toolbarSelector.toggleClass("slideInY");
582
         this.toolbarSelector.toggleClass("slideInY");
573
         this.extendedToolbarSelector.toggleClass("slideInX");
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 View File

68
     VIDEO_DEVICE_CHANGED: "UI.video_device_changed",
68
     VIDEO_DEVICE_CHANGED: "UI.video_device_changed",
69
     AUDIO_DEVICE_CHANGED: "UI.audio_device_changed",
69
     AUDIO_DEVICE_CHANGED: "UI.audio_device_changed",
70
     AUDIO_OUTPUT_DEVICE_CHANGED: "UI.audio_output_device_changed",
70
     AUDIO_OUTPUT_DEVICE_CHANGED: "UI.audio_output_device_changed",
71
+
71
     /**
72
     /**
72
      * Notifies interested listeners that the follow-me feature is enabled or
73
      * Notifies interested listeners that the follow-me feature is enabled or
73
      * disabled.
74
      * disabled.
74
      */
75
      */
75
     FOLLOW_ME_ENABLED: "UI.follow_me_enabled",
76
     FOLLOW_ME_ENABLED: "UI.follow_me_enabled",
77
+
76
     /**
78
     /**
77
      * Notifies that flipX property of the local video is changed.
79
      * Notifies that flipX property of the local video is changed.
78
      */
80
      */
79
     LOCAL_FLIPX_CHANGED: "UI.local_flipx_changed",
81
     LOCAL_FLIPX_CHANGED: "UI.local_flipx_changed",
82
+
80
     // An event which indicates that the resolution of a remote video has
83
     // An event which indicates that the resolution of a remote video has
81
     // changed.
84
     // changed.
82
     RESOLUTION_CHANGED: "UI.resolution_changed",
85
     RESOLUTION_CHANGED: "UI.resolution_changed",
86
+
83
     /**
87
     /**
84
      * Notifies that the button "Go to webstore" is pressed on the dialog for
88
      * Notifies that the button "Go to webstore" is pressed on the dialog for
85
      * external extension installation.
89
      * external extension installation.
86
      */
90
      */
87
     OPEN_EXTENSION_STORE: "UI.open_extension_store",
91
     OPEN_EXTENSION_STORE: "UI.open_extension_store",
92
+
88
     /**
93
     /**
89
      * Notifies that the button "Cancel" is pressed on the dialog for
94
      * Notifies that the button "Cancel" is pressed on the dialog for
90
      * external extension installation.
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
 };

Loading…
Cancel
Save