Browse Source

Remove bottom toolbar and change side panel position and behavior

j8
yanas 8 years ago
parent
commit
8562d3d55d

+ 13
- 24
modules/UI/UI.js View File

@@ -5,10 +5,9 @@ var UI = {};
5 5
 import Chat from "./side_pannels/chat/Chat";
6 6
 import Toolbar from "./toolbars/Toolbar";
7 7
 import ToolbarToggler from "./toolbars/ToolbarToggler";
8
-import BottomToolbar from "./toolbars/BottomToolbar";
9 8
 import ContactList from "./side_pannels/contactlist/ContactList";
10 9
 import Avatar from "./avatar/Avatar";
11
-import PanelToggler from "./side_pannels/SidePanelToggler";
10
+import ExtendedToolbarToggler from "./side_pannels/ExtendedToolbarToggler";
12 11
 import UIUtil from "./util/UIUtil";
13 12
 import UIEvents from "../../service/UI/UIEvents";
14 13
 import CQEvents from '../../service/connectionquality/CQEvents';
@@ -134,7 +133,6 @@ function setupChat() {
134 133
  */
135 134
 function setupToolbars() {
136 135
     Toolbar.init(eventEmitter);
137
-    BottomToolbar.setupListeners(eventEmitter);
138 136
 }
139 137
 
140 138
 /**
@@ -299,7 +297,7 @@ UI.initConference = function () {
299 297
     //if local role changes buttons state will be again updated
300 298
     UI.updateLocalRole(false);
301 299
 
302
-    ToolbarToggler.showToolbar();
300
+    UI.showToolbar();
303 301
 
304 302
     let displayName = config.displayJids ? id : Settings.getDisplayName();
305 303
 
@@ -337,7 +335,7 @@ UI.mucJoined = function () {
337 335
  */
338 336
 UI.handleToggleFilmStrip = () => {
339 337
     UI.toggleFilmStrip();
340
-    VideoLayout.resizeVideoArea(PanelToggler.isVisible(), true, false);
338
+    VideoLayout.resizeVideoArea(true, false);
341 339
 };
342 340
 
343 341
 /**
@@ -362,7 +360,7 @@ function registerListeners() {
362 360
     UI.addListener(UIEvents.TOGGLE_CHAT, UI.toggleChat);
363 361
 
364 362
     UI.addListener(UIEvents.TOGGLE_SETTINGS, function () {
365
-        PanelToggler.toggleSettingsMenu();
363
+        ExtendedToolbarToggler.toggle("settingsmenu");
366 364
     });
367 365
 
368 366
     UI.addListener(UIEvents.TOGGLE_CONTACT_LIST, UI.toggleContactList);
@@ -380,8 +378,7 @@ function registerListeners() {
380 378
  */
381 379
 function bindEvents() {
382 380
     function onResize() {
383
-        PanelToggler.resizeChat();
384
-        VideoLayout.resizeVideoArea(PanelToggler.isVisible());
381
+        ExtendedToolbarToggler.resize();
385 382
     }
386 383
 
387 384
     // Resize and reposition videos in full screen mode.
@@ -430,22 +427,22 @@ UI.start = function () {
430 427
     registerListeners();
431 428
 
432 429
     ToolbarToggler.init();
433
-    BottomToolbar.init();
430
+    ExtendedToolbarToggler.init();
434 431
     FilmStrip.init(eventEmitter);
435 432
 
436 433
     VideoLayout.init(eventEmitter);
437 434
     if (!interfaceConfig.filmStripOnly) {
438
-        VideoLayout.initLargeVideo(PanelToggler.isVisible());
435
+        VideoLayout.initLargeVideo();
439 436
     }
440
-    VideoLayout.resizeVideoArea(PanelToggler.isVisible(), true, true);
437
+    VideoLayout.resizeVideoArea(true, true);
441 438
 
442 439
     ContactList.init(eventEmitter);
443 440
 
444 441
     bindEvents();
445 442
     sharedVideoManager = new SharedVideoManager(eventEmitter);
446 443
     if (!interfaceConfig.filmStripOnly) {
447
-        $("#videospace").mousemove(function () {
448
-            return ToolbarToggler.showToolbar();
444
+        $("#videoconference_page").mousemove(function () {
445
+            return UI.showToolbar();
449 446
         });
450 447
         setupToolbars();
451 448
         setupChat();
@@ -468,9 +465,8 @@ UI.start = function () {
468 465
             elem.href = 'data:application/json;charset=utf-8,\n' + data;
469 466
         });
470 467
     } else {
471
-        $("#header").css("display", "none");
468
+        $("#mainToolbarContainer").css("display", "none");
472 469
         $("#downloadlog").css("display", "none");
473
-        BottomToolbar.hide();
474 470
         FilmStrip.setupFilmStripOnly();
475 471
         messageHandler.enableNotifications(false);
476 472
         $('body').popover("disable");
@@ -499,13 +495,6 @@ UI.start = function () {
499 495
             "hideEasing": "linear",
500 496
             "showMethod": "fadeIn",
501 497
             "hideMethod": "fadeOut",
502
-            "reposition": function () {
503
-                if (PanelToggler.isVisible()) {
504
-                    $("#toast-container").addClass("notification-bottom-right-center");
505
-                } else {
506
-                    $("#toast-container").removeClass("notification-bottom-right-center");
507
-                }
508
-            },
509 498
             "newestOnTop": false
510 499
         };
511 500
 
@@ -727,14 +716,14 @@ UI.isFilmStripVisible = function () {
727 716
  * Toggles chat panel.
728 717
  */
729 718
 UI.toggleChat = function () {
730
-    PanelToggler.toggleChat();
719
+    ExtendedToolbarToggler.toggle("chatspace");
731 720
 };
732 721
 
733 722
 /**
734 723
  * Toggles contact list panel.
735 724
  */
736 725
 UI.toggleContactList = function () {
737
-    PanelToggler.toggleContactList();
726
+    ExtendedToolbarToggler.toggle("contactlist");
738 727
 };
739 728
 
740 729
 /**

+ 0
- 2
modules/UI/recording/Recording.js View File

@@ -19,7 +19,6 @@ import UIUtil from '../util/UIUtil';
19 19
 import VideoLayout from '../videolayout/VideoLayout';
20 20
 import Feedback from '../Feedback.js';
21 21
 import Toolbar from '../toolbars/Toolbar';
22
-import BottomToolbar from '../toolbars/BottomToolbar';
23 22
 
24 23
 /**
25 24
  * The dialog for user input.
@@ -260,7 +259,6 @@ var Recording = {
260 259
             VideoLayout.setLocalVideoVisible(false);
261 260
             Feedback.enableFeedback(false);
262 261
             Toolbar.enable(false);
263
-            BottomToolbar.enable(false);
264 262
             APP.UI.messageHandler.enableNotifications(false);
265 263
             APP.UI.messageHandler.enablePopups(false);
266 264
         }

+ 70
- 0
modules/UI/side_pannels/ExtendedToolbarToggler.js View File

@@ -0,0 +1,70 @@
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;

+ 0
- 186
modules/UI/side_pannels/SidePanelToggler.js View File

@@ -1,186 +0,0 @@
1
-/* global require, $ */
2
-import Chat from "./chat/Chat";
3
-import ContactList from "./contactlist/ContactList";
4
-import Settings from "./../../settings/Settings";
5
-import SettingsMenu from "./settings/SettingsMenu";
6
-import VideoLayout from "../videolayout/VideoLayout";
7
-import ToolbarToggler from "../toolbars/ToolbarToggler";
8
-import UIUtil from "../util/UIUtil";
9
-
10
-const buttons = {
11
-    '#chatspace': '#chatBottomButton',
12
-    '#contactlist': '#contactListButton',
13
-    '#settingsmenu': '#toolbar_button_settings'
14
-};
15
-
16
-var currentlyOpen = null;
17
-
18
-/**
19
- * Toggles the windows in the side panel
20
- * @param object the window that should be shown
21
- * @param selector the selector for the element containing the panel
22
- * @param onOpenComplete function to be called when the panel is opened
23
- * @param onOpen function to be called if the window is going to be opened
24
- * @param onClose function to be called if the window is going to be closed
25
- * @param onVideoResizeComplete function to be called after the video area
26
- * is resized
27
- */
28
-function toggle (object, selector, onOpenComplete,
29
-                 onOpen, onClose, onVideoResizeComplete) {
30
-    let isSideBarVisible = object.isVisible();
31
-
32
-    UIUtil.buttonClick(buttons[selector], "active");
33
-
34
-    if (isSideBarVisible) {
35
-        $("#toast-container").animate({
36
-            right: 5
37
-        }, {
38
-            queue: false,
39
-            duration: 500
40
-        });
41
-
42
-        $(selector).hide("slide", {
43
-            direction: "right",
44
-            queue: false,
45
-            duration: 500,
46
-            // Set the size to 0 at the end of the animation to ensure that
47
-            // the is(":visible") function on this selector will return {false}
48
-            // when the element is hidden.
49
-            complete: function() {$(selector).css("width", "0");}
50
-        });
51
-
52
-        resizeVideoArea(false, onVideoResizeComplete);
53
-
54
-        if(typeof onClose === "function") {
55
-            onClose();
56
-        }
57
-
58
-        currentlyOpen = null;
59
-    } else {
60
-        resizeVideoArea(true, onVideoResizeComplete);
61
-
62
-        // Undock the toolbar when the chat is shown and if we're in a
63
-        // video mode.
64
-        if (VideoLayout.isLargeVideoVisible()) {
65
-            ToolbarToggler.dockToolbar(false);
66
-        }
67
-
68
-        if (currentlyOpen) {
69
-            var current = $(currentlyOpen);
70
-            UIUtil.buttonClick(buttons[currentlyOpen], "active");
71
-            current.css('z-index', 4);
72
-            setTimeout(function () {
73
-                current.css('display', 'none');
74
-                current.css('z-index', 5);
75
-            }, 500);
76
-        }
77
-
78
-        $("#toast-container").animate({
79
-            right: (UIUtil.getSidePanelSize()[0] + 5)
80
-        }, {
81
-            queue: false,
82
-            duration: 500
83
-        });
84
-        // Set the size dynamically (not in the css), so that we're sure that
85
-        // when is(":visible") is called on this selector the result is {false}
86
-        // before it's actually visible.
87
-        // (Chrome seems to return {true} for an element which is in the DOM and
88
-        // has non-null size set).
89
-        $(selector).css("width", "20%");
90
-        $(selector).show("slide", {
91
-            direction: "right",
92
-            queue: false,
93
-            duration: 500,
94
-            complete: onOpenComplete
95
-        });
96
-        if(typeof onOpen === "function") {
97
-            onOpen();
98
-        }
99
-
100
-        currentlyOpen = selector;
101
-    }
102
-}
103
-
104
-function resizeVideoArea(isSidePanelVisible, completeFunction) {
105
-    VideoLayout.resizeVideoArea(isSidePanelVisible,
106
-        false,//don't force thumbnail count update
107
-        true, //animate
108
-        completeFunction);
109
-}
110
-
111
-/**
112
- * Toggler for the chat, contact list, settings menu, etc..
113
- */
114
-var PanelToggler = {
115
-
116
-    /**
117
-     * Opens / closes the chat area.
118
-     */
119
-    toggleChat () {
120
-        var chatCompleteFunction = Chat.isVisible()
121
-            ? function () {}
122
-            : function () {
123
-                Chat.scrollChatToBottom();
124
-                $('#chatspace').trigger('shown');
125
-            };
126
-
127
-        toggle(Chat, //Object
128
-            '#chatspace', // Selector
129
-            function () { //onOpenComplete
130
-                // Request the focus in the nickname field or the chat input
131
-                // field.
132
-                if ($('#nickname').css('visibility') === 'visible') {
133
-                    $('#nickinput').focus();
134
-                } else {
135
-                    $('#usermsg').focus();
136
-                }
137
-            },
138
-            () => this.resizeChat(), //OnOpen
139
-            null,
140
-            chatCompleteFunction); //OnClose
141
-    },
142
-
143
-    resizeChat () {
144
-        let [width, height] = UIUtil.getSidePanelSize();
145
-        Chat.resizeChat(width, height);
146
-    },
147
-
148
-    /**
149
-     * Opens / closes the contact list area.
150
-     */
151
-    toggleContactList () {
152
-        var completeFunction = ContactList.isVisible()
153
-            ? function () {}
154
-            : function () {
155
-                $('#contactlist').trigger('shown');
156
-            };
157
-
158
-        toggle(ContactList,
159
-            '#contactlist',
160
-            null,
161
-            function() {
162
-                ContactList.setVisualNotification(false);
163
-            },
164
-            null,
165
-            completeFunction);
166
-    },
167
-
168
-    /**
169
-     * Opens / closes the settings menu
170
-     */
171
-    toggleSettingsMenu () {
172
-        toggle(SettingsMenu,
173
-            '#settingsmenu',
174
-            null,
175
-            function() {},
176
-            null);
177
-    },
178
-
179
-    isVisible () {
180
-        return (Chat.isVisible() ||
181
-                ContactList.isVisible() ||
182
-                SettingsMenu.isVisible());
183
-    }
184
-};
185
-
186
-export default PanelToggler;

+ 0
- 21
modules/UI/side_pannels/chat/Chat.js View File

@@ -18,15 +18,11 @@ var unreadMessages = 0;
18 18
  */
19 19
 function setVisualNotification(show) {
20 20
     var unreadMsgElement = document.getElementById('unreadMessages');
21
-    var unreadMsgBottomElement
22
-        = document.getElementById('bottomUnreadMessages');
23 21
 
24 22
     var glower = $('#toolbar_button_chat');
25
-    var bottomGlower = $('#chatBottomButton');
26 23
 
27 24
     if (unreadMessages) {
28 25
         unreadMsgElement.innerHTML = unreadMessages.toString();
29
-        unreadMsgBottomElement.innerHTML = unreadMessages.toString();
30 26
 
31 27
         ToolbarToggler.dockToolbar(true);
32 28
 
@@ -42,19 +38,6 @@ function setVisualNotification(show) {
42 38
                 'top:' + topIndent +
43 39
                 '; left:' + leftIndent + ';');
44 40
 
45
-        var chatBottomButtonElement
46
-            = document.getElementById('chatBottomButton').parentNode;
47
-        var bottomLeftIndent = (UIUtil.getTextWidth(chatBottomButtonElement) -
48
-            UIUtil.getTextWidth(unreadMsgBottomElement)) / 2;
49
-        var bottomTopIndent = (UIUtil.getTextHeight(chatBottomButtonElement) -
50
-            UIUtil.getTextHeight(unreadMsgBottomElement)) / 2 - 2;
51
-
52
-        unreadMsgBottomElement.setAttribute(
53
-            'style',
54
-                'top:' + bottomTopIndent +
55
-                '; left:' + bottomLeftIndent + ';');
56
-
57
-
58 41
         if (!glower.hasClass('icon-chat-simple')) {
59 42
             glower.removeClass('icon-chat');
60 43
             glower.addClass('icon-chat-simple');
@@ -62,7 +45,6 @@ function setVisualNotification(show) {
62 45
     }
63 46
     else {
64 47
         unreadMsgElement.innerHTML = '';
65
-        unreadMsgBottomElement.innerHTML = '';
66 48
         glower.removeClass('icon-chat-simple');
67 49
         glower.addClass('icon-chat');
68 50
     }
@@ -70,15 +52,12 @@ function setVisualNotification(show) {
70 52
     if (show && !notificationInterval) {
71 53
         notificationInterval = window.setInterval(function () {
72 54
             glower.toggleClass('active');
73
-            bottomGlower.toggleClass('active glowing');
74 55
         }, 800);
75 56
     }
76 57
     else if (!show && notificationInterval) {
77 58
         window.clearInterval(notificationInterval);
78 59
         notificationInterval = false;
79 60
         glower.removeClass('active');
80
-        bottomGlower.removeClass('glowing');
81
-        bottomGlower.addClass('active');
82 61
     }
83 62
 }
84 63
 

+ 15
- 8
modules/UI/side_pannels/contactlist/ContactList.js View File

@@ -14,16 +14,23 @@ let notificationInterval;
14 14
  */
15 15
 function updateNumberOfParticipants(delta) {
16 16
     numberOfContacts += delta;
17
-    if (numberOfContacts === 1) {
18
-        // when the user is alone we don't show the number of participants
19
-        $("#numberOfParticipants").text('');
20
-        ContactList.setVisualNotification(false);
21
-    } else if (numberOfContacts > 1) {
22
-        ContactList.setVisualNotification(!ContactList.isVisible());
23
-        $("#numberOfParticipants").text(numberOfContacts);
24
-    } else {
17
+
18
+    if (numberOfContacts <= 0) {
25 19
         console.error("Invalid number of participants: " + numberOfContacts);
20
+        return;
26 21
     }
22
+
23
+    let buttonIndicatorText = (numberOfContacts === 1) ? '' : numberOfContacts;
24
+    $("#numberOfParticipants").text(buttonIndicatorText);
25
+
26
+    let showVisualNotification
27
+        = (numberOfContacts === 1) ? false : !ContactList.isVisible();
28
+    ContactList.setVisualNotification(showVisualNotification);
29
+
30
+    $("#contactlist>div.title").text(
31
+        APP.translation.translateString(
32
+            "contactlist", {participants: numberOfContacts}
33
+        ));
27 34
 }
28 35
 
29 36
 /**

+ 0
- 130
modules/UI/toolbars/BottomToolbar.js View File

@@ -1,130 +0,0 @@
1
-/* global $, APP, interfaceConfig, JitsiMeetJS */
2
-import UIUtil from '../util/UIUtil';
3
-import UIEvents from '../../../service/UI/UIEvents';
4
-
5
-const defaultBottomToolbarButtons = {
6
-    'chat': {
7
-        id: '#bottom_toolbar_chat'
8
-    },
9
-    'contacts': {
10
-        id: '#bottom_toolbar_contact_list'
11
-    },
12
-    'filmstrip': {
13
-        id: '#bottom_toolbar_film_strip',
14
-        shortcut: "F",
15
-        shortcutAttr: "filmstripPopover",
16
-        shortcutFunc: function() {
17
-            JitsiMeetJS.analytics.sendEvent("shortcut.film.toggled");
18
-            APP.UI.handleToggleFilmStrip();
19
-        },
20
-        shortcutDescription: "keyboardShortcuts.toggleFilmstrip"
21
-    }
22
-};
23
-
24
-const BottomToolbar = {
25
-    init () {
26
-        this.toolbar = $('#bottomToolbar');
27
-
28
-        // The bottom toolbar is enabled by default.
29
-        this.enabled = true;
30
-    },
31
-    /**
32
-     * Enables / disables the bottom toolbar.
33
-     * @param {e} set to {true} to enable the bottom toolbar or {false}
34
-     * to disable it
35
-     */
36
-    enable (e) {
37
-        this.enabled = e;
38
-        if (!e && this.isVisible())
39
-            this.hide(false);
40
-    },
41
-    /**
42
-     * Indicates if the bottom toolbar is currently enabled.
43
-     * @return {this.enabled}
44
-     */
45
-    isEnabled() {
46
-        return this.enabled;
47
-    },
48
-
49
-    setupListeners (emitter) {
50
-        UIUtil.hideDisabledButtons(defaultBottomToolbarButtons);
51
-
52
-        const buttonHandlers = {
53
-            "bottom_toolbar_contact_list": function () {
54
-                JitsiMeetJS.analytics.sendEvent(
55
-                    'bottomtoolbar.contacts.toggled');
56
-                emitter.emit(UIEvents.TOGGLE_CONTACT_LIST);
57
-            },
58
-            "bottom_toolbar_film_strip": function () {
59
-                JitsiMeetJS.analytics.sendEvent(
60
-                    'bottomtoolbar.filmstrip.toggled');
61
-                emitter.emit(UIEvents.TOGGLE_FILM_STRIP);
62
-            },
63
-            "bottom_toolbar_chat": function () {
64
-                JitsiMeetJS.analytics.sendEvent('bottomtoolbar.chat.toggled');
65
-                emitter.emit(UIEvents.TOGGLE_CHAT);
66
-            }
67
-        };
68
-
69
-        Object.keys(defaultBottomToolbarButtons).forEach(
70
-                id => {
71
-                if (UIUtil.isButtonEnabled(id)) {
72
-                    var button = defaultBottomToolbarButtons[id];
73
-
74
-                    if (button.shortcut)
75
-                        APP.keyboardshortcut.registerShortcut(
76
-                            button.shortcut,
77
-                            button.shortcutAttr,
78
-                            button.shortcutFunc,
79
-                            button.shortcutDescription
80
-                        );
81
-                }
82
-            }
83
-        );
84
-
85
-        Object.keys(buttonHandlers).forEach(
86
-            buttonId => $(`#${buttonId}`).click(buttonHandlers[buttonId])
87
-        );
88
-    },
89
-
90
-    resizeToolbar (thumbWidth, thumbHeight) {
91
-        let bottom = (thumbHeight - this.toolbar.outerHeight())/2 + 18;
92
-        this.toolbar.css({bottom});
93
-    },
94
-
95
-    /**
96
-     * Returns true if this toolbar is currently visible, or false otherwise.
97
-     * @return <tt>true</tt> if currently visible, <tt>false</tt> - otherwise
98
-     */
99
-    isVisible() {
100
-        return this.toolbar.is(":visible");
101
-    },
102
-
103
-    /**
104
-     * Hides the bottom toolbar with animation or not depending on the animate
105
-     * parameter.
106
-     * @param animate <tt>true</tt> to hide the bottom toolbar with animation,
107
-     * <tt>false</tt> or nothing to hide it without animation.
108
-     */
109
-    hide(animate) {
110
-        if (animate)
111
-            this.toolbar.hide("slide", {direction: "right", duration: 300});
112
-        else
113
-            this.toolbar.css("display", "none");
114
-    },
115
-
116
-    /**
117
-     * Shows the bottom toolbar with animation or not depending on the animate
118
-     * parameter.
119
-     * @param animate <tt>true</tt> to show the bottom toolbar with animation,
120
-     * <tt>false</tt> or nothing to show it without animation.
121
-     */
122
-    show(animate) {
123
-        if (animate)
124
-            this.toolbar.show("slide", {direction: "right", duration: 300});
125
-        else
126
-            this.toolbar.css("display", "block");
127
-    }
128
-};
129
-
130
-export default BottomToolbar;

+ 41
- 7
modules/UI/toolbars/Toolbar.js View File

@@ -2,6 +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 6
 
6 7
 let roomUrl = null;
7 8
 let emitter = null;
@@ -92,6 +93,11 @@ const buttonHandlers = {
92 93
         JitsiMeetJS.analytics.sendEvent('toolbar.chat.toggled');
93 94
         emitter.emit(UIEvents.TOGGLE_CHAT);
94 95
     },
96
+    "toolbar_contact_list": function () {
97
+        JitsiMeetJS.analytics.sendEvent(
98
+            'toolbar.contacts.toggled');
99
+        emitter.emit(UIEvents.TOGGLE_CONTACT_LIST);
100
+    },
95 101
     "toolbar_button_etherpad": function () {
96 102
         JitsiMeetJS.analytics.sendEvent('toolbar.etherpad.clicked');
97 103
         emitter.emit(UIEvents.ETHERPAD_CLICKED);
@@ -150,6 +156,11 @@ const buttonHandlers = {
150 156
                 }
151 157
             }
152 158
         );
159
+    },
160
+    "toolbar_film_strip": function () {
161
+        JitsiMeetJS.analytics.sendEvent(
162
+            'bottomtoolbar.filmstrip.toggled');
163
+        emitter.emit(UIEvents.TOGGLE_FILM_STRIP);
153 164
     }
154 165
 };
155 166
 const defaultToolbarButtons = {
@@ -199,6 +210,9 @@ const defaultToolbarButtons = {
199 210
         },
200 211
         shortcutDescription: "keyboardShortcuts.toggleChat"
201 212
     },
213
+    'contacts': {
214
+        id: '#toolbar_contact_list'
215
+    },
202 216
     'etherpad': {
203 217
         id: '#toolbar_button_etherpad'
204 218
     },
@@ -210,6 +224,16 @@ const defaultToolbarButtons = {
210 224
     },
211 225
     'hangup': {
212 226
         id: '#toolbar_button_hangup'
227
+    },
228
+    'filmstrip': {
229
+        id: '#toolbar_film_strip',
230
+        shortcut: "F",
231
+        shortcutAttr: "filmstripPopover",
232
+        shortcutFunc: function() {
233
+            JitsiMeetJS.analytics.sendEvent("shortcut.film.toggled");
234
+            APP.UI.toggleFilmStrip();
235
+        },
236
+        shortcutDescription: "keyboardShortcuts.toggleFilmstrip"
213 237
     }
214 238
 };
215 239
 
@@ -242,7 +266,8 @@ const Toolbar = {
242 266
         emitter = eventEmitter;
243 267
         // The toolbar is enabled by default.
244 268
         this.enabled = true;
245
-        this.toolbarSelector = $("#header");
269
+        this.toolbarSelector = $("#mainToolbarContainer");
270
+        this.extendedToolbarSelector = $("#extendedToolbar");
246 271
 
247 272
         UIUtil.hideDisabledButtons(defaultToolbarButtons);
248 273
 
@@ -507,7 +532,9 @@ const Toolbar = {
507 532
         });
508 533
         if (hovered)
509 534
             return true;
510
-        if ($("#bottomToolbar:hover").length > 0) {
535
+        if ($("#bottomToolbar:hover").length > 0
536
+            || $("#extendedToolbar:hover").length > 0
537
+            || ExtendedToolbarToggler.isVisible()) {
511 538
             return true;
512 539
         }
513 540
         return false;
@@ -518,7 +545,7 @@ const Toolbar = {
518 545
      * @return <tt>true</tt> if currently visible, <tt>false</tt> - otherwise
519 546
      */
520 547
     isVisible() {
521
-        return this.toolbarSelector.is(":visible");
548
+        return this.toolbarSelector.hasClass("slideInY");
522 549
     },
523 550
 
524 551
     /**
@@ -526,8 +553,9 @@ const Toolbar = {
526 553
      * parameter.
527 554
      */
528 555
     hide() {
529
-        this.toolbarSelector.hide(
530
-            "slide", { direction: "up", duration: 300});
556
+        this.toolbarSelector.toggleClass("slideInY").toggleClass("slideOutY");
557
+        this.extendedToolbarSelector.toggleClass("slideInX")
558
+            .toggleClass("slideOutX");
531 559
     },
532 560
 
533 561
     /**
@@ -535,8 +563,14 @@ const Toolbar = {
535 563
      * parameter.
536 564
      */
537 565
     show() {
538
-        this.toolbarSelector.show(
539
-            "slide", { direction: "up", duration: 300});
566
+        if (this.toolbarSelector.hasClass("slideOutY"))
567
+            this.toolbarSelector.toggleClass("slideOutY");
568
+
569
+        if (this.extendedToolbarSelector.hasClass("slideOutX"))
570
+            this.extendedToolbarSelector.toggleClass("slideOutX");
571
+
572
+        this.toolbarSelector.toggleClass("slideInY");
573
+        this.extendedToolbarSelector.toggleClass("slideInX");
540 574
     }
541 575
 };
542 576
 

+ 0
- 9
modules/UI/toolbars/ToolbarToggler.js View File

@@ -1,7 +1,6 @@
1 1
 /* global APP, config, $, interfaceConfig */
2 2
 
3 3
 import UIUtil from '../util/UIUtil';
4
-import BottomToolbar from './BottomToolbar';
5 4
 import Toolbar from './Toolbar';
6 5
 import FilmStrip from '../videolayout/FilmStrip.js';
7 6
 
@@ -37,9 +36,6 @@ function hideToolbar() {
37 36
     } else {
38 37
         Toolbar.hide();
39 38
         $('#subject').animate({top: "-=40"}, 300);
40
-        if (!FilmStrip.isFilmStripVisible()) {
41
-            BottomToolbar.hide(true);
42
-        }
43 39
     }
44 40
 }
45 41
 
@@ -78,11 +74,6 @@ const ToolbarToggler = {
78 74
             updateTimeout = true;
79 75
         }
80 76
 
81
-        if (BottomToolbar.isEnabled() && !BottomToolbar.isVisible()) {
82
-            BottomToolbar.show(true);
83
-            updateTimeout = true;
84
-        }
85
-
86 77
         if (updateTimeout) {
87 78
             if (toolbarTimeoutObject) {
88 79
                 clearTimeout(toolbarTimeoutObject);

+ 1
- 20
modules/UI/util/UIUtil.js View File

@@ -5,31 +5,12 @@
5 5
  */
6 6
  var UIUtil = {
7 7
 
8
-    /**
9
-     * Returns the size of the side panel.
10
-     */
11
-     getSidePanelSize () {
12
-        var availableHeight = window.innerHeight;
13
-        var availableWidth = window.innerWidth;
14
-
15
-        var panelWidth = 200;
16
-        if (availableWidth * 0.2 < 200) {
17
-            panelWidth = availableWidth * 0.2;
18
-        }
19
-
20
-        return [panelWidth, availableHeight];
21
-     },
22
-
23 8
     /**
24 9
      * Returns the available video width.
25 10
      */
26
-    getAvailableVideoWidth: function (isSidePanelVisible) {
11
+    getAvailableVideoWidth: function () {
27 12
         let rightPanelWidth = 0;
28 13
 
29
-        if (isSidePanelVisible) {
30
-            rightPanelWidth = UIUtil.getSidePanelSize()[0];
31
-        }
32
-
33 14
         return window.innerWidth - rightPanelWidth;
34 15
     },
35 16
 

+ 2
- 4
modules/UI/videolayout/FilmStrip.js View File

@@ -68,10 +68,8 @@ const FilmStrip = {
68 68
 
69 69
     /**
70 70
      * Calculates the thumbnail size.
71
-     * @param videoAreaAvailableWidth the currently available video area width
72
-     * that we want to take into account when calculating the film strip width.
73 71
      */
74
-     calculateThumbnailSize (isSideBarVisible) {
72
+     calculateThumbnailSize () {
75 73
         let availableHeight = interfaceConfig.FILM_STRIP_MAX_HEIGHT;
76 74
 
77 75
         let numvids = this.getThumbs(true).length;
@@ -84,7 +82,7 @@ const FilmStrip = {
84 82
          * film strip size hasn't been updated yet, but it will be.
85 83
          */
86 84
         let videoAreaAvailableWidth
87
-            = UIUtil.getAvailableVideoWidth(isSideBarVisible)
85
+            = UIUtil.getAvailableVideoWidth()
88 86
                 - UIUtil.parseCssInt(this.filmStrip.css('right'), 10)
89 87
                 - UIUtil.parseCssInt(this.filmStrip.css('paddingLeft'), 10)
90 88
                 - UIUtil.parseCssInt(this.filmStrip.css('paddingRight'), 10)

+ 3
- 4
modules/UI/videolayout/LargeVideo.js View File

@@ -536,11 +536,10 @@ export default class LargeVideoManager {
536 536
     }
537 537
 
538 538
     /**
539
-     * Update container size optionally taking side bar size into account.
540
-     * @param {boolean} isSideBarVisible if side bar is visible.
539
+     * Update container size.
541 540
      */
542
-    updateContainerSize (isSideBarVisible) {
543
-        this.width = UIUtil.getAvailableVideoWidth(isSideBarVisible);
541
+    updateContainerSize () {
542
+        this.width = UIUtil.getAvailableVideoWidth();
544 543
         this.height = window.innerHeight;
545 544
     }
546 545
 

+ 7
- 16
modules/UI/videolayout/VideoLayout.js View File

@@ -3,7 +3,6 @@
3 3
 
4 4
 import AudioLevels from "../audio_levels/AudioLevels";
5 5
 import Avatar from "../avatar/Avatar";
6
-import BottomToolbar from "../toolbars/BottomToolbar";
7 6
 import FilmStrip from "./FilmStrip";
8 7
 import UIEvents from "../../../service/UI/UIEvents";
9 8
 import UIUtil from "../util/UIUtil";
@@ -12,7 +11,6 @@ import RemoteVideo from "./RemoteVideo";
12 11
 import LargeVideoManager, {VIDEO_CONTAINER_TYPE} from "./LargeVideo";
13 12
 import {SHARED_VIDEO_CONTAINER_TYPE} from '../shared_video/SharedVideo';
14 13
 import LocalVideo from "./LocalVideo";
15
-import PanelToggler from "../side_pannels/SidePanelToggler";
16 14
 
17 15
 const RTCUIUtil = JitsiMeetJS.util.RTCUIHelper;
18 16
 
@@ -115,12 +113,12 @@ var VideoLayout = {
115 113
         this.lastNCount = config.channelLastN;
116 114
     },
117 115
 
118
-    initLargeVideo (isSideBarVisible) {
116
+    initLargeVideo () {
119 117
         largeVideo = new LargeVideoManager();
120 118
         if(localFlipX) {
121 119
             largeVideo.onLocalFlipXChange(localFlipX);
122 120
         }
123
-        largeVideo.updateContainerSize(isSideBarVisible);
121
+        largeVideo.updateContainerSize();
124 122
         AudioLevels.init();
125 123
     },
126 124
 
@@ -487,21 +485,16 @@ var VideoLayout = {
487 485
      */
488 486
     resizeThumbnails (  animate = false,
489 487
                         forceUpdate = false,
490
-                        isSideBarVisible = null,
491 488
                         onComplete = null) {
492
-        isSideBarVisible
493
-            = (isSideBarVisible !== null)
494
-                ? isSideBarVisible : PanelToggler.isVisible();
495 489
 
496 490
         let {thumbWidth, thumbHeight}
497
-            = FilmStrip.calculateThumbnailSize(isSideBarVisible);
491
+            = FilmStrip.calculateThumbnailSize();
498 492
 
499 493
         $('.userAvatar').css('left', (thumbWidth - thumbHeight) / 2);
500 494
 
501 495
         FilmStrip.resizeThumbnails(thumbWidth, thumbHeight,
502 496
             animate, forceUpdate)
503 497
             .then(function () {
504
-                BottomToolbar.resizeToolbar(thumbWidth, thumbHeight);
505 498
                 AudioLevels.updateCanvasSize(thumbWidth, thumbHeight);
506 499
                 if (onComplete && typeof onComplete === "function")
507 500
                     onComplete();
@@ -891,31 +884,29 @@ var VideoLayout = {
891 884
     /**
892 885
      * Resizes the video area.
893 886
      *
894
-     * @param isSideBarVisible indicates if the side bar is currently visible
895 887
      * @param forceUpdate indicates that hidden thumbnails will be shown
896 888
      * @param completeFunction a function to be called when the video area is
897 889
      * resized.
898 890
      */
899
-    resizeVideoArea (isSideBarVisible,
900
-                    forceUpdate = false,
891
+    resizeVideoArea (forceUpdate = false,
901 892
                     animate = false,
902 893
                     completeFunction = null) {
903 894
 
904 895
         if (largeVideo) {
905
-            largeVideo.updateContainerSize(isSideBarVisible);
896
+            largeVideo.updateContainerSize();
906 897
             largeVideo.resize(animate);
907 898
         }
908 899
 
909 900
         // Calculate available width and height.
910 901
         let availableHeight = window.innerHeight;
911
-        let availableWidth = UIUtil.getAvailableVideoWidth(isSideBarVisible);
902
+        let availableWidth = UIUtil.getAvailableVideoWidth();
912 903
 
913 904
         if (availableWidth < 0 || availableHeight < 0) {
914 905
             return;
915 906
         }
916 907
 
917 908
         // Resize the thumbnails first.
918
-        this.resizeThumbnails(false, forceUpdate, isSideBarVisible);
909
+        this.resizeThumbnails(false, forceUpdate);
919 910
 
920 911
         // Resize the video area element.
921 912
         $('#videospace').animate({

Loading…
Cancel
Save