diff --git a/modules/UI/UI.js b/modules/UI/UI.js
index 42d165859..1e1b9581f 100644
--- a/modules/UI/UI.js
+++ b/modules/UI/UI.js
@@ -1105,13 +1105,13 @@ UI.updateAuthInfo = function (isAuthEnabled, login) {
let showAuth = isAuthEnabled && UIUtil.isAuthenticationEnabled();
let loggedIn = !!login;
- Toolbar.showAuthenticateButton(showAuth);
+ Profile.showAuthenticationButtons(showAuth);
if (showAuth) {
- Toolbar.setAuthenticatedIdentity(login);
+ Profile.setAuthenticatedIdentity(login);
- Toolbar.showLoginButton(!loggedIn);
- Toolbar.showLogoutButton(loggedIn);
+ Profile.showLoginButton(!loggedIn);
+ Profile.showLogoutButton(loggedIn);
}
};
diff --git a/modules/UI/side_pannels/profile/Profile.js b/modules/UI/side_pannels/profile/Profile.js
index 2f9e44bbd..67a7f4df9 100644
--- a/modules/UI/side_pannels/profile/Profile.js
+++ b/modules/UI/side_pannels/profile/Profile.js
@@ -1,4 +1,4 @@
-/* global $ */
+/* global $, APP, JitsiMeetJS */
import UIUtil from "../../util/UIUtil";
import UIEvents from "../../../../service/UI/UIEvents";
import Settings from '../../../settings/Settings';
@@ -18,15 +18,15 @@ const htmlStr = `
-
@@ -68,6 +68,34 @@ export default {
updateEmail();
}
}).focusout(updateEmail);
+
+ // LOGIN
+ function loginClicked () {
+ JitsiMeetJS.analytics.sendEvent('authenticate.login.clicked');
+ emitter.emit(UIEvents.AUTH_CLICKED);
+ }
+
+ $('#profile_button_login').click(loginClicked);
+
+ // LOGOUT
+ function logoutClicked () {
+ let titleKey = "dialog.logoutTitle";
+ let msgKey = "dialog.logoutQuestion";
+ JitsiMeetJS.analytics.sendEvent('authenticate.logout.clicked');
+ // Ask for confirmation
+ APP.UI.messageHandler.openTwoButtonDialog({
+ titleKey: titleKey,
+ msgKey: msgKey,
+ leftButtonKey: "dialog.Yes",
+ submitFunction: function (evt, yes) {
+ if (yes) {
+ emitter.emit(UIEvents.LOGOUT);
+ }
+ }
+ });
+ }
+
+ $('#profile_button_logout').click(logoutClicked);
},
/**
@@ -92,5 +120,46 @@ export default {
*/
changeAvatar (avatarUrl) {
$('#avatar').attr('src', avatarUrl);
+ },
+
+ /**
+ * Shows or hides authentication related buttons
+ * @param {boolean} show
true to show or
false to hide
+ */
+ showAuthenticationButtons (show) {
+ let id = 'profile_auth_container';
+ UIUtil.showOrHideElement(id, show);
+ },
+
+ /**
+ * Shows/hides login button.
+ * @param {boolean} show
true to show or
false to hide
+ */
+ showLoginButton (show) {
+ let id = 'profile_button_login';
+
+ UIUtil.showOrHideElement(id, show);
+ },
+
+ /**
+ * Shows/hides logout button.
+ * @param {boolean} show
true to show or
false to hide
+ */
+ showLogoutButton (show) {
+ let id = 'profile_button_logout';
+
+ UIUtil.showOrHideElement(id, show);
+ },
+
+ /**
+ * Displays user's authenticated identity name (login).
+ * @param {string} authIdentity identity name to be displayed.
+ */
+ setAuthenticatedIdentity (authIdentity) {
+ let id = 'profile_auth_identity';
+
+ UIUtil.showOrHideElement(id, !!authIdentity);
+
+ $(`#${id}`).text(authIdentity ? authIdentity : '');
}
};
diff --git a/modules/UI/toolbars/Toolbar.js b/modules/UI/toolbars/Toolbar.js
index 1ea160a16..58970c9ef 100644
--- a/modules/UI/toolbars/Toolbar.js
+++ b/modules/UI/toolbars/Toolbar.js
@@ -97,26 +97,6 @@ const buttonHandlers = {
JitsiMeetJS.analytics.sendEvent('toolbar.hangup');
emitter.emit(UIEvents.HANGUP);
},
- "toolbar_button_login": function () {
- JitsiMeetJS.analytics.sendEvent('toolbar.authenticate.login.clicked');
- emitter.emit(UIEvents.AUTH_CLICKED);
- },
- "toolbar_button_logout": function () {
- let titleKey = "dialog.logoutTitle";
- let msgKey = "dialog.logoutQuestion";
- JitsiMeetJS.analytics.sendEvent('toolbar.authenticate.logout.clicked');
- // Ask for confirmation
- APP.UI.messageHandler.openTwoButtonDialog({
- titleKey,
- msgKey,
- leftButtonKey: "dialog.Yes",
- submitFunction: function (evt, yes) {
- if (yes) {
- emitter.emit(UIEvents.LOGOUT);
- }
- }
- });
- },
"toolbar_button_raisehand": function () {
JitsiMeetJS.analytics.sendEvent('toolbar.raiseHand.clicked');
APP.conference.maybeToggleRaisedHand();
@@ -397,14 +377,6 @@ Toolbar = {
isEnabled() {
return this.enabled;
},
- /**
- * Shows or hides authentication button
- * @param show
true to show or
false to hide
- */
- showAuthenticateButton (show) {
- let id = 'authenticationContainer';
- UIUtil.showOrHideElement(id, show);
- },
showEtherpadButton () {
if (!$('#toolbar_button_etherpad').is(":visible")) {
@@ -451,41 +423,6 @@ Toolbar = {
UIUtil.showOrHideElement(id, shouldShow);
},
- /**
- * Displays user authenticated identity name(login).
- * @param authIdentity identity name to be displayed.
- */
- setAuthenticatedIdentity (authIdentity) {
- let id = 'toolbar_auth_identity';
-
- if(authIdentity) {
- $(`#${id}`).text(authIdentity);
- } else {
- $(`#${id}`).text('');
- }
- UIUtil.showOrHideElement(id, !!authIdentity);
- },
-
- /**
- * Shows/hides login button.
- * @param show
true to show
- */
- showLoginButton (show) {
- let id = 'toolbar_button_login';
-
- UIUtil.showOrHideElement(id, show);
- },
-
- /**
- * Shows/hides logout button.
- * @param show
true to show
- */
- showLogoutButton (show) {
- let id = 'toolbar_button_logout';
-
- UIUtil.showOrHideElement(id, show);
- },
-
/**
* Update the state of the button. The button has blue glow if desktop
* streaming is active.