move random stuff out of Toolbar

This commit is contained in:
isymchych 2015-12-10 15:30:25 +02:00
parent eeb390cd9d
commit 7cc682d5a4
5 changed files with 234 additions and 225 deletions

42
app.js
View File

@ -355,7 +355,7 @@ function initConference(localTracks, connection) {
); );
APP.UI.addListener(UIEvents.USER_INVITED, function (roomUrl) { APP.UI.addListener(UIEvents.USER_INVITED, function (roomUrl) {
inviteParticipants( APP.UI.inviteParticipants(
roomUrl, roomUrl,
APP.conference.roomName, APP.conference.roomName,
roomLocker.password, roomLocker.password,
@ -479,44 +479,4 @@ $(window).bind('beforeunload', function () {
} }
}); });
/**
* Invite participants to conference.
*/
function inviteParticipants(roomUrl, conferenceName, key, nick) {
let keyText = "";
if (key) {
keyText = APP.translation.translateString(
"email.sharedKey", {sharedKey: key}
);
}
let and = APP.translation.translateString("email.and");
let supportedBrowsers = `Chromium, Google Chrome ${and} Opera`;
let subject = APP.translation.translateString(
"email.subject", {appName:interfaceConfig.APP_NAME, conferenceName}
);
let body = APP.translation.translateString(
"email.body", {
appName:interfaceConfig.APP_NAME,
sharedKeyText: keyText,
roomUrl,
supportedBrowsers
}
);
body = body.replace(/\n/g, "%0D%0A");
if (nick) {
body += "%0D%0A%0D%0A" + nick;
}
if (interfaceConfig.INVITATION_POWERED_BY) {
body += "%0D%0A%0D%0A--%0D%0Apowered by jitsi.org";
}
window.open(`mailto:?subject=${subject}&body=${body}`, '_blank');
}
export default APP; export default APP;

View File

@ -95,6 +95,30 @@ function setupToolbars() {
BottomToolbar.init(eventEmitter); BottomToolbar.init(eventEmitter);
} }
/**
* Toggles the application in and out of full screen mode
* (a.k.a. presentation mode in Chrome).
*/
function toggleFullScreen () {
let 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();
}
}
}
UI.notifyGracefulShudown = function () { UI.notifyGracefulShudown = function () {
messageHandler.openMessageDialog( messageHandler.openMessageDialog(
'dialog.serviceUnavailable', 'dialog.serviceUnavailable',
@ -179,6 +203,18 @@ function registerListeners() {
UI.addListener(UIEvents.ETHERPAD_CLICKED, function () { UI.addListener(UIEvents.ETHERPAD_CLICKED, function () {
Etherpad.toggleEtherpad(0); Etherpad.toggleEtherpad(0);
}); });
UI.addListener(UIEvents.FULLSCREEN_TOGGLE, toggleFullScreen);
UI.addListener(UIEvents.AUTH_CLICKED, function () {
Authentication.authenticate();
});
UI.addListener(UIEvents.TOGGLE_CHAT, UI.toggleChat);
UI.addListener(UIEvents.TOGGLE_SETTINGS, function () {
PanelToggler.toggleSettingsMenu();
});
} }
function bindEvents() { function bindEvents() {
@ -396,11 +432,7 @@ UI.updateUserRole = function (user) {
}; };
UI.notifyAuthRequired = function (intervalCallback) { UI.notifyAuthRequired = function (intervalCallback) {
Authentication.openAuthenticationDialog( Authentication.openAuthenticationDialog(APP.conference.roomName, intervalCallback);
APP.conference.roomName, intervalCallback, function () {
Toolbar.authenticateClicked();
}
);
}; };
@ -413,15 +445,15 @@ UI.getSettings = function () {
}; };
UI.toggleFilmStrip = function () { UI.toggleFilmStrip = function () {
return BottomToolbar.toggleFilmStrip(); BottomToolbar.toggleFilmStrip();
}; };
UI.toggleChat = function () { UI.toggleChat = function () {
return BottomToolbar.toggleChat(); BottomToolbar.toggleChat();
}; };
UI.toggleContactList = function () { UI.toggleContactList = function () {
return BottomToolbar.toggleContactList(); BottomToolbar.toggleContactList();
}; };
UI.inputDisplayNameHandler = function (value) { UI.inputDisplayNameHandler = function (value) {
@ -617,4 +649,45 @@ UI.updateDTMFSupport = function (isDTMFSupported) {
//Toolbar.showDialPadButton(dtmfSupport); //Toolbar.showDialPadButton(dtmfSupport);
}; };
/**
* Invite participants to conference.
*/
UI.inviteParticipants = function (roomUrl, conferenceName, key, nick) {
let keyText = "";
if (key) {
keyText = APP.translation.translateString(
"email.sharedKey", {sharedKey: key}
);
}
let and = APP.translation.translateString("email.and");
let supportedBrowsers = `Chromium, Google Chrome ${and} Opera`;
let subject = APP.translation.translateString(
"email.subject", {appName:interfaceConfig.APP_NAME, conferenceName}
);
let body = APP.translation.translateString(
"email.body", {
appName:interfaceConfig.APP_NAME,
sharedKeyText: keyText,
roomUrl,
supportedBrowsers
}
);
body = body.replace(/\n/g, "%0D%0A");
if (nick) {
body += "%0D%0A%0D%0A" + nick;
}
if (interfaceConfig.INVITATION_POWERED_BY) {
body += "%0D%0A%0D%0A--%0D%0Apowered by jitsi.org";
}
window.open(`mailto:?subject=${subject}&body=${body}`, '_blank');
};
module.exports = UI; module.exports = UI;

View File

@ -1,4 +1,7 @@
/* global $, APP*/ /* global $, APP*/
/* jshint -W101 */
import messageHandler from '../util/MessageHandler';
var LoginDialog = require('./LoginDialog'); var LoginDialog = require('./LoginDialog');
var Moderator = require('../../xmpp/moderator'); var Moderator = require('../../xmpp/moderator');
@ -10,7 +13,37 @@ var authRetryId = null;
var authenticationWindow = null; var authenticationWindow = null;
var Authentication = { var Authentication = {
openAuthenticationDialog: function (roomName, intervalCallback, callback) { authenticate () {
Authentication.focusAuthenticationWindow();
if (!APP.xmpp.isExternalAuthEnabled()) {
Authentication.xmppAuthenticate();
return;
}
// Get authentication URL
if (!APP.xmpp.isMUCJoined()) {
APP.xmpp.getLoginUrl(APP.conference.roomName, function (url) {
// If conference has not been started yet - redirect to login page
window.location.href = url;
});
} else {
APP.xmpp.getPopupLoginUrl(APP.conference.roomName, function (url) {
// Otherwise - open popup with authentication URL
var authenticationWindow = Authentication.createAuthenticationWindow(
function () {
// On popup closed - retry room allocation
APP.xmpp.allocateConferenceFocus(
APP.conference.roomName,
function () { console.info("AUTH DONE"); }
);
}, url);
if (!authenticationWindow) {
messageHandler.openMessageDialog(null, "dialog.popupError");
}
});
}
},
openAuthenticationDialog (roomName, intervalCallback) {
// This is the loop that will wait for the room to be created by // This is the loop that will wait for the room to be created by
// someone else. 'auth_required.moderator' will bring us back here. // someone else. 'auth_required.moderator' will bring us back here.
authRetryId = window.setTimeout(intervalCallback, 5000); authRetryId = window.setTimeout(intervalCallback, 5000);
@ -32,7 +65,7 @@ var Authentication = {
var buttons = []; var buttons = [];
buttons.push({title: buttonTxt, value: "authNow"}); buttons.push({title: buttonTxt, value: "authNow"});
authDialog = APP.UI.messageHandler.openDialog( authDialog = messageHandler.openDialog(
title, title,
msg, msg,
true, true,
@ -44,19 +77,18 @@ var Authentication = {
// Open login popup // Open login popup
if (submitValue === 'authNow') { if (submitValue === 'authNow') {
callback(); Authentication.authenticate();
} }
} }
); );
}, },
closeAuthenticationWindow: function () { closeAuthenticationWindow () {
if (authenticationWindow) { if (authenticationWindow) {
authenticationWindow.close(); authenticationWindow.close();
authenticationWindow = null; authenticationWindow = null;
} }
}, },
xmppAuthenticate: function () { xmppAuthenticate () {
var loginDialog = LoginDialog.show( var loginDialog = LoginDialog.show(
function (connection, state) { function (connection, state) {
if (!state) { if (!state) {
@ -86,22 +118,22 @@ var Authentication = {
} }
}, true); }, true);
}, },
focusAuthenticationWindow: function () { focusAuthenticationWindow () {
// If auth window exists just bring it to the front // If auth window exists just bring it to the front
if (authenticationWindow) { if (authenticationWindow) {
authenticationWindow.focus(); authenticationWindow.focus();
return; return;
} }
}, },
closeAuthenticationDialog: function () { closeAuthenticationDialog () {
// Close authentication dialog if opened // Close authentication dialog if opened
if (authDialog) { if (authDialog) {
authDialog.close(); authDialog.close();
authDialog = null; authDialog = null;
} }
}, },
createAuthenticationWindow: function (callback, url) { createAuthenticationWindow (callback, url) {
authenticationWindow = APP.UI.messageHandler.openCenteredPopup( authenticationWindow = messageHandler.openCenteredPopup(
url, 910, 660, url, 910, 660,
// On closed // On closed
function () { function () {
@ -112,7 +144,7 @@ var Authentication = {
}); });
return authenticationWindow; return authenticationWindow;
}, },
stopInterval: function () { stopInterval () {
// Clear retry interval, so that we don't call 'doJoinAfterFocus' twice // Clear retry interval, so that we don't call 'doJoinAfterFocus' twice
if (authRetryId) { if (authRetryId) {
window.clearTimeout(authRetryId); window.clearTimeout(authRetryId);

View File

@ -1,9 +1,6 @@
/* global APP, $, config, interfaceConfig */ /* global APP, $, config, interfaceConfig */
/* jshint -W101 */ /* jshint -W101 */
var messageHandler = require("../util/MessageHandler"); var messageHandler = require("../util/MessageHandler");
var BottomToolbar = require("./BottomToolbar");
var PanelToggler = require("../side_pannels/SidePanelToggler");
var Authentication = require("../authentication/Authentication");
var UIUtil = require("../util/UIUtil"); var UIUtil = require("../util/UIUtil");
var AnalyticsAdapter = require("../../statistics/AnalyticsAdapter"); var AnalyticsAdapter = require("../../statistics/AnalyticsAdapter");
var Feedback = require("../Feedback"); var Feedback = require("../Feedback");
@ -13,7 +10,86 @@ var roomUrl = null;
var recordingToaster = null; var recordingToaster = null;
var emitter = null; var emitter = null;
var buttonHandlers = {
/**
* Opens the invite link dialog.
*/
function openLinkDialog () {
var inviteAttributes;
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 = {
"toolbar_button_mute": function () { "toolbar_button_mute": function () {
if (APP.conference.audioMuted) { if (APP.conference.audioMuted) {
AnalyticsAdapter.sendEvent('toolbar.audio.unmuted'); AnalyticsAdapter.sendEvent('toolbar.audio.unmuted');
@ -34,18 +110,18 @@ var buttonHandlers = {
}, },
"toolbar_button_record": function () { "toolbar_button_record": function () {
AnalyticsAdapter.sendEvent('toolbar.recording.toggled'); AnalyticsAdapter.sendEvent('toolbar.recording.toggled');
return toggleRecording(); toggleRecording();
}, },
"toolbar_button_security": function () { "toolbar_button_security": function () {
emitter.emit(UIEvents.ROOM_LOCK_CLICKED); emitter.emit(UIEvents.ROOM_LOCK_CLICKED);
}, },
"toolbar_button_link": function () { "toolbar_button_link": function () {
AnalyticsAdapter.sendEvent('toolbar.invite.clicked'); AnalyticsAdapter.sendEvent('toolbar.invite.clicked');
return Toolbar.openLinkDialog(); openLinkDialog();
}, },
"toolbar_button_chat": function () { "toolbar_button_chat": function () {
AnalyticsAdapter.sendEvent('toolbar.chat.toggled'); AnalyticsAdapter.sendEvent('toolbar.chat.toggled');
return BottomToolbar.toggleChat(); emitter.emit(UIEvents.TOGGLE_CHAT);
}, },
"toolbar_button_prezi": function () { "toolbar_button_prezi": function () {
AnalyticsAdapter.sendEvent('toolbar.prezi.clicked'); AnalyticsAdapter.sendEvent('toolbar.prezi.clicked');
@ -61,32 +137,32 @@ var buttonHandlers = {
} else { } else {
AnalyticsAdapter.sendEvent('toolbar.screen.enabled'); AnalyticsAdapter.sendEvent('toolbar.screen.enabled');
} }
return APP.desktopsharing.toggleScreenSharing(); APP.desktopsharing.toggleScreenSharing();
}, },
"toolbar_button_fullScreen": function() { "toolbar_button_fullScreen": function() {
AnalyticsAdapter.sendEvent('toolbar.fullscreen.enabled'); AnalyticsAdapter.sendEvent('toolbar.fullscreen.enabled');
UIUtil.buttonClick("#toolbar_button_fullScreen", "icon-full-screen icon-exit-full-screen"); UIUtil.buttonClick("#toolbar_button_fullScreen", "icon-full-screen icon-exit-full-screen");
return Toolbar.toggleFullScreen(); emitter.emit(UIEvents.FULLSCREEN_TOGGLE);
}, },
"toolbar_button_sip": function () { "toolbar_button_sip": function () {
AnalyticsAdapter.sendEvent('toolbar.sip.clicked'); AnalyticsAdapter.sendEvent('toolbar.sip.clicked');
return callSipButtonClicked(); callSipButtonClicked();
}, },
"toolbar_button_dialpad": function () { "toolbar_button_dialpad": function () {
AnalyticsAdapter.sendEvent('toolbar.sip.dialpad.clicked'); AnalyticsAdapter.sendEvent('toolbar.sip.dialpad.clicked');
return dialpadButtonClicked(); dialpadButtonClicked();
}, },
"toolbar_button_settings": function () { "toolbar_button_settings": function () {
AnalyticsAdapter.sendEvent('toolbar.settings.toggled'); AnalyticsAdapter.sendEvent('toolbar.settings.toggled');
PanelToggler.toggleSettingsMenu(); emitter.emit(UIEvents.TOGGLE_SETTINGS);
}, },
"toolbar_button_hangup": function () { "toolbar_button_hangup": function () {
AnalyticsAdapter.sendEvent('toolbar.hangup'); AnalyticsAdapter.sendEvent('toolbar.hangup');
return hangup(); hangup();
}, },
"toolbar_button_login": function () { "toolbar_button_login": function () {
AnalyticsAdapter.sendEvent('toolbar.authenticate.login.clicked'); AnalyticsAdapter.sendEvent('toolbar.authenticate.login.clicked');
Toolbar.authenticateClicked(); emitter.emit(UIEvents.AUTH_CLICKED);
}, },
"toolbar_button_logout": function () { "toolbar_button_logout": function () {
AnalyticsAdapter.sendEvent('toolbar.authenticate.logout.clicked'); AnalyticsAdapter.sendEvent('toolbar.authenticate.logout.clicked');
@ -140,8 +216,7 @@ function hangup() {
} }
}; };
if (Feedback.isEnabled()) if (Feedback.isEnabled()) {
{
// If the user has already entered feedback, we'll show the window and // If the user has already entered feedback, we'll show the window and
// immidiately start the conference dispose timeout. // immidiately start the conference dispose timeout.
if (Feedback.feedbackScore > 0) { if (Feedback.feedbackScore > 0) {
@ -158,7 +233,7 @@ function hangup() {
// If the feedback functionality isn't enabled we show a thank you // If the feedback functionality isn't enabled we show a thank you
// dialog. // dialog.
APP.UI.messageHandler.openMessageDialog(null, null, null, messageHandler.openMessageDialog(null, null, null,
APP.translation.translateString("dialog.thankYou", APP.translation.translateString("dialog.thankYou",
{appName:interfaceConfig.APP_NAME})); {appName:interfaceConfig.APP_NAME}));
} }
@ -177,7 +252,7 @@ function toggleRecording(predefinedToken) {
var msg = APP.translation.generateTranslationHTML( var msg = APP.translation.generateTranslationHTML(
"dialog.recordingToken"); "dialog.recordingToken");
var token = APP.translation.translateString("dialog.token"); var token = APP.translation.translateString("dialog.token");
APP.UI.messageHandler.openTwoButtonDialog(null, null, null, messageHandler.openTwoButtonDialog(null, null, null,
'<h2>' + msg + '</h2>' + '<h2>' + msg + '</h2>' +
'<input name="recordingToken" type="text" ' + '<input name="recordingToken" type="text" ' +
' data-i18n="[placeholder]dialog.token" ' + ' data-i18n="[placeholder]dialog.token" ' +
@ -197,7 +272,7 @@ function toggleRecording(predefinedToken) {
function () { }, function () { },
':input:first' ':input:first'
); );
}, Toolbar.setRecordingButtonState); }, setRecordingButtonState);
} }
function dialpadButtonClicked() { function dialpadButtonClicked() {
@ -205,17 +280,16 @@ function dialpadButtonClicked() {
} }
function callSipButtonClicked() { function callSipButtonClicked() {
var defaultNumber let defaultNumber = config.defaultSipNumber
= config.defaultSipNumber ? config.defaultSipNumber : ''; ? config.defaultSipNumber
: '';
var sipMsg = APP.translation.generateTranslationHTML( let sipMsg = APP.translation.generateTranslationHTML("dialog.sipMsg");
"dialog.sipMsg"); messageHandler.openTwoButtonDialog(
messageHandler.openTwoButtonDialog(null, null, null, null, null, null,
'<h2>' + sipMsg + '</h2>' + `<h2>${sipMsg}</h2>
'<input name="sipNumber" type="text"' + <input name="sipNumber" type="text" value="${defaultNumber}" autofocus>`,
' value="' + defaultNumber + '" autofocus>', false, "dialog.Dial",
false,
"dialog.Dial",
function (e, v, m, f) { function (e, v, m, f) {
if (v) { if (v) {
var numberInput = f.sipNumber; var numberInput = f.sipNumber;
@ -228,7 +302,7 @@ function callSipButtonClicked() {
); );
} }
var Toolbar = { const Toolbar = {
init (eventEmitter) { init (eventEmitter) {
emitter = eventEmitter; emitter = eventEmitter;
UIUtil.hideDisabledButtons(defaultToolbarButtons); UIUtil.hideDisabledButtons(defaultToolbarButtons);
@ -237,37 +311,6 @@ var Toolbar = {
$("#" + k).click(buttonHandlers[k]); $("#" + k).click(buttonHandlers[k]);
}, },
authenticateClicked () {
Authentication.focusAuthenticationWindow();
if (!APP.xmpp.isExternalAuthEnabled()) {
Authentication.xmppAuthenticate();
return;
}
// Get authentication URL
if (!APP.xmpp.isMUCJoined()) {
APP.xmpp.getLoginUrl(APP.conference.roomName, function (url) {
// If conference has not been started yet - redirect to login page
window.location.href = url;
});
} else {
APP.xmpp.getPopupLoginUrl(APP.conference.roomName, function (url) {
// Otherwise - open popup with authentication URL
var authenticationWindow = Authentication.createAuthenticationWindow(
function () {
// On popup closed - retry room allocation
APP.xmpp.allocateConferenceFocus(
APP.conference.roomName,
function () { console.info("AUTH DONE"); }
);
}, url);
if (!authenticationWindow) {
messageHandler.openMessageDialog(
null, "dialog.popupError");
}
});
}
},
/** /**
* Updates the room invite url. * Updates the room invite url.
*/ */
@ -293,66 +336,6 @@ var Toolbar = {
} }
}, },
/**
* Opens the invite link dialog.
*/
openLinkDialog () {
var inviteAttributes;
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);
}
}
);
},
/**
* Toggles the application in and out of full screen mode
* (a.k.a. presentation mode in Chrome).
*/
toggleFullScreen () {
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();
}
}
},
/** /**
* Unlocks the lock button state. * Unlocks the lock button state.
*/ */
@ -392,48 +375,6 @@ var Toolbar = {
} }
}, },
// Sets the state of the recording button
setRecordingButtonState (recordingState) {
var selector = $('#toolbar_button_record');
if (recordingState === 'on') {
selector.removeClass("icon-recEnable");
selector.addClass("icon-recEnable active");
$("#largeVideo").toggleClass("videoMessageFilter", true);
var 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);
var recordPendingKey = "recording.pending";
$('#videoConnectionMessage').attr("data-i18n", recordPendingKey);
$('#videoConnectionMessage').text(APP.translation.translateString(recordPendingKey));
$('#videoConnectionMessage').css({display: "block"});
}
},
// checks whether recording is enabled and whether we have params // checks whether recording is enabled and whether we have params
// to start automatically recording // to start automatically recording
checkAutoRecord () { checkAutoRecord () {

View File

@ -1,4 +1,4 @@
var UIEvents = { export default {
NICKNAME_CHANGED: "UI.nickname_changed", NICKNAME_CHANGED: "UI.nickname_changed",
SELECTED_ENDPOINT: "UI.selected_endpoint", SELECTED_ENDPOINT: "UI.selected_endpoint",
PINNED_ENDPOINT: "UI.pinned_endpoint", PINNED_ENDPOINT: "UI.pinned_endpoint",
@ -25,10 +25,13 @@ var UIEvents = {
ETHERPAD_CLICKED: "UI.etherpad_clicked", ETHERPAD_CLICKED: "UI.etherpad_clicked",
ROOM_LOCK_CLICKED: "UI.room_lock_clicked", ROOM_LOCK_CLICKED: "UI.room_lock_clicked",
USER_INVITED: "UI.user_invited", USER_INVITED: "UI.user_invited",
FULLSCREEN_TOGGLE: "UI.fullscreen_toggle",
AUTH_CLICKED: "UI.auth_clicked",
TOGGLE_CHAT: "UI.toggle_chat",
TOGGLE_SETTINGS: "UI.toggle_settings",
/** /**
* Notifies interested parties when the film strip (remote video's panel) * Notifies interested parties when the film strip (remote video's panel)
* is hidden (toggled) or shown (un-toggled). * is hidden (toggled) or shown (un-toggled).
*/ */
FILM_STRIP_TOGGLED: "UI.filmstrip_toggled" FILM_STRIP_TOGGLED: "UI.filmstrip_toggled"
}; };
module.exports = UIEvents;