Adds room name generator.

This commit is contained in:
hristoterezov 2014-08-26 13:54:43 +03:00
parent 61a051b135
commit 5ccb720ecc
5 changed files with 247 additions and 24 deletions

24
app.js
View File

@ -1041,9 +1041,13 @@ $(document).ready(function () {
(!window.localStorage.welcomePageDisabled || window.localStorage.welcomePageDisabled == "false")) (!window.localStorage.welcomePageDisabled || window.localStorage.welcomePageDisabled == "false"))
{ {
$("#videoconference_page").hide(); $("#videoconference_page").hide();
$("#domain_name").text(window.location.host + "/");
$("span[name='appName']").text(brand.appName);
$("#enter_room_button").click(function() $("#enter_room_button").click(function()
{ {
var val = Util.escapeHtml($("#enter_room_field").val()); var val = $("#enter_room_field").val();
if(!val)
val = $("#enter_room_field").attr("placeholder");
window.location.pathname = "/" + val; window.location.pathname = "/" + val;
}); });
@ -1054,6 +1058,24 @@ $(document).ready(function () {
} }
}); });
function animate(word) {
var currentVal = $("#enter_room_field").attr("placeholder");
$("#enter_room_field").attr("placeholder", currentVal + word.substr(0, 1));
setTimeout(function() {
animate(word.substring(1, word.length))
}, 150);
}
function update_roomname()
{
$("#enter_room_field").attr("placeholder", "");
animate(RoomNameGenerator.generateRoomWithoutSeparator());
setTimeout(update_roomname, 10000);
}
update_roomname();
$("#disable_welcome").click(function () { $("#disable_welcome").click(function () {
window.localStorage.welcomePageDisabled = $("#disable_welcome").is(":checked"); window.localStorage.welcomePageDisabled = $("#disable_welcome").is(":checked");
}); });

4
brand.js Normal file
View File

@ -0,0 +1,4 @@
var brand =
{
appName: "Jitsi Meet"
}

View File

@ -8,7 +8,6 @@
background-image: url(../images/welcome_page/disable-welcome.png); background-image: url(../images/welcome_page/disable-welcome.png);
display:inline-block; display:inline-block;
position:absolute; position:absolute;
margin-left: 323px;
height: 54px; height: 54px;
cursor: pointer; cursor: pointer;
-webkit-user-select: none; -webkit-user-select: none;
@ -20,6 +19,9 @@
font-family: Helvetica; font-family: Helvetica;
font-size: 16px; font-size: 16px;
color: #acacac; color: #acacac;
z-index: 2;
float: left;
margin-left: 5px;
} }
#disable_welcome:checked + label #disable_welcome:checked + label
@ -27,7 +29,6 @@
background-image: url(../images/welcome_page/disable-welcome-selected.png); background-image: url(../images/welcome_page/disable-welcome-selected.png);
display:inline-block; display:inline-block;
position:absolute; position:absolute;
margin-left: 323px;
height: 54px; height: 54px;
cursor: pointer; cursor: pointer;
-webkit-user-select: none; -webkit-user-select: none;
@ -39,23 +40,45 @@
font-family: Helvetica; font-family: Helvetica;
font-size: 16px; font-size: 16px;
color: #acacac; color: #acacac;
z-index: 2;
float: left;
margin-left: 5px;
} }
#enter_room_form {
#enter_room_field {
border-radius: 10px; border-radius: 10px;
font-size: 16px; background-color: #FFFFFF;
padding: 15px 55px 10px 30px;
border: none; border: none;
-moz-border-radius: 10px; -moz-border-radius: 10px;
-webkit-border-radius: 10px; -webkit-border-radius: 10px;
-webkit-appearance: none; -webkit-appearance: none;
width: 318px;
height: 55px; height: 55px;
position:absolute; box-shadow: none;
float: left;
}
#domain_name
{
float: left;
padding: 20px 0px 10px 20px;
font-size: 18px;
font-weight: 500;
font-family: Helvetica;
}
#enter_room_field {
font-size: 16px;
padding: 15px 5px 10px 10px;
border: none;
-webkit-appearance: none;
width: 228px;
height: 55px;
font-weight: 500; font-weight: 500;
font-family: Helvetica; font-family: Helvetica;
box-shadow: none; box-shadow: none;
float: left;
background-color: #FFFFFF;
position: relative;
z-index: 2; z-index: 2;
} }
@ -68,19 +91,24 @@
color: #ffffff; color: #ffffff;
font-weight: 600; font-weight: 600;
border: none; border: none;
position:absolute;
margin-left: 240px;
margin-top: 5px; margin-top: 5px;
font-size: 19px; font-size: 19px;
font-family: Helvetica; font-family: Helvetica;
padding-top: 6px; padding-top: 6px;
z-index: 2;
outline: none; outline: none;
float:left;
position: relative;
z-index: 2;
} }
#enter_room { #enter_room_container {
margin: 70px auto 0px auto; margin: 70px auto 0px auto;
width:318px; width:531px;
}
#enter_room{
float:left;
padding-right: 5px;
} }
#welcome_page_header #welcome_page_header

