2015-12-03 13:11:01 +00:00
|
|
|
/* global APP, $, config, interfaceConfig */
|
2015-09-11 02:42:15 +00:00
|
|
|
/* jshint -W101 */
|
2015-12-10 16:36:03 +00:00
|
|
|
import messageHandler from '../util/MessageHandler';
|
|
|
|
import UIUtil from '../util/UIUtil';
|
|
|
|
import AnalyticsAdapter from '../../statistics/AnalyticsAdapter';
|
|
|
|
import UIEvents from '../../../service/UI/UIEvents';
|
2015-01-07 14:54:03 +00:00
|
|
|
|
2015-12-10 16:36:03 +00:00
|
|
|
let roomUrl = null;
|
|
|
|
let recordingToaster = null;
|
|
|
|
let emitter = null;
|
2015-01-07 14:54:03 +00:00
|
|
|
|
2015-12-10 13:30:25 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Opens the invite link dialog.
|
|
|
|
*/
|
|
|
|
function openLinkDialog () {
|
2015-12-10 16:36:03 +00:00
|
|
|
let inviteAttributes;
|
2015-12-10 13:30:25 +00:00
|
|
|
|
|
|
|
if (roomUrl === null) {
|
|
|
|
inviteAttributes = 'data-i18n="[value]roomUrlDefaultMsg" value="' +
|
|
|
|
APP.translation.translateString("roomUrlDefaultMsg") + '"';
|
|
|
|
} else {
|
|
|
|
inviteAttributes = "value=\"" + encodeURI(roomUrl) + "\"";
|
|
|
|
}
|
|
|
|
messageHandler.openTwoButtonDialog(
|
|
|
|
"dialog.shareLink", null, null,
|
|
|
|
`<input id="inviteLinkRef" type="text" ${inviteAttributes} onclick="this.select();" readonly>`,
|
|
|
|
false, "dialog.Invite",
|
|
|
|
function (e, v) {
|
|
|
|
if (v && roomUrl) {
|
|
|
|
emitter.emit(UIEvents.USER_INVITED, roomUrl);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
function (event) {
|
|
|
|
if (roomUrl) {
|
|
|
|
document.getElementById('inviteLinkRef').select();
|
|
|
|
} else {
|
|
|
|
if (event && event.target) {
|
|
|
|
$(event.target).find('button[value=true]').prop('disabled', true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Sets the state of the recording button
|
|
|
|
function setRecordingButtonState (recordingState) {
|
|
|
|
let selector = $('#toolbar_button_record');
|
|
|
|
|
|
|
|
if (recordingState === 'on') {
|
|
|
|
selector.removeClass("icon-recEnable");
|
|
|
|
selector.addClass("icon-recEnable active");
|
|
|
|
|
|
|
|
$("#largeVideo").toggleClass("videoMessageFilter", true);
|
|
|
|
let recordOnKey = "recording.on";
|
|
|
|
$('#videoConnectionMessage').attr("data-i18n", recordOnKey);
|
|
|
|
$('#videoConnectionMessage').text(APP.translation.translateString(recordOnKey));
|
|
|
|
|
|
|
|
setTimeout(function(){
|
|
|
|
$("#largeVideo").toggleClass("videoMessageFilter", false);
|
|
|
|
$('#videoConnectionMessage').css({display: "none"});
|
|
|
|
}, 1500);
|
|
|
|
|
|
|
|
recordingToaster = messageHandler.notify(
|
|
|
|
null, "recording.toaster", null,
|
|
|
|
null, null,
|
|
|
|
{timeOut: 0, closeButton: null, tapToDismiss: false}
|
|
|
|
);
|
|
|
|
} else if (recordingState === 'off') {
|
|
|
|
selector.removeClass("icon-recEnable active");
|
|
|
|
selector.addClass("icon-recEnable");
|
|
|
|
|
|
|
|
$("#largeVideo").toggleClass("videoMessageFilter", false);
|
|
|
|
$('#videoConnectionMessage').css({display: "none"});
|
|
|
|
|
|
|
|
if (recordingToaster) {
|
|
|
|
messageHandler.remove(recordingToaster);
|
|
|
|
}
|
|
|
|
} else if (recordingState === 'pending') {
|
|
|
|
selector.removeClass("icon-recEnable active");
|
|
|
|
selector.addClass("icon-recEnable");
|
|
|
|
|
|
|
|
$("#largeVideo").toggleClass("videoMessageFilter", true);
|
|
|
|
let recordPendingKey = "recording.pending";
|
|
|
|
$('#videoConnectionMessage').attr("data-i18n", recordPendingKey);
|
|
|
|
$('#videoConnectionMessage').text(APP.translation.translateString(recordPendingKey));
|
|
|
|
$('#videoConnectionMessage').css({display: "block"});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const buttonHandlers = {
|
2015-01-07 14:54:03 +00:00
|
|
|
"toolbar_button_mute": function () {
|
2015-12-09 13:09:12 +00:00
|
|
|
if (APP.conference.audioMuted) {
|
2015-09-16 22:44:53 +00:00
|
|
|
AnalyticsAdapter.sendEvent('toolbar.audio.unmuted');
|
2015-12-03 13:11:01 +00:00
|
|
|
emitter.emit(UIEvents.AUDIO_MUTED, false);
|
2015-09-02 17:08:48 +00:00
|
|
|
} else {
|
|
|
|
AnalyticsAdapter.sendEvent('toolbar.audio.muted');
|
2015-12-03 13:11:01 +00:00
|
|
|
emitter.emit(UIEvents.AUDIO_MUTED, true);
|
2015-09-02 17:08:48 +00:00
|
|
|
}
|
2015-01-07 14:54:03 +00:00
|
|
|
},
|
|
|
|
"toolbar_button_camera": function () {
|
2015-12-09 13:09:12 +00:00
|
|
|
if (APP.conference.videoMuted) {
|
2015-09-02 17:08:48 +00:00
|
|
|
AnalyticsAdapter.sendEvent('toolbar.video.enabled');
|
2015-12-03 13:11:01 +00:00
|
|
|
emitter.emit(UIEvents.VIDEO_MUTED, false);
|
2015-09-02 17:08:48 +00:00
|
|
|
} else {
|
|
|
|
AnalyticsAdapter.sendEvent('toolbar.video.disabled');
|
2015-12-03 13:11:01 +00:00
|
|
|
emitter.emit(UIEvents.VIDEO_MUTED, true);
|
2015-09-02 17:08:48 +00:00
|
|
|
}
|
2015-01-07 14:54:03 +00:00
|
|
|
},
|
|
|
|
"toolbar_button_record": function () {
|
2015-09-02 17:08:48 +00:00
|
|
|
AnalyticsAdapter.sendEvent('toolbar.recording.toggled');
|
2015-12-10 15:48:56 +00:00
|
|
|
emitter.emit(UIEvents.RECORDING_TOGGLE);
|
2015-01-07 14:54:03 +00:00
|
|
|
},
|
|
|
|
"toolbar_button_security": function () {
|
2015-12-09 17:10:49 +00:00
|
|
|
emitter.emit(UIEvents.ROOM_LOCK_CLICKED);
|
2015-01-07 14:54:03 +00:00
|
|
|
},
|
|
|
|
"toolbar_button_link": function () {
|
2015-09-02 17:08:48 +00:00
|
|
|
AnalyticsAdapter.sendEvent('toolbar.invite.clicked');
|
2015-12-10 13:30:25 +00:00
|
|
|
openLinkDialog();
|
2015-01-07 14:54:03 +00:00
|
|
|
},
|
|
|
|
"toolbar_button_chat": function () {
|
2015-09-02 17:08:48 +00:00
|
|
|
AnalyticsAdapter.sendEvent('toolbar.chat.toggled');
|
2015-12-10 13:30:25 +00:00
|
|
|
emitter.emit(UIEvents.TOGGLE_CHAT);
|
2015-01-07 14:54:03 +00:00
|
|
|
},
|
|
|
|
"toolbar_button_prezi": function () {
|
2015-09-02 17:08:48 +00:00
|
|
|
AnalyticsAdapter.sendEvent('toolbar.prezi.clicked');
|
2015-12-09 13:09:12 +00:00
|
|
|
emitter.emit(UIEvents.PREZI_CLICKED);
|
2015-01-07 14:54:03 +00:00
|
|
|
},
|
|
|
|
"toolbar_button_etherpad": function () {
|
2015-09-02 17:08:48 +00:00
|
|
|
AnalyticsAdapter.sendEvent('toolbar.etherpad.clicked');
|
2015-12-09 13:09:12 +00:00
|
|
|
emitter.emit(UIEvents.ETHERPAD_CLICKED);
|
2015-01-07 14:54:03 +00:00
|
|
|
},
|
|
|
|
"toolbar_button_desktopsharing": function () {
|
2016-02-04 15:25:11 +00:00
|
|
|
if (APP.conference.isSharingScreen) {
|
2015-09-02 17:08:48 +00:00
|
|
|
AnalyticsAdapter.sendEvent('toolbar.screen.disabled');
|
|
|
|
} else {
|
|
|
|
AnalyticsAdapter.sendEvent('toolbar.screen.enabled');
|
|
|
|
}
|
2015-12-30 13:28:56 +00:00
|
|
|
emitter.emit(UIEvents.TOGGLE_SCREENSHARING);
|
2015-01-07 14:54:03 +00:00
|
|
|
},
|
2015-07-28 21:52:32 +00:00
|
|
|
"toolbar_button_fullScreen": function() {
|
2015-09-02 17:08:48 +00:00
|
|
|
AnalyticsAdapter.sendEvent('toolbar.fullscreen.enabled');
|
2015-08-05 21:56:08 +00:00
|
|
|
UIUtil.buttonClick("#toolbar_button_fullScreen", "icon-full-screen icon-exit-full-screen");
|
2015-12-10 13:30:25 +00:00
|
|
|
emitter.emit(UIEvents.FULLSCREEN_TOGGLE);
|
2015-01-07 14:54:03 +00:00
|
|
|
},
|
|
|
|
"toolbar_button_sip": function () {
|
2015-09-02 17:08:48 +00:00
|
|
|
AnalyticsAdapter.sendEvent('toolbar.sip.clicked');
|
2015-12-10 15:48:56 +00:00
|
|
|
showSipNumberInput();
|
2015-01-07 14:54:03 +00:00
|
|
|
},
|
2015-04-08 10:51:29 +00:00
|
|
|
"toolbar_button_dialpad": function () {
|
2015-09-02 17:08:48 +00:00
|
|
|
AnalyticsAdapter.sendEvent('toolbar.sip.dialpad.clicked');
|
2015-12-10 13:30:25 +00:00
|
|
|
dialpadButtonClicked();
|
2015-04-08 10:51:29 +00:00
|
|
|
},
|
2015-01-07 14:54:03 +00:00
|
|
|
"toolbar_button_settings": function () {
|
2015-09-02 17:08:48 +00:00
|
|
|
AnalyticsAdapter.sendEvent('toolbar.settings.toggled');
|
2015-12-10 13:30:25 +00:00
|
|
|
emitter.emit(UIEvents.TOGGLE_SETTINGS);
|
2015-01-07 14:54:03 +00:00
|
|
|
},
|
|
|
|
"toolbar_button_hangup": function () {
|
2015-09-02 17:08:48 +00:00
|
|
|
AnalyticsAdapter.sendEvent('toolbar.hangup');
|
2015-12-10 15:48:56 +00:00
|
|
|
emitter.emit(UIEvents.HANGUP);
|
2015-02-18 15:50:47 +00:00
|
|
|
},
|
|
|
|
"toolbar_button_login": function () {
|
2015-09-02 17:08:48 +00:00
|
|
|
AnalyticsAdapter.sendEvent('toolbar.authenticate.login.clicked');
|
2015-12-10 13:30:25 +00:00
|
|
|
emitter.emit(UIEvents.AUTH_CLICKED);
|
2015-02-18 15:50:47 +00:00
|
|
|
},
|
|
|
|
"toolbar_button_logout": function () {
|
2015-09-02 17:08:48 +00:00
|
|
|
AnalyticsAdapter.sendEvent('toolbar.authenticate.logout.clicked');
|
2015-02-18 15:50:47 +00:00
|
|
|
// Ask for confirmation
|
|
|
|
messageHandler.openTwoButtonDialog(
|
2015-02-26 15:35:35 +00:00
|
|
|
"dialog.logoutTitle",
|
|
|
|
null,
|
2015-02-23 14:59:36 +00:00
|
|
|
"dialog.logoutQuestion",
|
2015-02-26 15:35:35 +00:00
|
|
|
null,
|
|
|
|
false,
|
|
|
|
"dialog.Yes",
|
2015-02-18 15:50:47 +00:00
|
|
|
function (evt, yes) {
|
|
|
|
if (yes) {
|
2015-12-10 15:48:56 +00:00
|
|
|
emitter.emit(UIEvents.LOGOUT);
|
2015-02-18 15:50:47 +00:00
|
|
|
}
|
2015-12-10 15:48:56 +00:00
|
|
|
}
|
|
|
|
);
|
2015-01-07 14:54:03 +00:00
|
|
|
}
|
|
|
|
};
|
2015-12-10 16:36:03 +00:00
|
|
|
const defaultToolbarButtons = {
|
2015-12-25 16:55:45 +00:00
|
|
|
'microphone': '#toolbar_button_mute',
|
|
|
|
'camera': '#toolbar_button_camera',
|
|
|
|
'desktop': '#toolbar_button_desktopsharing',
|
|
|
|
'security': '#toolbar_button_security',
|
|
|
|
'invite': '#toolbar_button_link',
|
|
|
|
'chat': '#toolbar_button_chat',
|
|
|
|
'prezi': '#toolbar_button_prezi',
|
|
|
|
'etherpad': '#toolbar_button_etherpad',
|
|
|
|
'fullscreen': '#toolbar_button_fullScreen',
|
|
|
|
'settings': '#toolbar_button_settings',
|
|
|
|
'hangup': '#toolbar_button_hangup'
|
2015-08-28 21:13:40 +00:00
|
|
|
};
|
2015-01-07 14:54:03 +00:00
|
|
|
|
2015-07-28 21:52:32 +00:00
|
|
|
function dialpadButtonClicked() {
|
|
|
|
//TODO show the dialpad box
|
2015-04-08 10:51:29 +00:00
|
|
|
}
|
|
|
|
|
2015-12-10 15:48:56 +00:00
|
|
|
function showSipNumberInput () {
|
2015-12-10 13:30:25 +00:00
|
|
|
let defaultNumber = config.defaultSipNumber
|
|
|
|
? config.defaultSipNumber
|
|
|
|
: '';
|
|
|
|
|
|
|
|
let sipMsg = APP.translation.generateTranslationHTML("dialog.sipMsg");
|
|
|
|
messageHandler.openTwoButtonDialog(
|
|
|
|
null, null, null,
|
|
|
|
`<h2>${sipMsg}</h2>
|
2015-12-25 16:55:45 +00:00
|
|
|
<input name="sipNumber" type="text" value="${defaultNumber}" autofocus>`,
|
2015-12-10 13:30:25 +00:00
|
|
|
false, "dialog.Dial",
|
2015-01-09 10:18:58 +00:00
|
|
|
function (e, v, m, f) {
|
2015-12-10 15:48:56 +00:00
|
|
|
if (v && f.sipNumber) {
|
|
|
|
emitter.emit(UIEvents.SIP_DIAL, f.sipNumber);
|
2015-01-09 10:18:58 +00:00
|
|
|
}
|
|
|
|
},
|
2015-03-26 13:13:27 +00:00
|
|
|
null, null, ':input:first'
|
2015-01-09 10:18:58 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2015-12-10 13:30:25 +00:00
|
|
|
const Toolbar = {
|
2015-12-09 17:10:49 +00:00
|
|
|
init (eventEmitter) {
|
2015-12-03 13:11:01 +00:00
|
|
|
emitter = eventEmitter;
|
2015-12-10 16:36:03 +00:00
|
|
|
|
2015-08-28 21:13:40 +00:00
|
|
|
UIUtil.hideDisabledButtons(defaultToolbarButtons);
|
|
|
|
|
2015-12-10 16:36:03 +00:00
|
|
|
Object.keys(buttonHandlers).forEach(
|
|
|
|
buttonId => $(`#${buttonId}`).click(buttonHandlers[buttonId])
|
|
|
|
);
|
2015-12-09 17:10:49 +00:00
|
|
|
},
|
2015-01-07 14:54:03 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Updates the room invite url.
|
|
|
|
*/
|
2015-12-09 17:10:49 +00:00
|
|
|
updateRoomUrl (newRoomUrl) {
|
2015-01-07 14:54:03 +00:00
|
|
|
roomUrl = newRoomUrl;
|
|
|
|
|
|
|
|
// If the invite dialog has been already opened we update the information.
|
2015-12-10 16:36:03 +00:00
|
|
|
let inviteLink = document.getElementById('inviteLinkRef');
|
2015-01-07 14:54:03 +00:00
|
|
|
if (inviteLink) {
|
|
|
|
inviteLink.value = roomUrl;
|
|
|
|
inviteLink.select();
|
2015-04-22 12:26:04 +00:00
|
|
|
$('#inviteLinkRef').parent()
|
|
|
|
.find('button[value=true]').prop('disabled', false);
|
2015-01-07 14:54:03 +00:00
|
|
|
}
|
2015-12-09 17:10:49 +00:00
|
|
|
},
|
2015-01-07 14:54:03 +00:00
|
|
|
|
2014-09-23 12:27:12 +00:00
|
|
|
/**
|
|
|
|
* Disables and enables some of the buttons.
|
|
|
|
*/
|
2015-12-09 17:10:49 +00:00
|
|
|
setupButtonsFromConfig () {
|
2015-12-25 16:55:45 +00:00
|
|
|
if (!UIUtil.isButtonEnabled('prezi')) {
|
2015-08-05 21:56:08 +00:00
|
|
|
$("#toolbar_button_prezi").css({display: "none"});
|
2014-09-23 12:27:12 +00:00
|
|
|
}
|
2015-12-09 17:10:49 +00:00
|
|
|
},
|
2014-06-12 18:33:57 +00:00
|
|
|
|
|
|
|
/**
|
2014-10-30 15:32:03 +00:00
|
|
|
* Unlocks the lock button state.
|
2014-06-12 18:33:57 +00:00
|
|
|
*/
|
2015-12-09 17:10:49 +00:00
|
|
|
unlockLockButton () {
|
2015-08-05 21:56:08 +00:00
|
|
|
if ($("#toolbar_button_security").hasClass("icon-security-locked"))
|
|
|
|
UIUtil.buttonClick("#toolbar_button_security", "icon-security icon-security-locked");
|
2015-12-09 17:10:49 +00:00
|
|
|
},
|
|
|
|
|
2014-10-28 12:46:06 +00:00
|
|
|
/**
|
|
|
|
* Updates the lock button state to locked.
|
|
|
|
*/
|
2015-12-09 17:10:49 +00:00
|
|
|
lockLockButton () {
|
2015-08-05 21:56:08 +00:00
|
|
|
if ($("#toolbar_button_security").hasClass("icon-security"))
|
|
|
|
UIUtil.buttonClick("#toolbar_button_security", "icon-security icon-security-locked");
|
2015-12-09 17:10:49 +00:00
|
|
|
},
|
2014-06-12 18:33:57 +00:00
|
|
|
|
2014-12-16 13:54:13 +00:00
|
|
|
/**
|
|
|
|
* Shows or hides authentication button
|
|
|
|
* @param show <tt>true</tt> to show or <tt>false</tt> to hide
|
|
|
|
*/
|
2015-12-09 17:10:49 +00:00
|
|
|
showAuthenticateButton (show) {
|
2015-08-28 21:13:40 +00:00
|
|
|
if (UIUtil.isButtonEnabled('authentication') && show) {
|
2014-12-16 13:54:13 +00:00
|
|
|
$('#authentication').css({display: "inline"});
|
2015-12-21 11:27:36 +00:00
|
|
|
} else {
|
2014-12-16 13:54:13 +00:00
|
|
|
$('#authentication').css({display: "none"});
|
|
|
|
}
|
2015-12-09 17:10:49 +00:00
|
|
|
},
|
2014-12-16 13:54:13 +00:00
|
|
|
|
2015-12-25 16:55:45 +00:00
|
|
|
showEtherpadButton () {
|
|
|
|
if (!$('#toolbar_button_etherpad').is(":visible")) {
|
|
|
|
$('#toolbar_button_etherpad').css({display: 'inline-block'});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2014-07-23 07:47:00 +00:00
|
|
|
// Shows or hides the 'recording' button.
|
2015-12-09 17:10:49 +00:00
|
|
|
showRecordingButton (show) {
|
2015-08-28 21:13:40 +00:00
|
|
|
if (UIUtil.isButtonEnabled('recording') && show) {
|
2015-08-12 18:06:55 +00:00
|
|
|
$('#toolbar_button_record').css({display: "inline-block"});
|
2015-12-21 11:27:36 +00:00
|
|
|
} else {
|
2015-08-05 21:56:08 +00:00
|
|
|
$('#toolbar_button_record').css({display: "none"});
|
2014-07-23 07:47:00 +00:00
|
|
|
}
|
2015-12-09 17:10:49 +00:00
|
|
|
},
|
2014-07-23 07:47:00 +00:00
|
|
|
|
2015-11-13 22:18:22 +00:00
|
|
|
// checks whether recording is enabled and whether we have params
|
|
|
|
// to start automatically recording
|
2015-12-09 17:10:49 +00:00
|
|
|
checkAutoRecord () {
|
2015-08-28 21:13:40 +00:00
|
|
|
if (UIUtil.isButtonEnabled('recording') && config.autoRecord) {
|
2015-12-10 15:48:56 +00:00
|
|
|
emitter.emit(UIEvents.RECORDING_TOGGLE, UIUtil.escapeHtml(config.autoRecordToken));
|
2015-08-07 15:31:27 +00:00
|
|
|
}
|
2015-12-09 17:10:49 +00:00
|
|
|
},
|
2015-08-07 15:31:27 +00:00
|
|
|
|
2015-11-13 22:18:22 +00:00
|
|
|
// checks whether desktop sharing is enabled and whether
|
|
|
|
// we have params to start automatically sharing
|
2015-12-09 17:10:49 +00:00
|
|
|
checkAutoEnableDesktopSharing () {
|
2015-12-30 13:28:56 +00:00
|
|
|
if (UIUtil.isButtonEnabled('desktop') && config.autoEnableDesktopSharing) {
|
|
|
|
emitter.emit(UIEvents.TOGGLE_SCREENSHARING);
|
2015-11-13 22:18:22 +00:00
|
|
|
}
|
2015-12-09 17:10:49 +00:00
|
|
|
},
|
2015-11-13 22:18:22 +00:00
|
|
|
|
2014-08-08 13:25:24 +00:00
|
|
|
// Shows or hides SIP calls button
|
2015-12-09 17:10:49 +00:00
|
|
|
showSipCallButton (show) {
|
2015-12-29 23:52:24 +00:00
|
|
|
if (APP.conference.sipGatewayEnabled() && UIUtil.isButtonEnabled('sip') && show) {
|
2015-08-05 21:56:08 +00:00
|
|
|
$('#toolbar_button_sip').css({display: "inline-block"});
|
2014-08-14 15:29:28 +00:00
|
|
|
} else {
|
2015-08-05 21:56:08 +00:00
|
|
|
$('#toolbar_button_sip').css({display: "none"});
|
2014-08-08 13:25:24 +00:00
|
|
|
}
|
2015-12-09 17:10:49 +00:00
|
|
|
},
|
2014-08-08 13:25:24 +00:00
|
|
|
|
2015-04-08 10:51:29 +00:00
|
|
|
// Shows or hides the dialpad button
|
2015-12-09 17:10:49 +00:00
|
|
|
showDialPadButton (show) {
|
2015-08-28 21:13:40 +00:00
|
|
|
if (UIUtil.isButtonEnabled('dialpad') && show) {
|
2015-08-05 21:56:08 +00:00
|
|
|
$('#toolbar_button_dialpad').css({display: "inline-block"});
|
2015-04-08 10:51:29 +00:00
|
|
|
} else {
|
2015-08-05 21:56:08 +00:00
|
|
|
$('#toolbar_button_dialpad').css({display: "none"});
|
2015-04-08 10:51:29 +00:00
|
|
|
}
|
2015-12-09 17:10:49 +00:00
|
|
|
},
|
2015-04-08 10:51:29 +00:00
|
|
|
|
2015-02-18 15:50:47 +00:00
|
|
|
/**
|
|
|
|
* Displays user authenticated identity name(login).
|
|
|
|
* @param authIdentity identity name to be displayed.
|
|
|
|
*/
|
2015-12-09 17:10:49 +00:00
|
|
|
setAuthenticatedIdentity (authIdentity) {
|
2015-02-18 15:50:47 +00:00
|
|
|
if (authIdentity) {
|
2015-12-10 16:36:03 +00:00
|
|
|
let selector = $('#toolbar_auth_identity');
|
2015-04-08 10:49:49 +00:00
|
|
|
selector.css({display: "list-item"});
|
|
|
|
selector.text(authIdentity);
|
2015-02-18 15:50:47 +00:00
|
|
|
} else {
|
|
|
|
$('#toolbar_auth_identity').css({display: "none"});
|
|
|
|
}
|
2015-12-09 17:10:49 +00:00
|
|
|
},
|
2015-02-18 15:50:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Shows/hides login button.
|
|
|
|
* @param show <tt>true</tt> to show
|
|
|
|
*/
|
2015-12-09 17:10:49 +00:00
|
|
|
showLoginButton (show) {
|
2015-08-28 21:13:40 +00:00
|
|
|
if (UIUtil.isButtonEnabled('authentication') && show) {
|
2015-02-18 15:50:47 +00:00
|
|
|
$('#toolbar_button_login').css({display: "list-item"});
|
|
|
|
} else {
|
|
|
|
$('#toolbar_button_login').css({display: "none"});
|
|
|
|
}
|
2015-12-09 17:10:49 +00:00
|
|
|
},
|
2015-02-18 15:50:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Shows/hides logout button.
|
|
|
|
* @param show <tt>true</tt> to show
|
|
|
|
*/
|
2015-12-09 17:10:49 +00:00
|
|
|
showLogoutButton (show) {
|
2015-08-28 21:13:40 +00:00
|
|
|
if (UIUtil.isButtonEnabled('authentication') && show) {
|
2015-02-18 15:50:47 +00:00
|
|
|
$('#toolbar_button_logout').css({display: "list-item"});
|
|
|
|
} else {
|
|
|
|
$('#toolbar_button_logout').css({display: "none"});
|
|
|
|
}
|
2015-12-09 17:10:49 +00:00
|
|
|
},
|
2015-02-18 15:50:47 +00:00
|
|
|
|
2014-09-24 12:47:26 +00:00
|
|
|
/**
|
2016-02-04 15:25:11 +00:00
|
|
|
* Update the state of the button. The button has blue glow if desktop
|
2014-11-28 15:16:27 +00:00
|
|
|
* streaming is active.
|
2014-09-24 12:47:26 +00:00
|
|
|
*/
|
2016-02-04 15:25:11 +00:00
|
|
|
updateDesktopSharingButtonState () {
|
2015-12-10 16:36:03 +00:00
|
|
|
let button = $("#toolbar_button_desktopsharing");
|
2016-02-04 15:25:11 +00:00
|
|
|
if (APP.conference.isSharingScreen) {
|
2014-09-24 12:47:26 +00:00
|
|
|
button.addClass("glow");
|
2015-07-28 21:52:32 +00:00
|
|
|
} else {
|
2014-09-24 12:47:26 +00:00
|
|
|
button.removeClass("glow");
|
|
|
|
}
|
2015-12-10 15:48:56 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
updateRecordingState (state) {
|
|
|
|
setRecordingButtonState(state);
|
2016-02-09 10:19:43 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Marks video icon as muted or not.
|
|
|
|
* @param {boolean} muted if icon should look like muted or not
|
|
|
|
*/
|
|
|
|
markVideoIconAsMuted (muted) {
|
|
|
|
$('#toolbar_button_camera').toggleClass("icon-camera-disabled", muted);
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Marks audio icon as muted or not.
|
|
|
|
* @param {boolean} muted if icon should look like muted or not
|
|
|
|
*/
|
|
|
|
markAudioIconAsMuted (muted) {
|
|
|
|
$('#toolbar_button_mute').toggleClass("icon-microphone", !muted).toggleClass("icon-mic-disabled", muted);
|
2015-12-09 17:10:49 +00:00
|
|
|
}
|
|
|
|
};
|
2015-01-07 14:54:03 +00:00
|
|
|
|
2015-12-09 17:10:49 +00:00
|
|
|
export default Toolbar;
|