|
@@ -53,6 +53,15 @@ class WelcomePage extends AbstractWelcomePage {
|
53
|
53
|
*/
|
54
|
54
|
this._additionalContentRef = null;
|
55
|
55
|
|
|
56
|
+ /**
|
|
57
|
+ * The HTML Element used as the container for additional toolbar content. Used
|
|
58
|
+ * for directly appending the additional content template to the dom.
|
|
59
|
+ *
|
|
60
|
+ * @private
|
|
61
|
+ * @type {HTMLTemplateElement|null}
|
|
62
|
+ */
|
|
63
|
+ this._additionalToolbarContentRef = null;
|
|
64
|
+
|
56
|
65
|
/**
|
57
|
66
|
* The template to use as the main content for the welcome page. If
|
58
|
67
|
* not found then only the welcome page head will display.
|
|
@@ -63,11 +72,24 @@ class WelcomePage extends AbstractWelcomePage {
|
63
|
72
|
this._additionalContentTemplate = document.getElementById(
|
64
|
73
|
'welcome-page-additional-content-template');
|
65
|
74
|
|
|
75
|
+ /**
|
|
76
|
+ * The template to use as the additional content for the welcome page header toolbar.
|
|
77
|
+ * If not found then only the settings icon will be displayed.
|
|
78
|
+ *
|
|
79
|
+ * @private
|
|
80
|
+ * @type {HTMLTemplateElement|null}
|
|
81
|
+ */
|
|
82
|
+ this._additionalToolbarContentTemplate = document.getElementById(
|
|
83
|
+ 'settings-toolbar-additional-content-template'
|
|
84
|
+ );
|
|
85
|
+
|
66
|
86
|
// Bind event handlers so they are only bound once per instance.
|
67
|
87
|
this._onFormSubmit = this._onFormSubmit.bind(this);
|
68
|
88
|
this._onRoomChange = this._onRoomChange.bind(this);
|
69
|
89
|
this._setAdditionalContentRef
|
70
|
90
|
= this._setAdditionalContentRef.bind(this);
|
|
91
|
+ this._setAdditionalToolbarContentRef
|
|
92
|
+ = this._setAdditionalToolbarContentRef.bind(this);
|
71
|
93
|
this._onTabSelected = this._onTabSelected.bind(this);
|
72
|
94
|
}
|
73
|
95
|
|
|
@@ -90,6 +112,12 @@ class WelcomePage extends AbstractWelcomePage {
|
90
|
112
|
this._additionalContentRef.appendChild(
|
91
|
113
|
this._additionalContentTemplate.content.cloneNode(true));
|
92
|
114
|
}
|
|
115
|
+
|
|
116
|
+ if (this._shouldShowAdditionalToolbarContent()) {
|
|
117
|
+ this._additionalToolbarContentRef.appendChild(
|
|
118
|
+ this._additionalToolbarContentTemplate.content.cloneNode(true)
|
|
119
|
+ );
|
|
120
|
+ }
|
93
|
121
|
}
|
94
|
122
|
|
95
|
123
|
/**
|
|
@@ -114,6 +142,7 @@ class WelcomePage extends AbstractWelcomePage {
|
114
|
142
|
const { t } = this.props;
|
115
|
143
|
const { APP_NAME } = interfaceConfig;
|
116
|
144
|
const showAdditionalContent = this._shouldShowAdditionalContent();
|
|
145
|
+ const showAdditionalToolbarContent = this._shouldShowAdditionalToolbarContent();
|
117
|
146
|
|
118
|
147
|
return (
|
119
|
148
|
<div
|
|
@@ -127,6 +156,12 @@ class WelcomePage extends AbstractWelcomePage {
|
127
|
156
|
<div className = 'welcome-page-settings'>
|
128
|
157
|
<SettingsButton
|
129
|
158
|
defaultTab = { SETTINGS_TABS.CALENDAR } />
|
|
159
|
+ { showAdditionalToolbarContent
|
|
160
|
+ ? <div
|
|
161
|
+ className = 'settings-toolbar-content'
|
|
162
|
+ ref = { this._setAdditionalToolbarContentRef } />
|
|
163
|
+ : null
|
|
164
|
+ }
|
130
|
165
|
</div>
|
131
|
166
|
<div className = 'header-image' />
|
132
|
167
|
<div className = 'header-text'>
|
|
@@ -263,6 +298,19 @@ class WelcomePage extends AbstractWelcomePage {
|
263
|
298
|
this._additionalContentRef = el;
|
264
|
299
|
}
|
265
|
300
|
|
|
301
|
+ /**
|
|
302
|
+ * Sets the internal reference to the HTMLDivElement used to hold the
|
|
303
|
+ * toolbar additional content.
|
|
304
|
+ *
|
|
305
|
+ * @param {HTMLDivElement} el - The HTMLElement for the div that is the root
|
|
306
|
+ * of the additional toolbar content.
|
|
307
|
+ * @private
|
|
308
|
+ * @returns {void}
|
|
309
|
+ */
|
|
310
|
+ _setAdditionalToolbarContentRef(el) {
|
|
311
|
+ this._additionalToolbarContentRef = el;
|
|
312
|
+ }
|
|
313
|
+
|
266
|
314
|
/**
|
267
|
315
|
* Returns whether or not additional content should be displayed below
|
268
|
316
|
* the welcome page's header for entering a room name.
|
|
@@ -276,6 +324,20 @@ class WelcomePage extends AbstractWelcomePage {
|
276
|
324
|
&& this._additionalContentTemplate.content
|
277
|
325
|
&& this._additionalContentTemplate.innerHTML.trim();
|
278
|
326
|
}
|
|
327
|
+
|
|
328
|
+ /**
|
|
329
|
+ * Returns whether or not additional content should be displayed inside
|
|
330
|
+ * the header toolbar.
|
|
331
|
+ *
|
|
332
|
+ * @private
|
|
333
|
+ * @returns {boolean}
|
|
334
|
+ */
|
|
335
|
+ _shouldShowAdditionalToolbarContent() {
|
|
336
|
+ return interfaceConfig.DISPLAY_WELCOME_PAGE_TOOLBAR_CONTENT
|
|
337
|
+ && this._additionalToolbarContentTemplate
|
|
338
|
+ && this._additionalToolbarContentTemplate.content
|
|
339
|
+ && this._additionalToolbarContentTemplate.innerHTML.trim();
|
|
340
|
+ }
|
279
|
341
|
}
|
280
|
342
|
|
281
|
343
|
export default translate(connect(_mapStateToProps)(WelcomePage));
|