View File

@ -24,6 +24,7 @@
<script src="libs/tooltip.js?v=1"></script><!-- bootstrap tooltip lib --> <script src="libs/tooltip.js?v=1"></script><!-- bootstrap tooltip lib -->
<script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib --> <script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
<script src="config.js?v=4"></script><!-- adapt to your needs, i.e. set hosts and bosh path --> <script src="config.js?v=4"></script><!-- adapt to your needs, i.e. set hosts and bosh path -->
<script src="brand.js?v=1"></script>
<script src="muc.js?v=13"></script><!-- simple MUC library --> <script src="muc.js?v=13"></script><!-- simple MUC library -->
<script src="estos_log.js?v=2"></script><!-- simple stanza logger --> <script src="estos_log.js?v=2"></script><!-- simple stanza logger -->
<script src="desktopsharing.js?v=2"></script><!-- desktop sharing --> <script src="desktopsharing.js?v=2"></script><!-- desktop sharing -->
@ -47,6 +48,7 @@
<script src="audio_levels.js?v=1"></script><!-- audio levels plugin --> <script src="audio_levels.js?v=1"></script><!-- audio levels plugin -->
<script src="media_stream.js?v=1"></script><!-- media stream --> <script src="media_stream.js?v=1"></script><!-- media stream -->
<script src="bottom_toolbar.js?v=1"></script><!-- media stream --> <script src="bottom_toolbar.js?v=1"></script><!-- media stream -->
<script src="roomname_generator.js?v=1"></script><!-- generator for random room names -->
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<link rel="stylesheet" href="css/font.css?v=3"/> <link rel="stylesheet" href="css/font.css?v=3"/>
<link rel="stylesheet" type="text/css" media="screen" href="css/main.css?v=23"/> <link rel="stylesheet" type="text/css" media="screen" href="css/main.css?v=23"/>
@ -72,11 +74,16 @@
<div id="jitsi_logo"></div> <div id="jitsi_logo"></div>
</a> </a>
<div id="enter_room"> <div id="enter_room_container">
<input id="enter_room_field" type="text" placeholder="Enter room name" /> <div id="enter_room_form" >
<input id="enter_room_button" type="button" value="GO" /> <div id="domain_name"></div>
<input type='checkbox' name='checkbox' id="disable_welcome"/> <div id="enter_room">
<label for="disable_welcome">Don't show this page</label> <input id="enter_room_field" type="text" placeholder="Enter room name" />
<input id="enter_room_button" type="button" value="GO" />
</div>
</div>
<input type='checkbox' name='checkbox' id="disable_welcome"/>
<label for="disable_welcome">Don't show this page</label>
</div> </div>
<div id="brand_header"></div> <div id="brand_header"></div>
<div id="header_text"></div> <div id="header_text"></div>
@ -87,7 +94,7 @@
<div class="feature_holder"> <div class="feature_holder">
<div class="feature_icon">Simple to use</div> <div class="feature_icon">Simple to use</div>
<div class="feature_description"> <div class="feature_description">
No downloads required. uTalk works directly within your browser. Simply share your conference URL with others to get started. No downloads required. <span name="appName"></span> works directly within your browser. Simply share your conference URL with others to get started.
</div> </div>
</div> </div>
<div class="feature_holder"> <div class="feature_holder">
@ -99,7 +106,7 @@
<div class="feature_holder"> <div class="feature_holder">
<div class="feature_icon">Open source</div> <div class="feature_icon">Open source</div>
<div class="feature_description"> <div class="feature_description">
uTalk is licensed under the &lt;GPL/LGPL/WHATEVER&gt;. You can download, use, modify, and share the software without any restrictions. <span name="appName"></span> is licensed under the &lt;GPL/LGPL/WHATEVER&gt;. You can download, use, modify, and share the software without any restrictions.
</div> </div>
</div> </div>
<div class="feature_holder"> <div class="feature_holder">
@ -113,19 +120,19 @@
<div class="feature_holder"> <div class="feature_holder">
<div class="feature_icon">Screen sharing</div> <div class="feature_icon">Screen sharing</div>
<div class="feature_description"> <div class="feature_description">
It's easy to share your screen with others. uTalk is ideal for on-line presentations, lectures, and tech support sessions. It's easy to share your screen with others. <span name="appName"></span> is ideal for on-line presentations, lectures, and tech support sessions.
</div> </div>
</div> </div>
<div class="feature_holder"> <div class="feature_holder">
<div class="feature_icon">Secure rooms</div> <div class="feature_icon">Secure rooms</div>
<div class="feature_description"> <div class="feature_description">
Need some privacy? uTalk conference rooms can be secured with a password in order to exclude unwanted guests and prevent interruptions. Need some privacy? <span name="appName"></span> conference rooms can be secured with a password in order to exclude unwanted guests and prevent interruptions.
</div> </div>
</div> </div>
<div class="feature_holder"> <div class="feature_holder">
<div class="feature_icon">Shared notes</div> <div class="feature_icon">Shared notes</div>
<div class="feature_description"> <div class="feature_description">
uTalk features Etherpad, a real-time collaborative text editor that's great for meeting minutes, writing articles, and more. <span name="appName"></span> features Etherpad, a real-time collaborative text editor that's great for meeting minutes, writing articles, and more.
</div> </div>
</div> </div>
<div class="feature_holder"> <div class="feature_holder">

