Browse Source

register shortcuts in the middleware

master
Radium Zheng 7 years ago
parent
commit
cc38fcc5d0

+ 0
- 14
react/features/local-recording/components/LocalRecordingButton.js View File

81
     _onClick() {
81
     _onClick() {
82
         this.props.onClick();
82
         this.props.onClick();
83
     }
83
     }
84
-
85
-    _onCloseDialog: () => void;
86
-
87
-    /**
88
-     * Callback invoked when {@code InlineDialog} signals that it should be
89
-     * close.
90
-     *
91
-     * @returns {void}
92
-     */
93
-    _onCloseDialog() {
94
-        // Do nothing for now, because we want the dialog to stay open
95
-        // after certain time, otherwise the moderator might need to repeatly
96
-        // open the dialog to see the stats.
97
-    }
98
 }
84
 }
99
 
85
 
100
 export default translate(LocalRecordingButton);
86
 export default translate(LocalRecordingButton);

+ 12
- 0
react/features/local-recording/middleware.js View File

2
 
2
 
3
 import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../base/app';
3
 import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../base/app';
4
 import { CONFERENCE_JOINED } from '../base/conference';
4
 import { CONFERENCE_JOINED } from '../base/conference';
5
+import { toggleDialog } from '../base/dialog';
5
 import { i18next } from '../base/i18n';
6
 import { i18next } from '../base/i18n';
6
 import { MiddlewareRegistry } from '../base/redux';
7
 import { MiddlewareRegistry } from '../base/redux';
7
 import { showNotification } from '../notifications';
8
 import { showNotification } from '../notifications';
8
 
9
 
9
 import { localRecordingEngaged, localRecordingUnengaged } from './actions';
10
 import { localRecordingEngaged, localRecordingUnengaged } from './actions';
11
+import { LocalRecordingInfoDialog } from './components';
10
 import { recordingController } from './controller';
12
 import { recordingController } from './controller';
11
 
13
 
14
+declare var APP: Object;
15
+
12
 MiddlewareRegistry.register(({ getState, dispatch }) => next => action => {
16
 MiddlewareRegistry.register(({ getState, dispatch }) => next => action => {
13
     const result = next(action);
17
     const result = next(action);
14
 
18
 
45
                 description: i18next.t(messageKey, messageParams)
49
                 description: i18next.t(messageKey, messageParams)
46
             }, 10000));
50
             }, 10000));
47
         };
51
         };
52
+
53
+        // register shortcut
54
+        APP.keyboardshortcut.registerShortcut(
55
+            'L',
56
+            null,
57
+            () => dispatch(toggleDialog(LocalRecordingInfoDialog)),
58
+            'keyboardShortcuts.localRecording'
59
+        );
48
         break;
60
         break;
49
     case APP_WILL_UNMOUNT:
61
     case APP_WILL_UNMOUNT:
50
         recordingController.onStateChanged = null;
62
         recordingController.onStateChanged = null;

+ 8
- 13
react/features/toolbox/components/web/Toolbox.js View File

237
             = this._onToolbarToggleScreenshare.bind(this);
237
             = this._onToolbarToggleScreenshare.bind(this);
238
         this._onToolbarToggleSharedVideo
238
         this._onToolbarToggleSharedVideo
239
             = this._onToolbarToggleSharedVideo.bind(this);
239
             = this._onToolbarToggleSharedVideo.bind(this);
240
-        this._onToolbarToggleLocalRecordingInfoDialog
241
-            = this._onToolbarToggleLocalRecordingInfoDialog.bind(this);
240
+        this._onToolbarOpenLocalRecordingInfoDialog
241
+            = this._onToolbarOpenLocalRecordingInfoDialog.bind(this);
242
     }
242
     }
243
 
243
 
244
     /**
244
     /**
268
                 character: 'S',
268
                 character: 'S',
269
                 exec: this._onShortcutToggleFullScreen,
269
                 exec: this._onShortcutToggleFullScreen,
270
                 helpDescription: 'keyboardShortcuts.fullScreen'
270
                 helpDescription: 'keyboardShortcuts.fullScreen'
271
-            },
272
-            this._shouldShowButton('localrecording') && {
273
-                character: 'L',
274
-                exec: this._onToolbarToggleLocalRecordingInfoDialog,
275
-                helpDescription: 'keyboardShortcuts.localRecording'
276
             }
271
             }
277
         ];
272
         ];
278
 
273
 
388
                 <div className = 'button-group-right'>
383
                 <div className = 'button-group-right'>
389
                     { this._shouldShowButton('localrecording')
384
                     { this._shouldShowButton('localrecording')
390
                         && <LocalRecordingButton
385
                         && <LocalRecordingButton
391
-                            isDialogShown =
392
-                                { this.props._localRecState.showDialog }
393
                             onClick = {
386
                             onClick = {
394
-                                this._onToolbarToggleLocalRecordingInfoDialog
387
+                                this._onToolbarOpenLocalRecordingInfoDialog
395
                             } />
388
                             } />
396
                     }
389
                     }
397
                     { this._shouldShowButton('invite')
390
                     { this._shouldShowButton('invite')
864
         this._doToggleSharedVideo();
857
         this._doToggleSharedVideo();
865
     }
858
     }
866
 
859
 
867
-    _onToolbarToggleLocalRecordingInfoDialog: () => void;
860
+    _onToolbarOpenLocalRecordingInfoDialog: () => void;
868
 
861
 
869
     /**
862
     /**
870
-     * Switches local recording on or off.
863
+     * Opens the {@code LocalRecordingInfoDialog}.
871
      *
864
      *
872
      * @private
865
      * @private
873
      * @returns {void}
866
      * @returns {void}
874
      */
867
      */
875
-    _onToolbarToggleLocalRecordingInfoDialog() {
868
+    _onToolbarOpenLocalRecordingInfoDialog() {
869
+        sendAnalytics(createToolbarEvent('local.recording'));
870
+
876
         this.props.dispatch(openDialog(LocalRecordingInfoDialog));
871
         this.props.dispatch(openDialog(LocalRecordingInfoDialog));
877
     }
872
     }
878
 
873
 

Loading…
Cancel
Save