Selaa lähdekoodia

Merge pull request #992 from kkrisstoff/task/make-extended-toolbar-dynamically-created

toolbar: authentication button changed
master
yanas 8 vuotta sitten
vanhempi
commit
0fa5aa48af

+ 0
- 1
conference.js Näytä tiedosto

@@ -1086,7 +1086,6 @@ export default {
1086 1086
             }
1087 1087
         );
1088 1088
 
1089
-
1090 1089
         room.on(ConferenceEvents.USER_JOINED, (id, user) => {
1091 1090
             if (user.isHidden())
1092 1091
                 return;

+ 1
- 19
css/_login_menu.scss Näytä tiedosto

@@ -31,24 +31,6 @@ 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
-
48
-span.authentication {
49
-    position: relative;
50
-}
51
-
52 34
 a.disabled {
53 35
     color: gray !important;
54 36
     pointer-events: none;
@@ -73,4 +55,4 @@ ul.loginmenu.extendedToolbarPopup:after {
73 55
     position: absolute;
74 56
     top: 18px;
75 57
     left: -7px;
76
-}
58
+}

+ 27
- 1
css/_side_toolbar_container.scss Näytä tiedosto

@@ -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%;
@@ -124,3 +124,29 @@
124 124
 #followMeCheckBox {
125 125
     width: 13px !important;
126 126
 }
127
+
128
+/**
129
+ * Profile
130
+ */
131
+.auth_container {
132
+    ul {
133
+        padding: 0;
134
+
135
+        li {
136
+            list-style-type: none;
137
+
138
+            a.authButton{
139
+                width: 160px;
140
+                margin: 10px 20px;
141
+                padding: 3px 29px;
142
+                box-sizing: border-box;
143
+                background-color: #06a5df;
144
+                border-radius: 4px;
145
+                cursor: pointer;
146
+                color: $defaultColor;
147
+                text-decoration: none;
148
+                text-align: center;
149
+            }
150
+        }
151
+    }
152
+}

+ 5
- 1
css/input-control/_input-control.scss Näytä tiedosto

@@ -20,7 +20,11 @@
20 20
     }
21 21
 
