Skip to content

Commit d6bb200

Browse files
author
Robert Hainer
authoredNov 2, 2020
Merge pull request #693 from jeffswartz/ECO-5684
ECO-5684 -- Support landing page UI config options
2 parents bdc2e45 + 629e986 commit d6bb200

File tree

9 files changed

+116
-10
lines changed

9 files changed

+116
-10
lines changed
 

‎CUSTOMIZING-UI.md

+13
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ The `web/` directory in the project root is mounted as a static path in the appl
2424

2525
You can put your images in the `web/images` directory. They can be accessed in the application as `/images/`. For example, the file `web/images/opentok-logo.png` can be accessed in the browser as `/images/opentok-logo.png`.
2626

27+
## Changing the app name, intro text, and Help links
28+
29+
See the [Configuration options](README.md#configuration-options) section in the main README file.
30+
These can be configured with these settings:
31+
32+
* `appName` (config.json) / `APP_NAME` (environment variable)
33+
* `introText` (config.json) / `INTRO_TEXT` (environment variable)
34+
* `helpLinkText1` (config.json) / `HELP_LINK_TEXT_1` (environment variable)
35+
* `helpLinkUrl1` (config.json) / `HELP_LINK_URL_1` (environment variable)
36+
* `helpLinkText2` (config.json) / `HELP_LINK_TEXT_2` (environment variable)
37+
* `helpLinkUrl2` (config.json) / `HELP_LINK_URL_2` (environment variable)
38+
2739
## Changing landing page HTML
2840

2941
Edit the view file [`views/index.ejs`](views/index.ejs) and change the images and text in the `<body>` section. You can also change the text in the `<title>` tag.
42+

‎README.md

+21
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,27 @@ To configure this, edit options in the config/config.json file or set environmen
566566

567567
### Additional configuration options
568568

569+
* `appName` (config.json) / `APP_NAME` (environment variable) -- The name of the application
570+
displayed in the precall widget, in the top of the room page, and in the end (/thanks) page.
571+
The default value is 'Vonage Video Conferencing'.
572+
573+
* `introText` (config.json) / `INTRO_TEXT` (environment variable) -- The text displayed under
574+
the application name in the precall widget. The default value is 'Welcome to Video Conferencing'
575+
576+
* `helpLinkText1` (config.json) / `HELP_LINK_TEXT_1` (environment variable) -- The text
577+
for the first help link displayed after "Need help?" at the top of the precall widget.
578+
If you do not set this option, the "Need help" section is omitted.
579+
580+
* `helpLinkUrl1` (config.json) / `HELP_LINK_URL_1` (environment variable) -- The URL for
581+
the first help link the precall widget.
582+
583+
* `helpLinkText2` (config.json) / `HELP_LINK_TEXT_2` (environment variable) -- The text
584+
for the second help link displayed after "Need help?" at the top of the precall widget.
585+
If you do not set this option, second help link is omitted.
586+
587+
* `helpLinkUrl2` (config.json) / `HELP_LINK_URL_2` (environment variable) -- The URL for
588+
the second help link the precall widget.
589+
569590
* `showTos` (config.json) / `SHOW_TOS` (environment variable) -- Whether the app will display the terms of service
570591
dialog box and require the user to agree to the terms before joining a room. The default value is `false`.
571592

‎config/example.json

+6
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@
4545
"maxUsersPerRoom": 0,
4646
"enableRoomLocking": true,
4747
"autoGenerateRoomName": true,
48+
"appName": "Vonage Video Conferencing",
49+
"introText": "Welcome to Video Conferencing.",
50+
"helpLinkText1": "",
51+
"helpLinkUrl1": "",
52+
"helpLinkText2": "",
53+
"helpLinkUrl2": "",
4854
"adobeTracking": {
4955
"url": "",
5056
"primaryCategory": "",

‎server/serverConstants.js

+12
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,18 @@ E.BLACKLIST = { envVar: 'BLACKLIST', jsonPath: 'blacklist', defaultValue: '' };
176176

177177
E.MEDIA_MODE = { envVar: 'MEDIA_MODE', jsonPath: 'mediaMode', defaultValue: 'routed' };
178178

179+
E.INTRO_TEXT = { envVar: 'INTRO_TEXT', jsonPath: 'introText', defaultValue: 'Welcome to Video Conferencing.' };
180+
181+
E.APP_NAME = { envVar: 'APP_NAME', jsonPath: 'appName', defaultValue: 'Vonage Video Conferencing' };
182+
183+
E.HELP_LINK_TEXT_1 = { envVar: 'HELP_LINK_TEXT_1', jsonPath: 'helpLinkText1', defaultValue: '' };
184+
185+
E.HELP_LINK_URL_1 = { envVar: 'HELP_LINK_URL_1', jsonPath: 'helpLinkUrl1', defaultValue: '' };
186+
187+
E.HELP_LINK_TEXT_2 = { envVar: 'HELP_LINK_TEXT_2', jsonPath: 'helpLinkText2', defaultValue: '' };
188+
189+
E.HELP_LINK_URL_2 = { envVar: 'HELP_LINK_URL_2', jsonPath: 'helpLinkUrl2', defaultValue: '' };
190+
179191
E.ADOBE_TRACKING_URL = { envVar: 'ADOBE_TRACKING_URL', jsonPath: 'adobeTracking.url', defaultValue: '' };
180192

181193
E.ADOBE_TRACKING_PRIMARY_CATEGORY = { envVar: 'ADOBE_TRACKING_PRIMARY_CATEGORY', jsonPath: 'adobeTracking.primaryCategory', defaultValue: '' };

‎server/serverMethods.js

+25
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,12 @@ function ServerMethods(aLogLevel, aModules) {
196196
const hotjarVersion = config.get(C.HOTJAR_VERSION);
197197
const enableFeedback = config.get(C.ENABLE_FEEDBACK);
198198
const autoGenerateRoomName = config.get(C.AUTO_GENERATE_ROOM_NAME);
199+
const introText = config.get(C.INTRO_TEXT);
200+
const appName = config.get(C.APP_NAME);
201+
const helpLinkText1 = config.get(C.HELP_LINK_TEXT_1);
202+
const helpLinkUrl1 = config.get(C.HELP_LINK_URL_1);
203+
const helpLinkText2 = config.get(C.HELP_LINK_TEXT_2);
204+
const helpLinkUrl2 = config.get(C.HELP_LINK_URL_2);
199205

200206
roomBlackList = config.get(C.BLACKLIST)
201207
? config.get(C.BLACKLIST).split(',').map((word) => word.trim().toLowerCase()) : [];
@@ -259,6 +265,12 @@ function ServerMethods(aLogLevel, aModules) {
259265
mediaMode,
260266
enableEmoji,
261267
autoGenerateRoomName,
268+
introText,
269+
appName,
270+
helpLinkText1,
271+
helpLinkUrl1,
272+
helpLinkText2,
273+
helpLinkUrl2,
262274
};
263275
});
264276
}
@@ -313,6 +325,7 @@ function ServerMethods(aLogLevel, aModules) {
313325
userLanguage: language,
314326
userCountry: country,
315327
useGoogleFonts: aReq.tbConfig.useGoogleFonts,
328+
appName: aReq.tbConfig.appName,
316329
}, (err, html) => {
317330
if (err) {
318331
logger.error('getMeetingCompletion. error: ', err);
@@ -430,6 +443,12 @@ function ServerMethods(aLogLevel, aModules) {
430443
opentokJsUrl: aReq.tbConfig.opentokJsUrl,
431444
enablePrecallTest: aReq.tbConfig.enablePrecallTest,
432445
enterButtonLabel: 'Start Meeting',
446+
introText: aReq.tbConfig.introText,
447+
appName: aReq.tbConfig.appName,
448+
helpLinkText1: aReq.tbConfig.helpLinkText1,
449+
helpLinkUrl1: aReq.tbConfig.helpLinkUrl1,
450+
helpLinkText2: aReq.tbConfig.helpLinkText2,
451+
helpLinkUrl2: aReq.tbConfig.helpLinkUrl2,
433452
}, (err, html) => {
434453
if (err) {
435454
logger.error('getRoot. error: ', err);
@@ -523,6 +542,12 @@ function ServerMethods(aLogLevel, aModules) {
523542
enableFeedback: tbConfig.enableFeedback,
524543
enterButtonLabel: 'Join Meeting',
525544
routedFromStartMeeting: Boolean(routedFromStartMeeting),
545+
introText: tbConfig.introText,
546+
appName: tbConfig.appName,
547+
helpLinkText1: tbConfig.helpLinkText1,
548+
helpLinkUrl1: tbConfig.helpLinkUrl1,
549+
helpLinkText2: tbConfig.helpLinkText2,
550+
helpLinkUrl2: tbConfig.helpLinkUrl2,
526551
// eslint-disable-next-line no-dupe-keys
527552
userName,
528553
}, (err, html) => {

‎views/endMeeting.ejs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<title>Thanks for using Vonage Free Conferencing!</title>
4+
<title>Thanks for using <%= appName %>!</title>
55
<meta charset="UTF-8">
66
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
77
<meta http-equiv="X-UA-Compatible" content="chrome=1">
@@ -37,7 +37,7 @@
3737
<a href="https://vonage.com" title="Vonage" target="_blank" rel="noopener">
3838
<img id="logo" src="../images/vonage-logo-no-text.svg" alt="vonage transparent logo">
3939
</a>
40-
<p>Thanks for using<br>Vonage Free Conferencing!</p>
40+
<p>Thanks for using<br><%= appName %>!</p>
4141
</header>
4242
<div class="endMeeting-box-container">
4343
<div class="endMeeting-box">

‎views/index.ejs

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
<head>
44
<meta charset="utf-8">
55
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
6-
<title>Vonage Free Conferencing</title>
6+
<title>
7+
<%= appName %>
8+
</title>
79
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
810
<meta name="apple-mobile-web-app-capable" content="yes"/>
911
<meta
@@ -53,6 +55,12 @@
5355
window.precallApiKey='<%=precallApiKey%>';
5456
window.precallSessionId='<%=precallSessionId%>';
5557
window.precallToken='<%=precallToken%>';
58+
window.introText='<%=introText%>';
59+
window.appName='<%=appName%>';
60+
window.helpLinkText1='<%=helpLinkText1%>';
61+
window.helpLinkUrl1='<%=helpLinkUrl1%>';
62+
window.helpLinkText2='<%=helpLinkText2%>';
63+
window.helpLinkUrl2='<%=helpLinkUrl2%>';
5664
window.autoGenerateRoomName=<%=autoGenerateRoomName%>;
5765
</script>
5866

‎views/room.ejs

+8-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<% if(iosAppId) { %>
77
<meta name="apple-itunes-app" content="app-id=<%=iosAppId%>, app-argument=<%=iosURL%>">
88
<% } %>
9-
<title>Vonage Free Conferencing</title>
9+
<title><%= appName %></title>
1010
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover'"/>
1111
<meta name="apple-mobile-web-app-capable" content="yes"/>
1212

@@ -71,6 +71,12 @@
7171
window.autoGenerateRoomName = <%=autoGenerateRoomName%>;
7272
window.publishAudio = <%=publishAudio%>;
7373
window.publishVideo = <%=publishVideo%>;
74+
window.introText='<%=introText%>';
75+
window.appName='<%=appName%>';
76+
window.helpLinkText1='<%=helpLinkText1%>';
77+
window.helpLinkUrl1='<%=helpLinkUrl1%>';
78+
window.helpLinkText2='<%=helpLinkText2%>';
79+
window.helpLinkUrl2='<%=helpLinkUrl2%>';
7480
var isMobile = function() { return window.matchMedia("only screen and (max-width: 480px)").matches; }
7581
7682
var mobileSettings = function() {
@@ -132,7 +138,7 @@
132138
<div class="room-info">
133139
<div class="name-wrapper">
134140
<i id="room-locked-state" data-icon="closedLock" title="This room is locked. No additional participants may join the room."></i>
135-
<p class="room-name">Vonage Video Conferencing</p>
141+
<p class="room-name"><%= appName %></p>
136142
</div>
137143
<div class="participants-wrapper">
138144
<i data-icon="participants"></i><span id="participantsStr"></span>

‎web/templates/precall.ejs

+20-5
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@
55
<img src="/images/vonage-logo-no-text.svg" alt="Vonage logo">
66
</a>
77
<h2>
8-
Vonage
9-
<br>
10-
Free Conferencing
8+
<% if (appName === "Vonage Free Conferencing") { %>
9+
Vonage
10+
<br>
11+
Free Conferencing
12+
<% } else { %>
13+
<%= appName %>
14+
<% } %>
1115
</h2>
1216
<p>
13-
Host free group video calls with friends, family, teammates&mdash;anyone!
17+
<%=introText%>
1418
</p>
1519
</header>
1620
<footer>
@@ -19,7 +23,18 @@
1923
</div>
2024
<div id="righthand-container" class="user-name-modal">
2125
<div class="landing-more-info">
22-
Need help? <a href="Vonage-Free-Conferencing-help.pdf" target="_blank">Read our FAQs</a>
26+
<% if (helpLinkText1) { %>
27+
Need help?
28+
<% if (helpLinkText1 && helpLinkUrl1 ) { %>
29+
<a href="<%= helpLinkUrl1 %>" target="_blank"><%= helpLinkText1 %></a>
30+
<%
31+
}
32+
if (helpLinkText2 && helpLinkUrl2 ) {
33+
%>
34+
/
35+
<a href="<%= helpLinkUrl2 %>" target="_blank"><%= helpLinkText2 %></a>
36+
<% } %>
37+
<% } %>
2338
</div>
2439
<form method="post">
2540
<div id="video-preview">

0 commit comments

Comments
 (0)
Please sign in to comment.