Browse Source

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

toolbar: authentication button changed
master
yanas 8 years ago
parent
commit
0fa5aa48af

+ 0
- 1
conference.js View File

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

+ 1
- 19
css/_login_menu.scss View File

31
     left: 18px;
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
 a.disabled {
34
 a.disabled {
53
     color: gray !important;
35
     color: gray !important;
54
     pointer-events: none;
36
     pointer-events: none;
73
     position: absolute;
55
     position: absolute;
74
     top: 18px;
56
     top: 18px;
75
     left: -7px;
57
     left: -7px;
76
-}
58
+}

+ 27
- 1
css/_side_toolbar_container.scss View File

25
      */
25
      */
26
     input, label, select, a,
26
     input, label, select, a,
27
     .sideToolbarBlock, .input-control, .button-control {
27
     .sideToolbarBlock, .input-control, .button-control {
28
-        display: inline-block;
28
+        display: block;
29
         margin-top: 15px;
29
         margin-top: 15px;
30
         margin-left: 10%;
30
         margin-left: 10%;
31
         width: 80%;
31
         width: 80%;
124
 #followMeCheckBox {
124
 #followMeCheckBox {
125
     width: 13px !important;
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 View File

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

+ 14
- 13
index.html View File

103
                 <span id="mainToolbar" class="toolbar"></span>
103
                 <span id="mainToolbar" class="toolbar"></span>
104
         </div>
104
         </div>
105
         <div id="subject" class="hide"></div>
105
         <div id="subject" class="hide"></div>
106
+
106
         <div id="extendedToolbar" class="toolbar">
107
         <div id="extendedToolbar" class="toolbar">
107
             <a class="button" id="toolbar_button_profile" data-container="body" data-placement="right" data-i18n="[content]toolbar.profile" content="Edit your profile">
108
             <a class="button" id="toolbar_button_profile" data-container="body" data-placement="right" data-i18n="[content]toolbar.profile" content="Edit your profile">
108
                 <img id="avatar" src="images/avatar2.png"/>
109
                 <img id="avatar" src="images/avatar2.png"/>
109
             </a>
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
             <a class="button icon-contactList" id="toolbar_contact_list" shortcut="contactlistpopover">
111
             <a class="button icon-contactList" id="toolbar_contact_list" shortcut="contactlistpopover">
124
                 <span class="badge-round">
112
                 <span class="badge-round">
125
                     <span id="numberOfParticipants"></span>
113
                     <span id="numberOfParticipants"></span>
144
             <a class="button icon-raised-hand" id="toolbar_button_raisehand" shortcut="raiseHandPopover"></a>
132
             <a class="button icon-raised-hand" id="toolbar_button_raisehand" shortcut="raiseHandPopover"></a>
145
             <a class="button icon-toggle-filmstrip" id="toolbar_film_strip" data-container="body" shortcut="filmstripPopover"></a>
133
             <a class="button icon-toggle-filmstrip" id="toolbar_film_strip" data-container="body" shortcut="filmstripPopover"></a>
146
             <a class="button icon-feedback" id="feedbackButton"></a>
134
             <a class="button icon-feedback" id="feedbackButton"></a>
135
+
147
             <div id="sideToolbarContainer">
136
             <div id="sideToolbarContainer">
148
                 <div id="profile_container" class="sideToolbarContainer__inner">
137
                 <div id="profile_container" class="sideToolbarContainer__inner">
149
                     <div class="title" data-i18n="profile.title"></div>
138
                     <div class="title" data-i18n="profile.title"></div>
155
                         <label data-i18n="profile.setEmailLabel"></label>
144
                         <label data-i18n="profile.setEmailLabel"></label>
156
                         <input type="text" id="setEmail" placeholder="Enter e-mail">
145
                         <input type="text" id="setEmail" placeholder="Enter e-mail">
157
                     </div>
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
                 </div>
159
                 </div>
159
                 <div id="chat_container" class="sideToolbarContainer__inner">
160
                 <div id="chat_container" class="sideToolbarContainer__inner">
160
                     <div id="nickname">
161
                     <div id="nickname">

+ 4
- 0
interface_config.js View File

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

+ 3
- 2
modules/UI/UI.js View File

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

+ 7
- 7
modules/UI/authentication/LoginDialog.js View File

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

+ 9
- 9
modules/UI/toolbars/Toolbar.js View File

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

+ 9
- 0
modules/UI/util/UIUtil.js View File

204
         return interfaceConfig.SETTINGS_SECTIONS.indexOf(name) !== -1;
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
      * Shows the element given by id.
217
      * Shows the element given by id.
209
      *
218
      *

Loading…
Cancel
Save