22 22
     &__input {
23
-        margin: 8px 0;
23
+        margin-bottom: 8px;
24
+
25
+        &:last-child {
26
+            margin-bottom: inherit;
27
+        }
24 28
 
25 29
         &::selection {
26 30
             background-color: $defaultDarkSelectionColor;

+ 14
- 13
index.html Näytä tiedosto

@@ -103,23 +103,11 @@
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>
123 111
             <a class="button icon-contactList" id="toolbar_contact_list" shortcut="contactlistpopover">
124 112
                 <span class="badge-round">
125 113
                     <span id="numberOfParticipants"></span>
@@ -144,6 +132,7 @@
144 132
             <a class="button icon-raised-hand" id="toolbar_button_raisehand" shortcut="raiseHandPopover"></a>
145 133
             <a class="button icon-toggle-filmstrip" id="toolbar_film_strip" data-container="body" shortcut="filmstripPopover"></a>
146 134
             <a class="button icon-feedback" id="feedbackButton"></a>
135
+
147 136
             <div id="sideToolbarContainer">
148 137
                 <div id="profile_container" class="sideToolbarContainer__inner">
149 138
                     <div class="title" data-i18n="profile.title"></div>
@@ -155,6 +144,18 @@
155 144
                         <label data-i18n="profile.setEmailLabel"></label>
156 145
                         <input type="text" id="setEmail" placeholder="Enter e-mail">
157 146
                     </div>
147
+                    <div class="sideToolbarBlock auth_container" id="authenticationContainer">
148
+                        <p data-i18n="toolbar.authenticate"></p>
149
+                        <ul>
150
+                            <li id="toolbar_auth_identity"></li>
151
+                            <li id="toolbar_button_login">
152
+                                <a class="authButton" data-i18n="toolbar.login"></a>
153
+                            </li>
154
+                            <li id="toolbar_button_logout">
155
+                                <a class="authButton" data-i18n="toolbar.logout"></a>
156
+                            </li>
157
+                        </ul>
158
+                    </div>
158 159
                 </div>
159 160
                 <div id="chat_container" class="sideToolbarContainer__inner">
160 161
                     <div id="nickname">

+ 4
- 0
interface_config.js Näytä tiedosto

@@ -17,6 +17,10 @@ var interfaceConfig = { // eslint-disable-line no-unused-vars
17 17
     GENERATE_ROOMNAMES_ON_WELCOME_PAGE: true,
18 18
     APP_NAME: "Jitsi Meet",
19 19
     INVITATION_POWERED_BY: true,
20
+    /**
21
+     * If we should show authentication block in profile
22
+     */
23
+    AUTHENTICATION_ENABLE: true,
20 24
     // the toolbar buttons line is intentionally left in one line, to be able
21 25
     // to easily override values or remove them using regex
22 26
     MAIN_TOOLBAR_BUTTONS: ['microphone', 'camera', 'desktop', 'invite', 'fullscreen', 'hangup'], // jshint ignore:line

+ 3
- 2
modules/UI/UI.js Näytä tiedosto

@@ -1141,11 +1141,12 @@ UI.notifyFocusLeft = function () {
1141 1141
  * @param {string} [login] current login
1142 1142
  */
1143 1143
 UI.updateAuthInfo = function (isAuthEnabled, login) {
1144
+    let showAuth = isAuthEnabled && UIUtil.isAuthenticationEnabled();
1144 1145
     let loggedIn = !!login;
1145 1146
 
1146
-    Toolbar.showAuthenticateButton(isAuthEnabled);
1147
+    Toolbar.showAuthenticateButton(showAuth);
1147 1148
 
1148
-    if (isAuthEnabled) {
1149
+    if (showAuth) {
1149 1150
         Toolbar.setAuthenticatedIdentity(login);
1150 1151
 
1151 1152
         Toolbar.showLoginButton(!loggedIn);

+ 7
- 7
modules/UI/authentication/LoginDialog.js Näytä tiedosto

@@ -8,16 +8,15 @@ function getPasswordInputHtml() {
8 8
     let placeholder = config.hosts.authdomain
9 9
         ? "user identity"
10 10
         : "user@domain.net";
11
-    let passRequiredMsg = APP.translation.translateString(
12
-        "dialog.passwordRequired"
13
-    );
11
+
14 12
     return `
15
-        <h2 data-i18n="dialog.passwordRequired">${passRequiredMsg}</h2>
16
-        <input name="username" type="text" placeholder=${placeholder} autofocus>
13
+        <input name="username" type="text" 
14
+               class="input-control__input"
15
+               placeholder=${placeholder} autofocus>
17 16
         <input name="password" type="password"
17
+               class="input-control__input"
18 18
                data-i18n="[placeholder]dialog.userPassword"
19
-               placeholder="user password">
20
-        `;
19
+               placeholder="user password">`;
21 20
 }
22 21
 
23 22
 /**
@@ -80,6 +79,7 @@ function LoginDialog(successCallback, cancelCallback) {
80 79
 
81 80
     const states = {
82 81
         login: {
82
+            title: APP.translation.translateString('dialog.passwordRequired'),
83 83
             html: getPasswordInputHtml(),
84 84
             buttons: loginButtons,
85 85
             focus: ':input:first',

+ 9
- 9
modules/UI/toolbars/Toolbar.js Näytä tiedosto

@@ -391,11 +391,9 @@ Toolbar = {
391 391
      * @param show <tt>true</tt> to show or <tt>false</tt> to hide
392 392
      */
393 393
     showAuthenticateButton (show) {
394
-        if (UIUtil.isButtonEnabled('authentication') && show) {
395
-            $('#authentication').css({display: "inline"});
396
-        } else {
397
-            $('#authentication').css({display: "none"});
398
-        }
394
+        let display = show ? 'block' : 'none';
395
+
396
+        $('#authenticationContainer').css({display});
399 397
     },
400 398
 
401 399
     showEtherpadButton () {
@@ -449,12 +447,14 @@ Toolbar = {
449 447
      * @param authIdentity identity name to be displayed.
450 448
      */
451 449
     setAuthenticatedIdentity (authIdentity) {
450
+        let selector = $('#toolbar_auth_identity');
451
+
452 452
         if (authIdentity) {
453
-            let selector = $('#toolbar_auth_identity');
454 453
             selector.css({display: "list-item"});
455 454
             selector.text(authIdentity);
456 455
         } else {
457
-            $('#toolbar_auth_identity').css({display: "none"});
456
+            selector.css({display: "none"});
457
+            selector.text('');
458 458
         }
459 459
     },
460 460
 
@@ -463,7 +463,7 @@ Toolbar = {
463 463
      * @param show <tt>true</tt> to show
464 464
      */
465 465
     showLoginButton (show) {
466
-        if (UIUtil.isButtonEnabled('authentication') && show) {
466
+        if (show) {
467 467
             $('#toolbar_button_login').css({display: "list-item"});
468 468
         } else {
469 469
             $('#toolbar_button_login').css({display: "none"});
@@ -475,7 +475,7 @@ Toolbar = {
475 475
      * @param show <tt>true</tt> to show
476 476
      */
477 477
     showLogoutButton (show) {
478
-        if (UIUtil.isButtonEnabled('authentication') && show) {
478
+        if (show) {
479 479
             $('#toolbar_button_logout').css({display: "list-item"});
480 480
         } else {
481 481
             $('#toolbar_button_logout').css({display: "none"});

+ 9
- 0
modules/UI/util/UIUtil.js Näytä tiedosto

@@ -204,6 +204,15 @@ const TOOLTIP_POSITIONS = {
204 204
         return interfaceConfig.SETTINGS_SECTIONS.indexOf(name) !== -1;
205 205
     },
206 206
 
207
+    /**
208
+     * Indicates if Authentication Section should be shown
209
+     *
210
+     * @returns {boolean}
211
+     */
212
+    isAuthenticationEnabled: function() {
213
+        return interfaceConfig.AUTHENTICATION_ENABLE;
214
+    },
215
+
207 216
     /**
208 217
      * Shows the element given by id.
209 218
      *

Loading…
Peruuta
Tallenna