You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AskForPassword.js 976B

12345678910111213141516171819202122232425262728293031
  1. /* global APP, $ */
  2. import UIUtil from '../util/UIUtil';
  3. /**
  4. * Show dialog which asks for required conference password.
  5. * @returns {Promise<string>} password or nothing if user canceled
  6. */
  7. export default function askForPassword () {
  8. let titleKey = "dialog.passwordRequired";
  9. let msgString = `
  10. <input name="lockKey" type="text"
  11. data-i18n="[placeholder]dialog.password"
  12. autofocus>`;
  13. return new Promise(function (resolve, reject) {
  14. APP.UI.messageHandler.openTwoButtonDialog({
  15. titleKey,
  16. msgString,
  17. leftButtonKey: "dialog.Ok",
  18. submitFunction: $.noop,
  19. closeFunction: function (e, v, m, f) {
  20. if (v && f.lockKey) {
  21. resolve(UIUtil.escapeHtml(f.lockKey));
  22. } else {
  23. reject(APP.UI.messageHandler.CANCEL);
  24. }
  25. },
  26. focus: ':input:first'
  27. });
  28. });
  29. }