浏览代码

Removes unused connection settings form.

j8
paweldomas 10 年前
父节点
当前提交
f48633fa1d
共有 5 个文件被更改,包括 7 次插入54 次删除
  1. 1
    1
      app.js
  2. 0
    4
      css/main.css
  3. 0
    9
      index.html
  4. 0
    16
      modules/UI/UI.js
  5. 6
    24
      modules/xmpp/xmpp.js

+ 1
- 1
app.js 查看文件

@@ -21,7 +21,7 @@ var APP =
21 21
 function init() {
22 22
 
23 23
     APP.RTC.start();
24
-    APP.xmpp.start(APP.UI.getCredentials());
24
+    APP.xmpp.start();
25 25
     APP.statistics.start();
26 26
     APP.connectionquality.init();
27 27
 

+ 0
- 4
css/main.css 查看文件

@@ -29,10 +29,6 @@ html, body{
29 29
     z-index: 5;
30 30
 }
31 31
 
32
-#settings {
33
-    display:none;
34
-}
35
-
36 32
 #nowebrtc {
37 33
     display:none;
38 34
 }

+ 0
- 9
index.html 查看文件

@@ -211,15 +211,6 @@
211 211
             </div>
212 212
             <div id="subject"></div>
213 213
         </div>
214
-        <div id="settings">
215
-          <h1 data-i18n="connectionsettings"></h1>
216
-          <form id="loginInfo">
217
-            <label>JID: <input id="jid" type="text" name="jid" placeholder="me@example.com"/></label>
218
-            <label>Password: <input id="password" type="password" name="password" placeholder="secret"/></label>
219
-            <label>BOSH URL: <input id="boshURL" type="text" name="boshURL" placeholder="/http-bind"/></label>
220
-            <input id="connect" type="submit" value="Connect" />
221
-          </form>
222
-        </div>
223 214
         <div id="reloadPresentation"><a id="reloadPresentationLink"><i title="Reload Prezi" class="fa fa-repeat fa-lg"></i></a></div>
224 215
         <div id="videospace">
225 216
             <div id="largeVideoContainer" class="videocontainer">

+ 0
- 16
modules/UI/UI.js 查看文件

@@ -626,22 +626,6 @@ UI.connectionIndicatorShowMore = function(id)
626 626
     return VideoLayout.connectionIndicators[id].showMore();
627 627
 };
628 628
 
629
-UI.getCredentials = function () {
630
-    var settings = this.getSettings();
631
-    return {
632
-        bosh: document.getElementById('boshURL').value,
633
-        password: document.getElementById('password').value,
634
-        jid: document.getElementById('jid').value,
635
-        email: settings.email,
636
-        displayName: settings.displayName,
637
-        uid: settings.uid
638
-    };
639
-};
640
-
641
-UI.disableConnect = function () {
642
-    document.getElementById('connect').disabled = true;
643
-};
644
-
645 629
 UI.showLoginPopup = function(callback)
646 630
 {
647 631
     console.log('password is required');

+ 6
- 24
modules/xmpp/xmpp.js 查看文件

@@ -1,3 +1,4 @@
1
+/* global $, APP, config, Strophe*/
1 2
 var Moderator = require("./moderator");
2 3
 var EventEmitter = require("events");
3 4
 var Recording = require("./recording");
@@ -11,26 +12,11 @@ var eventEmitter = new EventEmitter();
11 12
 var connection = null;
12 13
 var authenticatedUser = false;
13 14
 
14
-function connect(jid, password, uiCredentials) {
15
-    var bosh
16
-        = (uiCredentials && uiCredentials.bosh? uiCredentials.bosh : null)
17
-        || config.bosh || '/http-bind';
15
+function connect(jid, password) {
16
+    var bosh = config.bosh || '/http-bind';
18 17
     connection = new Strophe.Connection(bosh);
19 18
     Moderator.setConnection(connection);
20 19
 
21
-    if(uiCredentials) {
22
-        var email = uiCredentials.email;
23
-        var displayName = uiCredentials.displayName;
24
-        if (email) {
25
-            connection.emuc.addEmailToPresence(email);
26
-        } else {
27
-            connection.emuc.addUserIdToPresence(uiCredentials.uid);
28
-        }
29
-        if (displayName) {
30
-            connection.emuc.addDisplayNameToPresence(displayName);
31
-        }
32
-    }
33
-
34 20
     if (connection.disco) {
35 21
         // for chrome, add multistream cap
36 22
     }
@@ -42,9 +28,6 @@ function connect(jid, password, uiCredentials) {
42 28
         connection.jingle.pc_constraints.optional.push({googIPv6: true});
43 29
     }
44 30
 
45
-    if(!password)
46
-        password = uiCredentials.password;
47
-
48 31
     var anonymousConnectionFailed = false;
49 32
     connection.connect(jid, password, function (status, msg) {
50 33
         console.log('Strophe status changed to',
@@ -53,7 +36,6 @@ function connect(jid, password, uiCredentials) {
53 36
             if (config.useStunTurn) {
54 37
                 connection.jingle.getStunAndTurnCredentials();
55 38
             }
56
-            APP.UI.disableConnect();
57 39
 
58 40
             console.info("My Jabber ID: " + connection.jid);
59 41
 
@@ -150,7 +132,7 @@ var XMPP = {
150 132
      * @type {boolean}
151 133
      */
152 134
     forceMuted: false,
153
-    start: function (uiCredentials) {
135
+    start: function () {
154 136
         setupEvents();
155 137
         initStrophePlugins();
156 138
         registerListeners();
@@ -161,8 +143,8 @@ var XMPP = {
161 143
             window.location.search.indexOf("login=true") !== -1) {
162 144
             configDomain = config.hosts.domain;
163 145
         }
164
-        var jid = uiCredentials.jid || configDomain || window.location.hostname;
165
-        connect(jid, null, uiCredentials);
146
+        var jid = configDomain || window.location.hostname;
147
+        connect(jid, null);
166 148
     },
167 149
     promptLogin: function () {
168 150
         APP.UI.showLoginPopup(connect);

正在加载...
取消
保存