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

Merge pull request #338 from gerges/issue/toolbar-refactor

Refactors toolbar
master
hristoterezov пре 10 година
родитељ
комит
fd7e8c9162

+ 26
- 8
css/main.css Прегледај датотеку

@@ -38,17 +38,30 @@ html, body{
38 38
     position: relative;
39 39
 }
40 40
 
41
+#toolbar a.button::after {
42
+    content: '';
43
+    display: inline-block;
44
+    position: absolute;
45
+    left: 40px;
46
+    width: 1px;
47
+    height: 20px;
48
+    background: #373737;
49
+}
50
+
51
+#toolbar a.button:last-child::after {
52
+    content: none;
53
+}
54
+
41 55
 .button {
42 56
     display: inline-block;
43 57
     position: relative;
44 58
     color: #FFFFFF;
45
-    top: 0px;
46
-    padding: 10px 0px;
59
+    top: 0;
60
+    padding: 10px 0;
47 61
     width: 38px;
48 62
     cursor: pointer;
49
-    font-size: 11pt;
50 63
     text-align: center;
51
-    text-shadow: 0px 1px 0px rgba(255,255,255,.3), 0px -1px 0px rgba(0,0,0,.6);
64
+    text-shadow: 0 1px 0 rgba(255,255,255,.3), 0 -1px 0 rgba(0,0,0,.6);
52 65
     z-index: 1;
53 66
 }
54 67
 
@@ -61,13 +74,13 @@ html, body{
61 74
     cursor: pointer;
62 75
 }
63 76
 
64
-#chatButton, #chatBottomButton, #contactListButton, #numberOfParticipants {
77
+#toolbar_button_chat, #chatBottomButton, #contactListButton, #numberOfParticipants {
65 78
     -webkit-transition: all .5s ease-in-out;
66 79
        -moz-transition: all .5s ease-in-out;
67 80
             transition: all .5s ease-in-out;
68 81
 }
69 82
 /*#ffde00*/
70
-#chatButton.active, #contactListButton.glowing, #chatBottomButton.glowing {
83
+#toolbar_button_chat.active, #contactListButton.glowing, #chatBottomButton.glowing {
71 84
     -webkit-text-shadow:    -1px 0 10px #00ccff,
72 85
                             0 1px 10px #00ccff,
73 86
                             1px 0 10px #00ccff,
@@ -82,6 +95,11 @@ html, body{
82 95
                     0 -1px 10px #00ccff;
83 96
 }
84 97
 
98
+#toolbar_button_hangup {
99
+    color: #ff0000;
100
+    font-size: 1.4em;
101
+}
102
+
85 103
 #numberOfParticipants {
86 104
     position: absolute;
87 105
     top: 0px;
@@ -100,13 +118,13 @@ html, body{
100 118
     color: #00ccff;
101 119
 }
102 120
 
103
-#recordButton {
121
+#toolbar_button_record {
104 122
     -webkit-transition: all .5s ease-in-out;
105 123
     -moz-transition: all .5s ease-in-out;
106 124
     transition: all .5s ease-in-out;
107 125
 }
108 126
 /*#ffde00*/
109
-#recordButton.active {
127
+#toolbar_button_record.active {
110 128
     -webkit-text-shadow:    -1px 0 10px #00ccff,
111 129
     0 1px 10px #00ccff,
112 130
     1px 0 10px #00ccff,

+ 1
- 1
css/videolayout_default.css Прегледај датотеку

@@ -135,7 +135,7 @@
135 135
     z-index: 0;
136 136
 }
137 137
 
138
-#etherpadButton {
138
+#toolbar_button_etherpad {
139 139
     display: none;
140 140
 }
141 141
 

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

@@ -22,7 +22,7 @@
22 22
     <script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
23 23
     <script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
24 24
     <script src="interface_config.js?v=5"></script>
25
-    <script src="libs/app.bundle.js?v=126"></script>
25
+    <script src="libs/app.bundle.js?v=123"></script>
26 26
     <script src="analytics.js?v=1"></script><!-- google analytics plugin -->
27 27
     <link rel="stylesheet" href="css/font.css?v=7"/>
28 28
     <link rel="stylesheet" href="css/toastr.css?v=1">
@@ -133,9 +133,7 @@
133 133
                 </div>
134 134
                 <span id="toolbar">
135 135
                     <span id="authentication" class="authentication" style="display: none">
