Browse Source

Merge pull request #885 from jitsi/add-raise-hand-toggle

Adds raise hand toggle state.
master
Дамян Минков 8 years ago
parent
commit
f0a898c674
6 changed files with 34 additions and 0 deletions
  1. 2
    0
      conference.js
  2. 4
    0
      css/_toolbars.scss
  3. 1
    0
      css/_variables.scss
  4. 10
    0
      modules/UI/UI.js
  5. 12
    0
      modules/UI/toolbars/Toolbar.js
  6. 5
    0
      service/UI/UIEvents.js

+ 2
- 0
conference.js View File

1648
     setRaisedHand(raisedHand) {
1648
     setRaisedHand(raisedHand) {
1649
         if (raisedHand !== this.isHandRaised)
1649
         if (raisedHand !== this.isHandRaised)
1650
         {
1650
         {
1651
+            APP.UI.onLocalRaiseHandChanged(raisedHand);
1652
+
1651
             this.isHandRaised = raisedHand;
1653
             this.isHandRaised = raisedHand;
1652
             // Advertise the updated status
1654
             // Advertise the updated status
1653
             room.setLocalParticipantProperty("raisedHand", raisedHand);
1655
             room.setLocalParticipantProperty("raisedHand", raisedHand);

+ 4
- 0
css/_toolbars.scss View File

118
     cursor: default;
118
     cursor: default;
119
 }
119
 }
120
 
120
 
121
+.button.toggled {
122
+    color: $toolbarButtonToggled;
123
+}
124
+
121
 a.button.unclickable:hover,
125
 a.button.unclickable:hover,
122
 a.button.unclickable:active,
126
 a.button.unclickable:active,
123
 a.button.unclickable.selected{
127
 a.button.unclickable.selected{

+ 1
- 0
css/_variables.scss View File

25
 
25
 
26
 // Toolbar
26
 // Toolbar
27
 $toolbarSelectBackground: rgba(0, 0, 0, .6);
27
 $toolbarSelectBackground: rgba(0, 0, 0, .6);
28
+$toolbarButtonToggled: #44A5FF;
28
 
29
 
29
 // Main controls
30
 // Main controls
30
 $inputBackground: rgba(132, 132, 132, .5);
31
 $inputBackground: rgba(132, 132, 132, .5);

+ 10
- 0
modules/UI/UI.js View File

1211
     SettingsMenu.updateStartMutedBox(startAudioMuted, startVideoMuted);
1211
     SettingsMenu.updateStartMutedBox(startAudioMuted, startVideoMuted);
1212
 };
1212
 };
1213
 
1213
 
1214
+/**
1215
+ * Notifies interested listeners that the raise hand property has changed.
1216
+ *
1217
+ * @param {boolean} isRaisedHand indicates the current state of the
1218
+ * "raised hand"
1219
+ */
1220
+UI.onLocalRaiseHandChanged = function (isRaisedHand) {
1221
+    eventEmitter.emit(UIEvents.LOCAL_RAISE_HAND_CHANGED, isRaisedHand);
1222
+};
1223
+
1214
 /**
1224
 /**
1215
  * Update list of available physical devices.
1225
  * Update list of available physical devices.
1216
  * @param {object[]} devices new list of available devices
1226
  * @param {object[]} devices new list of available devices

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

400
                                                             isVisible);
400
                                                             isVisible);
401
             });
401
             });
402
 
402
 
403
+        APP.UI.addListener(UIEvents.LOCAL_RAISE_HAND_CHANGED,
404
+            function(isRaisedHand) {
405
+                Toolbar._toggleRaiseHand(isRaisedHand);
406
+            });
407
+
403
         if(!APP.tokenData.isGuest) {
408
         if(!APP.tokenData.isGuest) {
404
             $("#toolbar_button_profile").addClass("unclickable");
409
             $("#toolbar_button_profile").addClass("unclickable");
405
         }
410
         }
565
         }
570
         }
566
     },
571
     },
567
 
572
 
573
+    /**
574
+     * Toggles / untoggles the view for raised hand.
575
+     */
576
+    _toggleRaiseHand(isRaisedHand) {
577
+        $('#toolbar_button_raisehand').toggleClass("toggled", isRaisedHand);
578
+    },
579
+
568
     /**
580
     /**
569
      * Marks video icon as muted or not.
581
      * Marks video icon as muted or not.
570
      * @param {boolean} muted if icon should look like muted or not
582
      * @param {boolean} muted if icon should look like muted or not

+ 5
- 0
service/UI/UIEvents.js View File

107
      */
107
      */
108
     SIDE_TOOLBAR_CONTAINER_TOGGLED: "UI.side_container_toggled",
108
     SIDE_TOOLBAR_CONTAINER_TOGGLED: "UI.side_container_toggled",
109
 
109
 
110
+    /**
111
+     * Notifies that the raise hand has been changed.
112
+     */
113
+    LOCAL_RAISE_HAND_CHANGED: "UI.local_raise_hand_changed",
114
+
110
     /**
115
     /**
111
      * Notifies that the avatar is displayed or not on the largeVideo.
116
      * Notifies that the avatar is displayed or not on the largeVideo.
112
      */
117
      */

Loading…
Cancel
Save