Преглед изворни кода

Adds room name generator.

j8
hristoterezov пре 11 година
родитељ
комит
5ccb720ecc
5 измењених фајлова са 247 додато и 24 уклоњено
  1. 23
    1
      app.js
  2. 4
    0
      brand.js
  3. 41
    13
      css/welcome_page.css
  4. 17
    10
      index.html
  5. 162
    0
      roomname_generator.js

+ 23
- 1
app.js Прегледај датотеку

@@ -1041,9 +1041,13 @@ $(document).ready(function () {
1041 1041
         (!window.localStorage.welcomePageDisabled || window.localStorage.welcomePageDisabled == "false"))
1042 1042
     {
1043 1043
         $("#videoconference_page").hide();
1044
+        $("#domain_name").text(window.location.host + "/");
1045
+        $("span[name='appName']").text(brand.appName);
1044 1046
         $("#enter_room_button").click(function()
1045 1047
         {
1046
-            var val = Util.escapeHtml($("#enter_room_field").val());
1048
+            var val = $("#enter_room_field").val();
1049
+            if(!val)
1050
+                val = $("#enter_room_field").attr("placeholder");
1047 1051
             window.location.pathname = "/" + val;
1048 1052
         });
1049 1053
 
@@ -1054,6 +1058,24 @@ $(document).ready(function () {
1054 1058
             }
1055 1059
         });
1056 1060
 
1061
+        function animate(word) {
1062
+            var currentVal = $("#enter_room_field").attr("placeholder");
1063
+            $("#enter_room_field").attr("placeholder", currentVal + word.substr(0, 1));
1064
+            setTimeout(function() {
1065
+                    animate(word.substring(1, word.length))
1066
+                }, 150);
1067
+        }
1068
+
1069
+        function update_roomname()
1070
+        {
1071
+
1072
+            $("#enter_room_field").attr("placeholder", "");
1073
+            animate(RoomNameGenerator.generateRoomWithoutSeparator());
1074
+            setTimeout(update_roomname, 10000);
1075
+
1076
+        }
1077
+        update_roomname();
1078
+
1057 1079
         $("#disable_welcome").click(function () {
1058 1080
             window.localStorage.welcomePageDisabled = $("#disable_welcome").is(":checked");
1059 1081
         });

+ 4
- 0
brand.js Прегледај датотеку

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

+ 41
- 13
css/welcome_page.css Прегледај датотеку

@@ -8,7 +8,6 @@
8 8
     background-image: url(../images/welcome_page/disable-welcome.png);
9 9
     display:inline-block;
10 10
     position:absolute;
11
-    margin-left: 323px;
12 11
     height: 54px;
13 12
     cursor: pointer;
14 13
     -webkit-user-select: none;
@@ -20,6 +19,9 @@
20 19
     font-family: Helvetica;
21 20
     font-size: 16px;
22 21
     color: #acacac;
22
+    z-index: 2;
23
+    float: left;
24
+    margin-left: 5px;
23 25
 }
24 26
 
25 27
 #disable_welcome:checked + label
@@ -27,7 +29,6 @@
27 29
     background-image: url(../images/welcome_page/disable-welcome-selected.png);
28 30
     display:inline-block;
29 31
     position:absolute;
30
-    margin-left: 323px;
31 32
     height: 54px;
32 33
     cursor: pointer;
33 34
     -webkit-user-select: none;
@@ -39,23 +40,45 @@
39 40
     font-family: Helvetica;
40 41
     font-size: 16px;
41 42
     color: #acacac;
43
+    z-index: 2;
44
+    float: left;
45
+    margin-left: 5px;
42 46
 }
43 47
 
44
-
45
-#enter_room_field {
48
+#enter_room_form {
46 49
     border-radius: 10px;
47
-    font-size: 16px;
48
-    padding: 15px 55px 10px 30px;
50
+    background-color: #FFFFFF;
49 51
     border: none;
50 52
     -moz-border-radius: 10px;
51 53
     -webkit-border-radius: 10px;
52 54
     -webkit-appearance: none;
53
-    width: 318px;
54 55
     height: 55px;
55
-    position:absolute;
56
+    box-shadow: none;
57
+    float: left;
58
+}
59
+
60
+#domain_name
61
+{
62
+    float: left;
63
+    padding: 20px 0px 10px 20px;
64
+    font-size: 18px;
65
+    font-weight: 500;
66
+    font-family: Helvetica;
67
+}
68
+
69
+#enter_room_field {
70
+    font-size: 16px;
71
+    padding: 15px 5px 10px 10px;
72
+    border: none;
73
+    -webkit-appearance: none;
74
+    width: 228px;
75
+    height: 55px;
56 76
     font-weight: 500;
57 77
     font-family: Helvetica;
58 78
     box-shadow: none;
79
+    float: left;
80
+    background-color: #FFFFFF;
81
+    position: relative;
59 82
     z-index: 2;
60 83
 }
61 84
 
@@ -68,19 +91,24 @@
68 91
     color: #ffffff;
69 92
     font-weight: 600;
70 93
     border: none;
71
-    position:absolute;
72
-    margin-left: 240px;
73 94
     margin-top: 5px;
74 95
     font-size: 19px;
75 96
     font-family: Helvetica;
76 97
     padding-top: 6px;
