Ver código fonte

React Toolbox

j8
Lyubo Marinov 8 anos atrás
pai
commit
1e2d88cd5d
30 arquivos alterados com 429 adições e 437 exclusões
  1. 1
    1
      conference.js
  2. 8
    12
      modules/UI/UI.js
  3. 3
    3
      modules/UI/recording/Recording.js
  4. 4
    4
      modules/UI/shared_video/SharedVideo.js
  5. 5
    5
      modules/UI/side_pannels/chat/Chat.js
  6. 42
    43
      react/features/conference/components/Conference.native.js
  7. 2
    2
      react/features/conference/components/Conference.web.js
  8. 2
    2
      react/features/film-strip/components/FilmStrip.js
  9. 0
    98
      react/features/toolbar/actionTypes.js
  10. 0
    1
      react/features/toolbar/components/index.js
  11. 0
    39
      react/features/toolbar/middleware.js
  12. 95
    0
      react/features/toolbox/actionTypes.js
  13. 57
    52
      react/features/toolbox/actions.native.js
  14. 35
    48
      react/features/toolbox/actions.web.js
  15. 0
    0
      react/features/toolbox/components/AbstractToolbarButton.js
  16. 0
    0
      react/features/toolbox/components/Notice.js
  17. 5
    7
      react/features/toolbox/components/PrimaryToolbar.web.js
  18. 5
    6
      react/features/toolbox/components/SecondaryToolbar.web.js
  19. 6
    5
      react/features/toolbox/components/Toolbar.web.js
  20. 0
    0
      react/features/toolbox/components/ToolbarButton.native.js
  21. 0
    0
      react/features/toolbox/components/ToolbarButton.web.js
  22. 5
    5
      react/features/toolbox/components/Toolbox.native.js
  23. 27
    26
      react/features/toolbox/components/Toolbox.web.js
  24. 1
    0
      react/features/toolbox/components/index.js
  25. 3
    2
      react/features/toolbox/components/styles.js
  26. 20
    20
      react/features/toolbox/defaultToolbarButtons.js
  27. 22
    20
      react/features/toolbox/functions.js
  28. 0
    0
      react/features/toolbox/index.js
  29. 39
    0
      react/features/toolbox/middleware.js
  30. 42
    36
      react/features/toolbox/reducer.js

+ 1
- 1
conference.js Ver arquivo

@@ -20,7 +20,7 @@ import analytics from './modules/analytics/analytics';
20 20
 
21 21
 import EventEmitter from "events";
22 22
 
23
-import { showDesktopSharingButton } from './react/features/toolbar';
23
+import { showDesktopSharingButton } from './react/features/toolbox';
24 24
 
25 25
 import {
26 26
     AVATAR_ID_COMMAND,

+ 8
- 12
modules/UI/UI.js Ver arquivo

@@ -29,7 +29,7 @@ import {
29 29
 } from '../../react/features/base/media';
30 30
 import {
31 31
     checkAutoEnableDesktopSharing,
32
-    dockToolbar,
32
+    dockToolbox,
33 33
     setAudioIconEnabled,
34 34
     setToolbarButton,
35 35
     setVideoIconEnabled,
@@ -37,8 +37,8 @@ import {
37 37
     showEtherpadButton,
38 38
     showSharedVideoButton,
39 39
     showSIPCallButton,
40
-    showToolbar
41
-} from '../../react/features/toolbar';
40
+    showToolbox
41
+} from '../../react/features/toolbox';
42 42
 
43 43
 var EventEmitter = require("events");
44 44
 UI.messageHandler = require("./util/MessageHandler");
@@ -202,7 +202,7 @@ UI.setRaisedHandStatus = (participant, raisedHandStatus) => {
202 202
  * Sets the local "raised hand" status.
203 203
  */
204 204
 UI.setLocalRaisedHandStatus
205
-    = raisedHandStatus => 
205
+    = raisedHandStatus =>
206 206
         VideoLayout.setRaisedHandStatus(
207 207
             APP.conference.getMyUserId(),
208 208
             raisedHandStatus);
@@ -739,15 +739,11 @@ UI.clickOnVideo = function (videoNumber) {
739 739
     videos[videoIndex].click();
740 740
 };
741 741
 
742
-//Used by torture
743
-UI.showToolbar = function (timeout) {
744
-    APP.store.dispatch(showToolbar(timeout));
745
-};
742
+// Used by torture.
743
+UI.showToolbar = timeout => APP.store.dispatch(showToolbox(timeout));
746 744
 
747
-//Used by torture
748
-UI.dockToolbar = function (isDock) {
749
-    APP.store.dispatch(dockToolbar(isDock));
750
-};
745
+// Used by torture.
746
+UI.dockToolbar = dock => APP.store.dispatch(dockToolbox(dock));
751 747
 
752 748
 /**
753 749
  * Updates the avatar for participant.

+ 3
- 3
modules/UI/recording/Recording.js Ver arquivo

@@ -21,7 +21,7 @@ import UIUtil from '../util/UIUtil';
21 21
 import VideoLayout from '../videolayout/VideoLayout';
22 22
 import Feedback from '../feedback/Feedback.js';
23 23
 
24
-import { hideToolbar } from '../../../react/features/toolbar';
24
+import { hideToolbox } from '../../../react/features/toolbox';
25 25
 
26 26
 /**
27 27
  * The dialog for user input.
@@ -65,7 +65,7 @@ function _requestLiveStreamId() {
65 65
                     name="streamId" type="text"
66 66
                     data-i18n="[placeholder]dialog.streamKey"
67 67
                     autofocus><div style="text-align: right">
68
-                    <a class="helper-link" target="_new" 
68
+                    <a class="helper-link" target="_new"
69 69
                     href="${interfaceConfig.LIVE_STREAMING_HELP_LINK}">`
70 70
                         + streamIdHelp
71 71
                         + `</a></div>`,
@@ -264,7 +264,7 @@ var Recording = {
264 264
                 APP.conference.getMyUserId(), false);
265 265
             VideoLayout.setLocalVideoVisible(false);
266 266
             Feedback.enableFeedback(false);
267
-            APP.store.dispatch(hideToolbar());
267
+            APP.store.dispatch(hideToolbox());
268 268
             APP.UI.messageHandler.enableNotifications(false);
269 269
             APP.UI.messageHandler.enablePopups(false);
270 270
         }

+ 4
- 4
modules/UI/shared_video/SharedVideo.js Ver arquivo

@@ -10,7 +10,7 @@ import LargeContainer from '../videolayout/LargeContainer';
10 10
 import SmallVideo from '../videolayout/SmallVideo';
11 11
 import FilmStrip from '../videolayout/FilmStrip';
12 12
 
13
-import { dockToolbar, showToolbar } from '../../../react/features/toolbar';
13
+import { dockToolbox, showToolbox } from '../../../react/features/toolbox';
14 14
 
15 15
 export const SHARED_VIDEO_CONTAINER_TYPE = "sharedvideo";
16 16
 
@@ -579,7 +579,7 @@ class SharedVideoContainer extends LargeContainer {
579 579
                 self.bodyBackground = document.body.style.background;
580 580
                 document.body.style.background = 'black';
581 581
                 this.$iframe.css({opacity: 1});
582
-                APP.store.dispatch(dockToolbar(true));
582
+                APP.store.dispatch(dockToolbox(true));
583 583
                 resolve();
584 584
             });
585 585
         });
@@ -587,7 +587,7 @@ class SharedVideoContainer extends LargeContainer {
587 587
 
588 588
     hide () {
589 589
         let self = this;
590
-        APP.store.dispatch(dockToolbar(false));
590
+        APP.store.dispatch(dockToolbox(false));
591 591
         return new Promise(resolve => {
592 592
             this.$iframe.fadeOut(300, () => {
593 593
                 document.body.style.background = self.bodyBackground;
@@ -598,7 +598,7 @@ class SharedVideoContainer extends LargeContainer {
598 598
     }
599 599
 
600 600
     onHoverIn () {
601
-        APP.store.dispatch(showToolbar());
601
+        APP.store.dispatch(showToolbox());
602 602
     }
603 603
 
604 604
     get id () {

+ 5
- 5
modules/UI/side_pannels/chat/Chat.js Ver arquivo

@@ -9,7 +9,7 @@ import UIEvents from '../../../../service/UI/UIEvents';
9 9
 
10 10
 import { smileys } from './smileys';
11 11
 
12
-import { dockToolbar, setSubject } from '../../../../react/features/toolbar';
12
+import { dockToolbox, setSubject } from '../../../../react/features/toolbox';
13 13
 
14 14
 let unreadMessages = 0;
15 15
 const sidePanelsContainerId = 'sideToolbarContainer';
@@ -25,9 +25,9 @@ const htmlStr = `
25 25
         </div>
26 26
 
27 27
         <div id="chatconversation"></div>
28
-        <audio id="chatNotification" src="sounds/incomingMessage.wav" 
28
+        <audio id="chatNotification" src="sounds/incomingMessage.wav"
29 29
             preload="auto"></audio>
30
-        <textarea id="usermsg" autofocus 
30
+        <textarea id="usermsg" autofocus
31 31
             data-i18n="[placeholder]chat.messagebox"></textarea>
32 32
         <div id="smileysarea">
33 33
             <div id="smileys" id="toggle_smileys">
@@ -60,7 +60,7 @@ function updateVisualNotification() {
60 60
     if (unreadMessages) {
61 61
         unreadMsgElement.innerHTML = unreadMessages.toString();
62 62
 
63
-        APP.store.dispatch(dockToolbar(true));
63
+        APP.store.dispatch(dockToolbox(true));
64 64
 
65 65
         const chatButtonElement
66 66
             = document.getElementById('toolbar_button_chat');
@@ -239,7 +239,7 @@ var Chat = {
239 239
                 // Undock the toolbar when the chat is shown and if we're in a
240 240
                 // video mode.
241 241
                 if (VideoLayout.isLargeVideoVisible()) {
242
-                    APP.store.dispatch(dockToolbar(false));
242
+                    APP.store.dispatch(dockToolbox(false));
243 243
                 }
244 244
 
245 245
                 // if we are in conversation mode focus on the text input

+ 42
- 43
react/features/conference/components/Conference.native.js Ver arquivo

@@ -6,17 +6,17 @@ import { DialogContainer } from '../../base/dialog';
6 6
 import { Container } from '../../base/react';
7 7
 import { FilmStrip } from '../../film-strip';
8 8
 import { LargeVideo } from '../../large-video';
9
-import { setToolbarVisible, Toolbar } from '../../toolbar';
9
+import { setToolboxVisible, Toolbox } from '../../toolbox';
10 10
 
11 11
 import { styles } from './styles';
12 12
 
13 13
 /**
14
- * The timeout in milliseconds after which the toolbar will be hidden.
14
+ * The timeout in milliseconds after which the Toolbox will be hidden.
15 15
  *
16 16
  * @private
17 17
  * @type {number}
18 18
  */
19
-const _TOOLBAR_TIMEOUT_MS = 5000;
19
+const _TOOLBOX_TIMEOUT_MS = 5000;
20 20
 
21 21
 /**
22 22
  * The conference page of the mobile (i.e. React Native) application.
@@ -45,21 +45,21 @@ class Conference extends Component {
45 45
         _onDisconnect: React.PropTypes.func,
46 46
 
47 47
         /**
48
-         * The handler which dispatches the (redux) action setTooblarVisible to
49
-         * show/hide the toolbar.
48
+         * The handler which dispatches the (redux) action setToolboxVisible to
49
+         * show/hide the Toolbox.
50 50
          *
51 51
          * @private
52 52
          * @type {boolean}
53 53
          */
54
-        _setToolbarVisible: React.PropTypes.func,
54
+        _setToolboxVisible: React.PropTypes.func,
55 55
 
56 56
         /**
57
-         * The indicator which determines whether toolbar is visible.
57
+         * The indicator which determines whether the Toolbox is visible.
58 58
          *
59 59
          * @private
60 60
          * @type {boolean}
61 61
          */
62
-        _toolbarVisible: React.PropTypes.bool
62
+        _toolboxVisible: React.PropTypes.bool
63 63
     };
64 64
 
65 65
     /**
@@ -73,25 +73,25 @@ class Conference extends Component {
73 73
 
74 74
         /**
75 75
          * The numerical ID of the timeout in milliseconds after which the
76
-         * toolbar will be hidden. To be used with
76
+         * Toolbox will be hidden. To be used with
77 77
          * {@link WindowTimers#clearTimeout()}.
78 78
          *
79 79
          * @private
80 80
          */
81
-        this._toolbarTimeout = undefined;
81
+        this._toolboxTimeout = undefined;
82 82
 
83 83
         // Bind event handlers so they are only bound once for every instance.
84 84
         this._onClick = this._onClick.bind(this);
85 85
     }