136
-                        <a class="button" id="toolbar_button_authentication" >
137
-                            <i id="authButton" class="icon-avatar"></i>
138
-                        </a>
136
+                        <a class="button icon-avatar" id="toolbar_button_authentication" data-i18n="[content]toolbar.authenticate"></a>
139 137
                         <ul class="loginmenu">
140 138
                             <span class="loginmenuPadding"></span>
141 139
                             <li id="toolbar_auth_identity" class="identity"></li>
@@ -146,79 +144,23 @@
146 144
                                 <a class="authButton" data-i18n="toolbar.logout"></a>
147 145
                             </li>
148 146
                         </ul>
149
-                        <div class="header_button_separator"></div>
150 147
                     </span>
151
-                    <a class="button" id="toolbar_button_mute" data-container="body" data-toggle="popover" data-placement="bottom" shortcut="mutePopover" data-i18n="[content]toolbar.mute" content="Mute / Unmute">
152
-                        <i id="mute" class="icon-microphone"></i>
148
+                    <a class="button icon-microphone" id="toolbar_button_mute" data-container="body" data-toggle="popover" data-placement="bottom" shortcut="mutePopover" data-i18n="[content]toolbar.mute" content="Mute / Unmute"></a>
149
+                    <a class="button icon-camera" id="toolbar_button_camera" data-container="body" data-toggle="popover" data-placement="bottom" shortcut="toggleVideoPopover" data-i18n="[content]toolbar.videomute" content="Start / stop camera"></a>
150
+                    <a class="button icon-recEnable" id="toolbar_button_record" data-container="body" data-toggle="popover" data-placement="bottom" data-i18n="[content]toolbar.record" content="Record" style="display: none"></a>
151
+                    <a class="button icon-security" id="toolbar_button_security" data-container="body" data-toggle="popover" data-placement="bottom" data-i18n="[content]toolbar.lock" content="Lock / unlock room"></a>
152
+                    <a class="button icon-link" id="toolbar_button_link" data-container="body" data-toggle="popover" data-placement="bottom" data-i18n="[content]toolbar.invite" content="Invite others"></a>
153
+                    <a class="button icon-chat" id="toolbar_button_chat" data-container="body" data-toggle="popover" shortcut="toggleChatPopover" data-placement="bottom" data-i18n="[content]toolbar.chat" content="Open / close chat">
154
+                        <span id="unreadMessages"></span>
153 155
                     </a>
