浏览代码

Improves password required interface and disables the padlock for participants.

master
Yana Stamcheva 11 年前
父节点
当前提交
76641cf389
共有 1 个文件被更改,包括 25 次插入0 次删除
  1. 25
    0
      app.js

+ 25
- 0
app.js 查看文件

317
         //console.log(jid, 'assoc ssrc', ssrc.getAttribute('type'), ssrc.getAttribute('ssrc'));
317
         //console.log(jid, 'assoc ssrc', ssrc.getAttribute('type'), ssrc.getAttribute('ssrc'));
318
         ssrc2jid[ssrc.getAttribute('ssrc')] = jid;
318
         ssrc2jid[ssrc.getAttribute('ssrc')] = jid;
319
     });
319
     });
320
+$(document).bind('passwordrequired.muc', function (event, jid) {
321
+    console.log('on password required', jid);
322
+
323
+    $.prompt('<h2>Password required</h2>' +
324
+            '<input id="lockKey" type="text" placeholder="shared key" autofocus>',
325
+             {
326
+                persistent: true,
327
+                buttons: { "Ok": true , "Cancel": false},
328
+                defaultButton: 1,
329
+                loaded: function(event) {
330
+                    document.getElementById('lockKey').focus();
331
+                },
332
+                submit: function(e,v,m,f){
333
+                    if(v)
334
+                    {
335
+                        var lockKey = document.getElementById('lockKey');
336
+
337
+                        if (lockKey.value != null)
338
+                        {
339
+                            setSharedKey(lockKey);
340
+                            connection.emuc.doJoin(jid, lockKey.value);
341
+                        }
342
+                    }
343
+                }
344
+            });
320
 });
345
 });
321
 
346
 
322
 function toggleVideo() {
347
 function toggleVideo() {

正在加载...
取消
保存