Przeglądaj źródła

toolbar: authentication button changed

master
Kostiantyn Pashura 9 lat temu
rodzic
commit
71475038ba

+ 22
- 14
css/_login_menu.scss Wyświetl plik

@@ -31,21 +31,8 @@ ul.loginmenu:after {
31 31
     left: 18px;
32 32
 }
33 33
 
34
-li a.authButton{
35
-    background-color: #06a5df;
36
-    padding-top: 3px;
37
-    padding-bottom: 3px;
38
-    padding-left: 29px;
39
-    padding-right: 29px;
40
-    border-radius: 4px;
41
-    cursor: pointer;
42
-}
43
-
44
-span.authentication:hover ul.loginmenu, ul.loginmenu:hover {
45
-    display:block !important;
46
-}
47 34
 
48
-span.authentication {
35
+.authentication {
49 36
     position: relative;
50 37
 }
51 38
 
@@ -74,3 +61,24 @@ ul.loginmenu.extendedToolbarPopup:after {
74 61
     top: 18px;
75 62
     left: -7px;
76 63
 }
64
+
65
+//extended toolbar: Log In menu
66
+.auth_container {
67
+    ul {
68
+        margin-top: 40px;
69
+        padding: 0;
70
+
71
+        li a.authButton{
72
+            width: 160px;
73
+            margin: 10px 20px;
74
+            background-color: #06a5df;
75
+            padding-top: 3px;
76
+            padding-bottom: 3px;
77
+            padding-left: 29px;
78
+            padding-right: 29px;
79
+            border-radius: 4px;
80
+            cursor: pointer;
81
+            box-sizing: border-box;
82
+        }
83
+    }
84
+}

+ 1
- 1
css/_side_toolbar_container.scss Wyświetl plik

@@ -25,7 +25,7 @@
25 25
      */
26 26
     input, label, select, a,
27 27
     .sideToolbarBlock, .input-control, .button-control {
28
-        display: inline-block;
28
+        display: block;
29 29
         margin-top: 15px;
30 30
         margin-left: 10%;
31 31
         width: 80%;

+ 14
- 13
index.html Wyświetl plik

@@ -103,23 +103,12 @@
103 103
                 <span id="mainToolbar" class="toolbar"></span>
104 104
         </div>
105 105
         <div id="subject" class="hide"></div>
106
+
106 107
         <div id="extendedToolbar" class="toolbar">
107 108
             <a class="button" id="toolbar_button_profile" data-container="body" data-placement="right" data-i18n="[content]toolbar.profile" content="Edit your profile">
108 109
                 <img id="avatar" src="images/avatar2.png"/>
109 110
             </a>
110
-            <span id="authentication" class="authentication" style="display: none">
111
-                <a class="button icon-avatar" id="toolbar_button_authentication" data-i18n="[content]toolbar.authenticate"></a>
112
-                <ul class="loginmenu extendedToolbarPopup">
113
-                    <span class="loginmenuPadding"></span>
114
-                    <li id="toolbar_auth_identity"></li>
115
-                    <li id="toolbar_button_login">
116
-                        <a class="authButton" data-i18n="toolbar.login"></a>
117
-                    </li>
118
-                    <li id="toolbar_button_logout">
119
-                        <a class="authButton" data-i18n="toolbar.logout"></a>
120
-                    </li>
121
-                </ul>
122
-            </span>
111
+            <a class="button icon-avatar authentication" id="toolbar_button_authentication" data-i18n="[content]toolbar.authenticate"></a>
123 112
             <a class="button icon-contactList" id="toolbar_contact_list" shortcut="contactlistpopover">
124 113
                 <span class="badge-round">
125 114
                     <span id="numberOfParticipants"></span>
@@ -144,7 +133,19 @@
144 133
             <a class="button icon-raised-hand" id="toolbar_button_raisehand" shortcut="raiseHandPopover"></a>
145 134
             <a class="button icon-toggle-filmstrip" id="toolbar_film_strip" data-container="body" shortcut="filmstripPopover"></a>
146 135
             <a class="button icon-feedback" id="feedbackButton"></a>
136
+
147 137
             <div id="sideToolbarContainer">
138
+                <div id="authentication_container" class="auth_container">
139
+                    <ul>
140
+                        <li id="toolbar_auth_identity"></li>
141
+                        <li id="toolbar_button_login">
142
+                            <a class="authButton" data-i18n="toolbar.login"></a>
143
+                        </li>
144
+                        <li id="toolbar_button_logout">
145
+                            <a class="authButton" data-i18n="toolbar.logout"></a>
146
+                        </li>
147
+                    </ul>
148
+                </div>
148 149
                 <div id="profile_container" class="sideToolbarContainer__inner">
149 150
                     <div class="title" data-i18n="profile.title"></div>
150 151
                     <div class="sideToolbarBlock first">

+ 9
- 0
modules/UI/UI.js Wyświetl plik

@@ -362,6 +362,8 @@ function registerListeners() {
362 362
 
363 363
     UI.addListener(UIEvents.TOGGLE_FULLSCREEN, UI.toggleFullScreen);
364 364
 
365
+    UI.addListener(UIEvents.TOGGLE_AUTHENTICATION, UI.toggleAuthentication);
366
+
365 367
     UI.addListener(UIEvents.TOGGLE_CHAT, UI.toggleChat);
366 368
 
367 369
     UI.addListener(UIEvents.TOGGLE_SETTINGS, function () {
@@ -722,6 +724,13 @@ UI.isFilmStripVisible = function () {
722 724
     return FilmStrip.isFilmStripVisible();
723 725
 };
724 726
 
727
+/**
728
+ * Toggles authentication panel.
729
+ */
730
+UI.toggleAuthentication = function () {
731
+    UI.toggleSidePanel("authentication_container");
732
+};
733
+
725 734
 /**
726 735
  * Toggles chat panel.
727 736
  */

+ 68
- 2
modules/UI/toolbars/Toolbar.js Wyświetl plik

@@ -6,7 +6,68 @@ import SideContainerToggler from "../side_pannels/SideContainerToggler";
6 6
 let emitter = null;
7 7
 let Toolbar;
8 8
 
9
+/**
10
+ * Opens the invite link dialog.
11
+ */
12
+function openLinkDialog () {
13
+    let inviteAttributes;
14
+
15
+    if (roomUrl === null) {
16
+        inviteAttributes = 'data-i18n="[value]roomUrlDefaultMsg" value="' +
17
+            APP.translation.translateString("roomUrlDefaultMsg") + '"';
18
+    } else {
19
+        inviteAttributes = "value=\"" + encodeURI(roomUrl) + "\"";
20
+    }
21
+
22
+    let inviteLinkId = "inviteLinkRef";
23
+    let focusInviteLink = function() {
24
+        $('#' + inviteLinkId)
25
+            .focus()
26
+            .select();
27
+    };
28
+
29
+    let title = APP.translation.generateTranslationHTML("dialog.shareLink");
30
+    APP.UI.messageHandler.openTwoButtonDialog(
31
+        null, title, null,
32
+        '<input id="' + inviteLinkId + '" type="text" '
33
+            + inviteAttributes + ' readonly/>',
34
+        false, "dialog.copy",
35
+        function (e, v) {
36
+            if (v && roomUrl) {
37
+                JitsiMeetJS.analytics.sendEvent('toolbar.invite.button');
38
+
39
+                focusInviteLink();
40
+
41
+                document.execCommand('copy');
42
+            }
43
+            else {
44
+                JitsiMeetJS.analytics.sendEvent('toolbar.invite.cancel');
45
+            }
46
+        },
47
+        function (event) {
48
+            if (!roomUrl) {
49
+                if (event && event.target) {
50
+                    $(event.target).find('button[value=true]')
51
+                        .prop('disabled', true);
52
+                }
53
+            }
54
+            else {
55
+                focusInviteLink();
56
+            }
57
+        },
58
+        function (e, v, m, f) {
59
+            if(!v && !m && !f)
60
+                JitsiMeetJS.analytics.sendEvent('toolbar.invite.close');
61
+        },
62
+        'Copy' // Focus Copy button.
63
+    );
64
+}
65
+
9 66
 const buttonHandlers = {
67
+    "toolbar_button_authentication": function() {
68
+        JitsiMeetJS.analytics.sendEvent('toolbar.authentication.toggled');
69
+        emitter.emit(UIEvents.TOGGLE_AUTHENTICATION);
70
+    },
10 71
     "toolbar_button_profile": function () {
11 72
         JitsiMeetJS.analytics.sendEvent('toolbar.profile.toggled');
12 73
         emitter.emit(UIEvents.TOGGLE_PROFILE);
@@ -125,6 +186,11 @@ const buttonHandlers = {
125 186
 };
126 187
 
127 188
 const defaultToolbarButtons = {
189
+    'authentication': {
190
+        id: 'toolbar_button_authentication',
191
+        tooltipKey: 'toolbar.authenticate',
192
+        sideContainerId: 'authentication_container'
193
+    },
128 194
     'microphone': {
129 195
         id: 'toolbar_button_mute',
130 196
         tooltipKey: 'toolbar.mute',
@@ -392,9 +458,9 @@ Toolbar = {
392 458
      */
393 459
     showAuthenticateButton (show) {
394 460
         if (UIUtil.isButtonEnabled('authentication') && show) {
395
-            $('#authentication').css({display: "inline"});
461
+            $('#toolbar_button_authentication').css({display: "inline"});
396 462
         } else {
397
-            $('#authentication').css({display: "none"});
463
+            $('#toolbar_button_authentication').css({display: "none"});
398 464
         }
399 465
     },
400 466
 

+ 4
- 0
service/UI/UIEvents.js Wyświetl plik

@@ -44,6 +44,10 @@ export default {
44 44
      * Notifies that the profile toolbar button has been clicked.
45 45
      */
46 46
     TOGGLE_PROFILE: "UI.toggle_profile",
47
+    /**
48
+     * Notifies that the authentication toolbar button has been clicked.
49
+     */
50
+    TOGGLE_AUTHENTICATION: "UI.toggle_authentication",
47 51
     /**
48 52
      * Notifies that a command to toggle the film strip has been issued. The
49 53
      * event may optionally specify a {Boolean} (primitive) value to assign to

Ładowanie…
Anuluj
Zapisz