Преглед изворни кода

feat(DownloadOverflowButton): Implement.

j8
Mihai Uscat пре 5 година
родитељ
комит
72bb897269

+ 7
- 0
config.js Прегледај датотеку

423
     // user documentation.
423
     // user documentation.
424
     // userDocumentationURL: 'https://docs.example.com/video-meetings.html'
424
     // userDocumentationURL: 'https://docs.example.com/video-meetings.html'
425
 
425
 
426
+    // URLs meant to be opened in different windows.
427
+    // deploymentUrls: {
428
+    //  // If specified a 'Download our apps' button will be displayed in the overflow menu with a link
429
+    //  // to the specified URL for an app download page.
430
+    //  downloadAppsUrl: 'https://docs.example.com/our-apps.html'
431
+    // }
432
+
426
     // List of undocumented settings used in jitsi-meet
433
     // List of undocumented settings used in jitsi-meet
427
     /**
434
     /**
428
      _immediateReloadThreshold
435
      _immediateReloadThreshold

+ 1
- 1
interface_config.js Прегледај датотеку

51
         'fodeviceselection', 'hangup', 'profile', 'info', 'chat', 'recording',
51
         'fodeviceselection', 'hangup', 'profile', 'info', 'chat', 'recording',
52
         'livestreaming', 'etherpad', 'sharedvideo', 'settings', 'raisehand',
52
         'livestreaming', 'etherpad', 'sharedvideo', 'settings', 'raisehand',
53
         'videoquality', 'filmstrip', 'invite', 'feedback', 'stats', 'shortcuts',
53
         'videoquality', 'filmstrip', 'invite', 'feedback', 'stats', 'shortcuts',
54
-        'tileview', 'videobackgroundblur'
54
+        'tileview', 'videobackgroundblur', 'download'
55
     ],
55
     ],
56
 
56
 
57
     SETTINGS_SECTIONS: [ 'devices', 'language', 'moderator', 'profile', 'calendar' ],
57
     SETTINGS_SECTIONS: [ 'devices', 'language', 'moderator', 'profile', 'calendar' ],

+ 2
- 0
lang/main.json Прегледај датотеку

570
             "cc": "Toggle subtitles",
570
             "cc": "Toggle subtitles",
571
             "chat": "Toggle chat window",
571
             "chat": "Toggle chat window",
572
             "document": "Toggle shared document",
572
             "document": "Toggle shared document",
573
+            "download": "Download our apps",
573
             "feedback": "Leave feedback",
574
             "feedback": "Leave feedback",
574
             "fullScreen": "Toggle full screen",
575
             "fullScreen": "Toggle full screen",
575
             "hangup": "Leave the call",
576
             "hangup": "Leave the call",
609
         "closeChat": "Close chat",
610
         "closeChat": "Close chat",
610
         "documentClose": "Close shared document",
611
         "documentClose": "Close shared document",
611
         "documentOpen": "Open shared document",
612
         "documentOpen": "Open shared document",
613
+        "download": "Download our apps",
612
         "enterFullScreen": "View full screen",
614
         "enterFullScreen": "View full screen",
613
         "enterTileView": "Enter tile view",
615
         "enterTileView": "Enter tile view",
614
         "exitFullScreen": "Exit full screen",
616
         "exitFullScreen": "Exit full screen",

+ 3
- 0
react/features/base/icons/svg/download.svg Прегледај датотеку

1
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+<path fill-rule="evenodd" clip-rule="evenodd" d="M11 13.3705V5C11 4.44772 11.4477 4 12 4C12.5523 4 13 4.44772 13 5V13.4667L15.631 10.5433C16.0005 10.1328 16.6328 10.0995 17.0433 10.469C17.4538 10.8384 17.4871 11.4707 17.1176 11.8812L12.1064 17.4492C12.0727 17.4867 12.0139 17.4867 11.9802 17.4492L6.96897 11.8812C6.59951 11.4707 6.63278 10.8384 7.04329 10.469C7.4538 10.0995 8.08609 10.1328 8.45555 10.5433L11 13.3705ZM20 15C20 14.4477 20.4477 14 21 14C21.5523 14 22 14.4477 22 15V21C22 21.5523 21.5523 22 21 22H3C2.96548 22 2.93137 21.9983 2.89776 21.9948C2.3935 21.9436 2 21.5178 2 21V15C2 14.4477 2.44772 14 3 14C3.55228 14 4 14.4477 4 15V20H20V15Z" fill="#A4B8D1"/>
3
+</svg>

+ 1
- 0
react/features/base/icons/svg/index.js Прегледај датотеку

24
 export { default as IconDeviceHeadphone } from './headset.svg';
24
 export { default as IconDeviceHeadphone } from './headset.svg';
25
 export { default as IconDeviceSpeaker } from './volume.svg';
25
 export { default as IconDeviceSpeaker } from './volume.svg';
26
 export { default as IconDominantSpeaker } from './dominant-speaker.svg';
26
 export { default as IconDominantSpeaker } from './dominant-speaker.svg';
27
+export { default as IconDownload } from './download.svg';
27
 export { default as IconEventNote } from './event_note.svg';
28
 export { default as IconEventNote } from './event_note.svg';
28
 export { default as IconExitFullScreen } from './exit-full-screen.svg';
29
 export { default as IconExitFullScreen } from './exit-full-screen.svg';
29
 export { default as IconFeedback } from './feedback.svg';
30
 export { default as IconFeedback } from './feedback.svg';

+ 56
- 0
react/features/toolbox/components/DownloadButton.js Прегледај датотеку

1
+// @flow
2
+
3
+import { createToolbarEvent, sendAnalytics } from '../../analytics';
4
+import { translate } from '../../base/i18n';
5
+import { IconDownload } from '../../base/icons';
6
+import { connect } from '../../base/redux';
7
+import { openURLInBrowser } from '../../base/util';
8
+import { AbstractButton, type AbstractButtonProps } from '../../base/toolbox';
9
+
10
+
11
+type Props = AbstractButtonProps & {
12
+
13
+    /**
14
+     * The URL to the applications page.
15
+     */
16
+    _downloadAppsUrl: string
17
+};
18
+
19
+/**
20
+ * Implements an {@link AbstractButton} to open the applications page in a new window.
21
+ */
22
+class DownloadButton extends AbstractButton<Props, *> {
23
+    accessibilityLabel = 'toolbar.accessibilityLabel.download';
24
+    icon = IconDownload;
25
+    label = 'toolbar.download';
26
+
27
+    /**
28
+     * Handles clicking / pressing the button, and opens a new window with the user documentation.
29
+     *
30
+     * @private
31
+     * @returns {void}
32
+     */
33
+    _handleClick() {
34
+        sendAnalytics(createToolbarEvent('download.pressed'));
35
+        openURLInBrowser(this.props._downloadAppsUrl);
36
+    }
37
+}
38
+
39
+
40
+/**
41
+ * Maps part of the redux state to the component's props.
42
+ *
43
+ * @param {Object} state - The redux store/state.
44
+ * @returns {Object}
45
+ */
46
+function _mapStateToProps(state: Object) {
47
+    const { downloadAppsUrl } = state['features/base/config'].deploymentUrls || {};
48
+    const visible = typeof downloadAppsUrl === 'string';
49
+
50
+    return {
51
+        _downloadAppsUrl: downloadAppsUrl,
52
+        visible
53
+    };
54
+}
55
+
56
+export default translate(connect(_mapStateToProps)(DownloadButton));