154
-                    <div class="header_button_separator"></div>
155
-                    <a class="button" id="toolbar_button_camera" data-container="body" data-toggle="popover" data-placement="bottom" shortcut="toggleVideoPopover" data-i18n="[content]toolbar.videomute" content="Start / stop camera">
156
-                        <i id="video" class="icon-camera"></i>
157
-                    </a>
158
-                    <span id="recording" style="display: none">
159
-                        <div class="header_button_separator"></div>
160
-                        <a class="button" id="toolbar_button_record" data-container="body" data-toggle="popover" data-placement="bottom" data-i18n="[content]toolbar.record" content="Record">
161
-                            <i id="recordButton" class="icon-recEnable"></i>
162
-                        </a>
163
-                    </span>
164
-                    <div class="header_button_separator"></div>
165
-                    <a class="button" id="toolbar_button_security" data-container="body" data-toggle="popover" data-placement="bottom" data-i18n="[content]toolbar.lock" content="Lock / unlock room">
166
-                        <i id="lockIcon" class="icon-security"></i>
167
-                    </a>
168
-                    <div class="header_button_separator"></div>
169
-                    <a class="button" id="toolbar_button_link" data-container="body" data-toggle="popover" data-placement="bottom" data-i18n="[content]toolbar.invite" content="Invite others">
170
-                        <i class="icon-link"></i>
171
-                    </a>
172
-                    <div class="header_button_separator"></div>
173
-                    <span class="toolbar_span">
174
-                        <a class="button" id="toolbar_button_chat" data-container="body" data-toggle="popover" shortcut="toggleChatPopover" data-placement="bottom" data-i18n="[content]toolbar.chat" content="Open / close chat">
175
-                            <i id="chatButton" class="icon-chat">
176
-                                <span id="unreadMessages"></span>
177
-                            </i>
178
-                        </a>
179
-                    </span>
180
-                    <span id="prezi_button">
181
-                        <div class="header_button_separator"></div>
182
-                        <a class="button" id="toolbar_button_prezi" data-container="body" data-toggle="popover" data-placement="bottom" data-i18n="[content]toolbar.prezi" content="Share Prezi">
183
-                            <i class="icon-prezi"></i>
184
-                        </a>
185
-                    </span>
186
-                    <span id="etherpadButton">
187
-                        <div class="header_button_separator"></div>
188
-                        <a class="button" id="toolbar_button_etherpad" data-container="body" data-toggle="popover" data-placement="bottom" content="Shared document" data-i18n="[content]toolbar.etherpad">
189
-                            <i class="icon-share-doc"></i>
190
-                        </a>
191
-                    </span>
192
-                    <span id="desktopsharing" style="display: none">
193
-                        <div class="header_button_separator"></div>
194
-                        <a class="button" id="toolbar_button_desktopsharing" data-container="body" data-toggle="popover" data-placement="bottom" content="Share screen" data-i18n="[content]toolbar.sharescreen">
195
-                            <i class="icon-share-desktop"></i>
196
-                        </a>
197
-                    </span>
198
-                    <div class="header_button_separator"></div>
199
-                    <a class="button" id="toolbar_button_fullScreen" data-container="body" data-toggle="popover" data-placement="bottom" content="Enter / Exit Full Screen" data-i18n="[content]toolbar.fullscreen">
200
-                        <i id="fullScreen" class="icon-full-screen"></i>
201
-                    </a>
202
-                    <span id="sipCallButton" style="display: none">
203
-                        <div class="header_button_separator"></div>
204
-                        <a class="button" id="toolbar_button_sip" data-container="body" data-toggle="popover" data-placement="bottom" content="Call SIP number" data-i18n="[content]toolbar.sip">
205
-                            <i class="icon-telephone"></i></a>
206
-                    </span>
207
-                    <span id="dialPadButton" style="display: none">
208
-                        <div class="header_button_separator"></div>
209
-                        <a class="button" id="toolbar_button_dialpad" data-container="body" data-toggle="popover" data-placement="bottom" content="Open dialpad" data-i18n="[content]toolbar.dialpad">
210
-                            <i class="icon-dialpad"></i></a>
211
-                    </span>
212
-                    <div class="header_button_separator"></div>
213
-                    <a class="button" id="toolbar_button_settings" data-container="body" data-toggle="popover" data-placement="bottom" content="Settings" data-i18n="[content]toolbar.Settings">
214
-                        <i id="settingsButton" class="icon-settings"></i>
215
-                    </a>
216
-                    <div class="header_button_separator"></div>
217
-                    <span id="hangup">
218
-                        <a class="button" id="toolbar_button_hangup" data-container="body" data-toggle="popover" data-placement="bottom" content="Hang Up" data-i18n="[content]toolbar.hangup">
219
-                            <i class="icon-hangup" style="color:#ff0000;font-size: 1.4em;"></i>
220
-                        </a>
221
-                    </span>
156
+                    <a class="button icon-prezi" id="toolbar_button_prezi" data-container="body" data-toggle="popover" data-placement="bottom" data-i18n="[content]toolbar.prezi" content="Share Prezi"></a>
157
+                    <a class="button icon-share-doc" id="toolbar_button_etherpad" data-container="body" data-toggle="popover" data-placement="bottom" content="Shared document" data-i18n="[content]toolbar.etherpad"></a>
158
+                    <a class="button icon-share-desktop" id="toolbar_button_desktopsharing" data-container="body" data-toggle="popover" data-placement="bottom" content="Share screen" data-i18n="[content]toolbar.sharescreen" style="display: none"></a>
159
+                    <a class="button icon-full-screen" id="toolbar_button_fullScreen" data-container="body" data-toggle="popover" data-placement="bottom" content="Enter / Exit Full Screen" data-i18n="[content]toolbar.fullscreen"></a>
160
+                    <a class="button icon-telephone" id="toolbar_button_sip" data-container="body" data-toggle="popover" data-placement="bottom" content="Call SIP number" data-i18n="[content]toolbar.sip" style="display: none"></a>
161
+                    <a class="button icon-dialpad" id="toolbar_button_dialpad" data-container="body" data-toggle="popover" data-placement="bottom" content="Open dialpad" data-i18n="[content]toolbar.dialpad" style="display: none"></a>
162
+                    <a class="button icon-settings" id="toolbar_button_settings" data-container="body" data-toggle="popover" data-placement="bottom" content="Settings" data-i18n="[content]toolbar.Settings"></a>
163
+                    <a class="button icon-hangup" id="toolbar_button_hangup" data-container="body" data-toggle="popover" data-placement="bottom" content="Hang Up" data-i18n="[content]toolbar.hangup"></a>
222 164
                 </span>
