|
|
|
@ -1,4 +1,4 @@ |
|
|
|
|
/* global APP, $, JitsiMeetJS */ |
|
|
|
|
/* global APP, $, JitsiMeetJS, interfaceConfig */ |
|
|
|
|
import UIUtil from "../../util/UIUtil"; |
|
|
|
|
import UIEvents from "../../../../service/UI/UIEvents"; |
|
|
|
|
import languages from "../../../../service/translation/languages"; |
|
|
|
@ -6,6 +6,7 @@ import Settings from '../../../settings/Settings'; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Generate html select options for available languages. |
|
|
|
|
* |
|
|
|
|
* @param {string[]} items available languages |
|
|
|
|
* @param {string} [currentLang] current language |
|
|
|
|
* @returns {string} |
|
|
|
@ -28,6 +29,7 @@ function generateLanguagesOptions(items, currentLang) { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Generate html select options for available physical devices. |
|
|
|
|
* |
|
|
|
|
* @param {{ deviceId, label }[]} items available devices |
|
|
|
|
* @param {string} [selectedId] id of selected device |
|
|
|
|
* @param {boolean} permissionGranted if permission to use selected device type |
|
|
|
@ -62,46 +64,66 @@ function generateDevicesOptions(items, selectedId, permissionGranted) { |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
init (emitter) { |
|
|
|
|
// START MUTED
|
|
|
|
|
$("#startMutedOptions").change(function () { |
|
|
|
|
let startAudioMuted = $("#startAudioMuted").is(":checked"); |
|
|
|
|
let startVideoMuted = $("#startVideoMuted").is(":checked"); |
|
|
|
|
emitter.emit( |
|
|
|
|
UIEvents.START_MUTED_CHANGED, |
|
|
|
|
startAudioMuted, |
|
|
|
|
startVideoMuted |
|
|
|
|
); |
|
|
|
|
}); |
|
|
|
|
if (UIUtil.isSettingEnabled('devices')) { |
|
|
|
|
// DEVICES LIST
|
|
|
|
|
JitsiMeetJS.mediaDevices.isDeviceListAvailable() |
|
|
|
|
.then((isDeviceListAvailable) => { |
|
|
|
|
if (isDeviceListAvailable && |
|
|
|
|
JitsiMeetJS.mediaDevices.isDeviceChangeAvailable()) { |
|
|
|
|
this._initializeDeviceSelectionSettings(emitter); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// Only show the subtitle if this is the only setting section.
|
|
|
|
|
if (interfaceConfig.SETTINGS_SECTIONS.length > 1) |
|
|
|
|
UIUtil.showHiddenElement("deviceOptionsTitle"); |
|
|
|
|
|
|
|
|
|
UIUtil.showHiddenElement("devicesOptions"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// FOLLOW ME
|
|
|
|
|
$("#followMeOptions").change(function () { |
|
|
|
|
let isFollowMeEnabled = $("#followMeCheckBox").is(":checked"); |
|
|
|
|
emitter.emit( |
|
|
|
|
UIEvents.FOLLOW_ME_ENABLED, |
|
|
|
|
isFollowMeEnabled |
|
|
|
|
); |
|
|
|
|
}); |
|
|
|
|
if (UIUtil.isSettingEnabled('language')) { |
|
|
|
|
//LANGUAGES BOX
|
|
|
|
|
let languagesBox = $("#languages_selectbox"); |
|
|
|
|
languagesBox.html(generateLanguagesOptions( |
|
|
|
|
languages.getLanguages(), |
|
|
|
|
APP.translation.getCurrentLanguage() |
|
|
|
|
)); |
|
|
|
|
APP.translation.translateElement(languagesBox); |
|
|
|
|
languagesBox.change(function () { |
|
|
|
|
emitter.emit(UIEvents.LANG_CHANGED, languagesBox.val()); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// LANGUAGES BOX
|
|
|
|
|
let languagesBox = $("#languages_selectbox"); |
|
|
|
|
languagesBox.html(generateLanguagesOptions( |
|
|
|
|
languages.getLanguages(), |
|
|
|
|
APP.translation.getCurrentLanguage() |
|
|
|
|
)); |
|
|
|
|
APP.translation.translateElement(languagesBox); |
|
|
|
|
languagesBox.change(function () { |
|
|
|
|
emitter.emit(UIEvents.LANG_CHANGED, languagesBox.val()); |
|
|
|
|
}); |
|
|
|
|
UIUtil.showHiddenElement("languages_selectbox"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (UIUtil.isSettingEnabled('moderator')) { |
|
|
|
|
// START MUTED
|
|
|
|
|
$("#startMutedOptions").change(function () { |
|
|
|
|
let startAudioMuted = $("#startAudioMuted").is(":checked"); |
|
|
|
|
let startVideoMuted = $("#startVideoMuted").is(":checked"); |
|
|
|
|
emitter.emit( |
|
|
|
|
UIEvents.START_MUTED_CHANGED, |
|
|
|
|
startAudioMuted, |
|
|
|
|
startVideoMuted |
|
|
|
|
); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// DEVICES LIST
|
|
|
|
|
JitsiMeetJS.mediaDevices.isDeviceListAvailable() |
|
|
|
|
.then((isDeviceListAvailable) => { |
|
|
|
|
if (isDeviceListAvailable && |
|
|
|
|
JitsiMeetJS.mediaDevices.isDeviceChangeAvailable()) { |
|
|
|
|
this._initializeDeviceSelectionSettings(emitter); |
|
|
|
|
} |
|
|
|
|
// FOLLOW ME
|
|
|
|
|
$("#followMeOptions").change(function () { |
|
|
|
|
let isFollowMeEnabled = $("#followMeCheckBox").is(":checked"); |
|
|
|
|
emitter.emit( |
|
|
|
|
UIEvents.FOLLOW_ME_ENABLED, |
|
|
|
|
isFollowMeEnabled |
|
|
|
|
); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// Only show the subtitle if this is the only setting section.
|
|
|
|
|
if (interfaceConfig.SETTINGS_SECTIONS.length > 1) |
|
|
|
|
UIUtil.showHiddenElement("moderatorOptionsTitle"); |
|
|
|
|
|
|
|
|
|
UIUtil.showHiddenElement("startMutedOptions"); |
|
|
|
|
UIUtil.showHiddenElement("followMeOptions"); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_initializeDeviceSelectionSettings(emitter) { |
|
|
|
|