77
-    z-index: 2;
78 98
     outline: none;
99
+    float:left;
100
+    position: relative;
101
+    z-index: 2;
79 102
 }
80 103
 
81
-#enter_room {
104
+#enter_room_container {
82 105
     margin: 70px auto 0px auto;
83
-    width:318px;
106
+    width:531px;
107
+}
108
+
109
+#enter_room{
110
+    float:left;
111
+    padding-right: 5px;
84 112
 }
85 113
 
86 114
 #welcome_page_header

+ 17
- 10
index.html Прегледај датотеку

@@ -24,6 +24,7 @@
24 24
     <script src="libs/tooltip.js?v=1"></script><!-- bootstrap tooltip lib -->
25 25
     <script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
26 26
     <script src="config.js?v=4"></script><!-- adapt to your needs, i.e. set hosts and bosh path -->
27
+    <script src="brand.js?v=1"></script>
27 28
     <script src="muc.js?v=13"></script><!-- simple MUC library -->
28 29
     <script src="estos_log.js?v=2"></script><!-- simple stanza logger -->
29 30
     <script src="desktopsharing.js?v=2"></script><!-- desktop sharing -->
@@ -47,6 +48,7 @@
47 48
     <script src="audio_levels.js?v=1"></script><!-- audio levels plugin -->
48 49
     <script src="media_stream.js?v=1"></script><!-- media stream -->
49 50
     <script src="bottom_toolbar.js?v=1"></script><!-- media stream -->
51
+    <script src="roomname_generator.js?v=1"></script><!-- generator for random room names -->
50 52
     <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
51 53
     <link rel="stylesheet" href="css/font.css?v=3"/>
52 54
     <link rel="stylesheet" type="text/css" media="screen" href="css/main.css?v=23"/>
@@ -72,11 +74,16 @@
72 74
                 <div id="jitsi_logo"></div>
73 75
             </a>
74 76
 
75
-            <div id="enter_room">
76
-                <input id="enter_room_field" type="text" placeholder="Enter room name" />
77
-                <input id="enter_room_button" type="button" value="GO" />
78
-                <input type='checkbox' name='checkbox' id="disable_welcome"/>
79
-                <label for="disable_welcome">Don't show this page</label>
77
+            <div id="enter_room_container">
78
+                    <div id="enter_room_form" >
79
+                        <div id="domain_name"></div>
80
+                        <div id="enter_room">
81
+                            <input id="enter_room_field" type="text" placeholder="Enter room name" />
82
+                            <input id="enter_room_button" type="button" value="GO" />
83
+                        </div>
84
+                    </div>
85
+                    <input type='checkbox' name='checkbox' id="disable_welcome"/>
86
+                    <label for="disable_welcome">Don't show this page</label>
80 87
             </div>
81 88
             <div id="brand_header"></div>
82 89
             <div id="header_text"></div>
@@ -87,7 +94,7 @@
87 94
                     <div class="feature_holder">
88 95
                         <div class="feature_icon">Simple to use</div>
89 96
                         <div class="feature_description">
90
-                            No downloads required. uTalk works directly within your browser. Simply share your conference URL with others to get started.
97
+                            No downloads required. <span name="appName"></span> works directly within your browser. Simply share your conference URL with others to get started.
91 98
                         </div>
92 99
                     </div>
93 100
                     <div class="feature_holder">
@@ -99,7 +106,7 @@
99 106
                     <div class="feature_holder">
100 107
                         <div class="feature_icon">Open source</div>
101 108
                         <div class="feature_description">
102
-                            uTalk is licensed under the &lt;GPL/LGPL/WHATEVER&gt;. You can download, use, modify, and share the software without any restrictions.
109
+                            <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.
103 110
                         </div>
104 111
                     </div>
105 112
                     <div class="feature_holder">
@@ -113,19 +120,19 @@
113 120
                     <div class="feature_holder">
114 121
                         <div class="feature_icon">Screen sharing</div>
115 122
                         <div class="feature_description">
116
-                            It's easy to share your screen with others. uTalk is ideal for on-line presentations, lectures, and tech support sessions.
123
+                            It's easy to share your screen with others. <span name="appName"></span> is ideal for on-line presentations, lectures, and tech support sessions.
117 124
                         </div>
118 125
                     </div>
119 126
                     <div class="feature_holder">
120 127
                         <div class="feature_icon">Secure rooms</div>
121 128
                         <div class="feature_description">
122
-                            Need some privacy? uTalk conference rooms can be secured with a password in order to exclude unwanted guests and prevent interruptions.
129
+                            Need some privacy? <span name="appName"></span> conference rooms can be secured with a password in order to exclude unwanted guests and prevent interruptions.
123 130
                         </div>
124 131
                     </div>
125 132
                     <div class="feature_holder">
126 133
                         <div class="feature_icon">Shared notes</div>
127 134
                         <div class="feature_description">
128
-                            uTalk features Etherpad, a real-time collaborative text editor that's great for meeting minutes, writing articles, and more.
135
+                            <span name="appName"></span> features Etherpad, a real-time collaborative text editor that's great for meeting minutes, writing articles, and more.
129 136
                         </div>
130 137
                     </div>
131 138
                     <div class="feature_holder">

+ 162
- 0
roomname_generator.js Прегледај датотеку

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

Loading…
Откажи
Сачувај