refactor(close_pages): Refactor the close pages.
This commit is contained in:
parent
da6af88910
commit
4bcd75f15c
15
close.html
15
close.html
|
@ -3,19 +3,12 @@
|
||||||
<link rel="stylesheet" href="css/all.css"/>
|
<link rel="stylesheet" href="css/all.css"/>
|
||||||
<!--#include virtual="title.html" -->
|
<!--#include virtual="title.html" -->
|
||||||
<script><!--#include virtual="/interface_config.js" --></script>
|
<script><!--#include virtual="/interface_config.js" --></script>
|
||||||
<script src="randomizer.js"></script>
|
<script src="close.js"></script>
|
||||||
<script src="utils.js"></script>
|
|
||||||
<script>
|
|
||||||
function onDocumentReady() {
|
|
||||||
insertTextMsgIntoDocument('hintMessage',
|
|
||||||
randomizer.getItem());
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</head>
|
</head>
|
||||||
<body onload="onDocumentReady();">
|
<body>
|
||||||
<div class="redirectPageMessage">
|
<div class="redirectPageMessage">
|
||||||
<div class="thanks-msg">
|
<div class="thanks-msg">
|
||||||
<p id="thanksMessage">Thank you for your feedback!</p>
|
<p>Thank you for your feedback!</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="hint-msg">
|
<div class="hint-msg">
|
||||||
<p>
|
<p>
|
||||||
|
@ -26,4 +19,4 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
/* global interfaceConfig */
|
||||||
|
//list of tips
|
||||||
|
var hints = [
|
||||||
|
"You can pin participants by clicking on their thumbnails.",// jshint ignore:line
|
||||||
|
"You can tell others you have something to say by using the \"Raise Hand\" feature",// jshint ignore:line
|
||||||
|
"You can learn about key shortcuts by pressing Shift+?",// jshint ignore:line
|
||||||
|
"You can learn more about the state of everyone's connection by hovering on the bars in their thumbnail",// jshint ignore:line
|
||||||
|
"You can hide all thumbnails by using the button in the bottom right corner"// jshint ignore:line
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a random hint meessage from hint array.
|
||||||
|
*
|
||||||
|
* @return {string} the hint message.
|
||||||
|
*/
|
||||||
|
function getHint(){
|
||||||
|
var l = hints.length - 1;
|
||||||
|
var n = Math.round(Math.random() * l);
|
||||||
|
|
||||||
|
return hints[n];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inserts text message
|
||||||
|
* into DOM element
|
||||||
|
*
|
||||||
|
* @param id {string} element identificator
|
||||||
|
* @param msg {string} text message
|
||||||
|
*/
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
function insertTextMsg(id, msg){
|
||||||
|
var el = document.getElementById(id);
|
||||||
|
|
||||||
|
if (el)
|
||||||
|
el.innerText = msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the hint and thanks messages. Will be executed on load event.
|
||||||
|
*/
|
||||||
|
function onLoad() {
|
||||||
|
//Works only for close2.html because close.html doesn't have this element.
|
||||||
|
insertTextMsg('thanksMessage',
|
||||||
|
'Thank you for using ' + interfaceConfig.APP_NAME);
|
||||||
|
insertTextMsg('hintMessage', getHint());
|
||||||
|
}
|
||||||
|
|
||||||
|
window.onload = onLoad;
|
13
close2.html
13
close2.html
|
@ -3,18 +3,9 @@
|
||||||
<link rel="stylesheet" href="css/all.css"/>
|
<link rel="stylesheet" href="css/all.css"/>
|
||||||
<!--#include virtual="title.html" -->
|
<!--#include virtual="title.html" -->
|
||||||
<script><!--#include virtual="/interface_config.js" --></script>
|
<script><!--#include virtual="/interface_config.js" --></script>
|
||||||
<script src="randomizer.js"></script>
|
<script src="close.js"></script>
|
||||||
<script src="utils.js"></script>
|
|
||||||
<script>
|
|
||||||
function onDocumentReady() {
|
|
||||||
insertTextMsgIntoDocument('thanksMessage',
|
|
||||||
'Thank you for using ' + interfaceConfig.APP_NAME);
|
|
||||||
insertTextMsgIntoDocument('hintMessage',
|
|
||||||
randomizer.getItem());
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</head>
|
</head>
|
||||||
<body onload="onDocumentReady();">
|
<body>
|
||||||
<div class="redirectPageMessage">
|
<div class="redirectPageMessage">
|
||||||
<div class="thanks-msg">
|
<div class="thanks-msg">
|
||||||
<p id="thanksMessage"></p>
|
<p id="thanksMessage"></p>
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
|
|
||||||
(function (){
|
|
||||||
//list of tips
|
|
||||||
var items = [
|
|
||||||
"You can pin participants by clicking on their thumbnails.",// jshint ignore:line
|
|
||||||
"You can tell others you have something to say by using the \"Raise Hand\" feature",// jshint ignore:line
|
|
||||||
"You can learn about key shortcuts by pressing Shift+?",// jshint ignore:line
|
|
||||||
"You can learn more about the state of everyone's connection by hovering on the bars in their thumbnail",// jshint ignore:line
|
|
||||||
"You can hide all thumbnails by using the button in the bottom right corner"// jshint ignore:line
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a randomiser.
|
|
||||||
* Put in in Global scope
|
|
||||||
*/
|
|
||||||
window.randomizer = {
|
|
||||||
/**
|
|
||||||
* Get a random integer between 0 and items length.
|
|
||||||
*
|
|
||||||
* @return {string} a random integer
|
|
||||||
*/
|
|
||||||
getItem: function (){
|
|
||||||
var l = items.length - 1;
|
|
||||||
var n = Math.round(Math.random() * l);
|
|
||||||
|
|
||||||
return items[n];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
})();
|
|
||||||
|
|
15
utils.js
15
utils.js
|
@ -66,18 +66,3 @@ function getConfigParamsFromUrl(source, dontParse) {
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Inserts text message
|
|
||||||
* into DOM element
|
|
||||||
*
|
|
||||||
* @param id {string} element identificator
|
|
||||||
* @param msg {string} text message
|
|
||||||
*/
|
|
||||||
// eslint-disable-next-line no-unused-vars
|
|
||||||
function insertTextMsgIntoDocument(id, msg){
|
|
||||||
var el = document.getElementById(id);
|
|
||||||
|
|
||||||
if (el)
|
|
||||||
el.innerText = msg;
|
|
||||||
}
|
|
Loading…
Reference in New Issue