2017-11-21 02:21:35 +00:00
|
|
|
/* global $, APP, interfaceConfig */
|
2017-03-01 02:55:12 +00:00
|
|
|
|
2017-11-21 02:21:35 +00:00
|
|
|
/* eslint-disable no-unused-vars */
|
2018-02-26 16:14:46 +00:00
|
|
|
|
2017-11-21 02:21:35 +00:00
|
|
|
import React from 'react';
|
|
|
|
import ReactDOM from 'react-dom';
|
|
|
|
import { I18nextProvider } from 'react-i18next';
|
|
|
|
import { Provider } from 'react-redux';
|
2017-10-12 23:02:29 +00:00
|
|
|
|
2017-11-21 02:21:35 +00:00
|
|
|
import { i18next } from '../../../../react/features/base/i18n';
|
2018-04-28 01:43:11 +00:00
|
|
|
import {
|
|
|
|
SettingsMenu,
|
|
|
|
isSettingEnabled
|
|
|
|
} from '../../../../react/features/settings';
|
2017-11-21 02:21:35 +00:00
|
|
|
import UIUtil from '../../util/UIUtil';
|
2015-01-07 14:54:03 +00:00
|
|
|
|
2018-02-26 16:14:46 +00:00
|
|
|
/* eslint-enable no-unused-vars */
|
|
|
|
|
2015-12-31 15:23:23 +00:00
|
|
|
export default {
|
2017-11-21 02:21:35 +00:00
|
|
|
init() {
|
|
|
|
const settingsMenuContainer = document.createElement('div');
|
2016-09-20 07:59:12 +00:00
|
|
|
|
2017-11-21 02:21:35 +00:00
|
|
|
settingsMenuContainer.id = 'settings_container';
|
|
|
|
settingsMenuContainer.className = 'sideToolbarContainer__inner';
|
2017-03-29 17:54:56 +00:00
|
|
|
|
2017-11-21 02:21:35 +00:00
|
|
|
$('#sideToolbarContainer').append(settingsMenuContainer);
|
2016-09-13 22:37:09 +00:00
|
|
|
|
2017-11-21 02:21:35 +00:00
|
|
|
const props = {
|
2018-04-28 01:43:11 +00:00
|
|
|
showDeviceSettings: isSettingEnabled('devices'),
|
|
|
|
showLanguageSettings: isSettingEnabled('language'),
|
|
|
|
showModeratorSettings: isSettingEnabled('moderator'),
|
2017-11-21 02:21:35 +00:00
|
|
|
showTitles: interfaceConfig.SETTINGS_SECTIONS.length > 1
|
|
|
|
};
|
2015-01-07 14:54:03 +00:00
|
|
|
|
2017-11-21 02:21:35 +00:00
|
|
|
ReactDOM.render(
|
|
|
|
<Provider store = { APP.store }>
|
|
|
|
<I18nextProvider i18n = { i18next }>
|
2018-02-26 16:14:46 +00:00
|
|
|
<SettingsMenu { ...props } />
|
2017-11-21 02:21:35 +00:00
|
|
|
</I18nextProvider>
|
|
|
|
</Provider>,
|
|
|
|
settingsMenuContainer
|
|
|
|
);
|
2016-03-24 01:43:29 +00:00
|
|
|
},
|
|
|
|
|
2016-03-02 15:39:39 +00:00
|
|
|
/**
|
|
|
|
* Check if settings menu is visible or not.
|
|
|
|
* @returns {boolean}
|
|
|
|
*/
|
2017-10-12 23:02:29 +00:00
|
|
|
isVisible() {
|
|
|
|
return UIUtil.isVisible(document.getElementById('settings_container'));
|
2015-01-07 14:54:03 +00:00
|
|
|
}
|
2016-10-03 16:12:04 +00:00
|
|
|
};
|