Browse Source

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

Adds a possibility to add raise hand as a button
j8
yanas 9 years ago
parent
commit
7ded10cd8d

+ 2
- 0
index.html View File

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">
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
                 <span id="numberOfParticipants"></span>
124
                 <span id="numberOfParticipants"></span>
125
             </a>
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
             <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
             <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
                 <span id="unreadMessages"></span>
128
                 <span id="unreadMessages"></span>
128
             </a>
129
             </a>
137
             <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
             <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
             <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
             <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
             <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>
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
             <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>
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
             <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>
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
             <a class="button icon-feedback" id="feedbackButton" data-container="body" data-toggle="popover" data-placement="right" data-i18n="[content]feedback"></a>
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 View File

20
     // the toolbar buttons line is intentionally left in one line, to be able
20
     // the toolbar buttons line is intentionally left in one line, to be able
21
     // to easily override values or remove them using regex
21
     // to easily override values or remove them using regex
22
     MAIN_TOOLBAR_BUTTONS: ['microphone', 'camera', 'desktop', 'invite', 'hangup'], // jshint ignore:line
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
     SETTINGS_SECTIONS: ['language', 'devices', 'moderator'],
24
     SETTINGS_SECTIONS: ['language', 'devices', 'moderator'],
25
     // Determines how the video would fit the screen. 'both' would fit the whole
25
     // Determines how the video would fit the screen. 'both' would fit the whole
26
     // screen, 'height' would fit the original video height to the height of the
26
     // screen, 'height' would fit the original video height to the height of the

+ 2
- 1
lang/main.json View File

94
         "unableToUnmutePopup": "You cannot un-mute while the shared video is on.",
94
         "unableToUnmutePopup": "You cannot un-mute while the shared video is on.",
95
         "cameraDisabled": "Camera is not available",
95
         "cameraDisabled": "Camera is not available",
96
         "micDisabled": "Microphone is not available",
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
     "bottomtoolbar": {
100
     "bottomtoolbar": {
100
         "chat": "Open / close chat",
101
         "chat": "Open / close chat",

+ 27
- 12
modules/UI/toolbars/Toolbar.js View File

168
     },
168
     },
169
     "toolbar_film_strip": function () {
169
     "toolbar_film_strip": function () {
170
         JitsiMeetJS.analytics.sendEvent(
170
         JitsiMeetJS.analytics.sendEvent(
171
-            'bottomtoolbar.filmstrip.toggled');
171
+            'toolbar.filmstrip.toggled');
172
         emitter.emit(UIEvents.TOGGLE_FILM_STRIP);
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
             APP.UI.toggleFilmStrip();
293
             APP.UI.toggleFilmStrip();
289
         },
294
         },
290
         shortcutDescription: "keyboardShortcuts.toggleFilmstrip"
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
         this.toolbarSelector = $("#mainToolbarContainer");
341
         this.toolbarSelector = $("#mainToolbarContainer");
324
         this.extendedToolbarSelector = $("#extendedToolbar");
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
         UIUtil.hideDisabledButtons(defaultToolbarButtons);
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
         Object.keys(defaultToolbarButtons).forEach(
352
         Object.keys(defaultToolbarButtons).forEach(
331
             id => {
353
             id => {
332
                 if (UIUtil.isButtonEnabled(id)) {
354
                 if (UIUtil.isButtonEnabled(id)) {
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
     _initMainToolbarButtons() {
708
     _initMainToolbarButtons() {
694
         interfaceConfig.MAIN_TOOLBAR_BUTTONS.forEach((value, index) => {
709
         interfaceConfig.MAIN_TOOLBAR_BUTTONS.forEach((value, index) => {

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

112
      * is enabled, {false} - otherwise
112
      * is enabled, {false} - otherwise
113
      */
113
      */
114
     isButtonEnabled: function (name) {
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
      * Indicates if the setting section is enabled.
119
      * Indicates if the setting section is enabled.

+ 0
- 5
modules/keyboardshortcut/keyboardshortcut.js View File

17
         APP.UI.toggleKeyboardShortcutsPanel();
17
         APP.UI.toggleKeyboardShortcutsPanel();
18
     }, "keyboardShortcuts.toggleShortcuts");
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
     KeyboardShortcut.registerShortcut("T", null, function() {
20
     KeyboardShortcut.registerShortcut("T", null, function() {
26
         JitsiMeetJS.analytics.sendEvent("shortcut.talk.clicked");
21
         JitsiMeetJS.analytics.sendEvent("shortcut.talk.clicked");
27
         APP.conference.muteAudio(true);
22
         APP.conference.muteAudio(true);

Loading…
Cancel
Save