Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fixes and changes

Konstantyn Pahsurada6af88910b4
diff --git a/close.html b/close.html
index 87260b5fa5..e0e8523274 100644
--- a/close.html
+++ b/close.html
@@ -3,21 +3,16 @@
<link rel="stylesheet" href="css/all.css"/>
<!--#include virtual="title.html" -->
<script><!--#include virtual="/interface_config.js" --></script>
- <script src="static/randomizer.js"></script>
+ <script src="randomizer.js"></script>
+ <script src="utils.js"></script>
<script>
- var randomizer = new Randomizer();
-
- function translateStr(id, msg) {
- var div = document.getElementById(id);
- div.innerHTML = msg;
- }
- function translate() {
- translateStr('hintMessage',
+ function onDocumentReady() {
+ insertTextMsgIntoDocument('hintMessage',
randomizer.getItem());
}
</script>
</head>
-<body onload="translate();">
+<body onload="onDocumentReady();">
<div class="redirectPageMessage">
<div class="thanks-msg">
<p id="thanksMessage">Thank you for your feedback!</p>
diff --git a/close2.html b/close2.html
index 82aa9fca5d..d70fd98767 100644
--- a/close2.html
+++ b/close2.html
@@ -3,23 +3,18 @@
<link rel="stylesheet" href="css/all.css"/>
<!--#include virtual="title.html" -->
<script><!--#include virtual="/interface_config.js" --></script>
- <script src="static/randomizer.js"></script>
+ <script src="randomizer.js"></script>
+ <script src="utils.js"></script>
<script>
- var randomizer = new Randomizer();
-
- function translateStr(id, msg) {
- var div = document.getElementById(id);
- div.innerHTML = msg;
- }
- function translate() {
- translateStr('thanksMessage',
+ function onDocumentReady() {
+ insertTextMsgIntoDocument('thanksMessage',
'Thank you for using ' + interfaceConfig.APP_NAME);
- translateStr('hintMessage',
+ insertTextMsgIntoDocument('hintMessage',
randomizer.getItem());
}
</script>
</head>
-<body onload="translate();">
+<body onload="onDocumentReady();">
<div class="redirectPageMessage">
<div class="thanks-msg">
<p id="thanksMessage"></p>
diff --git a/static/randomizer.js b/randomizer.js
similarity index 58%
rename from static/randomizer.js
rename to randomizer.js
index 70bec3fa02..23346b6c31 100644
--- a/static/randomizer.js
+++ b/randomizer.js
@@ -10,26 +10,21 @@
];
/**
- * Creates a new Randomiser.
- *
- * @class
+ * Creates a randomiser.
+ * Put in in Global scope
*/
- function Randomizer(){
- this.items = items;
- }
+ 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);
- /**
- * Get a random integer between 0 and items length.
- *
- * @return {string} a random integer
- */
- Randomizer.prototype.getItem = function (){
- var l = this.items.length - 1;
- var n = Math.round(Math.random() * l);
-
- return this.items[n];
+ return items[n];
+ }
};
-
- window.Randomizer = Randomizer;
})();
diff --git a/utils.js b/utils.js
index 00192dbefa..94e5249d31 100644
--- a/utils.js
+++ b/utils.js
@@ -66,3 +66,18 @@ function getConfigParamsFromUrl(source, dontParse) {
});
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;
+}
\ No newline at end of file