From 99bf4bc44d9c97f10991a2b95708af31ecc80ff6 Mon Sep 17 00:00:00 2001 From: yanas Date: Tue, 13 Sep 2016 20:50:30 -0500 Subject: [PATCH 1/3] Adds a possibility to add raise hand as a button --- lang/main.json | 3 +- modules/UI/toolbars/Toolbar.js | 31 +++++++++++++------- modules/keyboardshortcut/keyboardshortcut.js | 5 ---- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/lang/main.json b/lang/main.json index 443639820..d98229c7d 100644 --- a/lang/main.json +++ b/lang/main.json @@ -94,7 +94,8 @@ "unableToUnmutePopup": "You cannot un-mute while the shared video is on.", "cameraDisabled": "Camera is not available", "micDisabled": "Microphone is not available", - "filmstrip": "Show / hide videos" + "filmstrip": "Show / hide videos", + "raiseHand": "Raise hand to speak" }, "bottomtoolbar": { "chat": "Open / close chat", diff --git a/modules/UI/toolbars/Toolbar.js b/modules/UI/toolbars/Toolbar.js index d055f70aa..94f92f6b6 100644 --- a/modules/UI/toolbars/Toolbar.js +++ b/modules/UI/toolbars/Toolbar.js @@ -168,8 +168,13 @@ const buttonHandlers = { }, "toolbar_film_strip": function () { JitsiMeetJS.analytics.sendEvent( - 'bottomtoolbar.filmstrip.toggled'); + 'toolbar.filmstrip.toggled'); emitter.emit(UIEvents.TOGGLE_FILM_STRIP); + }, + "toolbar_button_raisehand": function () { + JitsiMeetJS.analytics.sendEvent( + 'toolbar.raiseHand.clicked'); + APP.conference.maybeToggleRaisedHand(); } }; @@ -288,6 +293,19 @@ const defaultToolbarButtons = { APP.UI.toggleFilmStrip(); }, shortcutDescription: "keyboardShortcuts.toggleFilmstrip" + }, + 'raisehand': { + id: "toolbar_button_raisehand", + className: "button icon-raised-hand", + shortcut: "R", + shortcutAttr: "raiseHandPopover", + shortcutFunc: function() { + JitsiMeetJS.analytics.sendEvent("shortcut.raisehand.clicked"); + APP.conference.maybeToggleRaisedHand(); + }, + shortcutDescription: "keyboardShortcuts.raiseHand", + content: "Raise Hand", + i18n: "[content]toolbar.raiseHand" } }; @@ -679,16 +697,9 @@ const Toolbar = { } ); }, + /** - * TODO: Fix mic popups - * - * - * - * + * Initialise main toolbar buttons. */ _initMainToolbarButtons() { interfaceConfig.MAIN_TOOLBAR_BUTTONS.forEach((value, index) => { diff --git a/modules/keyboardshortcut/keyboardshortcut.js b/modules/keyboardshortcut/keyboardshortcut.js index 7a54b7321..4bb98fb2c 100644 --- a/modules/keyboardshortcut/keyboardshortcut.js +++ b/modules/keyboardshortcut/keyboardshortcut.js @@ -17,11 +17,6 @@ function initGlobalShortcuts() { APP.UI.toggleKeyboardShortcutsPanel(); }, "keyboardShortcuts.toggleShortcuts"); - KeyboardShortcut.registerShortcut("R", null, function() { - JitsiMeetJS.analytics.sendEvent("shortcut.raisedhand.toggled"); - APP.conference.maybeToggleRaisedHand(); - }, "keyboardShortcuts.raiseHand"); - KeyboardShortcut.registerShortcut("T", null, function() { JitsiMeetJS.analytics.sendEvent("shortcut.talk.clicked"); APP.conference.muteAudio(true); From cf49c8c6ff3d60bfce2f2cb93a00a4420e6c7d7f Mon Sep 17 00:00:00 2001 From: yanas Date: Tue, 13 Sep 2016 21:19:27 -0500 Subject: [PATCH 2/3] Adds raise hand button to the side toolbar --- index.html | 2 ++ interface_config.js | 2 +- modules/UI/toolbars/Toolbar.js | 8 ++++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index e647cceae..209529741 100644 --- a/index.html +++ b/index.html @@ -123,6 +123,7 @@ + @@ -137,6 +138,7 @@ + diff --git a/interface_config.js b/interface_config.js index 6eeaf1725..9780d27f2 100644 --- a/interface_config.js +++ b/interface_config.js @@ -20,7 +20,7 @@ var interfaceConfig = { // the toolbar buttons line is intentionally left in one line, to be able // to easily override values or remove them using regex MAIN_TOOLBAR_BUTTONS: ['microphone', 'camera', 'desktop', 'invite', 'hangup'], // jshint ignore:line - TOOLBAR_BUTTONS: ['profile', 'authentication', 'microphone', 'camera', 'desktop', 'recording', 'security', 'invite', 'chat', 'etherpad', 'sharedvideo', 'fullscreen', 'sip', 'dialpad', 'settings', 'hangup', 'filmstrip', 'contacts'], // jshint ignore:line + TOOLBAR_BUTTONS: ['profile', 'authentication', 'microphone', 'camera', 'desktop', 'recording', 'security', 'raisehand', 'chat', 'etherpad', 'sharedvideo', 'fullscreen', 'sip', 'dialpad', 'settings', 'hangup', 'filmstrip', 'contacts'], // jshint ignore:line SETTINGS_SECTIONS: ['language', 'devices', 'moderator'], // Determines how the video would fit the screen. 'both' would fit the whole // screen, 'height' would fit the original video height to the height of the diff --git a/modules/UI/toolbars/Toolbar.js b/modules/UI/toolbars/Toolbar.js index 94f92f6b6..876b6f108 100644 --- a/modules/UI/toolbars/Toolbar.js +++ b/modules/UI/toolbars/Toolbar.js @@ -341,10 +341,14 @@ const Toolbar = { this.toolbarSelector = $("#mainToolbarContainer"); this.extendedToolbarSelector = $("#extendedToolbar"); - this._initMainToolbarButtons(); - + // First hide all disabled buttons in the extended toolbar. + // TODO: Make the extended toolbar dynamically created. UIUtil.hideDisabledButtons(defaultToolbarButtons); + // Initialise the main toolbar. The main toolbar will only take into + // account it's own configuration from interface_config. + this._initMainToolbarButtons(); + Object.keys(defaultToolbarButtons).forEach( id => { if (UIUtil.isButtonEnabled(id)) { From 3b05a16b327588960540681b01e322b84d05c8c1 Mon Sep 17 00:00:00 2001 From: yanas Date: Tue, 13 Sep 2016 22:10:13 -0500 Subject: [PATCH 3/3] Fix for button appearing in both toolbars --- index.html | 2 +- modules/UI/util/UIUtil.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 209529741..725aaa65b 100644 --- a/index.html +++ b/index.html @@ -123,7 +123,7 @@ - + diff --git a/modules/UI/util/UIUtil.js b/modules/UI/util/UIUtil.js index 321de2be9..b55191189 100644 --- a/modules/UI/util/UIUtil.js +++ b/modules/UI/util/UIUtil.js @@ -112,7 +112,8 @@ * is enabled, {false} - otherwise */ isButtonEnabled: function (name) { - return interfaceConfig.TOOLBAR_BUTTONS.indexOf(name) !== -1; + return interfaceConfig.TOOLBAR_BUTTONS.indexOf(name) !== -1 + || interfaceConfig.MAIN_TOOLBAR_BUTTONS.indexOf(name) !== -1; }, /** * Indicates if the setting section is enabled.