2015-01-19 09:20:00 +00:00
|
|
|
/* global $, buttonClick, config, lockRoom,
|
|
|
|
setSharedKey, Util */
|
2015-01-07 14:54:03 +00:00
|
|
|
var messageHandler = require("../util/MessageHandler");
|
|
|
|
var BottomToolbar = require("./BottomToolbar");
|
|
|
|
var Prezi = require("../prezi/Prezi");
|
|
|
|
var Etherpad = require("../etherpad/Etherpad");
|
|
|
|
var PanelToggler = require("../side_pannels/SidePanelToggler");
|
2015-01-19 09:20:00 +00:00
|
|
|
var Authentication = require("../authentication/Authentication");
|
|
|
|
var UIUtil = require("../util/UIUtil");
|
2015-01-07 14:54:03 +00:00
|
|
|
|
|
|
|
var roomUrl = null;
|
|
|
|
var sharedKey = '';
|
2015-01-19 09:20:00 +00:00
|
|
|
var UI = null;
|
2015-01-07 14:54:03 +00:00
|
|
|
|
|
|
|
var buttonHandlers =
|
|
|
|
{
|
|
|
|
"toolbar_button_mute": function () {
|
2015-01-28 14:35:22 +00:00
|
|
|
return APP.UI.toggleAudio();
|
2015-01-07 14:54:03 +00:00
|
|
|
},
|
|
|
|
"toolbar_button_camera": function () {
|
2015-01-28 14:35:22 +00:00
|
|
|
return APP.UI.toggleVideo();
|
2015-01-07 14:54:03 +00:00
|
|
|
},
|
|
|
|
"toolbar_button_authentication": function () {
|
|
|
|
return Toolbar.authenticateClicked();
|
|
|
|
},
|
|
|
|
"toolbar_button_record": function () {
|
|
|
|
return toggleRecording();
|
|
|
|
},
|
|
|
|
"toolbar_button_security": function () {
|
|
|
|
return Toolbar.openLockDialog();
|
|
|
|
},
|
|
|
|
"toolbar_button_link": function () {
|
|
|
|
return Toolbar.openLinkDialog();
|
|
|
|
},
|
|
|
|
"toolbar_button_chat": function () {
|
|
|
|
return BottomToolbar.toggleChat();
|
|
|
|
},
|
|
|
|
"toolbar_button_prezi": function () {
|
|
|
|
return Prezi.openPreziDialog();
|
|
|
|
},
|
|
|
|
"toolbar_button_etherpad": function () {
|
|
|
|
return Etherpad.toggleEtherpad(0);
|
|
|
|
},
|
|
|
|
"toolbar_button_desktopsharing": function () {
|
2015-01-28 14:35:22 +00:00
|
|
|
return APP.desktopsharing.toggleScreenSharing();
|
2015-01-07 14:54:03 +00:00
|
|
|
},
|
|
|
|
"toolbar_button_fullScreen": function()
|
|
|
|
{
|
2015-01-19 09:20:00 +00:00
|
|
|
UIUtil.buttonClick("#fullScreen", "icon-full-screen icon-exit-full-screen");
|
2015-01-07 14:54:03 +00:00
|
|
|
return Toolbar.toggleFullScreen();
|
|
|
|
},
|
|
|
|
"toolbar_button_sip": function () {
|
|
|
|
return callSipButtonClicked();
|
|
|
|
},
|
|
|
|
"toolbar_button_settings": function () {
|
|
|
|
PanelToggler.toggleSettingsMenu();
|
|
|
|
},
|
|
|
|
"toolbar_button_hangup": function () {
|
|
|
|
return hangup();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-01-09 11:35:48 +00:00
|
|
|
function hangup() {
|
2015-01-28 14:35:22 +00:00
|
|
|
APP.xmpp.disposeConference();
|
2015-01-09 11:35:48 +00:00
|
|
|
if(config.enableWelcomePage)
|
|
|
|
{
|
|
|
|
setTimeout(function()
|
|
|
|
{
|
|
|
|
window.localStorage.welcomePageDisabled = false;
|
|
|
|
window.location.pathname = "/";
|
|
|
|
}, 10000);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
UI.messageHandler.openDialog(
|
|
|
|
"Session Terminated",
|
|
|
|
"You hung up the call",
|
|
|
|
true,
|
|
|
|
{ "Join again": true },
|
|
|
|
function(event, value, message, formVals)
|
|
|
|
{
|
|
|
|
window.location.reload();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2015-01-07 14:54:03 +00:00
|
|
|
/**
|
|
|
|
* Starts or stops the recording for the conference.
|
|
|
|
*/
|
|
|
|
|
|
|
|
function toggleRecording() {
|
2015-02-06 12:54:19 +00:00
|
|
|
APP.xmpp.toggleRecording(function (callback) {
|
2015-01-28 14:35:22 +00:00
|
|
|
APP.UI.messageHandler.openTwoButtonDialog(null,
|
2015-01-19 09:20:00 +00:00
|
|
|
'<h2>Enter recording token</h2>' +
|
|
|
|
'<input id="recordingToken" type="text" ' +
|
|
|
|
'placeholder="token" autofocus>',
|
|
|
|
false,
|
|
|
|
"Save",
|
|
|
|
function (e, v, m, f) {
|
|
|
|
if (v) {
|
|
|
|
var token = document.getElementById('recordingToken');
|
|
|
|
|
|
|
|
if (token.value) {
|
2015-01-23 12:01:44 +00:00
|
|
|
callback(UIUtil.escapeHtml(token.value));
|
2015-01-19 09:20:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
function (event) {
|
|
|
|
document.getElementById('recordingToken').focus();
|
|
|
|
},
|
|
|
|
function () {
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}, Toolbar.setRecordingButtonState, Toolbar.setRecordingButtonState);
|
2015-01-07 14:54:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Locks / unlocks the room.
|
|
|
|
*/
|
|
|
|
function lockRoom(lock) {
|
|
|
|
var currentSharedKey = '';
|
|
|
|
if (lock)
|
|
|
|
currentSharedKey = sharedKey;
|
|
|
|
|
2015-02-06 12:54:19 +00:00
|
|
|
APP.xmpp.lockRoom(currentSharedKey, function (res) {
|
2015-01-07 14:54:03 +00:00
|
|
|
// password is required
|
|
|
|
if (sharedKey)
|
|
|
|
{
|
|
|
|
console.log('set room password');
|
|
|
|
Toolbar.lockLockButton();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
console.log('removed room password');
|
|
|
|
Toolbar.unlockLockButton();
|
|
|
|
}
|
|
|
|
}, function (err) {
|
|
|
|
console.warn('setting password failed', err);
|
|
|
|
messageHandler.showError('Lock failed',
|
|
|
|
'Failed to lock conference.',
|
|
|
|
err);
|
|
|
|
Toolbar.setSharedKey('');
|
|
|
|
}, function () {
|
|
|
|
console.warn('room passwords not supported');
|
|
|
|
messageHandler.showError('Warning',
|
|
|
|
'Room passwords are currently not supported.');
|
|
|
|
Toolbar.setSharedKey('');
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Invite participants to conference.
|
|
|
|
*/
|
|
|
|
function inviteParticipants() {
|
|
|
|
if (roomUrl === null)
|
|
|
|
return;
|
|
|
|
|
|
|
|
var sharedKeyText = "";
|
|
|
|
if (sharedKey && sharedKey.length > 0) {
|
|
|
|
sharedKeyText =
|
|
|
|
"This conference is password protected. Please use the " +
|
|
|
|
"following pin when joining:%0D%0A%0D%0A" +
|
|
|
|
sharedKey + "%0D%0A%0D%0A";
|
|
|
|
}
|
|
|
|
|
|
|
|
var conferenceName = roomUrl.substring(roomUrl.lastIndexOf('/') + 1);
|
|
|
|
var subject = "Invitation to a " + interfaceConfig.APP_NAME + " (" + conferenceName + ")";
|
|
|
|
var body = "Hey there, I%27d like to invite you to a " + interfaceConfig.APP_NAME +
|
|
|
|
" conference I%27ve just set up.%0D%0A%0D%0A" +
|
|
|
|
"Please click on the following link in order" +
|
|
|
|
" to join the conference.%0D%0A%0D%0A" +
|
|
|
|
roomUrl +
|
|
|
|
"%0D%0A%0D%0A" +
|
|
|
|
sharedKeyText +
|
|
|
|
"Note that " + interfaceConfig.APP_NAME + " is currently" +
|
|
|
|
" only supported by Chromium," +
|
|
|
|
" Google Chrome and Opera, so you need" +
|
|
|
|
" to be using one of these browsers.%0D%0A%0D%0A" +
|
|
|
|
"Talk to you in a sec!";
|
|
|
|
|
|
|
|
if (window.localStorage.displayname) {
|
|
|
|
body += "%0D%0A%0D%0A" + window.localStorage.displayname;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (interfaceConfig.INVITATION_POWERED_BY) {
|
|
|
|
body += "%0D%0A%0D%0A--%0D%0Apowered by jitsi.org";
|
|
|
|
}
|
|
|
|
|
|
|
|
window.open("mailto:?subject=" + subject + "&body=" + body, '_blank');
|
|
|
|
}
|
|
|
|
|
2015-01-09 10:18:58 +00:00
|
|
|
function callSipButtonClicked()
|
|
|
|
{
|
|
|
|
var defaultNumber
|
|
|
|
= config.defaultSipNumber ? config.defaultSipNumber : '';
|
|
|
|
|
|
|
|
messageHandler.openTwoButtonDialog(null,
|
|
|
|
'<h2>Enter SIP number</h2>' +
|
|
|
|
'<input id="sipNumber" type="text"' +
|
|
|
|
' value="' + defaultNumber + '" autofocus>',
|
|
|
|
false,
|
|
|
|
"Dial",
|
|
|
|
function (e, v, m, f) {
|
|
|
|
if (v) {
|
|
|
|
var numberInput = document.getElementById('sipNumber');
|
|
|
|
if (numberInput.value) {
|
2015-02-06 12:54:19 +00:00
|
|
|
APP.xmpp.dial(numberInput.value, 'fromnumber',
|
2015-01-19 09:20:00 +00:00
|
|
|
UI.getRoomName(), sharedKey);
|
2015-01-09 10:18:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
function (event) {
|
|
|
|
document.getElementById('sipNumber').focus();
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2014-06-12 18:33:57 +00:00
|
|
|
var Toolbar = (function (my) {
|
|
|
|
|
2015-01-19 09:20:00 +00:00
|
|
|
my.init = function (ui) {
|
2015-01-07 14:54:03 +00:00
|
|
|
for(var k in buttonHandlers)
|
|
|
|
$("#" + k).click(buttonHandlers[k]);
|
2015-01-19 09:20:00 +00:00
|
|
|
UI = ui;
|
2015-01-07 14:54:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets shared key
|
|
|
|
* @param sKey the shared key
|
|
|
|
*/
|
|
|
|
my.setSharedKey = function (sKey) {
|
|
|
|
sharedKey = sKey;
|
|
|
|
};
|
|
|
|
|
|
|
|
my.authenticateClicked = function () {
|
2015-01-19 09:20:00 +00:00
|
|
|
Authentication.focusAuthenticationWindow();
|
2015-01-07 14:54:03 +00:00
|
|
|
// Get authentication URL
|
2015-01-28 14:35:22 +00:00
|
|
|
APP.xmpp.getAuthUrl(APP.UI.getRoomName(), function (url) {
|
2015-01-07 14:54:03 +00:00
|
|
|
// Open popup with authentication URL
|
2015-01-19 09:20:00 +00:00
|
|
|
var authenticationWindow = Authentication.createAuthenticationWindow(function () {
|
|
|
|
// On popup closed - retry room allocation
|
2015-01-29 09:09:09 +00:00
|
|
|
APP.xmpp.allocateConferenceFocus(APP.UI.getRoomName(), APP.UI.checkForNicknameAndJoin);
|
2015-01-19 09:20:00 +00:00
|
|
|
}, url);
|
2015-01-07 14:54:03 +00:00
|
|
|
if (!authenticationWindow) {
|
|
|
|
Toolbar.showAuthenticateButton(true);
|
|
|
|
messageHandler.openMessageDialog(
|
|
|
|
null, "Your browser is blocking popup windows from this site." +
|
|
|
|
" Please enable popups in your browser security settings" +
|
|
|
|
" and try again.");
|
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Updates the room invite url.
|
|
|
|
*/
|
|
|
|
my.updateRoomUrl = function (newRoomUrl) {
|
|
|
|
roomUrl = newRoomUrl;
|
|
|
|
|
|
|
|
// If the invite dialog has been already opened we update the information.
|
|
|
|
var inviteLink = document.getElementById('inviteLinkRef');
|
|
|
|
if (inviteLink) {
|
|
|
|
inviteLink.value = roomUrl;
|
|
|
|
inviteLink.select();
|
|
|
|
document.getElementById('jqi_state0_buttonInvite').disabled = false;
|
|
|
|
}
|
2015-01-13 13:11:05 +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.
|
|
|
|
*/
|
|
|
|
my.setupButtonsFromConfig = function () {
|
2014-11-28 15:16:27 +00:00
|
|
|
if (config.disablePrezi)
|
2014-09-23 12:27:12 +00:00
|
|
|
{
|
|
|
|
$("#prezi_button").css({display: "none"});
|
|
|
|
}
|
2014-11-28 15:16:27 +00:00
|
|
|
};
|
2014-09-23 12:27:12 +00:00
|
|
|
|
2014-06-12 18:33:57 +00:00
|
|
|
/**
|
|
|
|
* Opens the lock room dialog.
|
|
|
|
*/
|
2014-07-13 17:30:14 +00:00
|
|
|
my.openLockDialog = function () {
|
2014-06-12 18:33:57 +00:00
|
|
|
// Only the focus is able to set a shared key.
|
2015-01-28 14:35:22 +00:00
|
|
|
if (!APP.xmpp.isModerator()) {
|
2014-08-14 15:29:28 +00:00
|
|
|
if (sharedKey) {
|
|
|
|
messageHandler.openMessageDialog(null,
|
|
|
|
"This conversation is currently protected by" +
|
2014-09-24 09:51:42 +00:00
|
|
|
" a password. Only the owner of the conference" +
|
|
|
|
" could set a password.",
|
2014-08-14 15:29:28 +00:00
|
|
|
false,
|
2014-09-24 09:51:42 +00:00
|
|
|
"Password");
|
2014-08-14 15:29:28 +00:00
|
|
|
} else {
|
|
|
|
messageHandler.openMessageDialog(null,
|
|
|
|
"This conversation isn't currently protected by" +
|
2014-09-24 09:51:42 +00:00
|
|
|
" a password. Only the owner of the conference" +
|
|
|
|
" could set a password.",
|
2014-08-14 15:29:28 +00:00
|
|
|
false,
|
2014-09-24 09:51:42 +00:00
|
|
|
"Password");
|
2014-08-14 15:29:28 +00:00
|
|
|
}
|
2014-06-12 18:33:57 +00:00
|
|
|
} else {
|
|
|
|
if (sharedKey) {
|
2014-08-14 15:29:28 +00:00
|
|
|
messageHandler.openTwoButtonDialog(null,
|
2014-09-24 09:51:42 +00:00
|
|
|
"Are you sure you would like to remove your password?",
|
2014-08-14 15:29:28 +00:00
|
|
|
false,
|
|
|
|
"Remove",
|
|
|
|
function (e, v) {
|
|
|
|
if (v) {
|
2015-01-07 14:54:03 +00:00
|
|
|
Toolbar.setSharedKey('');
|
2014-08-14 15:29:28 +00:00
|
|
|
lockRoom(false);
|
2014-06-12 18:33:57 +00:00
|
|
|
}
|
2014-08-14 15:29:28 +00:00
|
|
|
});
|
2014-06-12 18:33:57 +00:00
|
|
|
} else {
|
2014-08-14 15:29:28 +00:00
|
|
|
messageHandler.openTwoButtonDialog(null,
|
2014-09-24 09:51:42 +00:00
|
|
|
'<h2>Set a password to lock your room</h2>' +
|
2014-08-14 15:29:28 +00:00
|
|
|
'<input id="lockKey" type="text"' +
|
2014-09-24 09:51:42 +00:00
|
|
|
'placeholder="your password" autofocus>',
|
2014-08-14 15:29:28 +00:00
|
|
|
false,
|
|
|
|
"Save",
|
|
|
|
function (e, v) {
|
|
|
|
if (v) {
|
|
|
|
var lockKey = document.getElementById('lockKey');
|
|
|
|
|
|
|
|
if (lockKey.value) {
|
2015-01-23 12:01:44 +00:00
|
|
|
Toolbar.setSharedKey(UIUtil.escapeHtml(lockKey.value));
|
2014-08-14 15:29:28 +00:00
|
|
|
lockRoom(true);
|
2014-06-12 18:33:57 +00:00
|
|
|
}
|
|
|
|
}
|
2014-08-14 15:29:28 +00:00
|
|
|
},
|
|
|
|
function () {
|
|
|
|
document.getElementById('lockKey').focus();
|
2014-06-12 18:33:57 +00:00
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Opens the invite link dialog.
|
|
|
|
*/
|
2014-07-13 17:30:14 +00:00
|
|
|
my.openLinkDialog = function () {
|
|
|
|
var inviteLink;
|
2014-11-28 15:16:27 +00:00
|
|
|
if (roomUrl === null) {
|
2014-07-13 17:30:14 +00:00
|
|
|
inviteLink = "Your conference is currently being created...";
|
2014-08-14 15:29:28 +00:00
|
|
|
} else {
|
2014-07-13 17:30:14 +00:00
|
|
|
inviteLink = encodeURI(roomUrl);
|
2014-08-14 15:29:28 +00:00
|
|
|
}
|
|
|
|
messageHandler.openTwoButtonDialog(
|
|
|
|
"Share this link with everyone you want to invite",
|
|
|
|
'<input id="inviteLinkRef" type="text" value="' +
|
2014-07-13 17:30:14 +00:00
|
|
|
inviteLink + '" onclick="this.select();" readonly>',
|
2014-08-14 15:29:28 +00:00
|
|
|
false,
|
|
|
|
"Invite",
|
|
|
|
function (e, v) {
|
|
|
|
if (v) {
|
|
|
|
if (roomUrl) {
|
|
|
|
inviteParticipants();
|
2014-07-13 17:30:14 +00:00
|
|
|
}
|
2014-06-12 18:33:57 +00:00
|
|
|
}
|
2014-08-14 15:29:28 +00:00
|
|
|
},
|
|
|
|
function () {
|
|
|
|
if (roomUrl) {
|
|
|
|
document.getElementById('inviteLinkRef').select();
|
|
|
|
} else {
|
|
|
|
document.getElementById('jqi_state0_buttonInvite')
|
|
|
|
.disabled = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
2014-06-12 18:33:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Opens the settings dialog.
|
|
|
|
*/
|
2014-07-13 17:30:14 +00:00
|
|
|
my.openSettingsDialog = function () {
|
2014-08-14 15:29:28 +00:00
|
|
|
messageHandler.openTwoButtonDialog(
|
|
|
|
'<h2>Configure your conference</h2>' +
|
|
|
|
'<input type="checkbox" id="initMuted">' +
|
|
|
|
'Participants join muted<br/>' +
|
|
|
|
'<input type="checkbox" id="requireNicknames">' +
|
|
|
|
'Require nicknames<br/><br/>' +
|
2014-09-24 09:51:42 +00:00
|
|
|
'Set a password to lock your room:' +
|
|
|
|
'<input id="lockKey" type="text" placeholder="your password"' +
|
2014-08-14 15:29:28 +00:00
|
|
|
'autofocus>',
|
|
|
|
null,
|
|
|
|
false,
|
|
|
|
"Save",
|
|
|
|
function () {
|
|
|
|
document.getElementById('lockKey').focus();
|
|
|
|
},
|
|
|
|
function (e, v) {
|
|
|
|
if (v) {
|
|
|
|
if ($('#initMuted').is(":checked")) {
|
|
|
|
// it is checked
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($('#requireNicknames').is(":checked")) {
|
|
|
|
// it is checked
|
2014-06-12 18:33:57 +00:00
|
|
|
}
|
2014-08-14 15:29:28 +00:00
|
|
|
/*
|
|
|
|
var lockKey = document.getElementById('lockKey');
|
|
|
|
|
|
|
|
if (lockKey.value) {
|
|
|
|
setSharedKey(lockKey.value);
|
|
|
|
lockRoom(true);
|
|
|
|
}
|
|
|
|
*/
|
2014-06-12 18:33:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Toggles the application in and out of full screen mode
|
|
|
|
* (a.k.a. presentation mode in Chrome).
|
|
|
|
*/
|
2014-11-28 15:16:27 +00:00
|
|
|
my.toggleFullScreen = function () {
|
2014-06-12 18:33:57 +00:00
|
|
|
var fsElement = document.documentElement;
|
|
|
|
|
|
|
|
if (!document.mozFullScreen && !document.webkitIsFullScreen) {
|
|
|
|
//Enter Full Screen
|
|
|
|
if (fsElement.mozRequestFullScreen) {
|
|
|
|
fsElement.mozRequestFullScreen();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
fsElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
//Exit Full Screen
|
|
|
|
if (document.mozCancelFullScreen) {
|
|
|
|
document.mozCancelFullScreen();
|
|
|
|
} else {
|
|
|
|
document.webkitCancelFullScreen();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
/**
|
2014-10-30 15:32:03 +00:00
|
|
|
* Unlocks the lock button state.
|
2014-06-12 18:33:57 +00:00
|
|
|
*/
|
2014-11-28 15:16:27 +00:00
|
|
|
my.unlockLockButton = function () {
|
|
|
|
if ($("#lockIcon").hasClass("icon-security-locked"))
|
2015-01-19 09:20:00 +00:00
|
|
|
UIUtil.buttonClick("#lockIcon", "icon-security icon-security-locked");
|
2014-06-12 18:33:57 +00:00
|
|
|
};
|
2014-10-28 12:46:06 +00:00
|
|
|
/**
|
|
|
|
* Updates the lock button state to locked.
|
|
|
|
*/
|
2014-11-28 15:16:27 +00:00
|
|
|
my.lockLockButton = function () {
|
|
|
|
if ($("#lockIcon").hasClass("icon-security"))
|
2015-01-19 09:20:00 +00:00
|
|
|
UIUtil.buttonClick("#lockIcon", "icon-security icon-security-locked");
|
2014-10-28 12:46:06 +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
|
|
|
|
*/
|
|
|
|
my.showAuthenticateButton = function (show) {
|
|
|
|
if (show) {
|
|
|
|
$('#authentication').css({display: "inline"});
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$('#authentication').css({display: "none"});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-07-23 07:47:00 +00:00
|
|
|
// Shows or hides the 'recording' button.
|
|
|
|
my.showRecordingButton = function (show) {
|
|
|
|
if (!config.enableRecording) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (show) {
|
|
|
|
$('#recording').css({display: "inline"});
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$('#recording').css({display: "none"});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-11-28 15:19:20 +00:00
|
|
|
// Sets the state of the recording button
|
|
|
|
my.setRecordingButtonState = function (isRecording) {
|
|
|
|
if (isRecording) {
|
|
|
|
$('#recordButton').removeClass("icon-recEnable");
|
|
|
|
$('#recordButton').addClass("icon-recEnable active");
|
|
|
|
} else {
|
|
|
|
$('#recordButton').removeClass("icon-recEnable active");
|
|
|
|
$('#recordButton').addClass("icon-recEnable");
|
|
|
|
}
|
2014-07-23 07:47:00 +00:00
|
|
|
};
|
|
|
|
|
2014-08-08 13:25:24 +00:00
|
|
|
// Shows or hides SIP calls button
|
2014-11-28 15:16:27 +00:00
|
|
|
my.showSipCallButton = function (show) {
|
2015-01-28 14:35:22 +00:00
|
|
|
if (APP.xmpp.isSipGatewayEnabled() && show) {
|
2014-08-08 13:25:24 +00:00
|
|
|
$('#sipCallButton').css({display: "inline"});
|
2014-08-14 15:29:28 +00:00
|
|
|
} else {
|
2014-08-08 13:25:24 +00:00
|
|
|
$('#sipCallButton').css({display: "none"});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-09-24 12:47:26 +00:00
|
|
|
/**
|
2014-11-28 15:16:27 +00:00
|
|
|
* Sets the state of the button. The button has blue glow if desktop
|
|
|
|
* streaming is active.
|
2014-09-24 12:47:26 +00:00
|
|
|
* @param active the state of the desktop streaming.
|
|
|
|
*/
|
|
|
|
my.changeDesktopSharingButtonState = function (active) {
|
|
|
|
var button = $("#desktopsharing > a");
|
2014-11-28 15:16:27 +00:00
|
|
|
if (active)
|
2014-09-24 12:47:26 +00:00
|
|
|
{
|
|
|
|
button.addClass("glow");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
button.removeClass("glow");
|
|
|
|
}
|
2014-11-28 15:16:27 +00:00
|
|
|
};
|
2014-09-24 12:47:26 +00:00
|
|
|
|
2014-06-12 18:33:57 +00:00
|
|
|
return my;
|
2014-07-18 15:37:52 +00:00
|
|
|
}(Toolbar || {}));
|
2015-01-07 14:54:03 +00:00
|
|
|
|
|
|
|
module.exports = Toolbar;
|