소스 검색

add "authentication required" dialog

j8
isymchych 9 년 전
부모
커밋
28e5bf4bec
1개의 변경된 파일31개의 추가작업 그리고 0개의 파일을 삭제
  1. 31
    0
      modules/UI/authentication/LoginDialog.js

+ 31
- 0
modules/UI/authentication/LoginDialog.js 파일 보기

136
         }
136
         }
137
 
137
 
138
         return dialog;
138
         return dialog;
139
+    },
140
+
141
+    showAuthRequiredDialog: function (roomName, onAuthNow) {
142
+        var title = APP.translation.generateTranslationHTML(
143
+            "dialog.WaitingForHost"
144
+        );
145
+        var msg = APP.translation.generateTranslationHTML(
146
+            "dialog.WaitForHostMsg", {room: roomName}
147
+        );
148
+
149
+        var buttonTxt = APP.translation.generateTranslationHTML(
150
+            "dialog.IamHost"
151
+        );
152
+        var buttons = [{title: buttonTxt, value: "authNow"}];
153
+
154
+        return APP.UI.messageHandler.openDialog(
155
+            title,
156
+            msg,
157
+            true,
158
+            buttons,
159
+            function (onSubmitEvent, submitValue) {
160
+
161
+                // Do not close the dialog yet
162
+                onSubmitEvent.preventDefault();
163
+
164
+                // Open login popup
165
+                if (submitValue === 'authNow') {
166
+                    onAuthNow();
167
+                }
168
+            }
169
+        );
139
     }
170
     }
140
 };
171
 };
141
 
172
 

Loading…
취소
저장