var Toolbar = (function (my) {
/**
* Opens the lock room dialog.
*/
my.openLockDialog = function () {
// Only the focus is able to set a shared key.
if (focus === null) {
if (sharedKey) {
messageHandler.openMessageDialog(null,
"This conversation is currently protected by" +
" a shared secret key.",
false,
"Secret key");
} else {
messageHandler.openMessageDialog(null,
"This conversation isn't currently protected by" +
" a secret key. Only the owner of the conference" +
" could set a shared key.",
false,
"Secret key");
}
} else {
if (sharedKey) {
messageHandler.openTwoButtonDialog(null,
"Are you sure you would like to remove your secret key?",
false,
"Remove",
function (e, v) {
if (v) {
setSharedKey('');
lockRoom(false);
}
});
} else {
messageHandler.openTwoButtonDialog(null,
'
Set a secret key to lock your room
' +
'',
false,
"Save",
function (e, v) {
if (v) {
var lockKey = document.getElementById('lockKey');
if (lockKey.value) {
setSharedKey(Util.escapeHtml(lockKey.value));
lockRoom(true);
}
}
},
function () {
document.getElementById('lockKey').focus();
}
);
}
}
};
/**
* Opens the invite link dialog.
*/
my.openLinkDialog = function () {
var inviteLink;
if (roomUrl == null) {
inviteLink = "Your conference is currently being created...";
} else {
inviteLink = encodeURI(roomUrl);
}
messageHandler.openTwoButtonDialog(
"Share this link with everyone you want to invite",
'',
false,
"Invite",
function (e, v) {
if (v) {
if (roomUrl) {
inviteParticipants();
}
}
},
function () {
if (roomUrl) {
document.getElementById('inviteLinkRef').select();
} else {
document.getElementById('jqi_state0_buttonInvite')
.disabled = true;
}
}
);
};
/**
* 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 Jitsi Meet (" + conferenceName + ")";
var body = "Hey there, I%27d like to invite you to a Jitsi Meet" +
" 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 Jitsi Meet 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;
}
window.open("mailto:?subject=" + subject + "&body=" + body, '_blank');
}
/**
* Opens the settings dialog.
*/
my.openSettingsDialog = function () {
messageHandler.openTwoButtonDialog(
'