ソースを参照

Merge pull request #865 from jitsi/add-raise-hand-button

Adds a possibility to add raise hand as a button
master
yanas 8年前
コミット
7ded10cd8d

+ 2
- 0
index.html ファイルの表示

@@ -123,6 +123,7 @@
123 123
             <a class="button icon-contactList" id="toolbar_contact_list" data-container="body" data-toggle="popover" data-placement="right" shortcut="contactlistpopover"  data-i18n="[content]bottomtoolbar.contactlist" content="Open / close contact list">
124 124
                 <span id="numberOfParticipants"></span>
125 125
             </a>
126
+            <!--a class="button icon-link" id="toolbar_button_link" data-container="body" data-toggle="popover" data-placement="right" data-i18n="[content]toolbar.invite" content="Invite others"></a-->
126 127
             <a class="button icon-chat" id="toolbar_button_chat" data-container="body" data-toggle="popover" shortcut="toggleChatPopover" data-placement="right" data-i18n="[content]toolbar.chat" content="Open / close chat">
127 128
                 <span id="unreadMessages"></span>
128 129
             </a>
@@ -137,6 +138,7 @@
137 138
             <a class="button icon-telephone" id="toolbar_button_sip" data-container="body" data-toggle="popover" data-placement="right" content="Call SIP number" data-i18n="[content]toolbar.sip" style="display: none"></a>
138 139
             <a class="button icon-dialpad" id="toolbar_button_dialpad" data-container="body" data-toggle="popover" data-placement="right" content="Open dialpad" data-i18n="[content]toolbar.dialpad" style="display: none"></a>
139 140
             <a class="button icon-settings" id="toolbar_button_settings" data-container="body" data-toggle="popover" data-placement="right" content="Settings" data-i18n="[content]toolbar.Settings"></a>
141
+            <a class="button icon-raised-hand" id="toolbar_button_raisehand" data-container="body" data-toggle="popover" data-placement="right" data-i18n="[content]toolbar.raiseHand" content="Raise Hand" shortcut="raiseHandPopover"></a>
140 142
             <a class="button icon-full-screen" id="toolbar_button_fullScreen" data-container="body" data-toggle="popover" data-placement="right" shortcut="toggleFullscreenPopover" data-i18n="[content]toolbar.fullscreen" content="Enter / Exit Full Screen"></a>
141 143
             <a class="button icon-toggle-filmstrip" id="toolbar_film_strip" data-container="body" data-toggle="popover" shortcut="filmstripPopover" data-placement="right" data-i18n="[content]toolbar.filmstrip" content="Show / hide videos"></a>
142 144
             <a class="button icon-feedback" id="feedbackButton" data-container="body" data-toggle="popover" data-placement="right" data-i18n="[content]feedback"></a>

+ 1
- 1
interface_config.js ファイルの表示

@@ -20,7 +20,7 @@ var interfaceConfig = {
20 20
     // the toolbar buttons line is intentionally left in one line, to be able
21 21
     // to easily override values or remove them using regex
22 22
     MAIN_TOOLBAR_BUTTONS: ['microphone', 'camera', 'desktop', 'invite', 'hangup'], // jshint ignore:line
23
-    TOOLBAR_BUTTONS: ['profile', 'authentication', 'microphone', 'camera', 'desktop', 'recording', 'security', 'invite', 'chat', 'etherpad', 'sharedvideo', 'fullscreen', 'sip', 'dialpad', 'settings', 'hangup', 'filmstrip', 'contacts'], // jshint ignore:line
23
+    TOOLBAR_BUTTONS: ['profile', 'authentication', 'microphone', 'camera', 'desktop', 'recording', 'security', 'raisehand', 'chat', 'etherpad', 'sharedvideo', 'fullscreen', 'sip', 'dialpad', 'settings', 'hangup', 'filmstrip', 'contacts'], // jshint ignore:line
24 24
     SETTINGS_SECTIONS: ['language', 'devices', 'moderator'],
25 25
     // Determines how the video would fit the screen. 'both' would fit the whole
26 26
     // screen, 'height' would fit the original video height to the height of the

+ 2
- 1
lang/main.json ファイルの表示

@@ -94,7 +94,8 @@
94 94
         "unableToUnmutePopup": "You cannot un-mute while the shared video is on.",
95 95
         "cameraDisabled": "Camera is not available",
96 96
         "micDisabled": "Microphone is not available",
97
-        "filmstrip": "Show / hide videos"
97
+        "filmstrip": "Show / hide videos",
98
+        "raiseHand": "Raise hand to speak"
98 99
     },
