Przeglądaj źródła

Changes the padlock to locked when a participant is entering a locked room and still haven't entered the key. We show padlock locked whenever the room requires a key to enter.

master
Damian Minkov 10 lat temu
rodzic
commit
de04bb8ef1
2 zmienionych plików z 10 dodań i 3 usunięć
  1. 3
    3
      app.js
  2. 7
    0
      toolbar.js

+ 3
- 3
app.js Wyświetl plik

719
             focus.addNewParticipant(jid);
719
             focus.addNewParticipant(jid);
720
         }
720
         }
721
     }
721
     }
722
-    else if (sharedKey) {
723
-        Toolbar.updateLockButton();
724
-    }
725
 });
722
 });
726
 
723
 
727
 $(document).bind('left.muc', function (event, jid) {
724
 $(document).bind('left.muc', function (event, jid) {
860
 $(document).bind('passwordrequired.muc', function (event, jid) {
857
 $(document).bind('passwordrequired.muc', function (event, jid) {
861
     console.log('on password required', jid);
858
     console.log('on password required', jid);
862
 
859
 
860
+    // password is required
861
+    Toolbar.lockLockButton();
862
+
863
     messageHandler.openTwoButtonDialog(null,
863
     messageHandler.openTwoButtonDialog(null,
864
         '<h2>Password required</h2>' +
864
         '<h2>Password required</h2>' +
865
         '<input id="lockKey" type="text" placeholder="password" autofocus>',
865
         '<input id="lockKey" type="text" placeholder="password" autofocus>',

+ 7
- 0
toolbar.js Wyświetl plik

209
     my.updateLockButton = function() {
209
     my.updateLockButton = function() {
210
         buttonClick("#lockIcon", "icon-security icon-security-locked");
210
         buttonClick("#lockIcon", "icon-security icon-security-locked");
211
     };
211
     };
212
+    /**
213
+     * Updates the lock button state to locked.
214
+     */
215
+    my.lockLockButton = function() {
216
+        if($("#lockIcon").hasClass("icon-security"))
217
+            buttonClick("#lockIcon", "icon-security icon-security-locked");
218
+    };
212
 
219
 
213
     // Shows or hides the 'recording' button.
220
     // Shows or hides the 'recording' button.
214
     my.showRecordingButton = function (show) {
221
     my.showRecordingButton = function (show) {

Ładowanie…
Anuluj
Zapisz