+ 5
- 0
react/features/toolbox/components/web/Toolbox.js Прегледај датотеку

69
     setToolbarHovered
69
     setToolbarHovered
70
 } from '../../actions';
70
 } from '../../actions';
71
 import AudioMuteButton from '../AudioMuteButton';
71
 import AudioMuteButton from '../AudioMuteButton';
72
+import DownloadButton from '../DownloadButton';
72
 import { isToolboxVisible } from '../../functions';
73
 import { isToolboxVisible } from '../../functions';
73
 import HangupButton from '../HangupButton';
74
 import HangupButton from '../HangupButton';
74
 import HelpButton from '../HelpButton';
75
 import HelpButton from '../HelpButton';
975
                     key = 'shortcuts'
976
                     key = 'shortcuts'
976
                     onClick = { this._onToolbarOpenKeyboardShortcuts }
977
                     onClick = { this._onToolbarOpenKeyboardShortcuts }
977
                     text = { t('toolbar.shortcuts') } />,
978
                     text = { t('toolbar.shortcuts') } />,
979
+            this._shouldShowButton('download')
980
+                && <DownloadButton
981
+                    key = 'download'
982
+                    showLabel = { true } />,
978
             this._shouldShowButton('help')
983
             this._shouldShowButton('help')
979
                 && <HelpButton
984
                 && <HelpButton
980
                     key = 'help'
985
                     key = 'help'

Loading…
Откажи
Сачувај