浏览代码

Remove bottom toolbar and change side panel position and behavior

j8
yanas 8 年前
父节点
当前提交
8562d3d55d

+ 13
- 24
modules/UI/UI.js 查看文件

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

+ 0
- 2
modules/UI/recording/Recording.js 查看文件

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

+ 70
- 0
modules/UI/side_pannels/ExtendedToolbarToggler.js 查看文件

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 查看文件

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 查看文件

18
  */
18
  */
19
 function setVisualNotification(show) {
19
 function setVisualNotification(show) {
20
     var unreadMsgElement = document.getElementById('unreadMessages');
20
     var unreadMsgElement = document.getElementById('unreadMessages');
21
-    var unreadMsgBottomElement
22
-        = document.getElementById('bottomUnreadMessages');
23
 
21
 
24
     var glower = $('#toolbar_button_chat');
22
     var glower = $('#toolbar_button_chat');
25
-    var bottomGlower = $('#chatBottomButton');
26
 
23
 
27
     if (unreadMessages) {
24
     if (unreadMessages) {
28
         unreadMsgElement.innerHTML = unreadMessages.toString();
25
         unreadMsgElement.innerHTML = unreadMessages.toString();
29
-        unreadMsgBottomElement.innerHTML = unreadMessages.toString();
30
 
26
 
31
         ToolbarToggler.dockToolbar(true);
27
         ToolbarToggler.dockToolbar(true);
32
 
28
 
42
                 'top:' + topIndent +
38
                 'top:' + topIndent +
43
                 '; left:' + leftIndent + ';');
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
         if (!glower.hasClass('icon-chat-simple')) {
41
         if (!glower.hasClass('icon-chat-simple')) {
59
             glower.removeClass('icon-chat');
42
             glower.removeClass('icon-chat');
60
             glower.addClass('icon-chat-simple');
43
             glower.addClass('icon-chat-simple');
62
     }
45
     }
63
     else {
46
     else {
64
         unreadMsgElement.innerHTML = '';
47
         unreadMsgElement.innerHTML = '';
65
-        unreadMsgBottomElement.innerHTML = '';
66
         glower.removeClass('icon-chat-simple');
48
         glower.removeClass('icon-chat-simple');
67
         glower.addClass('icon-chat');
49
         glower.addClass('icon-chat');
68
     }
50
     }
70
     if (show && !notificationInterval) {
52
     if (show && !notificationInterval) {
71
         notificationInterval = window.setInterval(function () {
53
         notificationInterval = window.setInterval(function () {
72
             glower.toggleClass('active');
54
             glower.toggleClass('active');
73
-            bottomGlower.toggleClass('active glowing');
74
         }, 800);
55
         }, 800);
75
     }
56
     }
76
     else if (!show && notificationInterval) {
57
     else if (!show && notificationInterval) {
77
         window.clearInterval(notificationInterval);
58
         window.clearInterval(notificationInterval);
78
         notificationInterval = false;
59
         notificationInterval = false;
79
         glower.removeClass('active');
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 查看文件

14
  */
14
  */
15
 function updateNumberOfParticipants(delta) {
15
 function updateNumberOfParticipants(delta) {
16
     numberOfContacts += delta;
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
         console.error("Invalid number of participants: " + numberOfContacts);
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 查看文件

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 查看文件

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
 
6
 
6
 let roomUrl = null;
7
 let roomUrl = null;
7
 let emitter = null;
8
 let emitter = null;
92
         JitsiMeetJS.analytics.sendEvent('toolbar.chat.toggled');
93
         JitsiMeetJS.analytics.sendEvent('toolbar.chat.toggled');
93
         emitter.emit(UIEvents.TOGGLE_CHAT);
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
     "toolbar_button_etherpad": function () {
101
     "toolbar_button_etherpad": function () {
96
         JitsiMeetJS.analytics.sendEvent('toolbar.etherpad.clicked');
102
         JitsiMeetJS.analytics.sendEvent('toolbar.etherpad.clicked');
97
         emitter.emit(UIEvents.ETHERPAD_CLICKED);
103
         emitter.emit(UIEvents.ETHERPAD_CLICKED);
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
 const defaultToolbarButtons = {
166
 const defaultToolbarButtons = {
199
         },
210
         },
200
         shortcutDescription: "keyboardShortcuts.toggleChat"
211
         shortcutDescription: "keyboardShortcuts.toggleChat"
201
     },
212
     },
213
+    'contacts': {
214
+        id: '#toolbar_contact_list'
215
+    },
202
     'etherpad': {
216
     'etherpad': {
203
         id: '#toolbar_button_etherpad'
217
         id: '#toolbar_button_etherpad'
204
     },
218
     },
210
     },
224
     },
211
     'hangup': {
225
     'hangup': {
212
         id: '#toolbar_button_hangup'
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
         emitter = eventEmitter;
266
         emitter = eventEmitter;
243
         // The toolbar is enabled by default.
267
         // The toolbar is enabled by default.
244
         this.enabled = true;
268
         this.enabled = true;
245
-        this.toolbarSelector = $("#header");
269
+        this.toolbarSelector = $("#mainToolbarContainer");
270
+        this.extendedToolbarSelector = $("#extendedToolbar");
246
 
271
 
247
         UIUtil.hideDisabledButtons(defaultToolbarButtons);
272
         UIUtil.hideDisabledButtons(defaultToolbarButtons);
248
 
273
 
507
         });
532
         });
508
         if (hovered)
533
         if (hovered)
509
             return true;
534
             return true;
510
-        if ($("#bottomToolbar:hover").length > 0) {
535
+        if ($("#bottomToolbar:hover").length > 0
536
+            || $("#extendedToolbar:hover").length > 0
537
+            || ExtendedToolbarToggler.isVisible()) {
511
             return true;
538
             return true;
512
         }
539
         }
513
         return false;
540
         return false;
518
      * @return <tt>true</tt> if currently visible, <tt>false</tt> - otherwise
545
      * @return <tt>true</tt> if currently visible, <tt>false</tt> - otherwise
519
      */
546
      */
520
     isVisible() {
547
     isVisible() {
521
-        return this.toolbarSelector.is(":visible");
548
+        return this.toolbarSelector.hasClass("slideInY");
522
     },
549
     },
523
 
550
 
524
     /**
551
     /**
526
      * parameter.
553
      * parameter.
527
      */
554
      */
528
     hide() {
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
      * parameter.
563
      * parameter.
536
      */
564
      */
537
     show() {
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 查看文件

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

+ 1
- 20
modules/UI/util/UIUtil.js 查看文件

5
  */
5
  */
6
  var UIUtil = {
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
      * Returns the available video width.
9
      * Returns the available video width.
25
      */
10
      */
26
-    getAvailableVideoWidth: function (isSidePanelVisible) {
11
+    getAvailableVideoWidth: function () {
27
         let rightPanelWidth = 0;
12
         let rightPanelWidth = 0;
28
 
13
 
29
-        if (isSidePanelVisible) {
30
-            rightPanelWidth = UIUtil.getSidePanelSize()[0];
31
-        }
32
-
33
         return window.innerWidth - rightPanelWidth;
14
         return window.innerWidth - rightPanelWidth;
34
     },
15
     },
35
 
16
 

+ 2
- 4
modules/UI/videolayout/FilmStrip.js 查看文件

68
 
68
 
69
     /**
69
     /**
70
      * Calculates the thumbnail size.
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
         let availableHeight = interfaceConfig.FILM_STRIP_MAX_HEIGHT;
73
         let availableHeight = interfaceConfig.FILM_STRIP_MAX_HEIGHT;
76
 
74
 
77
         let numvids = this.getThumbs(true).length;
75
         let numvids = this.getThumbs(true).length;
84
          * film strip size hasn't been updated yet, but it will be.
82
          * film strip size hasn't been updated yet, but it will be.
85
          */
83
          */
86
         let videoAreaAvailableWidth
84
         let videoAreaAvailableWidth
87
-            = UIUtil.getAvailableVideoWidth(isSideBarVisible)
85
+            = UIUtil.getAvailableVideoWidth()
88
                 - UIUtil.parseCssInt(this.filmStrip.css('right'), 10)
86
                 - UIUtil.parseCssInt(this.filmStrip.css('right'), 10)
89
                 - UIUtil.parseCssInt(this.filmStrip.css('paddingLeft'), 10)
87
                 - UIUtil.parseCssInt(this.filmStrip.css('paddingLeft'), 10)
90
                 - UIUtil.parseCssInt(this.filmStrip.css('paddingRight'), 10)
88
                 - UIUtil.parseCssInt(this.filmStrip.css('paddingRight'), 10)

+ 3
- 4
modules/UI/videolayout/LargeVideo.js 查看文件

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
         this.height = window.innerHeight;
543
         this.height = window.innerHeight;
545
     }
544
     }
546
 
545
 

+ 7
- 16
modules/UI/videolayout/VideoLayout.js 查看文件

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

正在加载...
取消
保存