86 86
 
87 87
     /**
88
-     * Inits the toolbar timeout after the component is initially rendered.
88
+     * Inits the Toolbox timeout after the component is initially rendered.
89 89
      *
90 90
      * @inheritdoc
91 91
      * returns {void}
92 92
      */
93 93
     componentDidMount() {
94
-        this._setToolbarTimeout(this.props._toolbarVisible);
94
+        this._setToolboxTimeout(this.props._toolboxVisible);
95 95
     }
96 96
 
97 97
     /**
@@ -106,13 +106,13 @@ class Conference extends Component {
106 106
 
107 107
     /**
108 108
      * Destroys connection, conference and local tracks when conference screen
109
-     * is left. Clears {@link #_toolbarTimeout} before the component unmounts.
109
+     * is left. Clears {@link #_toolboxTimeout} before the component unmounts.
110 110
      *
111 111
      * @inheritdoc
112 112
      * @returns {void}
113 113
      */
114 114
     componentWillUnmount() {
115
-        this._clearToolbarTimeout();
115
+        this._clearToolboxTimeout();
116 116
 
117 117
         this.props._onDisconnect();
118 118
     }
@@ -132,7 +132,7 @@ class Conference extends Component {
132 132
 
133 133
                 <LargeVideo />
134 134
 
135
-                <Toolbar />
135
+                <Toolbox />
136 136
                 <FilmStrip />
137 137
 
138 138
                 <DialogContainer />
@@ -141,46 +141,45 @@ class Conference extends Component {
141 141
     }
142 142
 
143 143
     /**
144
-     * Clears {@link #_toolbarTimeout} if any.
144
+     * Clears {@link #_toolboxTimeout} if any.
145 145
      *
146 146
      * @private
147 147
      * @returns {void}
148 148
      */
149
-    _clearToolbarTimeout() {
150
-        if (this._toolbarTimeout) {
151
-            clearTimeout(this._toolbarTimeout);
152
-            this._toolbarTimeout = undefined;
149
+    _clearToolboxTimeout() {
150
+        if (this._toolboxTimeout) {
151
+            clearTimeout(this._toolboxTimeout);
152
+            this._toolboxTimeout = undefined;
153 153
         }
154 154
     }
155 155
 
156 156
     /**
157
-     * Changes the value of the toolbarVisible state, thus allowing us to
158
-     * 'switch' between toolbar and filmstrip views and change the visibility of
159
-     * the above.
157
+     * Changes the value of the toolboxVisible state, thus allowing us to switch
158
+     * between Toolbox and FilmStrip and change their visibility.
160 159
      *
161 160
      * @private
162 161
      * @returns {void}
163 162
      */
164 163
     _onClick() {
165
-        const toolbarVisible = !this.props._toolbarVisible;
164
+        const toolboxVisible = !this.props._toolboxVisible;
166 165
 
167
-        this.props._setToolbarVisible(toolbarVisible);
168
-        this._setToolbarTimeout(toolbarVisible);
166
+        this.props._setToolboxVisible(toolboxVisible);
167
+        this._setToolboxTimeout(toolboxVisible);
169 168
     }
170 169
 
171 170
     /**
172
-     * Triggers the default toolbar timeout.
171
+     * Triggers the default Toolbox timeout.
173 172
      *
174
-     * @param {boolean} toolbarVisible - Indicates if the toolbar is currently
175
-     * visible.
173
+     * @param {boolean} toolboxVisible - Indicates whether the Toolbox is
174
+     * currently visible.
176 175
      * @private
177 176
      * @returns {void}
178 177
      */
179
-    _setToolbarTimeout(toolbarVisible) {
180
-        this._clearToolbarTimeout();
181
-        if (toolbarVisible) {
182
-            this._toolbarTimeout
183
-                = setTimeout(this._onClick, _TOOLBAR_TIMEOUT_MS);
178
+    _setToolboxTimeout(toolboxVisible) {
179
+        this._clearToolboxTimeout();
180
+        if (toolboxVisible) {
181
+            this._toolboxTimeout
182
+                = setTimeout(this._onClick, _TOOLBOX_TIMEOUT_MS);
184 183
         }
185 184
     }
186 185
 }
@@ -193,7 +192,7 @@ class Conference extends Component {
193 192
  * @returns {{
194 193
  *     _onConnect: Function,
195 194
  *     _onDisconnect: Function,
196
- *     _setToolbarVisible: Function
195
+ *     _setToolboxVisible: Function
197 196
  * }}
198 197
  */
199 198
 function _mapDispatchToProps(dispatch) {
@@ -219,15 +218,15 @@ function _mapDispatchToProps(dispatch) {
219 218
         },
220 219
 
221 220
         /**
222
-         * Dispatched an action changing visiblity of the toolbar.
221
+         * Dispatches an action changing the visiblity of the Toolbox.
223 222
          *
224
-         * @param {boolean} isVisible - Flag showing whether toolbar is
225
-         * visible.
223
+         * @param {boolean} visible - True to show the Toolbox or false to hide
224
+         * it.
226 225
          * @returns {Object} Dispatched action.
227 226
          * @private
228 227
          */
229
-        _setToolbarVisible(isVisible: boolean) {
230
-            return dispatch(setToolbarVisible(isVisible));
228
+        _setToolboxVisible(visible: boolean) {
229
+            return dispatch(setToolboxVisible(visible));
231 230
         }
232 231
     };
233 232
 }
@@ -238,18 +237,18 @@ function _mapDispatchToProps(dispatch) {
238 237
  * @param {Object} state - The Redux state.
239 238
  * @private
240 239
  * @returns {{
241
- *     _toolbarVisible: boolean
240
+ *     _toolboxVisible: boolean
242 241
  * }}
243 242
  */
244 243
 function _mapStateToProps(state) {
245 244
     return {
246 245
         /**
247
-         * The indicator which determines whether toolbar is visible.
246
+         * The indicator which determines whether the Toolbox is visible.
248 247
          *
249 248
          * @private
250 249
          * @type {boolean}
251 250
          */
252
-        _toolbarVisible: state['features/toolbar'].visible
251
+        _toolboxVisible: state['features/toolbox'].visible
253 252
     };
254 253
 }
255 254
 

+ 2
- 2
react/features/conference/components/Conference.web.js Ver arquivo

@@ -7,7 +7,7 @@ import { connect, disconnect } from '../../base/connection';
7 7
 import { DialogContainer } from '../../base/dialog';
8 8
 import { Watermarks } from '../../base/react';
9 9
 import { OverlayContainer } from '../../overlay';
10
-import { Toolbar } from '../../toolbar';
10
+import { Toolbox } from '../../toolbox';
11 11
 import { HideNotificationBarStyle } from '../../unsupported-browser';
12 12
 
13 13
 declare var $: Function;
@@ -65,7 +65,7 @@ class Conference extends Component {
65 65
     render() {
66 66
         return (
67 67
             <div id = 'videoconference_page'>
68
-                <Toolbar />
68
+                <Toolbox />
69 69
 
70 70
                 <div id = 'videospace'>
71 71
                     <div

+ 2
- 2
react/features/film-strip/components/FilmStrip.js Ver arquivo

@@ -110,7 +110,7 @@ class FilmStrip extends Component {
110 110
  * @returns {{
111 111
  *     _participants: Participant[],
112 112
  *     _visible: boolean
113
- *  }}
113
+ * }}
114 114
  */
115 115
 function _mapStateToProps(state) {
116 116
     return {
@@ -132,7 +132,7 @@ function _mapStateToProps(state) {
132 132
          * @private
133 133
          * @type {boolean}
134 134
          */
135
-        _visible: !state['features/toolbar'].visible
135
+        _visible: !state['features/toolbox'].visible
136 136
     };
137 137
 }
138 138
 

+ 0
- 98
react/features/toolbar/actionTypes.js Ver arquivo

@@ -1,98 +0,0 @@
1
-import { Symbol } from '../base/react';
2
-
3
-/**
4
- * The type of the action which signals that toolbar timeout should be changed.
5
- *
6
- * {
7
- *      type: CLEAR_TOOLBAR_TIMEOUT
8
- * }
9
- */
10
-export const CLEAR_TOOLBAR_TIMEOUT = Symbol('CLEAR_TOOLBAR_TIMEOUT');
11
-
12
-/**
13
- * The type of the action which signals that a value for always visible toolbar
14
- * should be changed.
15
- *
16
- * {
17
- *     type: SET_ALWAYS_VISIBLE_TOOLBAR,
18
- *     alwaysVisible: boolean
19
- * }
20
- */
21
-export const SET_ALWAYS_VISIBLE_TOOLBAR = Symbol('SET_ALWAYS_VISIBLE_TOOLBAR');
22
-
23
-/**
24
- * The type of the action which signals that a value for conference subject
25
- * should be changed.
26
- *
27
- * {
28
- *      type: SET_SUBJECT,
29
- *      subject: string
30
- * }
31
- */
32
-export const SET_SUBJECT = Symbol('SET_SUBJECT');
33
-
34
-/**
35
- * The type of the action which signals that a value of subject slide in should
36
- * be changed.
37
- *
38
- * {
39
- *     type: SET_SUBJECT_SLIDE_IN,
40
- *     subjectSlideIn: boolean
41
- * }
42
- */
43
-export const SET_SUBJECT_SLIDE_IN = Symbol('SET_SUBJECT_SLIDE_IN');
44
-
45
-/**
46
- * The type of the action which signals that a value for toolbar button should
47
- * be changed.
48
- *
49
- * {
50
- *     type: SET_TOOLBAR_BUTTON,
51
- *     button: Object,
52
- *     key: string
53
- * }
54
- */
55
-export const SET_TOOLBAR_BUTTON = Symbol('SET_TOOLBAR_BUTTON');
56
-
57
-/**
58
- * The type of the action which signals that toolbar is/isn't being hovered.
59
- *
60
- * {
61
- *     type: SET_TOOLBAR_HOVERED,
62
- *     hovered: boolean
63
- * }
64
- */
65
-export const SET_TOOLBAR_HOVERED = Symbol('SET_TOOLBAR_HOVERED');
66
-
67
-/**
68
- * The type of the action which signals that new toolbar timeout should be set
69
- * and the value of toolbar timeout should be changed.
70
- *
71
- * {
72
- *      type: SET_TOOLBAR_TIMEOUT,
73
- *      handler: Function,
74
-        toolbarTimeout: number
75
- * }
76
- */
77
-export const SET_TOOLBAR_TIMEOUT = Symbol('SET_TOOLBAR_TIMEOUT');
78
-
79
-/**
80
- * The type of the action which signals that value of toolbar timeout should
81
- * be changed.
82
- *
83
- * {
84
- *      type: SET_TOOLBAR_TIMEOUT_NUMBER,
85
- *      toolbarTimeout: number
86
- * }
87
- */
88
-export const SET_TOOLBAR_TIMEOUT_NUMBER = Symbol('SET_TOOLBAR_TIMEOUT');
89
-
90
-/**
91
- * The type of the (redux) action which shows/hides the toolbar.
92
- *
93
- * {
94
- *     type: SET_TOOLBAR_VISIBLE,
95
- *     visible: boolean
96
- * }
97
- */
98
-export const SET_TOOLBAR_VISIBLE = Symbol('SET_TOOLBAR_VISIBLE');

+ 0
- 1
react/features/toolbar/components/index.js Ver arquivo

@@ -1 +0,0 @@
1
-export { default as Toolbar } from './Toolbar';

+ 0
- 39
react/features/toolbar/middleware.js Ver arquivo

@@ -1,39 +0,0 @@
1
-/* @flow */
2
-
3
-import { MiddlewareRegistry } from '../base/redux';
4
-
5
-import {
6
-    CLEAR_TOOLBAR_TIMEOUT,
7
-    SET_TOOLBAR_TIMEOUT
8
-} from './actionTypes';
9
-
10
-/**
11
- * Middleware that captures toolbar actions and handle changes in toolbar
12
- * timeout.
13
- *
14
- * @param {Store} store - Redux store.
15
- * @returns {Function}
16
- */
17
-MiddlewareRegistry.register(store => next => action => {
18
-    switch (action.type) {
19
-    case CLEAR_TOOLBAR_TIMEOUT: {
20
-        const { timeoutId } = store.getState()['features/toolbar'];
21
-
22
-        clearTimeout(timeoutId);
23
-        break;
24
-    }
25
-
26
-    case SET_TOOLBAR_TIMEOUT: {
27
-        const { timeoutId } = store.getState()['features/toolbar'];
28
-        const { handler, toolbarTimeout } = action;
29
-
30
-        clearTimeout(timeoutId);
31
-        const newTimeoutId = setTimeout(handler, toolbarTimeout);
32
-
33
-        action.timeoutId = newTimeoutId;
34
-        break;
35
-    }
36
-    }
37
-
38
-    return next(action);
39
-});

+ 95
- 0
react/features/toolbox/actionTypes.js Ver arquivo

@@ -0,0 +1,95 @@
1
+import { Symbol } from '../base/react';
2
+
3
+/**
4
+ * The type of the action which clears the Toolbox visibility timeout.
5
+ *
6
+ * {
7
+ *     type: CLEAR_TOOLBOX_TIMEOUT
8
+ * }
9
+ */
10
+export const CLEAR_TOOLBOX_TIMEOUT = Symbol('CLEAR_TOOLBOX_TIMEOUT');
11
+
12
+/**
13
+ * The type of the action which sets the permanent visibility of the Toolbox.
14
+ *
15
+ * {
16
+ *     type: SET_TOOLBOX_ALWAYS_VISIBLE,
17
+ *     alwaysVisible: boolean
18
+ * }
19
+ */
20
+export const SET_TOOLBOX_ALWAYS_VISIBLE = Symbol('SET_TOOLBOX_ALWAYS_VISIBLE');
21
+
22
+/**
23
+ * The type of the action which sets the conference subject.
24
+ *
25
+ * {
26
+ *     type: SET_SUBJECT,
27
+ *     subject: string
28
+ * }
29
+ */
30
+export const SET_SUBJECT = Symbol('SET_SUBJECT');
31
+
32
+/**
33
+ * The type of the action which sets the subject slide in.
34
+ *
35
+ * {
36
+ *     type: SET_SUBJECT_SLIDE_IN,
37
+ *     subjectSlideIn: boolean
38
+ * }
39
+ */
40
+export const SET_SUBJECT_SLIDE_IN = Symbol('SET_SUBJECT_SLIDE_IN');
41
+
42
+/**
43
+ * The type of the action which sets the descriptor of a toolbar button.
44
+ *
45
+ * {
46
+ *     type: SET_TOOLBAR_BUTTON,
47
+ *     button: Object,
48
+ *     key: string
49
+ * }
50
+ */
51
+export const SET_TOOLBAR_BUTTON = Symbol('SET_TOOLBAR_BUTTON');
52
+
53
+/**
54
+ * The type of the action which sets the indicator which determiens whether a
55
+ * fToolbar in the Toolbox is hovered.
56
+ *
57
+ * {
58
+ *     type: SET_TOOLBAR_HOVERED,
59
+ *     hovered: boolean
60
+ * }
61
+ */
62
+export const SET_TOOLBAR_HOVERED = Symbol('SET_TOOLBAR_HOVERED');
63
+
64
+/**
65
+ * The type of the action which sets a new Toolbox visibility timeout and its
66
+ * delay.
67
+ *
68
+ * {
69
+ *     type: SET_TOOLBOX_TIMEOUT,
70
+ *     handler: Function,
71
+ *     timeoutMS: number
72
+ * }
73
+ */
74
+export const SET_TOOLBOX_TIMEOUT = Symbol('SET_TOOLBOX_TIMEOUT');
75
+
76
+/**
77
+ * The type of the action which sets the delay in milliseconds after which
78
+ * the Toolbox visibility is to be changed.
79
+ *
80
+ * {
81
+ *     type: SET_TOOLBOX_TIMEOUT_MS,
82
+ *     timeoutMS: number
83
+ * }
84
+ */
85
+export const SET_TOOLBOX_TIMEOUT_MS = Symbol('SET_TOOLBOX_TIMEOUT');
86
+
87
+/**
88
+ * The type of the (redux) action which shows/hides the Toolbox.
89
+ *
90
+ * {
91
+ *     type: SET_TOOLBOX_VISIBLE,
92
+ *     visible: boolean
93
+ * }
94
+ */
95
+export const SET_TOOLBOX_VISIBLE = Symbol('SET_TOOLBOX_VISIBLE');

react/features/toolbar/actions.native.js → react/features/toolbox/actions.native.js Ver arquivo

@@ -3,15 +3,15 @@
3 3
 import type { Dispatch } from 'redux-thunk';
4 4
 
5 5
 import {
6
-    CLEAR_TOOLBAR_TIMEOUT,
7
-    SET_ALWAYS_VISIBLE_TOOLBAR,
6
+    CLEAR_TOOLBOX_TIMEOUT,
7
+    SET_TOOLBOX_ALWAYS_VISIBLE,
8 8
     SET_SUBJECT,
9 9
     SET_SUBJECT_SLIDE_IN,
10 10
     SET_TOOLBAR_BUTTON,
11 11
     SET_TOOLBAR_HOVERED,
12
-    SET_TOOLBAR_TIMEOUT,
13
-    SET_TOOLBAR_TIMEOUT_NUMBER,
14
-    SET_TOOLBAR_VISIBLE
12
+    SET_TOOLBOX_TIMEOUT,
13
+    SET_TOOLBOX_TIMEOUT_MS,
14
+    SET_TOOLBOX_VISIBLE
15 15
 } from './actionTypes';
16 16
 
17 17
 /**
@@ -23,7 +23,7 @@ import {
23 23
 export function changeLocalRaiseHand(handRaised: boolean): Function {
24 24
     return (dispatch: Dispatch<*>, getState: Function) => {
25 25
         const state = getState();
26
-        const { secondaryToolbarButtons } = state['features/toolbar'];
26
+        const { secondaryToolbarButtons } = state['features/toolbox'];
27 27
         const buttonName = 'raisehand';
28 28
         const button = secondaryToolbarButtons.get(buttonName);
29 29
 
@@ -34,15 +34,15 @@ export function changeLocalRaiseHand(handRaised: boolean): Function {
34 34
 }
35 35
 
36 36
 /**
37
- * Signals that toolbar timeout should be cleared.
37
+ * Signals that toolbox timeout should be cleared.
38 38
  *
39 39
  * @returns {{
40
- *      type: CLEAR_TOOLBAR_TIMEOUT
40
+ *     type: CLEAR_TOOLBOX_TIMEOUT
41 41
  * }}
42 42
  */
43
-export function clearToolbarTimeout(): Object {
43
+export function clearToolboxTimeout(): Object {
44 44
     return {
45
-        type: CLEAR_TOOLBAR_TIMEOUT
45
+        type: CLEAR_TOOLBOX_TIMEOUT
46 46
     };
47 47
 }
48 48
 
@@ -51,22 +51,22 @@ export function clearToolbarTimeout(): Object {
51 51
  *
52 52
  * @param {boolean} alwaysVisible - Value to be set in redux store.
53 53
  * @returns {{
54
- *     type: SET_ALWAYS_VISIBLE_TOOLBAR,
55
- *     alwaysVisible: bool
54
+ *     type: SET_TOOLBOX_ALWAYS_VISIBLE,
55
+ *     alwaysVisible: boolean
56 56
  * }}
57 57
  */
58
-export function setAlwaysVisibleToolbar(alwaysVisible: boolean): Object {
58
+export function setToolboxAlwaysVisible(alwaysVisible: boolean): Object {
59 59
     return {
60
-        type: SET_ALWAYS_VISIBLE_TOOLBAR,
60
+        type: SET_TOOLBOX_ALWAYS_VISIBLE,
61 61
         alwaysVisible
62 62
     };
63 63
 }
64 64
 
65 65
 /**
66
- * Enables / disables audio toolbar button.
66
+ * Enables/disables audio toolbar button.
67 67
  *
68
- * @param {boolean} enabled - Indicates if the button should be enabled
69
- * or disabled.
68
+ * @param {boolean} enabled - True if the button should be enabled; otherwise,
69
+ * false.
70 70
  * @returns {Function}
71 71
  */
72 72
 export function setAudioIconEnabled(enabled: boolean = false): Function {
@@ -84,12 +84,12 @@ export function setAudioIconEnabled(enabled: boolean = false): Function {
84 84
 }
85 85
 
86 86
 /**
87
- *  Signals that value of conference subject should be changed.
87
+ * Signals that value of conference subject should be changed.
88 88
  *
89
- *  @param {string} subject - Conference subject string.
90
- *  @returns {Object}
89
+ * @param {string} subject - Conference subject string.
90
+ * @returns {Object}
91 91
  */
92
-export function setSubject(subject: string) {
92
+export function setSubject(subject: string): Object {
93 93
     return {
94 94
         type: SET_SUBJECT,
95 95
         subject
@@ -97,9 +97,10 @@ export function setSubject(subject: string) {
97 97
 }
98 98
 
99 99
 /**
100
- * Signals that toolbar subject slide in value should be changed.
100
+ * Signals that toolbox subject slide in value should be changed.
101 101
  *
102
- * @param {boolean} subjectSlideIn - Flag showing whether subject is shown.
102
+ * @param {boolean} subjectSlideIn - True if the subject is shown; otherwise,
103
+ * false.
103 104
  * @returns {{
104 105
  *     type: SET_SUBJECT_SLIDE_IN,
105 106
  *     subjectSlideIn: boolean
@@ -119,15 +120,15 @@ export function setSubjectSlideIn(subjectSlideIn: boolean): Object {
119 120
  * @param {Object} button - Button object.
120 121
  * @returns {{
121 122
  *     type: SET_TOOLBAR_BUTTON,
122
- *     buttonName: string,
123
- *     button: Object
123
+ *     button: Object,
124
+ *     buttonName: string
124 125
  * }}
125 126
  */
126 127
 export function setToolbarButton(buttonName: string, button: Object): Object {
127 128
     return {
128 129
         type: SET_TOOLBAR_BUTTON,
129
-        buttonName,
130
-        button
130
+        button,
131
+        buttonName
131 132
     };
132 133
 }
133 134
 
@@ -147,63 +148,67 @@ export function setToolbarHovered(hovered: boolean): Object {
147 148
     };
148 149
 }
149 150
 
151
+/* eslint-disable flowtype/space-before-type-colon */
152
+
150 153
 /**
151 154
  * Dispatches an action which sets new timeout and clears the previous one.
152 155
  *
153 156
  * @param {Function} handler - Function to be invoked after the timeout.
154
- * @param {number} toolbarTimeout - Delay.
157
+ * @param {number} timeoutMS - Delay.
155 158
  * @returns {{
156
- *      type: SET_TOOLBAR_TIMEOUT,
157
- *      handler: Function,
158
- *      toolbarTimeout: number
159
+ *     type: SET_TOOLBOX_TIMEOUT,
160
+ *     handler: Function,
161
+ *     timeoutMS: number
159 162
  * }}
160 163
  */
161
-export function setToolbarTimeout(handler: Function,
162
-        toolbarTimeout: number): Object {
164
+export function setToolboxTimeout(handler: Function, timeoutMS: number)
165
+      : Object {
163 166
     return {
164
-        type: SET_TOOLBAR_TIMEOUT,
167
+        type: SET_TOOLBOX_TIMEOUT,
165 168
         handler,
166
-        toolbarTimeout
169
+        timeoutMS
167 170
     };
168 171
 }
169 172
 
173
+/* eslint-enable flowtype/space-before-type-colon */
174
+
170 175
 /**
171
- * Dispatches an action which sets new toolbar timeout value.
176
+ * Dispatches an action which sets new toolbox timeout value.
172 177
  *
173
- * @param {number} toolbarTimeout - Delay.
178
+ * @param {number} timeoutMS - Delay.
174 179
  * @returns {{
175
- *      type: SET_TOOLBAR_TIMEOUT_NUMBER,
176
- *      toolbarTimeout: number
180
+ *     type: SET_TOOLBOX_TIMEOUT_MS,
181
+ *     timeoutMS: number
177 182
  * }}
178 183
  */
179
-export function setToolbarTimeoutNumber(toolbarTimeout: number): Object {
184
+export function setToolboxTimeoutMS(timeoutMS: number): Object {
180 185
     return {
181
-        type: SET_TOOLBAR_TIMEOUT_NUMBER,
182
-        toolbarTimeout
186
+        type: SET_TOOLBOX_TIMEOUT_MS,
187
+        timeoutMS
183 188
     };
184 189
 }
185 190
 
186 191
 /**
187
- * Shows/hides the toolbar.
192
+ * Shows/hides the toolbox.
188 193
  *
189
- * @param {boolean} visible - True to show the toolbar or false to hide it.
194
+ * @param {boolean} visible - True to show the toolbox or false to hide it.
190 195
  * @returns {{
191
- *     type: SET_TOOLBAR_VISIBLE,
196
+ *     type: SET_TOOLBOX_VISIBLE,
192 197
  *     visible: boolean
193 198
  * }}
194 199
  */
195
-export function setToolbarVisible(visible: boolean): Object {
200
+export function setToolboxVisible(visible: boolean): Object {
196 201
     return {
197
-        type: SET_TOOLBAR_VISIBLE,
202
+        type: SET_TOOLBOX_VISIBLE,
198 203
         visible
199 204
     };
200 205
 }
201 206
 
202 207
 /**
203
- * Enables / disables audio toolbar button.
208
+ * Enables/disables audio toolbar button.
204 209
  *
205
- * @param {boolean} enabled - Indicates if the button should be enabled
206
- * or disabled.
210
+ * @param {boolean} enabled - True if the button should be enabled; otherwise,
211
+ * false.
207 212
  * @returns {Function}
208 213
  */
209 214
 export function setVideoIconEnabled(enabled: boolean = false): Function {
@@ -243,7 +248,7 @@ export function showEtherpadButton(): Function {
243 248
 export function toggleFullScreen(isFullScreen: boolean): Function {
244 249
     return (dispatch: Dispatch<*>, getState: Function) => {
245 250
         const state = getState();
246
-        const { primaryToolbarButtons } = state['features/toolbar'];
251
+        const { primaryToolbarButtons } = state['features/toolbox'];
247 252
         const buttonName = 'fullscreen';
248 253
         const button = primaryToolbarButtons.get(buttonName);
249 254
 
@@ -265,7 +270,7 @@ export function toggleToolbarButton(buttonName: string): Function {
265 270
         const {
266 271
             primaryToolbarButtons,
267 272
             secondaryToolbarButtons
268
-        } = state['features/toolbar'];
273
+        } = state['features/toolbox'];
269 274
         const button
270 275
             = primaryToolbarButtons.get(buttonName)
271 276
                 || secondaryToolbarButtons.get(buttonName);

react/features/toolbar/actions.web.js → react/features/toolbox/actions.web.js Ver arquivo

@@ -7,13 +7,12 @@ import UIEvents from '../../../service/UI/UIEvents';
7 7
 import UIUtil from '../../../modules/UI/util/UIUtil';
8 8
 
9 9
 import {
10
-    clearToolbarTimeout,
11
-    setAlwaysVisibleToolbar,
10
+    clearToolboxTimeout,
12 11
     setSubjectSlideIn,
13 12
     setToolbarButton,
14
-    setToolbarTimeout,
15
-    setToolbarTimeoutNumber,
16
-    setToolbarVisible,
13
+    setToolboxTimeout,
14
+    setToolboxTimeoutMS,
15
+    setToolboxVisible,
17 16
     toggleToolbarButton
18 17
 } from './actions.native';
19 18
 
@@ -43,86 +42,73 @@ export function checkAutoEnableDesktopSharing(): Function {
43 42
 }
44 43
 
45 44
 /**
46
- * Docks/undocks toolbar based on its parameter.
45
+ * Docks/undocks the Toolbox.
47 46
  *
48 47
  * @param {boolean} dock - True if dock, false otherwise.
49 48
  * @returns {Function}
50 49
  */
51
-export function dockToolbar(dock: boolean): Function {
50
+export function dockToolbox(dock: boolean): Function {
52 51
     return (dispatch: Dispatch<*>, getState: Function) => {
53 52
         if (interfaceConfig.filmStripOnly) {
54 53
             return;
55 54
         }
56 55
 
57 56
         const state = getState();
58
-        const { toolbarTimeout, visible } = state['features/toolbar'];
57
+        const { timeoutMS, visible } = state['features/toolbox'];
59 58
 
60 59
         if (dock) {
61
-            // First make sure the toolbar is shown.
62
-            visible || dispatch(showToolbar());
60
+            // First make sure the toolbox is shown.
61
+            visible || dispatch(showToolbox());
63 62
 
64
-            dispatch(clearToolbarTimeout());
63
+            dispatch(clearToolboxTimeout());
65 64
         } else if (visible) {
66 65
             dispatch(
67
-                setToolbarTimeout(
68
-                    () => dispatch(hideToolbar()),
69
-                    toolbarTimeout));
66
+                setToolboxTimeout(
67
+                    () => dispatch(hideToolbox()),
68
+                    timeoutMS));
70 69
         } else {
71
-            dispatch(showToolbar());
70
+            dispatch(showToolbox());
72 71
         }
73 72
     };
74 73
 }
75 74
 
76 75
 /**
77
- * Hides the toolbar.
76
+ * Hides the toolbox.
78 77
  *
79
- * @param {boolean} force - True to force the hiding of the toolbar without
78
+ * @param {boolean} force - True to force the hiding of the toolbox without
80 79
  * caring about the extended toolbar side panels.
81 80
  * @returns {Function}
82 81
  */
83
-export function hideToolbar(force: boolean = false): Function {
82
+export function hideToolbox(force: boolean = false): Function {
84 83
     return (dispatch: Dispatch<*>, getState: Function) => {
85 84
         const state = getState();
86 85
         const {
87 86
             alwaysVisible,
88 87
             hovered,
89
-            toolbarTimeout
90
-        } = state['features/toolbar'];
88
+            timeoutMS
89
+        } = state['features/toolbox'];
91 90
 
92 91
         if (alwaysVisible) {
93 92
             return;
94 93
         }
95 94
 
96
-        dispatch(clearToolbarTimeout());
95
+        dispatch(clearToolboxTimeout());
97 96
 
98 97
         if (!force
99 98
                 && (hovered
100 99
                     || APP.UI.isRingOverlayVisible()
101 100
                     || SideContainerToggler.isVisible())) {
102 101
             dispatch(
103
-                setToolbarTimeout(
104
-                    () => dispatch(hideToolbar()),
105
-                    toolbarTimeout));
102
+                setToolboxTimeout(
103
+                    () => dispatch(hideToolbox()),
104
+                    timeoutMS));
106 105
         } else {
107
-            dispatch(setToolbarVisible(false));
106
+            dispatch(setToolboxVisible(false));
108 107
             dispatch(setSubjectSlideIn(false));
109 108
         }
110 109
     };
111 110
 }
112 111
 
113
-/**
114
- * Action that reset always visible toolbar to default state.
115
- *
116
- * @returns {Function}
117
- */
118
-export function resetAlwaysVisibleToolbar(): Function {
119
-    return (dispatch: Dispatch<*>) => {
120
-        const alwaysVisible = config.alwaysVisibleToolbar === true;
121
-
122
-        dispatch(setAlwaysVisibleToolbar(alwaysVisible));
123
-    };
124
-}
125
-
126 112
 /**
127 113
  * Signals that unclickable property of profile button should change its value.
128 114
  *
@@ -240,27 +226,28 @@ export function showSIPCallButton(show: boolean): Function {
240 226
 }
241 227
 
242 228
 /**
243
- * Shows the toolbar for specified timeout.
229
+ * Shows the toolbox for specified timeout.
244 230
  *
245
- * @param {number} timeout - Timeout for showing the toolbar.
231
+ * @param {number} timeout - Timeout for showing the toolbox.
246 232
  * @returns {Function}
247 233
  */
248
-export function showToolbar(timeout: number = 0): Object {
234
+export function showToolbox(timeout: number = 0): Object {
249 235
     return (dispatch: Dispatch<*>, getState: Function) => {
250 236
         if (interfaceConfig.filmStripOnly) {
251 237
             return;
252 238
         }
253 239
 
254 240
         const state = getState();
255
-        const { toolbarTimeout, visible } = state['features/toolbar'];
256
-        const finalTimeout = timeout || toolbarTimeout;
241
+        const { timeoutMS, visible } = state['features/toolbox'];
257 242
 
258 243
         if (!visible) {
259
-            dispatch(setToolbarVisible(true));
244
+            dispatch(setToolboxVisible(true));
260 245
             dispatch(setSubjectSlideIn(true));
261 246
             dispatch(
262
-                setToolbarTimeout(() => dispatch(hideToolbar()), finalTimeout));
263
-            dispatch(setToolbarTimeoutNumber(interfaceConfig.TOOLBAR_TIMEOUT));
247
+                setToolboxTimeout(
248
+                    () => dispatch(hideToolbox()),
249
+                    timeout || timeoutMS));
250
+            dispatch(setToolboxTimeoutMS(interfaceConfig.TOOLBAR_TIMEOUT));
264 251
         }
265 252
     };
266 253
 }
@@ -269,12 +256,12 @@ export function showToolbar(timeout: number = 0): Object {
269 256
  * Event handler for side toolbar container toggled event.
270 257
  *
271 258
  * @param {string} containerId - ID of the container.
272
- * @returns {void}
259
+ * @returns {Function}
273 260
  */
274 261
 export function toggleSideToolbarContainer(containerId: string): Function {
275 262
     return (dispatch: Dispatch, getState: Function) => {
276 263
         const state = getState();
277
-        const { secondaryToolbarButtons } = state['features/toolbar'];
264
+        const { secondaryToolbarButtons } = state['features/toolbox'];
278 265
 
279 266
         for (const key of secondaryToolbarButtons.keys()) {
280 267
             const isButtonEnabled = UIUtil.isButtonEnabled(key);

react/features/toolbar/components/AbstractToolbarButton.js → react/features/toolbox/components/AbstractToolbarButton.js Ver arquivo


react/features/toolbar/components/Notice.js → react/features/toolbox/components/Notice.js Ver arquivo


react/features/toolbar/components/PrimaryToolbar.web.js → react/features/toolbox/components/PrimaryToolbar.web.js Ver arquivo

@@ -6,7 +6,7 @@ import { connect } from 'react-redux';
6 6
 import UIEvents from '../../../../service/UI/UIEvents';
7 7
 
8 8
 import { showDesktopSharingButton, toggleFullScreen } from '../actions';
9
-import BaseToolbar from './BaseToolbar';
9
+import Toolbar from './Toolbar';
10 10
 import { getToolbarClassNames } from '../functions';
11 11
 
12 12
 declare var APP: Object;
@@ -19,7 +19,6 @@ declare var interfaceConfig: Object;
19 19
  * @extends Component
20 20
  */
21 21
 class PrimaryToolbar extends Component {
22
-
23 22
     state: Object;
24 23
 
25 24
     static propTypes = {
@@ -39,7 +38,7 @@ class PrimaryToolbar extends Component {
39 38
         _primaryToolbarButtons: React.PropTypes.instanceOf(Map),
40 39
 
41 40
         /**
42
-         * Shows whether toolbar is visible.
41
+         * Shows whether toolbox is visible.
43 42
          */
44 43
         _visible: React.PropTypes.bool
45 44
     };
@@ -108,7 +107,7 @@ class PrimaryToolbar extends Component {
108 107
         const { primaryToolbarClassName } = getToolbarClassNames(this.props);
109 108
 
110 109
         return (
111
-            <BaseToolbar
110
+            <Toolbar
112 111
                 buttonHandlers = { buttonHandlers }
113 112
                 className = { primaryToolbarClassName }
114 113
                 splitterIndex = { splitterIndex }
@@ -164,7 +163,7 @@ function _mapStateToProps(state: Object): Object {
164 163
     const {
165 164
         primaryToolbarButtons,
166 165
         visible
167
-    } = state['features/toolbar'];
166
+    } = state['features/toolbox'];
168 167
 
169 168
     return {
170 169
         /**
@@ -176,7 +175,7 @@ function _mapStateToProps(state: Object): Object {
176 175
         _primaryToolbarButtons: primaryToolbarButtons,
177 176
 
178 177
         /**
179
-         * Shows whether toolbar is visible.
178
+         * Shows whether toolbox is visible.
180 179
          *
181 180
          * @protected
182 181
          * @type {boolean}
@@ -186,4 +185,3 @@ function _mapStateToProps(state: Object): Object {
186 185
 }
187 186
 
188 187
 export default connect(_mapStateToProps, _mapDispatchToProps)(PrimaryToolbar);
189
-

react/features/toolbar/components/SecondaryToolbar.web.js → react/features/toolbox/components/SecondaryToolbar.web.js Ver arquivo

@@ -12,7 +12,7 @@ import {
12 12
     showRecordingButton,
13 13
     toggleSideToolbarContainer
14 14
 } from '../actions';
15
-import BaseToolbar from './BaseToolbar';
15
+import Toolbar from './Toolbar';
16 16
 import { getToolbarClassNames } from '../functions';
17 17
 
18 18
 declare var APP: Object;
@@ -25,7 +25,6 @@ declare var config: Object;
25 25
  * @extends Component
26 26
  */
27 27
 class SecondaryToolbar extends Component {
28
-
29 28
     state: Object;
30 29
 
31 30
     /**
@@ -60,7 +59,7 @@ class SecondaryToolbar extends Component {
60 59
         _secondaryToolbarButtons: React.PropTypes.instanceOf(Map),
61 60
 
62 61
         /**
63
-         * Shows whether toolbar is visible.
62
+         * Shows whether toolbox is visible.
64 63
          */
65 64
         _visible: React.PropTypes.bool
66 65
     };
@@ -157,12 +156,12 @@ class SecondaryToolbar extends Component {
157 156
         const { secondaryToolbarClassName } = getToolbarClassNames(this.props);
158 157
 
159 158
         return (
160
-            <BaseToolbar
159
+            <Toolbar
161 160
                 buttonHandlers = { buttonHandlers }
162 161
                 className = { secondaryToolbarClassName }
163 162
                 toolbarButtons = { _secondaryToolbarButtons }>
164 163
                 <FeedbackButton />
165
-            </BaseToolbar>
164
+            </Toolbar>
166 165
         );
167 166
     }
168 167
 }
@@ -239,7 +238,7 @@ function _mapStateToProps(state: Object): Object {
239 238
     const {
240 239
         secondaryToolbarButtons,
241 240
         visible
242
-    } = state['features/toolbar'];
241
+    } = state['features/toolbox'];
243 242
 
244 243
     return {
245 244
         /**

react/features/toolbar/components/BaseToolbar.web.js → react/features/toolbox/components/Toolbar.web.js Ver arquivo

@@ -13,13 +13,14 @@ declare var config: Object;
13 13
 declare var interfaceConfig: Object;
14 14
 
15 15
 /**
16
- * Class implementing Primary Toolbar React component.
16
+ * Implements a toolbar in React/Web. It is a strip that contains a set of
17
+ * toolbar items such as buttons. Toolbar is commonly placed inside of a
18
+ * Toolbox.
17 19
  *
18
- * @class PrimaryToolbar
20
+ * @class Toolbar
19 21
  * @extends Component
20 22
  */
21
-class BaseToolbar extends Component {
22
-
23
+class Toolbar extends Component {
23 24
     _renderToolbarButton: Function;
24 25
 
25 26
     /**
@@ -197,4 +198,4 @@ function _mapDispatchToProps(dispatch: Function): Object {
197 198
     };
198 199
 }
199 200
 
200
-export default connect(null, _mapDispatchToProps)(BaseToolbar);
201
+export default connect(null, _mapDispatchToProps)(Toolbar);

react/features/toolbar/components/ToolbarButton.native.js → react/features/toolbox/components/ToolbarButton.native.js Ver arquivo


react/features/toolbar/components/ToolbarButton.web.js → react/features/toolbox/components/ToolbarButton.web.js Ver arquivo


react/features/toolbar/components/Toolbar.native.js → react/features/toolbox/components/Toolbox.native.js Ver arquivo

@@ -15,11 +15,11 @@ import { styles } from './styles';
15 15
 import ToolbarButton from './ToolbarButton';
16 16
 
17 17
 /**
18
- * Implements the conference toolbar on React Native.
18
+ * Implements the conference toolbox on React Native.
19 19
  */
20
-class Toolbar extends Component {
20
+class Toolbox extends Component {
21 21
     /**
22
-     * Toolbar component's property types.
22
+     * Toolbox component's property types.
23 23
      *
24 24
      * @static
25 25
      */
@@ -220,7 +220,7 @@ class Toolbar extends Component {
220 220
  * TODO As soon as we have common font sets for web and native, this will no
221 221
  * longer be required.
222 222
  */
223
-Object.assign(Toolbar.prototype, {
223
+Object.assign(Toolbox.prototype, {
224 224
     audioIcon: 'microphone',
225 225
     audioMutedIcon: 'mic-disabled',
226 226
     videoIcon: 'camera',
@@ -293,4 +293,4 @@ function _mapStateToProps(state) {
293 293
     };
294 294
 }
295 295
 
296
-export default connect(_mapStateToProps, _mapDispatchToProps)(Toolbar);
296
+export default connect(_mapStateToProps, _mapDispatchToProps)(Toolbox);

react/features/toolbar/components/Toolbar.web.js → react/features/toolbox/components/Toolbox.web.js Ver arquivo

@@ -5,7 +5,7 @@ import { connect } from 'react-redux';
5 5
 
6 6
 import UIEvents from '../../../../service/UI/UIEvents';
7 7
 
8
-import { resetAlwaysVisibleToolbar } from '../actions';
8
+import { setToolboxAlwaysVisible } from '../actions';
9 9
 import {
10 10
     abstractMapStateToProps,
11 11
     showCustomToolbarPopup
@@ -19,10 +19,9 @@ declare var config: Object;
19 19
 declare var interfaceConfig: Object;
20 20
 
21 21
 /**
22
- * Implements the conference toolbar on React.
22
+ * Implements the conference toolbox on React/Web.
23 23
  */
24
-class Toolbar extends Component {
25
-
24
+class Toolbox extends Component {
26 25
     /**
27 26
      * App component's property types.
28 27
      *
@@ -30,9 +29,9 @@ class Toolbar extends Component {
30 29
      */
31 30
     static propTypes = {
32 31
         /**
33
-         * Handler dispatching reset always visible toolbar action.
32
+         * Handler dispatching reset always visible toolbox action.
34 33
          */
35
-        _onResetAlwaysVisibleToolbar: React.PropTypes.func,
34
+        _setToolboxAlwaysVisible: React.PropTypes.func,
36 35
 
37 36
         /**
38 37
          * Represents conference subject.
@@ -45,21 +44,22 @@ class Toolbar extends Component {
45 44
         _subjectSlideIn: React.PropTypes.bool,
46 45
 
47 46
         /**
48
-         * Property containing toolbar timeout id.
47
+         * Property containing toolbox timeout id.
49 48
          */
50
-        _timeoutId: React.PropTypes.number
49
+        _timeoutID: React.PropTypes.number
51 50
     };
52 51
 
53 52
     /**
54
-     * Invokes reset always visible toolbar after mounting the component and
53
+     * Invokes reset always visible toolbox after mounting the component and
55 54
      * registers legacy UI listeners.
56 55
      *
57 56
      * @returns {void}
58 57
      */
59 58
     componentDidMount(): void {
60
-        this.props._onResetAlwaysVisibleToolbar();
59
+        this.props._setToolboxAlwaysVisible();
61 60
 
62
-        APP.UI.addListener(UIEvents.SHOW_CUSTOM_TOOLBAR_BUTTON_POPUP,
61
+        APP.UI.addListener(
62
+            UIEvents.SHOW_CUSTOM_TOOLBAR_BUTTON_POPUP,
63 63
             showCustomToolbarPopup);
64 64
     }
65 65
 
@@ -69,7 +69,8 @@ class Toolbar extends Component {
69 69
      *  @returns {void}
70 70
      */
71 71
     componentWillUnmount(): void {
72
-        APP.UI.removeListener(UIEvents.SHOW_CUSTOM_TOOLBAR_BUTTON_POPUP,
72
+        APP.UI.removeListener(
73
+            UIEvents.SHOW_CUSTOM_TOOLBAR_BUTTON_POPUP,
73 74
             showCustomToolbarPopup);
74 75
     }
75 76
 
@@ -94,7 +95,7 @@ class Toolbar extends Component {
94 95
     }
95 96
 
96 97
     /**
97
-     * Returns React element representing toolbar subject.
98
+     * Returns React element representing toolbox subject.
98 99
      *
99 100
      * @returns {ReactElement}
100 101
      * @private
@@ -137,9 +138,8 @@ class Toolbar extends Component {
137 138
      * @private
138 139
      */
139 140
     _renderToolbars(): ReactElement<*> | null {
140
-        // We should not show the toolbars till timeout object will be
141
-        // initialized.
142
-        if (this.props._timeoutId === null) {
141
+        // The toolbars should not be shown until timeoutID is initialized.
142
+        if (this.props._timeoutID === null) {
143 143
             return null;
144 144
         }
145 145
 
@@ -158,7 +158,7 @@ class Toolbar extends Component {
158 158
  *
159 159
  * @param {Function} dispatch - Redux action dispatcher.
160 160
  * @returns {{
161
- *      _onResetAlwaysVisibleToolbar: Function
161
+ *     _setToolboxAlwaysVisible: Function
162 162
  * }}
163 163
  * @private
164 164
  */
@@ -166,18 +166,19 @@ function _mapDispatchToProps(dispatch: Function): Object {
166 166
     return {
167 167
 
168 168
         /**
169
-         * Dispatches an action resetting always visible toolbar.
169
+         * Dispatches an action resetting always visible toolbox.
170 170
          *
171 171
          * @returns {Object} Dispatched action.
172 172
          */
173
-        _onResetAlwaysVisibleToolbar() {
174
-            dispatch(resetAlwaysVisibleToolbar());
173
+        _setToolboxAlwaysVisible() {
174
+            dispatch(
175
+                setToolboxAlwaysVisible(config.alwaysVisibleToolbar === true));
175 176
         }
176 177
     };
177 178
 }
178 179
 
179 180
 /**
180
- * Maps parts of toolbar state to component props.
181
+ * Maps parts of toolbox state to component props.
181 182
  *
182 183
  * @param {Object} state - Redux state.
183 184
  * @private
@@ -192,8 +193,8 @@ function _mapStateToProps(state: Object): Object {
192 193
     const {
193 194
         subject,
194 195
         subjectSlideIn,
195
-        timeoutId
196
-    } = state['features/toolbar'];
196
+        timeoutID
197
+    } = state['features/toolbox'];
197 198
 
198 199
     return {
199 200
         ...abstractMapStateToProps(state),
@@ -215,13 +216,13 @@ function _mapStateToProps(state: Object): Object {
215 216
         _subjectSlideIn: subjectSlideIn,
216 217
 
217 218
         /**
218
-         * Property containing toolbar timeout id.
219
+         * Property containing toolbox timeout id.
219 220
          *
220 221
          * @protected
221 222
          * @type {number}
222 223
          */
223
-        _timeoutId: timeoutId
224
+        _timeoutID: timeoutID
224 225
     };
225 226
 }
226 227
 
227
-export default connect(_mapStateToProps, _mapDispatchToProps)(Toolbar);
228
+export default connect(_mapStateToProps, _mapDispatchToProps)(Toolbox);

+ 1
- 0
react/features/toolbox/components/index.js Ver arquivo

@@ -0,0 +1 @@
1
+export { default as Toolbox } from './Toolbox';

react/features/toolbar/components/styles.js → react/features/toolbox/components/styles.js Ver arquivo

@@ -64,7 +64,7 @@ const toolbar = {
64 64
 };
65 65
 
66 66
 /**
67
- * The (conference) toolbar related styles.
67
+ * The (conference) Toolbox/Toolbar related styles.
68 68
  */
69 69
 export const styles = createStyleSheet({
70 70
     /**
@@ -116,7 +116,8 @@ export const styles = createStyleSheet({
116 116
     },
117 117
 
118 118
     /**
119
-     * The style of the root/top-level Container of Toolbar.
119
+     * The style of the root/top-level Container of Toolbar that contains
120
+     * toolbars.
120 121
      */
121 122
     toolbarContainer: {
122 123
         bottom: 0,

react/features/toolbar/defaultToolbarButtons.js → react/features/toolbox/defaultToolbarButtons.js Ver arquivo

@@ -37,11 +37,11 @@ function _showSIPNumberInput() {
37 37
 }
38 38
 
39 39
 /**
40
- * All toolbar buttons' descriptions.
40
+ * All toolbar buttons' descriptors.
41 41
  */
42 42
 export default {
43 43
     /**
44
-     * Object representing camera button.
44
+     * The descriptor of the camera toolbar button.
45 45
      */
46 46
     camera: {
47 47
         classNames: [ 'button', 'icon-camera' ],
@@ -67,7 +67,7 @@ export default {
67 67
     },
68 68
 
69 69
     /**
70
-     * The Object representing chat button.
70
+     * The descriptor of the chat toolbar button.
71 71
      */
72 72
     chat: {
73 73
         classNames: [ 'button', 'icon-chat' ],
@@ -92,16 +92,16 @@ export default {
92 92
     },
93 93
 
94 94
     /**
95
-     * The object representing contact list button.
95
+     * The descriptor of the contact list toolbar button.
96 96
      */
97 97
     contacts: {
98 98
         classNames: [ 'button', 'icon-contactList' ],
99 99
         enabled: true,
100 100
 
101
-        // XXX: Hotfix to solve race condition between toolbar rendering and
101
+        // XXX: Hotfix to solve race condition between toolbox rendering and
102 102
         // contact list view that updates the number of active participants
103 103
         // via jQuery. There is case when contact list view updates number of
104
-        // participants but toolbar has not been rendered yet. Since this issue
104
+        // participants but toolbox has not been rendered yet. Since this issue
105 105
         // is reproducible only for conferences with the only participant let's
106 106
         // use 1 participant as a default value for this badge. Later after
107 107
         // reactification of contact list let's use the value of active
@@ -120,7 +120,7 @@ export default {
120 120
     },
121 121
 
122 122
     /**
123
-     * The object representing desktop sharing button.
123
+     * The descriptor of the desktop sharing toolbar button.
124 124
      */
125 125
     desktop: {
126 126
         classNames: [ 'button', 'icon-share-desktop' ],
@@ -145,7 +145,7 @@ export default {
145 145
     },
146 146
 
147 147
     /**
148
-     * The object representing dialpad button.
148
+     * The descriptor of the dialpad toolbar button.
149 149
      */
150 150
     dialpad: {
151 151
         classNames: [ 'button', 'icon-dialpad' ],
@@ -161,7 +161,7 @@ export default {
161 161
     },
162 162
 
163 163
     /**
164
-     * The object representing etherpad button.
164
+     * The descriptor of the etherpad toolbar button.
165 165
      */
166 166
     etherpad: {
167 167
         classNames: [ 'button', 'icon-share-doc' ],
@@ -176,7 +176,7 @@ export default {
176 176
     },
177 177
 
178 178
     /**
179
-     * The object representing button toggling full screen mode.
179
+     * The descriptor of the toolbar button which toggles full-screen mode.
180 180
      */
181 181
     fullscreen: {
182 182
         classNames: [ 'button', 'icon-full-screen' ],
@@ -198,7 +198,7 @@ export default {
198 198
     },
199 199
 
200 200
     /**
201
-     * The object representing hanging the call up button.
201
+     * The descriptor of the toolbar button which hangs up the call/conference.
202 202
      */
203 203
     hangup: {
204 204
         classNames: [ 'button', 'icon-hangup', 'button_hangup' ],
@@ -212,7 +212,7 @@ export default {
212 212
     },
213 213
 
214 214
     /**
215
-     * The object representing button showing invite user dialog.
215
+     * The descriptor of the toolbar button which shows the invite user dialog.
216 216
      */
217 217
     invite: {
218 218
         classNames: [ 'button', 'icon-link' ],
@@ -226,7 +226,7 @@ export default {
226 226
     },
227 227
 
228 228
     /**
229
-     * The object representing microphone button.
229
+     * The descriptor of the microphone toolbar button.
230 230
      */
231 231
     microphone: {
232 232
         classNames: [ 'button', 'icon-microphone' ],
@@ -281,7 +281,7 @@ export default {
281 281
     },
282 282
 
283 283
     /**
284
-     * The object representing profile button.
284
+     * The descriptor of the profile toolbar button.
285 285
      */
286 286
     profile: {
287 287
         classNames: [ 'button' ],
@@ -299,7 +299,7 @@ export default {
299 299
     },
300 300
 
301 301
     /**
302
-     * The object representing "Raise hand" button.
302
+     * The descriptor of the "Raise hand" toolbar button.
303 303
      */
304 304
     raisehand: {
305 305
         classNames: [ 'button', 'icon-raised-hand' ],
@@ -320,8 +320,8 @@ export default {
320 320
     },
321 321
 
322 322
     /**
323
-     * The object representing recording button. Requires additional
324
-     * initialization in Recording module.
323
+     * The descriptor of the recording toolbar button. Requires additional
324
+     * initialization in the recording module.
325 325
      */
326 326
     recording: {
327 327
         classNames: [ 'button' ],
@@ -334,7 +334,7 @@ export default {
334 334
     },
335 335
 
336 336
     /**
337
-     * The objecr representing settings button.
337
+     * The descriptor of the settings toolbar button.
338 338
      */
339 339
     settings: {
340 340
         classNames: [ 'button', 'icon-settings' ],
@@ -349,7 +349,7 @@ export default {
349 349
     },
350 350
 
351 351
     /**
352
-     * The object representing sharing Youtube video button.
352
+     * The descriptor of the "Share YouTube video" toolbar button.
353 353
      */
354 354
     sharedvideo: {
355 355
         classNames: [ 'button', 'icon-shared-video' ],
@@ -371,7 +371,7 @@ export default {
371 371
     },
372 372
 
373 373
     /**
374
-     * The object representing SIP call.
374
+     * The descriptor of the SIP call toolbar button.
375 375
      */
376 376
     sip: {
377 377
         classNames: [ 'button', 'icon-telephone' ],

react/features/toolbar/functions.js → react/features/toolbox/functions.js Ver arquivo

@@ -8,16 +8,16 @@ import { toggleAudioMuted, toggleVideoMuted } from '../base/media';
8 8
 
9 9
 import defaultToolbarButtons from './defaultToolbarButtons';
10 10
 
11
-declare var $: Function;
12
-declare var AJS: Object;
13
-declare var interfaceConfig: Object;
14
-
15 11
 import type { Dispatch } from 'redux-thunk';
16 12
 
17 13
 type MapOfAttributes = { [key: string]: * };
18 14
 
15
+declare var $: Function;
16
+declare var AJS: Object;
17
+declare var interfaceConfig: Object;
18
+
19 19
 /**
20
- * Maps actions to React component props.
20
+ * Maps (redux) actions to React component props.
21 21
  *
22 22
  * @param {Function} dispatch - Redux action dispatcher.
23 23
  * @returns {{
@@ -83,7 +83,7 @@ export function abstractMapDispatchToProps(dispatch: Dispatch<*>): Object {
83 83
  */
84 84
 export function abstractMapStateToProps(state: Object): Object {
85 85
     const media = state['features/base/media'];
86
-    const { visible } = state['features/toolbar'];
86
+    const { visible } = state['features/toolbox'];
87 87
 
88 88
     return {
89 89
         /**
@@ -103,7 +103,7 @@ export function abstractMapStateToProps(state: Object): Object {
103 103
         _videoMuted: media.video.muted,
104 104
 
105 105
         /**
106
-         * Flag showing whether toolbar is visible.
106
+         * Flag showing whether toolbox is visible.
107 107
          *
108 108
          * @protected
109 109
          * @type {boolean}
@@ -116,7 +116,7 @@ export function abstractMapStateToProps(state: Object): Object {
116 116
  * Takes toolbar button props and maps them to HTML attributes to set.
117 117
  *
118 118
  * @param {Object} props - Props set to the React component.
119
- * @returns {Object}
119
+ * @returns {MapOfAttributes}
120 120
  */
121 121
 export function getButtonAttributesByProps(props: Object): MapOfAttributes {
122 122
     const classNames = [ ...props.classNames ];
@@ -156,27 +156,29 @@ export function getDefaultToolbarButtons(): Object {
156 156
 
157 157
     if (typeof interfaceConfig !== 'undefined'
158 158
             && interfaceConfig.TOOLBAR_BUTTONS) {
159
-        toolbarButtons = interfaceConfig.TOOLBAR_BUTTONS.reduce(
160
-            (acc, buttonName) => {
161
-                const button = defaultToolbarButtons[buttonName];
159
+        toolbarButtons
160
+            = interfaceConfig.TOOLBAR_BUTTONS.reduce(
161
+                (acc, buttonName) => {
162
+                    const button = defaultToolbarButtons[buttonName];
162 163
 
163
-                if (button) {
164
-                    const place = _getToolbarButtonPlace(buttonName);
164
+                    if (button) {
165
+                        const place = _getToolbarButtonPlace(buttonName);
165 166
 
166
-                    button.buttonName = buttonName;
167
-                    acc[place].set(buttonName, button);
168
-                }
167
+                        button.buttonName = buttonName;
168
+                        acc[place].set(buttonName, button);
169
+                    }
169 170
 
170
-                return acc;
171
-            }, toolbarButtons);
171
+                    return acc;
172
+                },
173
+                toolbarButtons);
172 174
     }
173 175
 
174 176
     return toolbarButtons;
175 177
 }
176 178
 
177 179
 /**
178
- * Get place for toolbar button.
179
- * Now it can be in main toolbar or in extended (left) toolbar.
180
+ * Get place for toolbar button. Now it can be in the primary Toolbar or in the
181
+ * secondary Toolbar.
180 182
  *
181 183
  * @param {string} btn - Button name.
182 184
  * @private

react/features/toolbar/index.js → react/features/toolbox/index.js Ver arquivo


+ 39
- 0
react/features/toolbox/middleware.js Ver arquivo

@@ -0,0 +1,39 @@
1
+/* @flow */
2
+
3
+import { MiddlewareRegistry } from '../base/redux';
4
+
5
+import {
6
+    CLEAR_TOOLBOX_TIMEOUT,
7
+    SET_TOOLBOX_TIMEOUT
8
+} from './actionTypes';
9
+
10
+/**
11
+ * Middleware which intercepts Toolbox actions to handle changes to the
12
+ * visibility timeout of the Toolbox.
13
+ *
14
+ * @param {Store} store - Redux store.
15
+ * @returns {Function}
16
+ */
17
+MiddlewareRegistry.register(store => next => action => {
18
+    switch (action.type) {
19
+    case CLEAR_TOOLBOX_TIMEOUT: {
20
+        const { timeoutID } = store.getState()['features/toolbox'];
21
+
22
+        clearTimeout(timeoutID);
23
+        break;
24
+    }
25
+
26
+    case SET_TOOLBOX_TIMEOUT: {
27
+        const { timeoutID } = store.getState()['features/toolbox'];
28
+        const { handler, timeoutMS } = action;
29
+
30
+        clearTimeout(timeoutID);
31
+        const newTimeoutId = setTimeout(handler, timeoutMS);
32
+
33
+        action.timeoutID = newTimeoutId;
34
+        break;
35
+    }
36
+    }
37
+
38
+    return next(action);
39
+});

react/features/toolbar/reducer.js → react/features/toolbox/reducer.js Ver arquivo

@@ -3,90 +3,96 @@
3 3
 import { ReducerRegistry } from '../base/redux';
4 4
 
5 5
 import {
6
-    CLEAR_TOOLBAR_TIMEOUT,
7
-    SET_ALWAYS_VISIBLE_TOOLBAR,
6
+    CLEAR_TOOLBOX_TIMEOUT,
7
+    SET_TOOLBOX_ALWAYS_VISIBLE,
8 8
     SET_SUBJECT,
9 9
     SET_SUBJECT_SLIDE_IN,
10 10
     SET_TOOLBAR_BUTTON,
11 11
     SET_TOOLBAR_HOVERED,
12
-    SET_TOOLBAR_TIMEOUT,
13
-    SET_TOOLBAR_TIMEOUT_NUMBER,
14
-    SET_TOOLBAR_VISIBLE
12
+    SET_TOOLBOX_TIMEOUT,
13
+    SET_TOOLBOX_TIMEOUT_MS,
14
+    SET_TOOLBOX_VISIBLE
15 15
 } from './actionTypes';
16 16
 import { getDefaultToolbarButtons } from './functions';
17 17
 
18 18
 declare var interfaceConfig: Object;
19 19
 
20 20
 /**
21
- * Returns initial state for toolbar's part of Redux store.
21
+ * Returns initial state for toolbox's part of Redux store.
22 22
  *
23
+ * @private
23 24
  * @returns {{
25
+ *     alwaysVisible: boolean,
26
+ *     hovered: boolean,
24 27
  *     primaryToolbarButtons: Map,
25
- *     secondaryToolbarButtons: Map
28
+ *     secondaryToolbarButtons: Map,
29
+ *     subject: string,
30
+ *     subjectSlideIn: boolean,
31
+ *     timeoutID: number,
32
+ *     timeoutMS: number,
33
+ *     visible: boolean
26 34
  * }}
27
- * @private
28 35
  */
29 36
 function _getInitialState() {
30
-    // Default toolbar timeout for mobile app.
31
-    let toolbarTimeout = 5000;
37
+    // Default toolbox timeout for mobile app.
38
+    let timeoutMS = 5000;
32 39
 
33 40
     if (typeof interfaceConfig !== 'undefined'
34 41
             && interfaceConfig.INITIAL_TOOLBAR_TIMEOUT) {
35
-        toolbarTimeout = interfaceConfig.INITIAL_TOOLBAR_TIMEOUT;
42
+        timeoutMS = interfaceConfig.INITIAL_TOOLBAR_TIMEOUT;
36 43
     }
37 44
 
38 45
     return {
39
-        /**
40
-         * Contains default toolbar buttons for primary and secondary toolbars.
41
-         *
42
-         * @type {Map}
43
-         */
44 46
         ...getDefaultToolbarButtons(),
45 47
 
46 48
         /**
47
-         * Shows whether toolbar is always visible.
49
+         * The indicator which determines whether the Toolbox should always be
50
+         * visible.
48 51
          *
49 52
          * @type {boolean}
50 53
          */
51 54
         alwaysVisible: false,
52 55
 
53 56
         /**
54
-         * Shows whether toolbar is hovered.
57
+         * The indicator which determines whether a Toolbar in the Toolbox is
58
+         * hovered.
55 59
          *
56 60
          * @type {boolean}
57 61
          */
58 62
         hovered: false,
59 63
 
60 64
         /**
61
-         * Contains text of conference subject.
65
+         * The text of the conference subject.
62 66
          *
63 67
          * @type {string}
64 68
          */
65 69
         subject: '',
66 70
 
67 71
         /**
68
-         * Shows whether subject is sliding in.
72
+         * The indicator which determines whether the subject is sliding in.
69 73
          *
70 74
          * @type {boolean}
71 75
          */
72 76
         subjectSlideIn: false,
73 77
 
74 78
         /**
75
-         * Contains toolbar timeout id.
79
+         * A number, non-zero value which identifies the timer created by a call
80
+         * to setTimeout() with timeoutMS.
76 81
          *
77 82
          * @type {number|null}
78 83
          */
79
-        timeoutId: null,
84
+        timeoutID: null,
80 85
 
81 86
         /**
82
-         * Contains delay of toolbar timeout.
87
+         * The delay in milliseconds before timeoutID executes (after its
88
+         * initialization).
83 89
          *
84 90
          * @type {number}
85 91
          */
86
-        toolbarTimeout,
92
+        timeoutMS,
87 93
 
88 94
         /**
89
-         * Shows whether toolbar is visible.
95
+         * The indicator which determines whether the Toolbox is visible.
90 96
          *
91 97
          * @type {boolean}
92 98
          */
@@ -95,16 +101,16 @@ function _getInitialState() {
95 101
 }
96 102
 
97 103
 ReducerRegistry.register(
98
-    'features/toolbar',
104
+    'features/toolbox',
99 105
     (state: Object = _getInitialState(), action: Object) => {
100 106
         switch (action.type) {
101
-        case CLEAR_TOOLBAR_TIMEOUT:
107
+        case CLEAR_TOOLBOX_TIMEOUT:
102 108
             return {
103 109
                 ...state,
104
-                timeoutId: undefined
110
+                timeoutID: undefined
105 111
             };
106 112
 
107
-        case SET_ALWAYS_VISIBLE_TOOLBAR:
113
+        case SET_TOOLBOX_ALWAYS_VISIBLE:
108 114
             return {
109 115
                 ...state,
110 116
                 alwaysVisible: action.alwaysVisible
@@ -131,20 +137,20 @@ ReducerRegistry.register(
131 137
                 hovered: action.hovered
132 138
             };
133 139
 
134
-        case SET_TOOLBAR_TIMEOUT:
140
+        case SET_TOOLBOX_TIMEOUT:
135 141
             return {
136 142
                 ...state,
137
-                toolbarTimeout: action.toolbarTimeout,
138
-                timeoutId: action.timeoutId
143
+                timeoutID: action.timeoutID,
144
+                timeoutMS: action.timeoutMS
139 145
             };
140 146
 
141
-        case SET_TOOLBAR_TIMEOUT_NUMBER:
147
+        case SET_TOOLBOX_TIMEOUT_MS:
142 148
             return {
143 149
                 ...state,
144
-                toolbarTimeout: action.toolbarTimeout
150
+                timeoutMS: action.timeoutMS
145 151
             };
146 152
 
147
-        case SET_TOOLBAR_VISIBLE:
153
+        case SET_TOOLBOX_VISIBLE:
148 154
             return {
149 155
                 ...state,
150 156
                 visible: action.visible
@@ -161,8 +167,8 @@ ReducerRegistry.register(
161 167
  * @param {Object} action - Dispatched action.
162 168
  * @param {Object} action.button - Object describing toolbar button.
163 169
  * @param {Object} action.buttonName - The name of the button.
164
- * @returns {Object}
165 170
  * @private
171
+ * @returns {Object}
166 172
  */
167 173
 function _setButton(state, { buttonName, button }): Object {
168 174
     const {

Carregando…
Cancelar
Salvar