diff --git a/modules/UI/Feedback.js b/modules/UI/Feedback.js index 5fca4464e..3b8eb3bab 100644 --- a/modules/UI/Feedback.js +++ b/modules/UI/Feedback.js @@ -1,11 +1,6 @@ /* global $, APP, config, interfaceConfig */ import UIEvents from "../../service/UI/UIEvents"; -/* - * Created by Yana Stamcheva on 2/10/15. - */ -var messageHandler = require("./util/MessageHandler"); - /** * Constructs the html for the overall feedback window. * diff --git a/modules/UI/UI.js b/modules/UI/UI.js index 8b50f3041..7f3d6a788 100644 --- a/modules/UI/UI.js +++ b/modules/UI/UI.js @@ -430,7 +430,7 @@ UI.start = function () { $("#downloadlog").css("display", "none"); BottomToolbar.hide(); FilmStrip.setupFilmStripOnly(); - messageHandler.disableNotifications(); + messageHandler.enableNotifications(false); $('body').popover("disable"); JitsiPopover.enabled = false; } diff --git a/modules/UI/authentication/LoginDialog.js b/modules/UI/authentication/LoginDialog.js index 30488cb0a..124269524 100644 --- a/modules/UI/authentication/LoginDialog.js +++ b/modules/UI/authentication/LoginDialog.js @@ -1,7 +1,5 @@ /* global $, APP, config*/ -var messageHandler = require('../util/MessageHandler'); - /** * Build html for "password required" dialog. * @returns {string} html string @@ -123,7 +121,7 @@ function LoginDialog(successCallback, cancelCallback) { } }; - var connDialog = messageHandler.openDialogWithStates( + var connDialog = APP.UI.messageHandler.openDialogWithStates( states, { persistent: true, closeText: '' }, null ); @@ -182,14 +180,14 @@ export default { * @returns auth dialog */ showExternalAuthDialog: function (url, callback) { - var dialog = messageHandler.openCenteredPopup( + var dialog = APP.UI.messageHandler.openCenteredPopup( url, 910, 660, // On closed callback ); if (!dialog) { - messageHandler.openMessageDialog(null, "dialog.popupError"); + APP.UI.messageHandler.openMessageDialog(null, "dialog.popupError"); } return dialog; diff --git a/modules/UI/authentication/RoomLocker.js b/modules/UI/authentication/RoomLocker.js index 703cba4e5..09e29a31b 100644 --- a/modules/UI/authentication/RoomLocker.js +++ b/modules/UI/authentication/RoomLocker.js @@ -1,5 +1,4 @@ /* global APP, JitsiMeetJS */ -import messageHandler from '../util/MessageHandler'; import UIUtil from '../util/UIUtil'; //FIXME: import AnalyticsAdapter from '../../statistics/AnalyticsAdapter'; @@ -19,7 +18,7 @@ function askForNewPassword () { `; return new Promise(function (resolve, reject) { - messageHandler.openTwoButtonDialog( + APP.UI.messageHandler.openTwoButtonDialog( null, null, null, msg, false, "dialog.Save", function (e, v, m, f) { @@ -27,7 +26,7 @@ function askForNewPassword () { resolve(UIUtil.escapeHtml(f.lockKey)); } else { - reject(messageHandler.CANCEL); + reject(APP.UI.messageHandler.CANCEL); } }, null, null, 'input:first' @@ -51,7 +50,7 @@ function askForPassword () { placeholder="${passMsg}" autofocus> `; return new Promise(function (resolve, reject) { - messageHandler.openTwoButtonDialog( + APP.UI.messageHandler.openTwoButtonDialog( null, null, null, msg, true, "dialog.Ok", function (e, v, m, f) {}, null, @@ -59,7 +58,7 @@ function askForPassword () { if (v && f.lockKey) { resolve(UIUtil.escapeHtml(f.lockKey)); } else { - reject(messageHandler.CANCEL); + reject(APP.UI.messageHandler.CANCEL); } }, ':input:first' @@ -73,14 +72,14 @@ function askForPassword () { */ function askToUnlock () { return new Promise(function (resolve, reject) { - messageHandler.openTwoButtonDialog( + APP.UI.messageHandler.openTwoButtonDialog( null, null, "dialog.passwordCheck", null, false, "dialog.Remove", function (e, v) { if (v) { resolve(); } else { - reject(messageHandler.CANCEL); + reject(APP.UI.messageHandler.CANCEL); } } ); @@ -93,7 +92,8 @@ function askToUnlock () { */ function notifyPasswordNotSupported () { console.warn('room passwords not supported'); - messageHandler.showError("dialog.warning", "dialog.passwordNotSupported"); + APP.UI.messageHandler.showError( + "dialog.warning", "dialog.passwordNotSupported"); } /** @@ -102,7 +102,8 @@ function notifyPasswordNotSupported () { */ function notifyPasswordFailed(err) { console.warn('setting password failed', err); - messageHandler.showError("dialog.lockTitle", "dialog.lockMessage"); + APP.UI.messageHandler.showError( + "dialog.lockTitle", "dialog.lockMessage"); } const ConferenceErrors = JitsiMeetJS.errors.conference; @@ -153,7 +154,7 @@ export default function createRoomLocker (room) { AnalyticsAdapter.sendEvent('toolbar.lock.disabled'); }).catch( reason => { - if (reason !== messageHandler.CANCEL) + if (reason !== APP.UI.messageHandler.CANCEL) console.error(reason); } ); @@ -171,7 +172,7 @@ export default function createRoomLocker (room) { AnalyticsAdapter.sendEvent('toolbar.lock.enabled'); }).catch( reason => { - if (reason !== messageHandler.CANCEL) + if (reason !== APP.UI.messageHandler.CANCEL) console.error(reason); } ); @@ -185,7 +186,7 @@ export default function createRoomLocker (room) { newPass => { password = newPass; } ).catch( reason => { - if (reason !== messageHandler.CANCEL) + if (reason !== APP.UI.messageHandler.CANCEL) console.error(reason); } ); @@ -196,9 +197,11 @@ export default function createRoomLocker (room) { */ notifyModeratorRequired () { if (password) { - messageHandler.openMessageDialog(null, "dialog.passwordError"); + APP.UI.messageHandler + .openMessageDialog(null, "dialog.passwordError"); } else { - messageHandler.openMessageDialog(null, "dialog.passwordError2"); + APP.UI.messageHandler + .openMessageDialog(null, "dialog.passwordError2"); } } }; diff --git a/modules/UI/recording/Recording.js b/modules/UI/recording/Recording.js index 8929d1be7..261687ff4 100644 --- a/modules/UI/recording/Recording.js +++ b/modules/UI/recording/Recording.js @@ -236,6 +236,8 @@ var Recording = { Feedback.enableFeedback(false); Toolbar.enable(false); BottomToolbar.enable(false); + APP.UI.messageHandler.enableNotifications(false); + APP.UI.messageHandler.enablePopups(false); } }, diff --git a/modules/UI/shared_video/SharedVideo.js b/modules/UI/shared_video/SharedVideo.js index ad4984ecc..827334718 100644 --- a/modules/UI/shared_video/SharedVideo.js +++ b/modules/UI/shared_video/SharedVideo.js @@ -1,6 +1,5 @@ /* global $, APP, YT, onPlayerReady, onPlayerStateChange, onPlayerError */ -import messageHandler from '../util/MessageHandler'; import UIUtil from '../util/UIUtil'; import UIEvents from '../../../service/UI/UIEvents'; @@ -71,7 +70,7 @@ export default class SharedVideoManager { this.emitter.emit( UIEvents.UPDATE_SHARED_VIDEO, this.url, 'stop')); } else { - messageHandler.openMessageDialog( + APP.UI.messageHandler.openMessageDialog( "dialog.shareVideoTitle", "dialog.alreadySharedVideoMsg" ); @@ -701,7 +700,7 @@ function getYoutubeLink(url) { */ function showStopVideoPropmpt() { return new Promise(function (resolve, reject) { - messageHandler.openTwoButtonDialog( + APP.UI.messageHandler.openTwoButtonDialog( "dialog.removeSharedVideoTitle", null, "dialog.removeSharedVideoMsg", @@ -736,7 +735,7 @@ function requestVideoLink() { const defaultUrl = i18n.translateString("defaultLink", i18nOptions); return new Promise(function (resolve, reject) { - let dialog = messageHandler.openDialogWithStates({ + let dialog = APP.UI.messageHandler.openDialogWithStates({ state0: { html: `