From 1a91f4953b580abea844d04e09aeb13635c6ef38 Mon Sep 17 00:00:00 2001 From: Konstantyn Pahsura Date: Fri, 11 Nov 2016 17:42:11 +0200 Subject: [PATCH 1/3] tip randomiser added --- close.html | 20 ++++++++++++-------- close2.html | 24 ++++++++++++++---------- static/randomizer.js | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 18 deletions(-) create mode 100644 static/randomizer.js diff --git a/close.html b/close.html index 0db143682e..87260b5fa5 100644 --- a/close.html +++ b/close.html @@ -3,14 +3,18 @@ - + diff --git a/close2.html b/close2.html index 6784cab246..82aa9fca5d 100644 --- a/close2.html +++ b/close2.html @@ -3,16 +3,20 @@ - + diff --git a/static/randomizer.js b/static/randomizer.js new file mode 100644 index 0000000000..70bec3fa02 --- /dev/null +++ b/static/randomizer.js @@ -0,0 +1,35 @@ + +(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 new Randomiser. + * + * @class + */ + function Randomizer(){ + this.items = items; + } + + /** + * 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]; + }; + + window.Randomizer = Randomizer; +})(); + From da6af88910b4c9c7d0494b727a5fa02fe9764d28 Mon Sep 17 00:00:00 2001 From: Konstantyn Pahsura Date: Mon, 14 Nov 2016 12:31:32 +0200 Subject: [PATCH 2/3] fixes and changes --- close.html | 15 +++++-------- close2.html | 17 ++++++--------- static/randomizer.js => randomizer.js | 31 +++++++++++---------------- utils.js | 15 +++++++++++++ 4 files changed, 39 insertions(+), 39 deletions(-) rename static/randomizer.js => randomizer.js (58%) diff --git a/close.html b/close.html index 87260b5fa5..e0e8523274 100644 --- a/close.html +++ b/close.html @@ -3,21 +3,16 @@ - + + - +

Thank you for your feedback!

diff --git a/close2.html b/close2.html index 82aa9fca5d..d70fd98767 100644 --- a/close2.html +++ b/close2.html @@ -3,23 +3,18 @@ - + + - +

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 From 4bcd75f15c744a514eefbbb9ee6e0be25914128d Mon Sep 17 00:00:00 2001 From: hristoterezov Date: Mon, 14 Nov 2016 15:01:08 -0600 Subject: [PATCH 3/3] refactor(close_pages): Refactor the close pages. --- close.html | 15 ++++----------- close.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ close2.html | 13 ++----------- randomizer.js | 30 ------------------------------ utils.js | 15 --------------- 5 files changed, 54 insertions(+), 67 deletions(-) create mode 100644 close.js delete mode 100644 randomizer.js diff --git a/close.html b/close.html index e0e8523274..3ade05050b 100644 --- a/close.html +++ b/close.html @@ -3,19 +3,12 @@ - - - + - +
-

Thank you for your feedback!

+

Thank you for your feedback!

@@ -26,4 +19,4 @@

- \ No newline at end of file + diff --git a/close.js b/close.js new file mode 100644 index 0000000000..6e3d3f1d92 --- /dev/null +++ b/close.js @@ -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; diff --git a/close2.html b/close2.html index d70fd98767..addb037e74 100644 --- a/close2.html +++ b/close2.html @@ -3,18 +3,9 @@ - - - + - +

diff --git a/randomizer.js b/randomizer.js deleted file mode 100644 index 23346b6c31..0000000000 --- a/randomizer.js +++ /dev/null @@ -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]; - } - }; -})(); - diff --git a/utils.js b/utils.js index 94e5249d31..00192dbefa 100644 --- a/utils.js +++ b/utils.js @@ -66,18 +66,3 @@ 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