2018-04-16 12:44:08 +00:00
|
|
|
/* global interfaceConfig */
|
2016-12-01 18:55:42 +00:00
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
|
2020-05-20 10:57:03 +00:00
|
|
|
import { isMobileBrowser } from '../../base/environment/utils';
|
2020-06-29 12:17:35 +00:00
|
|
|
import { translate, translateToHTML } from '../../base/i18n';
|
2020-05-18 12:07:09 +00:00
|
|
|
import { Icon, IconWarning } from '../../base/icons';
|
2020-01-29 12:30:17 +00:00
|
|
|
import { Watermarks } from '../../base/react';
|
2019-03-21 16:38:29 +00:00
|
|
|
import { connect } from '../../base/redux';
|
2018-08-27 15:13:59 +00:00
|
|
|
import { CalendarList } from '../../calendar-sync';
|
2018-08-01 16:41:54 +00:00
|
|
|
import { RecentList } from '../../recent-list';
|
2022-09-27 07:10:28 +00:00
|
|
|
import { SETTINGS_TABS, SettingsButton } from '../../settings';
|
2016-12-01 18:55:42 +00:00
|
|
|
|
2017-01-28 23:34:57 +00:00
|
|
|
import { AbstractWelcomePage, _mapStateToProps } from './AbstractWelcomePage';
|
2018-10-22 18:49:18 +00:00
|
|
|
import Tabs from './Tabs';
|
2016-11-23 21:46:46 +00:00
|
|
|
|
2019-10-14 15:17:54 +00:00
|
|
|
/**
|
|
|
|
* The pattern used to validate room name.
|
2021-11-04 21:10:43 +00:00
|
|
|
*
|
2019-10-14 15:17:54 +00:00
|
|
|
* @type {string}
|
|
|
|
*/
|
|
|
|
export const ROOM_NAME_VALIDATE_PATTERN_STR = '^[^?&:\u0022\u0027%#]+$';
|
|
|
|
|
2016-11-23 21:46:46 +00:00
|
|
|
/**
|
2016-12-16 03:00:06 +00:00
|
|
|
* The Web container rendering the welcome page.
|
|
|
|
*
|
2021-11-04 21:10:43 +00:00
|
|
|
* @augments AbstractWelcomePage
|
2016-11-23 21:46:46 +00:00
|
|
|
*/
|
2016-12-01 18:55:42 +00:00
|
|
|
class WelcomePage extends AbstractWelcomePage {
|
2018-08-06 15:24:59 +00:00
|
|
|
/**
|
|
|
|
* Default values for {@code WelcomePage} component's properties.
|
|
|
|
*
|
|
|
|
* @static
|
|
|
|
*/
|
|
|
|
static defaultProps = {
|
|
|
|
_room: ''
|
|
|
|
};
|
|
|
|
|
2016-12-01 18:55:42 +00:00
|
|
|
/**
|
2016-12-16 03:00:06 +00:00
|
|
|
* Initializes a new WelcomePage instance.
|
|
|
|
*
|
|
|
|
* @param {Object} props - The read-only properties with which the new
|
|
|
|
* instance is to be initialized.
|
|
|
|
*/
|
2016-12-01 18:55:42 +00:00
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
2016-12-16 03:00:06 +00:00
|
|
|
|
2017-01-17 22:16:08 +00:00
|
|
|
this.state = {
|
|
|
|
...this.state,
|
|
|
|
|
|
|
|
generateRoomnames:
|
2023-03-06 15:13:29 +00:00
|
|
|
interfaceConfig.GENERATE_ROOMNAMES_ON_WELCOME_PAGE
|
2017-01-17 22:16:08 +00:00
|
|
|
};
|
2016-12-01 18:55:42 +00:00
|
|
|
|
2018-02-22 04:58:55 +00:00
|
|
|
/**
|
|
|
|
* The HTML Element used as the container for additional content. Used
|
2018-07-24 19:26:17 +00:00
|
|
|
* for directly appending the additional content template to the dom.
|
2018-02-22 04:58:55 +00:00
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @type {HTMLTemplateElement|null}
|
|
|
|
*/
|
|
|
|
this._additionalContentRef = null;
|
|
|
|
|
2019-10-14 15:17:54 +00:00
|
|
|
this._roomInputRef = null;
|
|
|
|
|
2019-10-10 13:10:57 +00:00
|
|
|
/**
|
|
|
|
* The HTML Element used as the container for additional toolbar content. Used
|
|
|
|
* for directly appending the additional content template to the dom.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @type {HTMLTemplateElement|null}
|
|
|
|
*/
|
|
|
|
this._additionalToolbarContentRef = null;
|
|
|
|
|
2020-10-19 07:37:19 +00:00
|
|
|
this._additionalCardRef = null;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The template to use as the additional card displayed near the main one.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @type {HTMLTemplateElement|null}
|
|
|
|
*/
|
|
|
|
this._additionalCardTemplate = document.getElementById(
|
|
|
|
'welcome-page-additional-card-template');
|
|
|
|
|
2018-02-22 04:58:55 +00:00
|
|
|
/**
|
|
|
|
* The template to use as the main content for the welcome page. If
|
|
|
|
* not found then only the welcome page head will display.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @type {HTMLTemplateElement|null}
|
|
|
|
*/
|
|
|
|
this._additionalContentTemplate = document.getElementById(
|
|
|
|
'welcome-page-additional-content-template');
|
|
|
|
|
2019-10-10 13:10:57 +00:00
|
|
|
/**
|
|
|
|
* The template to use as the additional content for the welcome page header toolbar.
|
|
|
|
* If not found then only the settings icon will be displayed.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @type {HTMLTemplateElement|null}
|
|
|
|
*/
|
|
|
|
this._additionalToolbarContentTemplate = document.getElementById(
|
|
|
|
'settings-toolbar-additional-content-template'
|
|
|
|
);
|
|
|
|
|
2017-10-13 19:31:05 +00:00
|
|
|
// Bind event handlers so they are only bound once per instance.
|
2018-03-30 19:49:34 +00:00
|
|
|
this._onFormSubmit = this._onFormSubmit.bind(this);
|
2016-12-16 03:00:06 +00:00
|
|
|
this._onRoomChange = this._onRoomChange.bind(this);
|
2020-10-19 07:37:19 +00:00
|
|
|
this._setAdditionalCardRef = this._setAdditionalCardRef.bind(this);
|
2018-02-22 04:58:55 +00:00
|
|
|
this._setAdditionalContentRef
|
|
|
|
= this._setAdditionalContentRef.bind(this);
|
2019-10-14 15:17:54 +00:00
|
|
|
this._setRoomInputRef = this._setRoomInputRef.bind(this);
|
2019-10-10 13:10:57 +00:00
|
|
|
this._setAdditionalToolbarContentRef
|
|
|
|
= this._setAdditionalToolbarContentRef.bind(this);
|
2020-10-19 07:37:19 +00:00
|
|
|
this._renderFooter = this._renderFooter.bind(this);
|
2016-12-01 18:55:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2017-09-14 09:46:35 +00:00
|
|
|
* Implements React's {@link Component#componentDidMount()}. Invoked
|
|
|
|
* immediately after this component is mounted.
|
2016-12-16 03:00:06 +00:00
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
2016-12-01 18:55:42 +00:00
|
|
|
componentDidMount() {
|
2019-11-28 14:03:34 +00:00
|
|
|
super.componentDidMount();
|
|
|
|
|
2018-04-09 20:50:57 +00:00
|
|
|
document.body.classList.add('welcome-page');
|
2019-07-08 18:50:13 +00:00
|
|
|
document.title = interfaceConfig.APP_NAME;
|
2018-04-09 20:50:57 +00:00
|
|
|
|
2016-12-01 18:55:42 +00:00
|
|
|
if (this.state.generateRoomnames) {
|
|
|
|
this._updateRoomname();
|
|
|
|
}
|
2018-02-22 04:58:55 +00:00
|
|
|
|
|
|
|
if (this._shouldShowAdditionalContent()) {
|
|
|
|
this._additionalContentRef.appendChild(
|
|
|
|
this._additionalContentTemplate.content.cloneNode(true));
|
|
|
|
}
|
2019-10-10 13:10:57 +00:00
|
|
|
|
|
|
|
if (this._shouldShowAdditionalToolbarContent()) {
|
|
|
|
this._additionalToolbarContentRef.appendChild(
|
|
|
|
this._additionalToolbarContentTemplate.content.cloneNode(true)
|
|
|
|
);
|
|
|
|
}
|
2020-10-19 07:37:19 +00:00
|
|
|
|
|
|
|
if (this._shouldShowAdditionalCard()) {
|
|
|
|
this._additionalCardRef.appendChild(
|
|
|
|
this._additionalCardTemplate.content.cloneNode(true)
|
|
|
|
);
|
|
|
|
}
|
2016-12-01 18:55:42 +00:00
|
|
|
}
|
|
|
|
|
2018-04-09 20:50:57 +00:00
|
|
|
/**
|
|
|
|
* Removes the classname used for custom styling of the welcome page.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
componentWillUnmount() {
|
2018-04-12 21:23:30 +00:00
|
|
|
super.componentWillUnmount();
|
|
|
|
|
2018-04-09 20:50:57 +00:00
|
|
|
document.body.classList.remove('welcome-page');
|
|
|
|
}
|
|
|
|
|
2016-11-23 21:46:46 +00:00
|
|
|
/**
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {ReactElement|null}
|
|
|
|
*/
|
|
|
|
render() {
|
2020-06-29 12:17:35 +00:00
|
|
|
const { _moderatedRoomServiceUrl, t } = this.props;
|
2020-10-19 07:37:19 +00:00
|
|
|
const { DEFAULT_WELCOME_PAGE_LOGO_URL, DISPLAY_WELCOME_FOOTER } = interfaceConfig;
|
|
|
|
const showAdditionalCard = this._shouldShowAdditionalCard();
|
2018-02-22 04:58:55 +00:00
|
|
|
const showAdditionalContent = this._shouldShowAdditionalContent();
|
2019-10-10 13:10:57 +00:00
|
|
|
const showAdditionalToolbarContent = this._shouldShowAdditionalToolbarContent();
|
2021-03-23 09:06:03 +00:00
|
|
|
const contentClassName = showAdditionalContent ? 'with-content' : 'without-content';
|
|
|
|
const footerClassName = DISPLAY_WELCOME_FOOTER ? 'with-footer' : 'without-footer';
|
2018-02-22 04:58:55 +00:00
|
|
|
|
2016-11-23 21:46:46 +00:00
|
|
|
return (
|
2018-10-22 18:49:18 +00:00
|
|
|
<div
|
2021-03-23 09:06:03 +00:00
|
|
|
className = { `welcome ${contentClassName} ${footerClassName}` }
|
2018-10-22 18:49:18 +00:00
|
|
|
id = 'welcome_page'>
|
|
|
|
<div className = 'header'>
|
|
|
|
<div className = 'header-image' />
|
2020-10-19 07:37:19 +00:00
|
|
|
<div className = 'header-container'>
|
2022-12-22 13:18:06 +00:00
|
|
|
<div className = 'header-watermark-container'>
|
|
|
|
<div className = 'welcome-watermark'>
|
|
|
|
<Watermarks
|
|
|
|
defaultJitsiLogoURL = { DEFAULT_WELCOME_PAGE_LOGO_URL }
|
|
|
|
noMargins = { true } />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className = 'welcome-page-settings'>
|
|
|
|
<SettingsButton
|
|
|
|
defaultTab = { SETTINGS_TABS.CALENDAR }
|
|
|
|
isDisplayedOnWelcomePage = { true } />
|
|
|
|
{ showAdditionalToolbarContent
|
|
|
|
? <div
|
|
|
|
className = 'settings-toolbar-content'
|
|
|
|
ref = { this._setAdditionalToolbarContentRef } />
|
|
|
|
: null
|
|
|
|
}
|
|
|
|
</div>
|
2018-10-22 18:49:18 +00:00
|
|
|
<h1 className = 'header-text-title'>
|
2020-11-09 12:29:42 +00:00
|
|
|
{ t('welcomepage.headerTitle') }
|
2018-10-22 18:49:18 +00:00
|
|
|
</h1>
|
2020-10-19 07:37:19 +00:00
|
|
|
<span className = 'header-text-subtitle'>
|
2020-11-09 12:29:42 +00:00
|
|
|
{ t('welcomepage.headerSubtitle')}
|
2020-10-19 07:37:19 +00:00
|
|
|
</span>
|
|
|
|
<div id = 'enter_room'>
|
|
|
|
<div className = 'enter-room-input-container'>
|
|
|
|
<form onSubmit = { this._onFormSubmit }>
|
|
|
|
<input
|
|
|
|
aria-disabled = 'false'
|
|
|
|
aria-label = 'Meeting name input'
|
|
|
|
autoFocus = { true }
|
|
|
|
className = 'enter-room-input'
|
|
|
|
id = 'enter_room_field'
|
|
|
|
onChange = { this._onRoomChange }
|
|
|
|
pattern = { ROOM_NAME_VALIDATE_PATTERN_STR }
|
|
|
|
placeholder = { this.state.roomPlaceholder }
|
|
|
|
ref = { this._setRoomInputRef }
|
|
|
|
title = { t('welcomepage.roomNameAllowedChars') }
|
|
|
|
type = 'text'
|
|
|
|
value = { this.state.room } />
|
|
|
|
<div
|
|
|
|
className = { _moderatedRoomServiceUrl
|
|
|
|
? 'warning-with-link'
|
|
|
|
: 'warning-without-link' }>
|
|
|
|
{ this._renderInsecureRoomNameWarning() }
|
|
|
|
</div>
|
|
|
|
</form>
|
2018-10-22 18:49:18 +00:00
|
|
|
</div>
|
2020-10-19 07:37:19 +00:00
|
|
|
<button
|
|
|
|
aria-disabled = 'false'
|
|
|
|
aria-label = 'Start meeting'
|
|
|
|
className = 'welcome-page-button'
|
|
|
|
id = 'enter_room_button'
|
|
|
|
onClick = { this._onFormSubmit }
|
|
|
|
tabIndex = '0'
|
|
|
|
type = 'button'>
|
|
|
|
{ t('welcomepage.startMeeting') }
|
|
|
|
</button>
|
2018-02-22 04:58:55 +00:00
|
|
|
</div>
|
2020-10-19 07:37:19 +00:00
|
|
|
|
|
|
|
{ _moderatedRoomServiceUrl && (
|
|
|
|
<div id = 'moderated-meetings'>
|
2022-12-22 13:18:06 +00:00
|
|
|
{
|
|
|
|
translateToHTML(
|
|
|
|
t, 'welcomepage.moderatedMessage', { url: _moderatedRoomServiceUrl })
|
|
|
|
}
|
2020-10-19 07:37:19 +00:00
|
|
|
</div>)}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className = 'welcome-cards-container'>
|
2022-12-22 13:18:06 +00:00
|
|
|
<div className = 'welcome-card-column'>
|
2020-10-19 07:37:19 +00:00
|
|
|
<div className = 'welcome-tabs welcome-card welcome-card--blue'>
|
|
|
|
{ this._renderTabs() }
|
2020-06-29 12:17:35 +00:00
|
|
|
</div>
|
2020-10-19 07:37:19 +00:00
|
|
|
{ showAdditionalCard
|
|
|
|
? <div
|
|
|
|
className = 'welcome-card welcome-card--dark'
|
|
|
|
ref = { this._setAdditionalCardRef } />
|
|
|
|
: null }
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{ showAdditionalContent
|
|
|
|
? <div
|
|
|
|
className = 'welcome-page-content'
|
|
|
|
ref = { this._setAdditionalContentRef } />
|
|
|
|
: null }
|
2018-02-22 04:58:55 +00:00
|
|
|
</div>
|
2020-10-19 07:37:19 +00:00
|
|
|
{ DISPLAY_WELCOME_FOOTER && this._renderFooter()}
|
2018-10-22 18:49:18 +00:00
|
|
|
</div>
|
2020-10-19 07:37:19 +00:00
|
|
|
|
2016-11-23 21:46:46 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2020-05-18 12:07:09 +00:00
|
|
|
/**
|
|
|
|
* Renders the insecure room name warning.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
_doRenderInsecureRoomNameWarning() {
|
|
|
|
return (
|
|
|
|
<div className = 'insecure-room-name-warning'>
|
|
|
|
<Icon src = { IconWarning } />
|
|
|
|
<span>
|
|
|
|
{ this.props.t('security.insecureRoomNameWarning') }
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2018-03-30 19:49:34 +00:00
|
|
|
/**
|
2018-07-24 19:26:17 +00:00
|
|
|
* Prevents submission of the form and delegates join logic.
|
2018-03-30 19:49:34 +00:00
|
|
|
*
|
|
|
|
* @param {Event} event - The HTML Event which details the form submission.
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onFormSubmit(event) {
|
|
|
|
event.preventDefault();
|
|
|
|
|
2019-10-14 15:17:54 +00:00
|
|
|
if (!this._roomInputRef || this._roomInputRef.reportValidity()) {
|
|
|
|
this._onJoin();
|
|
|
|
}
|
2018-03-30 19:49:34 +00:00
|
|
|
}
|
|
|
|
|
2016-12-16 03:00:06 +00:00
|
|
|
/**
|
|
|
|
* Overrides the super to account for the differences in the argument types
|
|
|
|
* provided by HTML and React Native text inputs.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @override
|
|
|
|
* @param {Event} event - The (HTML) Event which details the change such as
|
|
|
|
* the EventTarget.
|
|
|
|
* @protected
|
|
|
|
*/
|
|
|
|
_onRoomChange(event) {
|
|
|
|
super._onRoomChange(event.target.value);
|
|
|
|
}
|
|
|
|
|
2020-10-19 07:37:19 +00:00
|
|
|
/**
|
|
|
|
* Renders the footer.
|
|
|
|
*
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
_renderFooter() {
|
|
|
|
const {
|
2022-12-20 17:03:57 +00:00
|
|
|
t,
|
|
|
|
_deeplinkingCfg: {
|
2022-12-22 13:15:38 +00:00
|
|
|
ios = {},
|
|
|
|
android = {}
|
2022-12-20 17:03:57 +00:00
|
|
|
}
|
|
|
|
} = this.props;
|
2020-10-19 07:37:19 +00:00
|
|
|
|
2022-12-22 13:15:38 +00:00
|
|
|
const { downloadLink: iosDownloadLink } = ios;
|
|
|
|
|
|
|
|
const { fDroidUrl, downloadLink: androidDownloadLink } = android;
|
|
|
|
|
2020-10-19 07:37:19 +00:00
|
|
|
return (<footer className = 'welcome-footer'>
|
|
|
|
<div className = 'welcome-footer-centered'>
|
|
|
|
<div className = 'welcome-footer-padded'>
|
|
|
|
<div className = 'welcome-footer-row-block welcome-footer--row-1'>
|
|
|
|
<div className = 'welcome-footer-row-1-text'>{t('welcomepage.jitsiOnMobile')}</div>
|
|
|
|
<a
|
|
|
|
className = 'welcome-badge'
|
2022-12-20 17:03:57 +00:00
|
|
|
href = { iosDownloadLink }>
|
2021-06-10 12:48:44 +00:00
|
|
|
<img
|
|
|
|
alt = { t('welcomepage.mobileDownLoadLinkIos') }
|
|
|
|
src = './images/app-store-badge.png' />
|
2020-10-19 07:37:19 +00:00
|
|
|
</a>
|
|
|
|
<a
|
|
|
|
className = 'welcome-badge'
|
2022-12-20 17:03:57 +00:00
|
|
|
href = { androidDownloadLink }>
|
2021-06-10 12:48:44 +00:00
|
|
|
<img
|
|
|
|
alt = { t('welcomepage.mobileDownLoadLinkAndroid') }
|
|
|
|
src = './images/google-play-badge.png' />
|
2020-10-19 07:37:19 +00:00
|
|
|
</a>
|
|
|
|
<a
|
|
|
|
className = 'welcome-badge'
|
2022-12-20 17:03:57 +00:00
|
|
|
href = { fDroidUrl }>
|
2021-06-10 12:48:44 +00:00
|
|
|
<img
|
|
|
|
alt = { t('welcomepage.mobileDownLoadLinkFDroid') }
|
|
|
|
src = './images/f-droid-badge.png' />
|
2020-10-19 07:37:19 +00:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</footer>);
|
|
|
|
}
|
|
|
|
|
2018-08-27 15:13:59 +00:00
|
|
|
/**
|
|
|
|
* Renders tabs to show previous meetings and upcoming calendar events. The
|
|
|
|
* tabs are purposefully hidden on mobile browsers.
|
|
|
|
*
|
|
|
|
* @returns {ReactElement|null}
|
|
|
|
*/
|
|
|
|
_renderTabs() {
|
2020-01-29 12:30:17 +00:00
|
|
|
if (isMobileBrowser()) {
|
2018-08-27 15:13:59 +00:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2020-03-31 11:06:04 +00:00
|
|
|
const { _calendarEnabled, _recentListEnabled, t } = this.props;
|
2018-08-27 15:13:59 +00:00
|
|
|
|
|
|
|
const tabs = [];
|
|
|
|
|
2019-05-28 13:32:29 +00:00
|
|
|
if (_calendarEnabled) {
|
2018-08-27 15:13:59 +00:00
|
|
|
tabs.push({
|
2023-03-06 15:13:29 +00:00
|
|
|
id: 'calendar',
|
2022-12-22 13:18:06 +00:00
|
|
|
label: t('welcomepage.upcomingMeetings'),
|
2018-09-05 21:46:28 +00:00
|
|
|
content: <CalendarList />
|
2018-08-27 15:13:59 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2020-03-31 11:06:04 +00:00
|
|
|
if (_recentListEnabled) {
|
|
|
|
tabs.push({
|
2023-03-06 15:13:29 +00:00
|
|
|
id: 'recent',
|
2022-12-22 13:18:06 +00:00
|
|
|
label: t('welcomepage.recentMeetings'),
|
2020-03-31 11:06:04 +00:00
|
|
|
content: <RecentList />
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
if (tabs.length === 0) {
|
|
|
|
return null;
|
|
|
|
}
|
2018-08-27 15:13:59 +00:00
|
|
|
|
|
|
|
return (
|
2018-10-22 18:49:18 +00:00
|
|
|
<Tabs
|
2023-03-06 15:13:29 +00:00
|
|
|
accessibilityLabel = { t('welcomepage.meetingsAccessibilityLabel') }
|
|
|
|
tabs = { tabs } />
|
|
|
|
);
|
2018-08-27 15:13:59 +00:00
|
|
|
}
|
|
|
|
|
2020-10-19 07:37:19 +00:00
|
|
|
/**
|
|
|
|
* Sets the internal reference to the HTMLDivElement used to hold the
|
|
|
|
* additional card shown near the tabs card.
|
|
|
|
*
|
|
|
|
* @param {HTMLDivElement} el - The HTMLElement for the div that is the root
|
|
|
|
* of the welcome page content.
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_setAdditionalCardRef(el) {
|
|
|
|
this._additionalCardRef = el;
|
|
|
|
}
|
|
|
|
|
2016-11-23 21:46:46 +00:00
|
|
|
/**
|
2018-02-22 04:58:55 +00:00
|
|
|
* Sets the internal reference to the HTMLDivElement used to hold the
|
|
|
|
* welcome page content.
|
2016-11-23 21:46:46 +00:00
|
|
|
*
|
2018-02-22 04:58:55 +00:00
|
|
|
* @param {HTMLDivElement} el - The HTMLElement for the div that is the root
|
|
|
|
* of the welcome page content.
|
2016-11-23 21:46:46 +00:00
|
|
|
* @private
|
2018-02-22 04:58:55 +00:00
|
|
|
* @returns {void}
|
2016-11-23 21:46:46 +00:00
|
|
|
*/
|
2018-02-22 04:58:55 +00:00
|
|
|
_setAdditionalContentRef(el) {
|
|
|
|
this._additionalContentRef = el;
|
2016-11-23 21:46:46 +00:00
|
|
|
}
|
|
|
|
|
2019-10-10 13:10:57 +00:00
|
|
|
/**
|
|
|
|
* Sets the internal reference to the HTMLDivElement used to hold the
|
|
|
|
* toolbar additional content.
|
|
|
|
*
|
|
|
|
* @param {HTMLDivElement} el - The HTMLElement for the div that is the root
|
|
|
|
* of the additional toolbar content.
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_setAdditionalToolbarContentRef(el) {
|
|
|
|
this._additionalToolbarContentRef = el;
|
|
|
|
}
|
|
|
|
|
2016-11-23 21:46:46 +00:00
|
|
|
/**
|
2019-10-14 15:17:54 +00:00
|
|
|
* Sets the internal reference to the HTMLInputElement used to hold the
|
|
|
|
* welcome page input room element.
|
|
|
|
*
|
|
|
|
* @param {HTMLInputElement} el - The HTMLElement for the input of the room name on the welcome page.
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_setRoomInputRef(el) {
|
|
|
|
this._roomInputRef = el;
|
|
|
|
}
|
|
|
|
|
2020-10-19 07:37:19 +00:00
|
|
|
/**
|
|
|
|
* Returns whether or not an additional card should be displayed near the tabs.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {boolean}
|
|
|
|
*/
|
|
|
|
_shouldShowAdditionalCard() {
|
|
|
|
return interfaceConfig.DISPLAY_WELCOME_PAGE_ADDITIONAL_CARD
|
|
|
|
&& this._additionalCardTemplate
|
|
|
|
&& this._additionalCardTemplate.content
|
|
|
|
&& this._additionalCardTemplate.innerHTML.trim();
|
|
|
|
}
|
|
|
|
|
2019-10-14 15:17:54 +00:00
|
|
|
/**
|
2018-07-24 19:26:17 +00:00
|
|
|
* Returns whether or not additional content should be displayed below
|
2018-02-22 04:58:55 +00:00
|
|
|
* the welcome page's header for entering a room name.
|
2016-11-23 21:46:46 +00:00
|
|
|
*
|
|
|
|
* @private
|
2018-02-22 04:58:55 +00:00
|
|
|
* @returns {boolean}
|
2016-11-23 21:46:46 +00:00
|
|
|
*/
|
2018-02-22 04:58:55 +00:00
|
|
|
_shouldShowAdditionalContent() {
|
|
|
|
return interfaceConfig.DISPLAY_WELCOME_PAGE_CONTENT
|
|
|
|
&& this._additionalContentTemplate
|
|
|
|
&& this._additionalContentTemplate.content
|
|
|
|
&& this._additionalContentTemplate.innerHTML.trim();
|
2016-11-23 21:46:46 +00:00
|
|
|
}
|
2019-10-10 13:10:57 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether or not additional content should be displayed inside
|
|
|
|
* the header toolbar.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {boolean}
|
|
|
|
*/
|
|
|
|
_shouldShowAdditionalToolbarContent() {
|
2019-10-15 07:33:36 +00:00
|
|
|
return interfaceConfig.DISPLAY_WELCOME_PAGE_TOOLBAR_ADDITIONAL_CONTENT
|
2019-10-10 13:10:57 +00:00
|
|
|
&& this._additionalToolbarContentTemplate
|
|
|
|
&& this._additionalToolbarContentTemplate.content
|
|
|
|
&& this._additionalToolbarContentTemplate.innerHTML.trim();
|
|
|
|
}
|
2016-11-23 21:46:46 +00:00
|
|
|
}
|
2016-12-01 18:55:42 +00:00
|
|
|
|
2017-02-23 16:56:25 +00:00
|
|
|
export default translate(connect(_mapStateToProps)(WelcomePage));
|