2017-01-03 20:15:32 +00:00
|
|
|
/* global interfaceConfig */
|
2017-10-12 23:02:29 +00:00
|
|
|
// list of tips
|
|
|
|
const hints = [
|
|
|
|
'You can pin participants by clicking on their thumbnails.',
|
|
|
|
'You can tell others you have something to say by using the "Raise Hand" '
|
|
|
|
+ 'feature',
|
|
|
|
'You can learn about key shortcuts by pressing Shift+?',
|
|
|
|
'You can learn more about the state of everyone\'s connection by hovering '
|
|
|
|
+ 'on the bars in their thumbnail',
|
|
|
|
'You can hide all thumbnails by using the button in the bottom right corner'
|
2016-11-14 21:01:08 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
/**
|
2020-09-30 09:54:27 +00:00
|
|
|
* Get a random hint message from hint array.
|
2016-11-14 21:01:08 +00:00
|
|
|
*
|
|
|
|
* @return {string} the hint message.
|
|
|
|
*/
|
2017-10-12 23:02:29 +00:00
|
|
|
function getHint() {
|
|
|
|
const l = hints.length - 1;
|
|
|
|
const n = Math.round(Math.random() * l);
|
2016-11-14 21:01:08 +00:00
|
|
|
|
|
|
|
return hints[n];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Inserts text message
|
|
|
|
* into DOM element
|
|
|
|
*
|
|
|
|
* @param id {string} element identificator
|
|
|
|
* @param msg {string} text message
|
|
|
|
*/
|
2017-10-12 23:02:29 +00:00
|
|
|
function insertTextMsg(id, msg) {
|
|
|
|
const el = document.getElementById(id);
|
2016-11-14 21:01:08 +00:00
|
|
|
|
2017-10-12 23:02:29 +00:00
|
|
|
if (el) {
|
2016-12-30 16:59:21 +00:00
|
|
|
el.innerHTML = msg;
|
2017-10-12 23:02:29 +00:00
|
|
|
}
|
2016-11-14 21:01:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the hint and thanks messages. Will be executed on load event.
|
|
|
|
*/
|
|
|
|
function onLoad() {
|
2018-01-08 21:47:54 +00:00
|
|
|
// Intentionally use string concatenation as this file does not go through
|
|
|
|
// babel but IE11 is still supported.
|
|
|
|
// eslint-disable-next-line prefer-template
|
|
|
|
const thankYouMessage = 'Thank you for using ' + interfaceConfig.APP_NAME;
|
|
|
|
|
2017-10-12 23:02:29 +00:00
|
|
|
// Works only for close2.html because close.html doesn't have this element.
|
2018-01-08 21:47:54 +00:00
|
|
|
insertTextMsg('thanksMessage', thankYouMessage);
|
2016-12-30 16:59:21 +00:00
|
|
|
|
|
|
|
// If there is a setting show a special message only for the guests
|
|
|
|
if (interfaceConfig.CLOSE_PAGE_GUEST_HINT) {
|
2017-10-12 23:02:29 +00:00
|
|
|
if (window.sessionStorage.getItem('guest') === 'true') {
|
|
|
|
const element = document.getElementById('hintQuestion');
|
|
|
|
|
2016-12-30 16:59:21 +00:00
|
|
|
element.classList.add('hide');
|
|
|
|
insertTextMsg('hintMessage', interfaceConfig.CLOSE_PAGE_GUEST_HINT);
|
2017-10-12 23:02:29 +00:00
|
|
|
|
2016-12-30 16:59:21 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-11-14 21:01:08 +00:00
|
|
|
insertTextMsg('hintMessage', getHint());
|
|
|
|
}
|
|
|
|
|
|
|
|
window.onload = onLoad;
|