|
@@ -1,4 +1,4 @@
|
1
|
|
-/* global APP, $, JitsiMeetJS */
|
|
1
|
+/* global APP, $, JitsiMeetJS, interfaceConfig */
|
2
|
2
|
import UIUtil from "../../util/UIUtil";
|
3
|
3
|
import UIEvents from "../../../../service/UI/UIEvents";
|
4
|
4
|
import languages from "../../../../service/translation/languages";
|
|
@@ -6,6 +6,7 @@ import Settings from '../../../settings/Settings';
|
6
|
6
|
|
7
|
7
|
/**
|
8
|
8
|
* Generate html select options for available languages.
|
|
9
|
+ *
|
9
|
10
|
* @param {string[]} items available languages
|
10
|
11
|
* @param {string} [currentLang] current language
|
11
|
12
|
* @returns {string}
|
|
@@ -28,6 +29,7 @@ function generateLanguagesOptions(items, currentLang) {
|
28
|
29
|
|
29
|
30
|
/**
|
30
|
31
|
* Generate html select options for available physical devices.
|
|
32
|
+ *
|
31
|
33
|
* @param {{ deviceId, label }[]} items available devices
|
32
|
34
|
* @param {string} [selectedId] id of selected device
|
33
|
35
|
* @param {boolean} permissionGranted if permission to use selected device type
|
|
@@ -62,46 +64,66 @@ function generateDevicesOptions(items, selectedId, permissionGranted) {
|
62
|
64
|
|
63
|
65
|
export default {
|
64
|
66
|
init (emitter) {
|
65
|
|
- // START MUTED
|
66
|
|
- $("#startMutedOptions").change(function () {
|
67
|
|
- let startAudioMuted = $("#startAudioMuted").is(":checked");
|
68
|
|
- let startVideoMuted = $("#startVideoMuted").is(":checked");
|
69
|
|
- emitter.emit(
|
70
|
|
- UIEvents.START_MUTED_CHANGED,
|
71
|
|
- startAudioMuted,
|
72
|
|
- startVideoMuted
|
73
|
|
- );
|
74
|
|
- });
|
|
67
|
+ if (UIUtil.isSettingEnabled('devices')) {
|
|
68
|
+ // DEVICES LIST
|
|
69
|
+ JitsiMeetJS.mediaDevices.isDeviceListAvailable()
|
|
70
|
+ .then((isDeviceListAvailable) => {
|
|
71
|
+ if (isDeviceListAvailable &&
|
|
72
|
+ JitsiMeetJS.mediaDevices.isDeviceChangeAvailable()) {
|
|
73
|
+ this._initializeDeviceSelectionSettings(emitter);
|
|
74
|
+ }
|
|
75
|
+ });
|
|
76
|
+
|
|
77
|
+ // Only show the subtitle if this is the only setting section.
|
|
78
|
+ if (interfaceConfig.SETTINGS_SECTIONS.length > 1)
|
|
79
|
+ UIUtil.showHiddenElement("deviceOptionsTitle");
|
|
80
|
+
|
|
81
|
+ UIUtil.showHiddenElement("devicesOptions");
|
|
82
|
+ }
|
75
|
83
|
|
76
|
|
- // FOLLOW ME
|
77
|
|
- $("#followMeOptions").change(function () {
|
78
|
|
- let isFollowMeEnabled = $("#followMeCheckBox").is(":checked");
|
79
|
|
- emitter.emit(
|
80
|
|
- UIEvents.FOLLOW_ME_ENABLED,
|
81
|
|
- isFollowMeEnabled
|
82
|
|
- );
|
83
|
|
- });
|
|
84
|
+ if (UIUtil.isSettingEnabled('language')) {
|
|
85
|
+ //LANGUAGES BOX
|
|
86
|
+ let languagesBox = $("#languages_selectbox");
|
|
87
|
+ languagesBox.html(generateLanguagesOptions(
|
|
88
|
+ languages.getLanguages(),
|
|
89
|
+ APP.translation.getCurrentLanguage()
|
|
90
|
+ ));
|
|
91
|
+ APP.translation.translateElement(languagesBox);
|
|
92
|
+ languagesBox.change(function () {
|
|
93
|
+ emitter.emit(UIEvents.LANG_CHANGED, languagesBox.val());
|
|
94
|
+ });
|
84
|
95
|
|
85
|
|
- // LANGUAGES BOX
|
86
|
|
- let languagesBox = $("#languages_selectbox");
|
87
|
|
- languagesBox.html(generateLanguagesOptions(
|
88
|
|
- languages.getLanguages(),
|
89
|
|
- APP.translation.getCurrentLanguage()
|
90
|
|
- ));
|
91
|
|
- APP.translation.translateElement(languagesBox);
|
92
|
|
- languagesBox.change(function () {
|
93
|
|
- emitter.emit(UIEvents.LANG_CHANGED, languagesBox.val());
|
94
|
|
- });
|
|
96
|
+ UIUtil.showHiddenElement("languages_selectbox");
|
|
97
|
+ }
|
95
|
98
|
|
|
99
|
+ if (UIUtil.isSettingEnabled('moderator')) {
|
|
100
|
+ // START MUTED
|
|
101
|
+ $("#startMutedOptions").change(function () {
|
|
102
|
+ let startAudioMuted = $("#startAudioMuted").is(":checked");
|
|
103
|
+ let startVideoMuted = $("#startVideoMuted").is(":checked");
|
|
104
|
+ emitter.emit(
|
|
105
|
+ UIEvents.START_MUTED_CHANGED,
|
|
106
|
+ startAudioMuted,
|
|
107
|
+ startVideoMuted
|
|
108
|
+ );
|
|
109
|
+ });
|
96
|
110
|
|
97
|
|
- // DEVICES LIST
|
98
|
|
- JitsiMeetJS.mediaDevices.isDeviceListAvailable()
|
99
|
|
- .then((isDeviceListAvailable) => {
|
100
|
|
- if (isDeviceListAvailable &&
|
101
|
|
- JitsiMeetJS.mediaDevices.isDeviceChangeAvailable()) {
|
102
|
|
- this._initializeDeviceSelectionSettings(emitter);
|
103
|
|
- }
|
|
111
|
+ // FOLLOW ME
|
|
112
|
+ $("#followMeOptions").change(function () {
|
|
113
|
+ let isFollowMeEnabled = $("#followMeCheckBox").is(":checked");
|
|
114
|
+ emitter.emit(
|
|
115
|
+ UIEvents.FOLLOW_ME_ENABLED,
|
|
116
|
+ isFollowMeEnabled
|
|
117
|
+ );
|
104
|
118
|
});
|
|
119
|
+
|
|
120
|
+ // Only show the subtitle if this is the only setting section.
|
|
121
|
+ if (interfaceConfig.SETTINGS_SECTIONS.length > 1)
|
|
122
|
+ UIUtil.showHiddenElement("moderatorOptionsTitle");
|
|
123
|
+
|
|
124
|
+ UIUtil.showHiddenElement("startMutedOptions");
|
|
125
|
+ UIUtil.showHiddenElement("followMeOptions");
|
|
126
|
+ }
|
105
|
127
|
},
|
106
|
128
|
|
107
|
129
|
_initializeDeviceSelectionSettings(emitter) {
|