소스 검색

Adds the number of participants to the contact list icon.

Adds glowing to the bottom toolbar chat button and the contact list button when a contact enters or leaves.
j8
fo 10 년 전
부모
커밋
02d8f1a3ca
7개의 변경된 파일132개의 추가작업 그리고 26개의 파일을 삭제
  1. 2
    2
      bottom_toolbar.js
  2. 23
    3
      chat.js
  3. 58
    2
      contact_list.js
  4. 20
    6
      css/chat.css
  5. 15
    2
      css/main.css
  6. 2
    3
      images/chatArrow.svg
  7. 12
    8
      index.html

+ 2
- 2
bottom_toolbar.js 파일 보기

9
             }, 500);
9
             }, 500);
10
         }
10
         }
11
 
11
 
12
-        buttonClick("#chatBottomButton", "active");
13
-
14
         Chat.toggleChat();
12
         Chat.toggleChat();
13
+
14
+        buttonClick("#chatBottomButton", "active");
15
     };
15
     };
16
 
16
 
17
     my.toggleContactList = function() {
17
     my.toggleContactList = function() {

+ 23
- 3
chat.js 파일 보기

354
      */
354
      */
355
     function setVisualNotification(show) {
355
     function setVisualNotification(show) {
356
         var unreadMsgElement = document.getElementById('unreadMessages');
356
         var unreadMsgElement = document.getElementById('unreadMessages');
357
+        var unreadMsgBottomElement = document.getElementById('bottomUnreadMessages');
357
 
358
 
358
         var glower = $('#chatButton');
359
         var glower = $('#chatButton');
360
+        var bottomGlower = $('#chatBottomButton');
359
 
361
 
360
         if (unreadMessages) {
362
         if (unreadMessages) {
361
             unreadMsgElement.innerHTML = unreadMessages.toString();
363
             unreadMsgElement.innerHTML = unreadMessages.toString();
364
+            unreadMsgBottomElement.innerHTML = unreadMessages.toString();
362
 
365
 
363
             ToolbarToggler.dockToolbar(true);
366
             ToolbarToggler.dockToolbar(true);
364
 
367
 
365
             var chatButtonElement
368
             var chatButtonElement
366
                 = document.getElementById('chatButton').parentNode;
369
                 = document.getElementById('chatButton').parentNode;
367
             var leftIndent = (Util.getTextWidth(chatButtonElement) -
370
             var leftIndent = (Util.getTextWidth(chatButtonElement) -
368
-                              Util.getTextWidth(unreadMsgElement)) / 2;
371
+                Util.getTextWidth(unreadMsgElement)) / 2;
369
             var topIndent = (Util.getTextHeight(chatButtonElement) -
372
             var topIndent = (Util.getTextHeight(chatButtonElement) -
370
-                             Util.getTextHeight(unreadMsgElement)) / 2 - 3;
373
+                Util.getTextHeight(unreadMsgElement)) / 2 - 2;
371
 
374
 
372
             unreadMsgElement.setAttribute(
375
             unreadMsgElement.setAttribute(
373
-                    'style',
376
+                'style',
374
                     'top:' + topIndent +
377
                     'top:' + topIndent +
375
                     '; left:' + leftIndent + ';');
378
                     '; left:' + leftIndent + ';');
376
 
379
 
380
+            var chatBottomButtonElement
381
+                = document.getElementById('chatBottomButton').parentNode;
382
+            var bottomLeftIndent = (Util.getTextWidth(chatBottomButtonElement) -
383
+                Util.getTextWidth(unreadMsgBottomElement)) / 2;
384
+            var bottomTopIndent = (Util.getTextHeight(chatBottomButtonElement) -
385
+                Util.getTextHeight(unreadMsgBottomElement)) / 2 - 3;
386
+
387
+            unreadMsgBottomElement.setAttribute(
388
+                'style',
389
+                    'top:' + bottomTopIndent +
390
+                    '; left:' + bottomLeftIndent + ';');
391
+
392
+
377
             if (!glower.hasClass('icon-chat-simple')) {
393
             if (!glower.hasClass('icon-chat-simple')) {
378
                 glower.removeClass('icon-chat');
394
                 glower.removeClass('icon-chat');
379
                 glower.addClass('icon-chat-simple');
395
                 glower.addClass('icon-chat-simple');
381
         }
397
         }
382
         else {
398
         else {
383
             unreadMsgElement.innerHTML = '';
399
             unreadMsgElement.innerHTML = '';
400
+            unreadMsgBottomElement.innerHTML = '';
384
             glower.removeClass('icon-chat-simple');
401
             glower.removeClass('icon-chat-simple');
385
             glower.addClass('icon-chat');
402
             glower.addClass('icon-chat');
386
         }
403
         }
388
         if (show && !notificationInterval) {
405
         if (show && !notificationInterval) {
389
             notificationInterval = window.setInterval(function () {
406
             notificationInterval = window.setInterval(function () {
390
                 glower.toggleClass('active');
407
                 glower.toggleClass('active');
408
+                bottomGlower.toggleClass('active glowing');
391
             }, 800);
409
             }, 800);
392
         }
410
         }
393
         else if (!show && notificationInterval) {
411
         else if (!show && notificationInterval) {
394
             window.clearInterval(notificationInterval);
412
             window.clearInterval(notificationInterval);
395
             notificationInterval = false;
413
             notificationInterval = false;
396
             glower.removeClass('active');
414
             glower.removeClass('active');
415
+            bottomGlower.removeClass('glowing');
416
+            bottomGlower.addClass('active');
397
         }
417
         }
398
     }
418
     }
399
 
419
 

+ 58
- 2
contact_list.js 파일 보기

2
  * Contact list.
2
  * Contact list.
3
  */
3
  */
4
 var ContactList = (function (my) {
4
 var ContactList = (function (my) {
5
+
6
+    var numberOfContacts = 0;
7
+    var notificationInterval;
8
+
5
     /**
9
     /**
6
      * Indicates if the chat is currently visible.
10
      * Indicates if the chat is currently visible.
7
      *
11
      *
65
         else {
69
         else {
66
             clElement.appendChild(newContact);
70
             clElement.appendChild(newContact);
67
         }
71
         }
72
+        updateNumberOfParticipants(1);
68
     };
73
     };
69
 
74
 
70
     /**
75
     /**
81
             var contactlist = $('#contactlist>ul');
86
             var contactlist = $('#contactlist>ul');
82
 
87
 
83
             contactlist.get(0).removeChild(contact.get(0));
88
             contactlist.get(0).removeChild(contact.get(0));
89
+
90
+            updateNumberOfParticipants(-1);
84
         }
91
         }
85
     };
92
     };
86
 
93
 
163
             $('#contactlist').show("slide", { direction: "right",
170
             $('#contactlist').show("slide", { direction: "right",
164
                                             queue: false,
171
                                             queue: false,
165
                                             duration: 500});
172
                                             duration: 500});
173
+
174
+            //stop the glowing of the contact list icon
175
+            setVisualNotification(false);
176
+        }
177
+    };
178
+
179
+    /**
180
+     * Updates the number of participants in the contact list button and sets
181
+     * the glow
182
+     * @param delta indicates whether a new user has joined (1) or someone has
183
+     * left(-1)
184
+     */
185
+    function updateNumberOfParticipants(delta) {
186
+        //when the user is alone we don't show the number of participants
187
+        if(numberOfContacts === 0) {
188
+            $("#numberOfParticipants").text('');
189
+            numberOfContacts += delta;
190
+        } else if(numberOfContacts !== 0 && !ContactList.isVisible()) {
191
+            setVisualNotification(true);
192
+            numberOfContacts += delta;
193
+            $("#numberOfParticipants").text(numberOfContacts);
166
         }
194
         }
167
     };
195
     };
168
 
196
 
176
         avatar.className = "icon-avatar avatar";
204
         avatar.className = "icon-avatar avatar";
177
 
205
 
178
         return avatar;
206
         return avatar;
179
-    };
207
+    }
180
 
208
 
181
     /**
209
     /**
182
      * Creates the display name paragraph.
210
      * Creates the display name paragraph.
188
         p.innerHTML = displayName;
216
         p.innerHTML = displayName;
189
 
217
 
190
         return p;
218
         return p;
191
-    };
219
+    }
220
+
221
+    /**
222
+     * Shows/hides a visual notification, indicating that a new user has joined
223
+     * the conference.
224
+     */
225
+    function setVisualNotification(show, stopGlowingIn) {
226
+        var glower = $('#contactListButton');
227
+        function stopGlowing() {
228
+            window.clearInterval(notificationInterval);
229
+            notificationInterval = false;
230
+            glower.removeClass('glowing');
231
+            if(!ContactList.isVisible()) {
232
+                glower.removeClass('active');
233
+            }
234
+        }
235
+
236
+        if (show && !notificationInterval) {
237
+            notificationInterval = window.setInterval(function () {
238
+                glower.toggleClass('active glowing');
239
+            }, 800);
240
+        }
241
+        else if (!show && notificationInterval) {
242
+            stopGlowing();
243
+        }
244
+        if(stopGlowingIn) {
245
+            setTimeout(stopGlowing, stopGlowingIn);
246
+        }
247
+    }
192
 
248
 
193
     /**
249
     /**
194
      * Indicates that the display name has changed.
250
      * Indicates that the display name has changed.

+ 20
- 6
css/chat.css 파일 보기

46
     max-height:150px;
46
     max-height:150px;
47
     min-height:35px;
47
     min-height:35px;
48
     border: 0px none;
48
     border: 0px none;
49
-    background: #231F20;
49
+    background: #3a3a3a;
50
     color: #a7a7a7;
50
     color: #a7a7a7;
51
     box-shadow: none;
51
     box-shadow: none;
52
     border-radius:0;
52
     border-radius:0;
75
 #nickinput {
75
 #nickinput {
76
     margin-top: 20px;
76
     margin-top: 20px;
77
     font-size: 14px;
77
     font-size: 14px;
78
-    background: #231F20;
78
+    background: #3a3a3a;
79
     box-shadow: inset 0 0 3px 2px #a7a7a7;
79
     box-shadow: inset 0 0 3px 2px #a7a7a7;
80
     border: 1px solid #a7a7a7;
80
     border: 1px solid #a7a7a7;
81
     color: #a7a7a7;
81
     color: #a7a7a7;
82
 }
82
 }
83
 
83
 
84
+#unreadMessages {
85
+    font-size: 8px;
86
+    position: absolute;
87
+    left: 46%;
88
+    top: 27%
89
+}
90
+
91
+#bottomUnreadMessages {
92
+    top: 5px;
93
+    left: 10px;
94
+    position: absolute;
95
+    font-size: 8px;
96
+}
97
+
84
 #chatspace .username {
98
 #chatspace .username {
85
     float: left;
99
     float: left;
86
     padding-left: 5px;
100
     padding-left: 5px;
105
 }
119
 }
106
 
120
 
107
 .chatmessage {
121
 .chatmessage {
108
-    background: #231F20;
122
+    background: #3a3a3a;
109
     width: 93%;
123
     width: 93%;
110
     margin-left: 5%;
124
     margin-left: 5%;
111
     margin-right: auto;
125
     margin-right: auto;
149
     max-height:150px;
163
     max-height:150px;
150
     min-height:35px;
164
     min-height:35px;
151
     border: 0px none;
165
     border: 0px none;
152
-    background: #231F20;
166
+    background: #3a3a3a;
153
     overflow: hidden;
167
     overflow: hidden;
154
     visibility: hidden;
168
     visibility: hidden;
155
 }
169
 }
157
 #smileysContainer {
171
 #smileysContainer {
158
     display: none;
172
     display: none;
159
     position: absolute;
173
     position: absolute;
160
-    background: #231F20;
174
+    background: #3a3a3a;
161
     border-bottom: 1px solid;
175
     border-bottom: 1px solid;
162
     border-top: 1px solid;
176
     border-top: 1px solid;
163
     width: 100%;
177
     width: 100%;
205
 }
219
 }
206
 
220
 
207
 #usermsg::-webkit-scrollbar-track-piece {
221
 #usermsg::-webkit-scrollbar-track-piece {
208
-    background: #231F20;
222
+    background: #3a3a3a;
209
 }
223
 }

+ 15
- 2
css/main.css 파일 보기

70
     cursor: pointer;
70
     cursor: pointer;
71
 }
71
 }
72
 
72
 
73
-#chatButton {
73
+#chatButton, #chatBottomButton, #contactListButton {
74
     -webkit-transition: all .5s ease-in-out;
74
     -webkit-transition: all .5s ease-in-out;
75
        -moz-transition: all .5s ease-in-out;
75
        -moz-transition: all .5s ease-in-out;
76
             transition: all .5s ease-in-out;
76
             transition: all .5s ease-in-out;
77
 }
77
 }
78
 /*#ffde00*/
78
 /*#ffde00*/
79
-#chatButton.active {
79
+#chatButton.active, #contactListButton.glowing, #chatBottomButton.glowing {
80
     -webkit-text-shadow:    -1px 0 10px #00ccff,
80
     -webkit-text-shadow:    -1px 0 10px #00ccff,
81
                             0 1px 10px #00ccff,
81
                             0 1px 10px #00ccff,
82
                             1px 0 10px #00ccff,
82
                             1px 0 10px #00ccff,
91
                     0 -1px 10px #00ccff;
91
                     0 -1px 10px #00ccff;
92
 }
92
 }
93
 
93
 
94
+#numberOfParticipants {
95
+    position: absolute;
96
+    top: 0px;
97
+    right: -1;
98
+    color: white;
99
+    width: 13px;
100
+    height: 13px;
101
+    line-height: 13px;
102
+    font-weight: bold;
103
+    border-radius: 2px;
104
+    text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;
105
+}
106
+
94
 #recordButton {
107
 #recordButton {
95
     -webkit-transition: all .5s ease-in-out;
108
     -webkit-transition: all .5s ease-in-out;
96
     -moz-transition: all .5s ease-in-out;
109
     -moz-transition: all .5s ease-in-out;

+ 2
- 3
images/chatArrow.svg 파일 보기

2
 <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
2
 <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
3
 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
 <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
 <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
-	 width="258.559px" height="396.871px" viewBox="83.27 0 258.559 396.871" enable-background="new 83.27 0 258.559 396.871"
5
+	 width="258.559px" height="396.871px" viewBox="0 0 258.559 396.871" enable-background="new 0 0 258.559 396.871"
6
 	 xml:space="preserve">
6
 	 xml:space="preserve">
7
 <g id="u6PRpE_1_">
7
 <g id="u6PRpE_1_">
8
 	<g>
8
 	<g>
9
-		<path fill-rule="evenodd" clip-rule="evenodd" fill="#231F20" d="M341.829,396.871c0,0-16.524-193.936-258.445-396.871
10
-			c86.17,0,258.445,0,258.445,0V396.871z"/>
9
+		<path fill="#3A3A3A" d="M341.829,396.871c0,0-16.524-193.936-258.445-396.871c86.17,0,258.445,0,258.445,0V396.871z"/>
11
 	</g>
10
 	</g>
12
 </g>
11
 </g>
13
 </svg>
12
 </svg>

+ 12
- 8
index.html 파일 보기

36
     <script src="data_channels.js?v=3"></script><!-- data channels -->
36
     <script src="data_channels.js?v=3"></script><!-- data channels -->
37
     <script src="app.js?v=18"></script><!-- application logic -->
37
     <script src="app.js?v=18"></script><!-- application logic -->
38
     <script src="commands.js?v=1"></script><!-- application logic -->
38
     <script src="commands.js?v=1"></script><!-- application logic -->
39
-    <script src="chat.js?v=12"></script><!-- chat logic -->
40
-    <script src="contact_list.js?v=4"></script><!-- contact list logic -->
39
+    <script src="chat.js?v=13"></script><!-- chat logic -->
40
+    <script src="contact_list.js?v=5"></script><!-- contact list logic -->
41
     <script src="util.js?v=6"></script><!-- utility functions -->
41
     <script src="util.js?v=6"></script><!-- utility functions -->
42
     <script src="etherpad.js?v=9"></script><!-- etherpad plugin -->
42
     <script src="etherpad.js?v=9"></script><!-- etherpad plugin -->
43
     <script src="prezi.js?v=6"></script><!-- prezi plugin -->
43
     <script src="prezi.js?v=6"></script><!-- prezi plugin -->
54
     <script src="canvas_util.js?v=1"></script><!-- canvas drawing utils -->
54
     <script src="canvas_util.js?v=1"></script><!-- canvas drawing utils -->
55
     <script src="audio_levels.js?v=2"></script><!-- audio levels plugin -->
55
     <script src="audio_levels.js?v=2"></script><!-- audio levels plugin -->
56
     <script src="media_stream.js?v=1"></script><!-- media stream -->
56
     <script src="media_stream.js?v=1"></script><!-- media stream -->
57
-    <script src="bottom_toolbar.js?v=4"></script><!-- media stream -->
57
+    <script src="bottom_toolbar.js?v=5"></script><!-- media stream -->
58
     <script src="roomname_generator.js?v=1"></script><!-- generator for random room names -->
58
     <script src="roomname_generator.js?v=1"></script><!-- generator for random room names -->
59
     <script src="keyboard_shortcut.js?v=3"></script>
59
     <script src="keyboard_shortcut.js?v=3"></script>
60
     <script src="tracking.js?v=1"></script><!-- tracking -->
60
     <script src="tracking.js?v=1"></script><!-- tracking -->
63
     <script src="api_connector.js?v=1"></script>
63
     <script src="api_connector.js?v=1"></script>
64
     <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
64
     <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
65
     <link rel="stylesheet" href="css/font.css?v=5"/>
65
     <link rel="stylesheet" href="css/font.css?v=5"/>
66
-    <link rel="stylesheet" type="text/css" media="screen" href="css/main.css?v=27"/>
66
+    <link rel="stylesheet" type="text/css" media="screen" href="css/main.css?v=28"/>
67
     <link rel="stylesheet" type="text/css" media="screen" href="css/videolayout_default.css?v=13" id="videolayout_default"/>
67
     <link rel="stylesheet" type="text/css" media="screen" href="css/videolayout_default.css?v=13" id="videolayout_default"/>
68
     <link rel="stylesheet" href="css/jquery-impromptu.css?v=4">
68
     <link rel="stylesheet" href="css/jquery-impromptu.css?v=4">
69
     <link rel="stylesheet" href="css/modaldialog.css?v=3">
69
     <link rel="stylesheet" href="css/modaldialog.css?v=3">
71
     <link rel="stylesheet" href="css/popover.css?v=2">
71
     <link rel="stylesheet" href="css/popover.css?v=2">
72
       <link rel="stylesheet" href="css/jitsi_popover.css?v=2">
72
       <link rel="stylesheet" href="css/jitsi_popover.css?v=2">
73
     <link rel="stylesheet" href="css/contact_list.css?v=3">
73
     <link rel="stylesheet" href="css/contact_list.css?v=3">
74
-    <link rel="stylesheet" href="css/chat.css?v=4">
74
+    <link rel="stylesheet" href="css/chat.css?v=5">
75
     <link rel="stylesheet" href="css/welcome_page.css?v=2">
75
     <link rel="stylesheet" href="css/welcome_page.css?v=2">
76
     <!--
76
     <!--
77
         Link used for inline installation of chrome desktop streaming extension,
77
         Link used for inline installation of chrome desktop streaming extension,
193
                     <div class="header_button_separator"></div>
193
                     <div class="header_button_separator"></div>
194
                     <span class="toolbar_span">
194
                     <span class="toolbar_span">
195
                         <a class="button" data-container="body" data-toggle="popover" shortcut="toggleChatPopover" data-placement="bottom" content="Open / close chat" onclick='BottomToolbar.toggleChat();'>
195
                         <a class="button" data-container="body" data-toggle="popover" shortcut="toggleChatPopover" data-placement="bottom" content="Open / close chat" onclick='BottomToolbar.toggleChat();'>
196
-                            <i id="chatButton" class="icon-chat"></i>
196
+                            <i id="chatButton" class="icon-chat">
197
+                                <span id="unreadMessages"></span>
198
+                            </i>
197
                         </a>
199
                         </a>
198
-                        <span id="unreadMessages"></span>
199
                     </span>
200
                     </span>
200
                     <span id="prezi_button">
201
                     <span id="prezi_button">
201
                         <div class="header_button_separator"></div>
202
                         <div class="header_button_separator"></div>
273
             <span id="bottomToolbar">
274
             <span id="bottomToolbar">
274
                 <span class="bottomToolbar_span">
275
                 <span class="bottomToolbar_span">
275
                     <a class="bottomToolbarButton" data-container="body" data-toggle="popover" shortcut="toggleChatPopover" data-placement="top" content="Open / close chat" onclick='BottomToolbar.toggleChat();'>
276
                     <a class="bottomToolbarButton" data-container="body" data-toggle="popover" shortcut="toggleChatPopover" data-placement="top" content="Open / close chat" onclick='BottomToolbar.toggleChat();'>
276
-                        <i id="chatBottomButton" class="icon-chat-simple"></i>
277
+                        <i id="chatBottomButton" class="icon-chat-simple">
278
+                            <span id="bottomUnreadMessages"></span>
279
+                        </i>
277
                     </a>
280
                     </a>
278
                 </span>
281
                 </span>
279
                 <div class="bottom_button_separator"></div>
282
                 <div class="bottom_button_separator"></div>
280
                 <span class="bottomToolbar_span">
283
                 <span class="bottomToolbar_span">
281
                     <a class="bottomToolbarButton" data-container="body" data-toggle="popover" data-placement="top" id="contactlistpopover" content="Open / close contact list" onclick='BottomToolbar.toggleContactList();'>
284
                     <a class="bottomToolbarButton" data-container="body" data-toggle="popover" data-placement="top" id="contactlistpopover" content="Open / close contact list" onclick='BottomToolbar.toggleContactList();'>
282
                         <i id="contactListButton" class="icon-contactList"></i>
285
                         <i id="contactListButton" class="icon-contactList"></i>
286
+                        <span id="numberOfParticipants"></span>
283
                     </a>
287
                     </a>
284
                 </span>
288
                 </span>
285
                 <div class="bottom_button_separator"></div>
289
                 <div class="bottom_button_separator"></div>

Loading…
취소
저장