diff --git a/modules/UI/authentication/LoginDialog.js b/modules/UI/authentication/LoginDialog.js index a6b39a3b6..d08d0ecb5 100644 --- a/modules/UI/authentication/LoginDialog.js +++ b/modules/UI/authentication/LoginDialog.js @@ -136,6 +136,37 @@ var LoginDialog = { } return dialog; + }, + + showAuthRequiredDialog: function (roomName, onAuthNow) { + var title = APP.translation.generateTranslationHTML( + "dialog.WaitingForHost" + ); + var msg = APP.translation.generateTranslationHTML( + "dialog.WaitForHostMsg", {room: roomName} + ); + + var buttonTxt = APP.translation.generateTranslationHTML( + "dialog.IamHost" + ); + var buttons = [{title: buttonTxt, value: "authNow"}]; + + return APP.UI.messageHandler.openDialog( + title, + msg, + true, + buttons, + function (onSubmitEvent, submitValue) { + + // Do not close the dialog yet + onSubmitEvent.preventDefault(); + + // Open login popup + if (submitValue === 'authNow') { + onAuthNow(); + } + } + ); } };