99 100
     "bottomtoolbar": {
100 101
         "chat": "Open / close chat",

+ 27
- 12
modules/UI/toolbars/Toolbar.js ファイルの表示

@@ -168,8 +168,13 @@ const buttonHandlers = {
168 168
     },
169 169
     "toolbar_film_strip": function () {
170 170
         JitsiMeetJS.analytics.sendEvent(
171
-            'bottomtoolbar.filmstrip.toggled');
171
+            'toolbar.filmstrip.toggled');
172 172
         emitter.emit(UIEvents.TOGGLE_FILM_STRIP);
173
+    },
174
+    "toolbar_button_raisehand": function () {
175
+        JitsiMeetJS.analytics.sendEvent(
176
+            'toolbar.raiseHand.clicked');
177
+        APP.conference.maybeToggleRaisedHand();
173 178
     }
174 179
 };
175 180
 
@@ -288,6 +293,19 @@ const defaultToolbarButtons = {
288 293
             APP.UI.toggleFilmStrip();
289 294
         },
290 295
         shortcutDescription: "keyboardShortcuts.toggleFilmstrip"
296
+    },
297
+    'raisehand': {
298
+        id: "toolbar_button_raisehand",
299
+        className: "button icon-raised-hand",
300
+        shortcut: "R",
301
+        shortcutAttr: "raiseHandPopover",
302
+        shortcutFunc: function() {
303
+            JitsiMeetJS.analytics.sendEvent("shortcut.raisehand.clicked");
304
+            APP.conference.maybeToggleRaisedHand();
305
+        },
306
+        shortcutDescription: "keyboardShortcuts.raiseHand",
307
+        content: "Raise Hand",
308
+        i18n: "[content]toolbar.raiseHand"
291 309
     }
292 310
 };
293 311
 
@@ -323,10 +341,14 @@ const Toolbar = {
323 341
         this.toolbarSelector = $("#mainToolbarContainer");
324 342
         this.extendedToolbarSelector = $("#extendedToolbar");
325 343
 
326
-        this._initMainToolbarButtons();
327
-
344
+        // First hide all disabled buttons in the extended toolbar.
345
+        // TODO: Make the extended toolbar dynamically created.
328 346
         UIUtil.hideDisabledButtons(defaultToolbarButtons);
329 347
 
348
+        // Initialise the main toolbar. The main toolbar will only take into
349
+        // account it's own configuration from interface_config.
350
+        this._initMainToolbarButtons();
351
+
330 352
         Object.keys(defaultToolbarButtons).forEach(
331 353
             id => {
332 354
                 if (UIUtil.isButtonEnabled(id)) {
@@ -679,16 +701,9 @@ const Toolbar = {
679 701
             }
680 702
         );
681 703
     },
704
+
682 705
     /**
683
-     * TODO: Fix mic popups
684
-     * <a class="button icon-microphone" id="toolbar_button_mute" data-container="body" data-toggle="popover" data-placement="bottom" shortcut="mutePopover" data-i18n="[content]toolbar.mute" content="Mute / Unmute">
685
-     *   <ul id="micMutedPopup" class="loginmenu">
686
-     *       <li data-i18n="[html]toolbar.micMutedPopup"></li>
687
-     *   </ul>
688
-     *   <ul id="unableToUnmutePopup" class="loginmenu">
689
-     *       <li data-i18n="[html]toolbar.unableToUnmutePopup"></li>
690
-     *   </ul>
691
-     * </a>
706
+     * Initialise main toolbar buttons.
692 707
      */
693 708
     _initMainToolbarButtons() {
694 709
         interfaceConfig.MAIN_TOOLBAR_BUTTONS.forEach((value, index) => {

+ 2
- 1
modules/UI/util/UIUtil.js ファイルの表示

@@ -112,7 +112,8 @@
112 112
      * is enabled, {false} - otherwise
113 113
      */
114 114
     isButtonEnabled: function (name) {
115
-        return interfaceConfig.TOOLBAR_BUTTONS.indexOf(name) !== -1;
115
+        return interfaceConfig.TOOLBAR_BUTTONS.indexOf(name) !== -1
116
+                || interfaceConfig.MAIN_TOOLBAR_BUTTONS.indexOf(name) !== -1;
116 117
     },
117 118
     /**
118 119
      * Indicates if the setting section is enabled.

+ 0
- 5
modules/keyboardshortcut/keyboardshortcut.js ファイルの表示

@@ -17,11 +17,6 @@ function initGlobalShortcuts() {
17 17
         APP.UI.toggleKeyboardShortcutsPanel();
18 18
     }, "keyboardShortcuts.toggleShortcuts");
19 19
 
20
-    KeyboardShortcut.registerShortcut("R", null, function() {
21
-        JitsiMeetJS.analytics.sendEvent("shortcut.raisedhand.toggled");
22
-        APP.conference.maybeToggleRaisedHand();
23
-    }, "keyboardShortcuts.raiseHand");
24
-
25 20
     KeyboardShortcut.registerShortcut("T", null, function() {
26 21
         JitsiMeetJS.analytics.sendEvent("shortcut.talk.clicked");
27 22
         APP.conference.muteAudio(true);

読み込み中…
キャンセル
保存