162
roomname_generator.js Normal file
View File

@ -0,0 +1,162 @@
var RoomNameGenerator = function(my) {
/**
* Constructs new RoomNameGenerator object.
* @constructor constructs new RoomNameGenerator object.
*/
function RoomNameGeneratorProto()
{
}
/**
* Default separator the words in the room name
* @type {string}
*/
var DEFAULT_SEPARATOR = "-";
/**
* Default number of words in the room name.
* @type {number}
*/
var NUMBER_OF_WORDS = 3;
/**
* The list with words.
* @type {string[]}
*/
var words = [
"definite ", "indefinite ", "articles", "name", "preposition ", "help", "very", "to", "through", "and", "just",
"a", "form", "in", "sentence", "is", "great", "it", "think", "you", "say", "that", "help", "he", "low", "was",
"line", "for", "differ", "on", "turn", "are", "cause", "with", "much", "as", "mean", "before", "his", "move",
"they", "right", "be", "boy", "at", "old", "one", "too", "have", "same", "this", "tell", "from", "does", "or",
"set", "had", "three", "by", "want", "hot", "air", "word", "well", "but", "also", "what", "play", "some", "small",
"we", "end", "can", "put", "out", "home", "other", "read", "were", "hand", "all", "port", "there", "large",
"when", "spell", "up", "add", "use", "even", "your", "land", "how", "here", "said", "must", "an", "big", "each",
"high", "she", "such", "which", "follow", "do", "act", "their", "why", "time", "ask", "if", "men", "will", "change",
"way", "went", "about", "light", "many", "kind", "then", "off", "them", "need", "write", "house", "would",
"picture", "like", "try", "so", "us", "these", "again", "her", "animal", "long", "point", "make", "mother",
"thing", "world", "see", "near", "him", "build", "two", "self", "has", "earth", "look", "father", "more", "head",
"day", "stand", "could", "own", "go", "page", "come", "should", "did", "country", "number", "found", "sound",
"answer", "no", "school", "most", "grow", "people", "study", "my", "still", "over", "learn", "know", "plant",
"water", "cover", "than", "food", "call", "sun", "first", "four", "who", "between", "may", "state", "down",
"keep", "side", "eye", "been", "never", "now", "last", "find", "let", "any", "thought", "new", "city", "work",
"tree", "part", "cross", "take", "farm", "get", "hard", "place", "start", "made", "might", "live", "story",
"where", "saw", "after", "far", "back", "sea", "little", "draw", "only", "left", "round", "late", "man", "run",
"year", "don't", "came", "while", "show", "press", "every", "close", "good", "night", "me", "real", "give",
"life", "our", "few", "under", "north", "open", "ten", "seem", "simple", "together", "several", "next", "vowel",
"white", "toward", "children", "war", "begin", "lay", "got", "against", "walk", "pattern", "example", "slow",
"ease", "center", "paper", "love", "group", "person", "always", "money", "music", "serve", "those", "appear",
"both", "road", "mark", "map", "often", "rain", "letter", "rule", "until", "govern", "mile", "pull", "river",
"cold", "car", "notice", "feet", "voice", "care", "unit", "second", "power", "book", "town", "carry", "fine",
"took", "certain", "science", "fly", "eat", "fall", "room", "lead", "friend", "cry", "began", "dark", "idea",
"machine", "fish", "note", "mountain", "wait", "stop", "plan", "once", "figure", "base", "star", "hear", "box",
"horse", "noun", "cut", "field", "sure", "rest", "watch", "correct", "color", "able", "face", "pound", "wood",
"done", "main", "beauty", "enough", "drive", "plain", "stood", "girl", "contain", "usual", "front", "young",
"teach", "ready", "week", "above", "final", "ever", "gave", "red", "green", "list", "oh", "though", "quick",
"feel", "develop", "talk", "ocean", "bird", "warm", "soon", "free", "body", "minute", "dog", "strong", "family",
"special", "direct", "mind", "pose", "behind", "leave", "clear", "song", "tail", "measure", "produce", "door",
"fact", "product", "street", "black", "inch", "short", "multiply", "numeral", "nothing", "class", "course", "wind",
"stay", "question", "wheel", "happen", "full", "complete", "force", "ship", "blue", "area", "object", "half",
"decide", "rock", "surface", "order", "deep", "fire", "moon", "south", "island", "problem", "foot", "piece",
"system", "told", "busy", "knew", "test", "pass", "record", "since", "boat", "top", "common", "whole", "gold",
"king", "possible", "space", "plane", "heard", "stead", "best", "dry", "hour", "wonder", "better", "laugh",
"true", "thousand", "during", "ago", "hundred", "ran", "five", "check", "remember", "game", "step", "shape",
"early", "equate", "hold", "hot", "west", "miss", "ground", "brought", "interest", "heat", "reach", "snow",
"fast", "tire", "verb", "bring", "sing", "yes", "listen", "distant", "six", "fill", "table", "east", "travel",
"paint", "less", "language", "morning", "among", "grand", "cat", "ball", "century", "yet", "consider", "wave",
"type", "drop", "law", "heart", "bit", "am", "coast", "present", "copy", "heavy", "phrase", "dance", "silent",
"engine", "tall", "position", "sand", "arm", "soil", "wide", "roll", "sail", "temperature", "material", "finger",
"size", "industry", "vary", "value", "settle", "fight", "speak", "lie", "weight", "beat", "general", "excite",
"ice", "natural", "matter", "view", "circle", "sense", "pair", "ear", "include", "else", "divide", "quite",
"syllable", "broke", "felt", "case", "perhaps", "middle", "pick", "kill", "sudden", "son", "count", "lake",
"square", "moment", "reason", "scale", "length", "loud", "represent", "spring", "art", "observe", "subject",
"child", "region", "straight", "energy", "consonant", "hunt", "nation", "probable", "dictionary", "bed", "milk",
"brother", "speed", "egg", "method", "ride", "organ", "cell", "pay", "believe", "age", "fraction", "section",
"forest", "dress", "sit", "cloud", "race", "surprise", "window", "quiet", "store", "stone", "summer", "tiny",
"train", "climb", "sleep", "cool", "prove", "design", "lone", "poor", "leg", "lot", "exercise", "experiment",
"wall", "bottom", "catch", "key", "mount", "iron", "wish", "single", "sky", "stick", "board", "flat", "joy",
"twenty", "winter", "skin", "sat", "smile", "written", "crease", "wild", "hole", "instrument", "trade", "kept",
"melody", "glass", "trip", "grass", "office", "cow", "receive", "job", "row", "edge", "mouth", "sign", "exact",
"visit", "symbol", "past", "die", "soft", "least", "fun", "trouble", "bright", "shout", "gas", "except",
"weather", "wrote", "month", "seed", "million", "tone", "bear", "join", "finish", "suggest", "happy", "clean",
"hope", "break", "flower", "lady", "clothe", "yard", "strange", "rise", "gone", "bad", "jump", "blow", "baby",
"oil", "eight", "blood", "village", "touch", "meet", "grew", "root", "cent", "buy", "mix", "raise", "team",
"solve", "wire", "metal", "cost", "whether", "lost", "push", "brown", "seven", "wear", "paragraph", "garden",
"third", "equal", "shall", "sent", "held", "choose", "hair", "fell", "describe", "fit", "cook", "flow", "floor",
"fair", "either", "bank", "result", "collect", "burn", "save", "hill", "control", "safe", "decimal", "rank",
"word", "reference", "gentle", "truck", "woman", "noise", "captain", "level",
"practice", "chance", "separate", "gather", "difficult", "shop", "doctor", "stretch", "please", "throw",
"protect", "shine", "noon", "property", "whose", "column", "locate", "molecule", "ring", "select", "character",
"wrong", "insect", "gray", "caught", "repeat", "period", "require", "indicate", "broad", "radio", "prepare",
"spoke", "salt", "atom", "nose", "human", "plural", "history", "anger", "effect", "claim", "electric",
"continent", "expect", "oxygen", "crop", "sugar", "modern", "death", "element", "pretty", "hit", "skill",
"student", "women", "corner", "season", "party", "solution", "supply", "magnet", "bone", "silver", "rail",
"thank", "imagine", "branch", "provide", "match", "agree", "suffix", "thus", "especially", "capital", "fig",
"won't", "afraid", "chair", "huge", "danger", "sister", "fruit", "steel", "rich", "discuss", "thick", "forward",
"soldier", "similar", "process", "guide", "operate", "experience", "guess", "score", "necessary", "apple",
"sharp", "bought", "wing", "led", "create", "pitch", "neighbor", "coat", "wash", "mass", "bat", "card", "rather",
"band", "crowd", "rope", "corn", "slip", "compare", "win", "poem", "dream", "string", "evening", "bell",
"condition", "depend", "feed", "meat", "tool", "rub", "total", "tube", "basic", "famous", "smell", "dollar",
"valley", "stream", "nor", "fear", "double", "sight", "seat", "thin", "arrive", "triangle", "master", "planet",
"track", "hurry", "parent", "chief", "shore", "colony", "division", "clock", "sheet", "mine", "substance", "tie",
"favor", "enter", "connect", "major", "post", "fresh", "spend", "search", "chord", "send", "fat", "yellow",
"glad", "gun", "original", "allow", "share", "print", "station", "dead", "dad", "spot", "bread", "desert",
"charge", "suit", "proper", "current", "bar", "lift", "offer", "rose", "segment", "continue", "slave", "block",
"duck", "chart", "instant", "hat", "market", "sell", "degree", "success", "populate", "company", "chick",
"subtract", "dear", "event", "enemy", "particular", "reply", "deal", "drink", "swim", "occur", "term", "support",
"opposite", "speech", "wife", "nature", "shoe", "range", "shoulder", "steam", "spread", "motion", "arrange",
"path", "camp", "liquid", "invent", "log", "cotton", "meant", "born", "quotient", "determine", "teeth", "quart",
"shell", "nine", "neck", "fancy", "fan", "football"
];
/**
* Returns random word from the array of words.
* @returns {string} random word from the array of words.
*/
function generateWord()
{
return words[( Math.round(((new Date().getTime() / 1000) +Math.random()*1000) % 1008))];
}
/**
* Generates new room name.
* @param separator the separator for the words.
* @param number_of_words number of words in the room name
* @returns {string} the room name
*/
RoomNameGeneratorProto.generateRoom = function(separator, number_of_words)
{
if(!separator)
separator = DEFAULT_SEPARATOR;
if(!number_of_words)
number_of_words = NUMBER_OF_WORDS;
var name = "";
for(var i = 0; i<number_of_words; i++)
name += ((i != 0)? separator : "") + generateWord();
return name;
}
/**
* Generates new room name.
* @param number_of_words number of words in the room name
* @returns {string} the room name
*/
RoomNameGeneratorProto.generateRoomWithoutSeparator = function(number_of_words)
{
if(!number_of_words)
number_of_words = NUMBER_OF_WORDS;
var name = "";
for(var i = 0; i<number_of_words; i++) {
var word = generateWord();
word = word.substring(0, 1).toUpperCase() + word.substring(1, word.length);
name += word ;
}
return name;
}
return RoomNameGeneratorProto;
}();