From 1a91f4953b580abea844d04e09aeb13635c6ef38 Mon Sep 17 00:00:00 2001 From: Konstantyn Pahsura Date: Fri, 11 Nov 2016 17:42:11 +0200 Subject: [PATCH] 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 0db143682..87260b5fa 100644 --- a/close.html +++ b/close.html @@ -3,14 +3,18 @@ - + diff --git a/close2.html b/close2.html index 6784cab24..82aa9fca5 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 000000000..70bec3fa0 --- /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; +})(); +