223 165
             </div>
224 166
             <div id="subject"></div>

+ 21344
- 21296
libs/app.bundle.js
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку


+ 3
- 3
modules/UI/UI.js Прегледај датотеку

@@ -821,10 +821,10 @@ UI.setAudioMuted = function (mute, earlyMute) {
821 821
     if (!audioMute(mute, function () {
822 822
             VideoLayout.showLocalAudioIndicator(mute);
823 823
 
824
-            UIUtil.buttonClick("#mute", "icon-microphone icon-mic-disabled");
824
+            UIUtil.buttonClick("#toolbar_button_mute", "icon-microphone icon-mic-disabled");
825 825
         })) {
826 826
         // We still click the button.
827
-        UIUtil.buttonClick("#mute", "icon-microphone icon-mic-disabled");
827
+        UIUtil.buttonClick("#toolbar_button_mute", "icon-microphone icon-mic-disabled");
828 828
         return;
829 829
     }
830 830
 };
@@ -851,7 +851,7 @@ UI.dockToolbar = function (isDock) {
851 851
 };
852 852
 
853 853
 UI.setVideoMuteButtonsState = function (mute) {
854
-    var video = $('#video');
854
+    var video = $('#toolbar_button_camera');
855 855
     var communicativeClass = "icon-camera";
856 856
     var muteClass = "icon-camera icon-camera-disabled";
857 857
 

+ 2
- 2
modules/UI/etherpad/Etherpad.js Прегледај датотеку

@@ -30,8 +30,8 @@ function resize() {
30 30
  * Creates the Etherpad button and adds it to the toolbar.
31 31
  */
32 32
 function enableEtherpadButton() {
33
-    if (!$('#etherpadButton').is(":visible"))
34
-        $('#etherpadButton').css({display: 'inline-block'});
33
+    if (!$('#toolbar_button_etherpad').is(":visible"))
34
+        $('#toolbar_button_etherpad').css({display: 'inline-block'});
35 35
 }
36 36
 
37 37
 /**

+ 1
- 1
modules/UI/side_pannels/SidePanelToggler.js Прегледај датотеку

@@ -17,7 +17,7 @@ var PanelToggler = (function(my) {
17 17
     var buttons = {
18 18
         '#chatspace': '#chatBottomButton',
19 19
         '#contactlist': '#contactListButton',
20
-        '#settingsmenu': '#settingsButton'
20
+        '#settingsmenu': '#toolbar_button_settings'
21 21
     };
22 22
 
23 23
     /**

+ 2
- 2
modules/UI/side_pannels/chat/Chat.js Прегледај датотеку

@@ -19,7 +19,7 @@ function setVisualNotification(show) {
19 19
     var unreadMsgBottomElement
20 20
         = document.getElementById('bottomUnreadMessages');
21 21
 
22
-    var glower = $('#chatButton');
22
+    var glower = $('#toolbar_button_chat');
23 23
     var bottomGlower = $('#chatBottomButton');
24 24
 
25 25
     if (unreadMessages) {
@@ -29,7 +29,7 @@ function setVisualNotification(show) {
29 29
         ToolbarToggler.dockToolbar(true);
30 30
 
31 31
         var chatButtonElement
32
-            = document.getElementById('chatButton').parentNode;
32
+            = document.getElementById('toolbar_button_chat');
33 33
         var leftIndent = (UIUtil.getTextWidth(chatButtonElement) -
34 34
             UIUtil.getTextWidth(unreadMsgElement)) / 2;
35 35
         var topIndent = (UIUtil.getTextHeight(chatButtonElement) -

+ 14
- 14
modules/UI/toolbars/Toolbar.js Прегледај датотеку

@@ -47,7 +47,7 @@ var buttonHandlers = {
47 47
         return APP.desktopsharing.toggleScreenSharing();
48 48
     },
49 49
     "toolbar_button_fullScreen": function() {
50
-        UIUtil.buttonClick("#fullScreen", "icon-full-screen icon-exit-full-screen");
50
+        UIUtil.buttonClick("#toolbar_button_fullScreen", "icon-full-screen icon-exit-full-screen");
51 51
         return Toolbar.toggleFullScreen();
52 52
     },
53 53
     "toolbar_button_sip": function () {
@@ -340,7 +340,7 @@ var Toolbar = (function (my) {
340 340
      */
341 341
     my.setupButtonsFromConfig = function () {
342 342
         if (config.disablePrezi) {
343
-            $("#prezi_button").css({display: "none"});
343
+            $("#toolbar_button_prezi").css({display: "none"});
344 344
         }
345 345
     };
346 346
 
@@ -515,15 +515,15 @@ var Toolbar = (function (my) {
515 515
      * Unlocks the lock button state.
516 516
      */
517 517
     my.unlockLockButton = function () {
518
-        if ($("#lockIcon").hasClass("icon-security-locked"))
519
-            UIUtil.buttonClick("#lockIcon", "icon-security icon-security-locked");
518
+        if ($("#toolbar_button_security").hasClass("icon-security-locked"))
519
+            UIUtil.buttonClick("#toolbar_button_security", "icon-security icon-security-locked");
520 520
     };
521 521
     /**
522 522
      * Updates the lock button state to locked.
523 523
      */
524 524
     my.lockLockButton = function () {
525
-        if ($("#lockIcon").hasClass("icon-security"))
526
-            UIUtil.buttonClick("#lockIcon", "icon-security icon-security-locked");
525
+        if ($("#toolbar_button_security").hasClass("icon-security"))
526
+            UIUtil.buttonClick("#toolbar_button_security", "icon-security icon-security-locked");
527 527
     };
528 528
 
529 529
     /**
@@ -546,16 +546,16 @@ var Toolbar = (function (my) {
546 546
         }
547 547
 
548 548
         if (show) {
549
-            $('#recording').css({display: "inline"});
549
+            $('#toolbar_button_record').css({display: "inline-block"});
550 550
         }
551 551
         else {
552
-            $('#recording').css({display: "none"});
552
+            $('#toolbar_button_record').css({display: "none"});
553 553
         }
554 554
     };
555 555
 
556 556
     // Sets the state of the recording button
557 557
     my.setRecordingButtonState = function (recordingState) {
558
-        var selector = $('#recordButton');
558
+        var selector = $('#toolbar_button_record');
559 559
 
560 560
         if (recordingState === 'on') {
561 561
             selector.removeClass("icon-recEnable");
@@ -605,18 +605,18 @@ var Toolbar = (function (my) {
605 605
     // Shows or hides SIP calls button
606 606
     my.showSipCallButton = function (show) {
607 607
         if (APP.xmpp.isSipGatewayEnabled() && show) {
608
-            $('#sipCallButton').css({display: "inline-block"});
608
+            $('#toolbar_button_sip').css({display: "inline-block"});
609 609
         } else {
610
-            $('#sipCallButton').css({display: "none"});
610
+            $('#toolbar_button_sip').css({display: "none"});
611 611
         }
612 612
     };
613 613
 
614 614
     // Shows or hides the dialpad button
615 615
     my.showDialPadButton = function (show) {
616 616
         if (show) {
617
-            $('#dialPadButton').css({display: "inline-block"});
617
+            $('#toolbar_button_dialpad').css({display: "inline-block"});
618 618
         } else {
619
-            $('#dialPadButton').css({display: "none"});
619
+            $('#toolbar_button_dialpad').css({display: "none"});
620 620
         }
621 621
     };
622 622
 
@@ -664,7 +664,7 @@ var Toolbar = (function (my) {
664 664
      * @param active the state of the desktop streaming.
665 665
      */
666 666
     my.changeDesktopSharingButtonState = function (active) {
667
-        var button = $("#desktopsharing > a");
667
+        var button = $("#toolbar_button_desktopsharing");
668 668
         if (active) {
669 669
             button.addClass("glow");
670 670
         } else {

+ 2
- 2
modules/UI/toolbars/ToolbarToggler.js Прегледај датотеку

@@ -6,9 +6,9 @@ var toolbarTimeoutObject,
6 6
 
7 7
 function showDesktopSharingButton() {
8 8
     if (APP.desktopsharing.isDesktopSharingEnabled()) {
9
-        $('#desktopsharing').css({display: "inline"});
9
+        $('#toolbar_button_desktopsharing').css({display: "inline-block"});
10 10
     } else {
11
-        $('#desktopsharing').css({display: "none"});
11
+        $('#toolbar_button_desktopsharing').css({display: "none"});
12 12
     }
13 13
 }
14 14
 

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