浏览代码

Fixes issues with accessing modules not from APP object.

master
hristoterezov 10 年前
父节点
当前提交
57fcee676a

+ 1
- 1
index.html 查看文件

@@ -19,7 +19,7 @@
19 19
     <script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
20 20
     <script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
21 21
     <script src="interface_config.js?v=5"></script>
22
-    <script src="libs/app.bundle.js?v=4"></script>
22
+    <script src="libs/app.bundle.js?v=5"></script>
23 23
 
24 24
     <script src="analytics.js?v=1"></script><!-- google analytics plugin -->
25 25
     <link rel="stylesheet" href="css/font.css?v=6"/>

+ 18
- 18
libs/app.bundle.js 查看文件

@@ -20,7 +20,7 @@ var APP =
20 20
 function init() {
21 21
 
22 22
     APP.RTC.start();
23
-    APP.xmpp.start(APP.UI.getCreadentials);
23
+    APP.xmpp.start(APP.UI.getCredentials());
24 24
     APP.statistics.start();
25 25
     APP.connectionquality.init();
26 26
 
@@ -1800,7 +1800,7 @@ UI.connectionIndicatorShowMore = function(id)
1800 1800
     return VideoLayout.connectionIndicators[id].showMore();
1801 1801
 };
1802 1802
 
1803
-UI.getCreadentials = function () {
1803
+UI.getCredentials = function () {
1804 1804
     var settings = this.getSettings();
1805 1805
     return {
1806 1806
         bosh: document.getElementById('boshURL').value,
@@ -2781,7 +2781,7 @@ var Prezi = {
2781 2781
                 "Remove",
2782 2782
                 function(e,v,m,f) {
2783 2783
                     if(v) {
2784
-                        xmpp.removePreziFromPresence();
2784
+                        APP.xmpp.removePreziFromPresence();
2785 2785
                     }
2786 2786
                 }
2787 2787
             );
@@ -2833,7 +2833,7 @@ var Prezi = {
2833 2833
                                         return false;
2834 2834
                                     }
2835 2835
                                     else {
2836
-                                        xmpp.addToPresence("prezi", urlValue);
2836
+                                        APP.xmpp.addToPresence("prezi", urlValue);
2837 2837
                                         $.prompt.close();
2838 2838
                                     }
2839 2839
                                 }
@@ -2891,7 +2891,7 @@ function presentationAdded(event, jid, presUrl, currentSlide) {
2891 2891
     VideoLayout.resizeThumbnails();
2892 2892
 
2893 2893
     var controlsEnabled = false;
2894
-    if (jid === xmpp.myJid())
2894
+    if (jid === APP.xmpp.myJid())
2895 2895
         controlsEnabled = true;
2896 2896
 
2897 2897
     setPresentationVisible(true);
@@ -2931,7 +2931,7 @@ function presentationAdded(event, jid, presUrl, currentSlide) {
2931 2931
     preziPlayer.on(PreziPlayer.EVENT_STATUS, function(event) {
2932 2932
         console.log("prezi status", event.value);
2933 2933
         if (event.value == PreziPlayer.STATUS_CONTENT_READY) {
2934
-            if (jid != xmpp.myJid())
2934
+            if (jid != APP.xmpp.myJid())
2935 2935
                 preziPlayer.flyToStep(currentSlide);
2936 2936
         }
2937 2937
     });
@@ -4386,7 +4386,7 @@ var ContactList = {
4386 4386
 
4387 4387
     onDisplayNameChange: function (peerJid, displayName) {
4388 4388
         if (peerJid === 'localVideoContainer')
4389
-            peerJid = xmpp.myJid();
4389
+            peerJid = APP.xmpp.myJid();
4390 4390
 
4391 4391
         var resourceJid = Strophe.getResourceFromJid(peerJid);
4392 4392
 
@@ -4480,7 +4480,7 @@ var SettingsMenu = {
4480 4480
         var email = Settings.setEmail(newEmail);
4481 4481
 
4482 4482
 
4483
-        Avatar.setUserAvatar(xmpp.myJid(), email);
4483
+        Avatar.setUserAvatar(APP.xmpp.myJid(), email);
4484 4484
     },
4485 4485
 
4486 4486
     isVisible: function() {
@@ -4494,7 +4494,7 @@ var SettingsMenu = {
4494 4494
 
4495 4495
     onDisplayNameChange: function(peerJid, newDisplayName) {
4496 4496
         if(peerJid === 'localVideoContainer' ||
4497
-            peerJid === xmpp.myJid()) {
4497
+            peerJid === APP.xmpp.myJid()) {
4498 4498
             this.setDisplayName(newDisplayName);
4499 4499
         }
4500 4500
     }
@@ -4640,7 +4640,7 @@ function hangup() {
4640 4640
  */
4641 4641
 
4642 4642
 function toggleRecording() {
4643
-    xmpp.toggleRecording(function (callback) {
4643
+    APP.xmpp.toggleRecording(function (callback) {
4644 4644
         APP.UI.messageHandler.openTwoButtonDialog(null,
4645 4645
                 '<h2>Enter recording token</h2>' +
4646 4646
                 '<input id="recordingToken" type="text" ' +
@@ -4673,7 +4673,7 @@ function lockRoom(lock) {
4673 4673
     if (lock)
4674 4674
         currentSharedKey = sharedKey;
4675 4675
 
4676
-    xmpp.lockRoom(currentSharedKey, function (res) {
4676
+    APP.xmpp.lockRoom(currentSharedKey, function (res) {
4677 4677
         // password is required
4678 4678
         if (sharedKey)
4679 4679
         {
@@ -4755,7 +4755,7 @@ function callSipButtonClicked()
4755 4755
             if (v) {
4756 4756
                 var numberInput = document.getElementById('sipNumber');
4757 4757
                 if (numberInput.value) {
4758
-                    xmpp.dial(numberInput.value, 'fromnumber',
4758
+                    APP.xmpp.dial(numberInput.value, 'fromnumber',
4759 4759
                         UI.getRoomName(), sharedKey);
4760 4760
                 }
4761 4761
             }
@@ -12316,7 +12316,7 @@ JingleSession.prototype.notifyMySSRCUpdate = function (old_sdp, new_sdp) {
12316 12316
  * disabled; otherwise, <tt>false</tt>
12317 12317
  */
12318 12318
 JingleSession.prototype.isVideoMute = function () {
12319
-    var tracks = RTC.localVideo.getVideoTracks();
12319
+    var tracks = APP.RTC.localVideo.getVideoTracks();
12320 12320
     var mute = true;
12321 12321
 
12322 12322
     for (var i = 0; i < tracks.length; ++i) {
@@ -12368,7 +12368,7 @@ JingleSession.prototype.setVideoMute = function (mute, callback, options) {
12368 12368
         return callback(mute)
12369 12369
     };
12370 12370
 
12371
-    if (mute == RTC.localVideo.isMuted())
12371
+    if (mute == APP.RTC.localVideo.isMuted())
12372 12372
     {
12373 12373
         // Even if no change occurs, the specified callback is to be executed.
12374 12374
         // The specified callback may, optionally, return a successCallback
@@ -12544,19 +12544,19 @@ function sendKeyframe(pc) {
12544 12544
                         },
12545 12545
                         function (error) {
12546 12546
                             console.log('triggerKeyframe setLocalDescription failed', error);
12547
-                            UI.messageHandler.showError();
12547
+                            APP.UI.messageHandler.showError();
12548 12548
                         }
12549 12549
                     );
12550 12550
                 },
12551 12551
                 function (error) {
12552 12552
                     console.log('triggerKeyframe createAnswer failed', error);
12553
-                    UI.messageHandler.showError();
12553
+                    APP.UI.messageHandler.showError();
12554 12554
                 }
12555 12555
             );
12556 12556
         },
12557 12557
         function (error) {
12558 12558
             console.log('triggerKeyframe setRemoteDescription failed', error);
12559
-            UI.messageHandler.showError();
12559
+            APP.UI.messageHandler.showError();
12560 12560
         }
12561 12561
     );
12562 12562
 }
@@ -15910,7 +15910,7 @@ var XMPP = {
15910 15910
         } else {
15911 15911
             // We are done immediately
15912 15912
             console.error("No conference handler");
15913
-            UI.messageHandler.showError('Error',
15913
+            APP.UI.messageHandler.showError('Error',
15914 15914
                 'Unable to switch video stream.');
15915 15915
             callback();
15916 15916
         }

+ 4
- 4
modules/UI/prezi/Prezi.js 查看文件

@@ -39,7 +39,7 @@ var Prezi = {
39 39
                 "Remove",
40 40
                 function(e,v,m,f) {
41 41
                     if(v) {
42
-                        xmpp.removePreziFromPresence();
42
+                        APP.xmpp.removePreziFromPresence();
43 43
                     }
44 44
                 }
45 45
             );
@@ -91,7 +91,7 @@ var Prezi = {
91 91
                                         return false;
92 92
                                     }
93 93
                                     else {
94
-                                        xmpp.addToPresence("prezi", urlValue);
94
+                                        APP.xmpp.addToPresence("prezi", urlValue);
95 95
                                         $.prompt.close();
96 96
                                     }
97 97
                                 }
@@ -149,7 +149,7 @@ function presentationAdded(event, jid, presUrl, currentSlide) {
149 149
     VideoLayout.resizeThumbnails();
150 150
 
151 151
     var controlsEnabled = false;
152
-    if (jid === xmpp.myJid())
152
+    if (jid === APP.xmpp.myJid())
153 153
         controlsEnabled = true;
154 154
 
155 155
     setPresentationVisible(true);
@@ -189,7 +189,7 @@ function presentationAdded(event, jid, presUrl, currentSlide) {
189 189
     preziPlayer.on(PreziPlayer.EVENT_STATUS, function(event) {
190 190
         console.log("prezi status", event.value);
191 191
         if (event.value == PreziPlayer.STATUS_CONTENT_READY) {
192
-            if (jid != xmpp.myJid())
192
+            if (jid != APP.xmpp.myJid())
193 193
                 preziPlayer.flyToStep(currentSlide);
194 194
         }
195 195
     });

+ 1
- 1
modules/UI/side_pannels/contactlist/ContactList.js 查看文件

@@ -169,7 +169,7 @@ var ContactList = {
169 169
 
170 170
     onDisplayNameChange: function (peerJid, displayName) {
171 171
         if (peerJid === 'localVideoContainer')
172
-            peerJid = xmpp.myJid();
172
+            peerJid = APP.xmpp.myJid();
173 173
 
174 174
         var resourceJid = Strophe.getResourceFromJid(peerJid);
175 175
 

+ 2
- 2
modules/UI/side_pannels/settings/SettingsMenu.js 查看文件

@@ -19,7 +19,7 @@ var SettingsMenu = {
19 19
         var email = Settings.setEmail(newEmail);
20 20
 
21 21
 
22
-        Avatar.setUserAvatar(xmpp.myJid(), email);
22
+        Avatar.setUserAvatar(APP.xmpp.myJid(), email);
23 23
     },
24 24
 
25 25
     isVisible: function() {
@@ -33,7 +33,7 @@ var SettingsMenu = {
33 33
 
34 34
     onDisplayNameChange: function(peerJid, newDisplayName) {
35 35
         if(peerJid === 'localVideoContainer' ||
36
-            peerJid === xmpp.myJid()) {
36
+            peerJid === APP.xmpp.myJid()) {
37 37
             this.setDisplayName(newDisplayName);
38 38
         }
39 39
     }

+ 3
- 3
modules/UI/toolbars/Toolbar.js 查看文件

@@ -90,7 +90,7 @@ function hangup() {
90 90
  */
91 91
 
92 92
 function toggleRecording() {
93
-    xmpp.toggleRecording(function (callback) {
93
+    APP.xmpp.toggleRecording(function (callback) {
94 94
         APP.UI.messageHandler.openTwoButtonDialog(null,
95 95
                 '<h2>Enter recording token</h2>' +
96 96
                 '<input id="recordingToken" type="text" ' +
@@ -123,7 +123,7 @@ function lockRoom(lock) {
123 123
     if (lock)
124 124
         currentSharedKey = sharedKey;
125 125
 
126
-    xmpp.lockRoom(currentSharedKey, function (res) {
126
+    APP.xmpp.lockRoom(currentSharedKey, function (res) {
127 127
         // password is required
128 128
         if (sharedKey)
129 129
         {
@@ -205,7 +205,7 @@ function callSipButtonClicked()
205 205
             if (v) {
206 206
                 var numberInput = document.getElementById('sipNumber');
207 207
                 if (numberInput.value) {
208
-                    xmpp.dial(numberInput.value, 'fromnumber',
208
+                    APP.xmpp.dial(numberInput.value, 'fromnumber',
209 209
                         UI.getRoomName(), sharedKey);
210 210
                 }
211 211
             }

+ 5
- 5
modules/xmpp/JingleSession.js 查看文件

@@ -1064,7 +1064,7 @@ JingleSession.prototype.notifyMySSRCUpdate = function (old_sdp, new_sdp) {
1064 1064
  * disabled; otherwise, <tt>false</tt>
1065 1065
  */
1066 1066
 JingleSession.prototype.isVideoMute = function () {
1067
-    var tracks = RTC.localVideo.getVideoTracks();
1067
+    var tracks = APP.RTC.localVideo.getVideoTracks();
1068 1068
     var mute = true;
1069 1069
 
1070 1070
     for (var i = 0; i < tracks.length; ++i) {
@@ -1116,7 +1116,7 @@ JingleSession.prototype.setVideoMute = function (mute, callback, options) {
1116 1116
         return callback(mute)
1117 1117
     };
1118 1118
 
1119
-    if (mute == RTC.localVideo.isMuted())
1119
+    if (mute == APP.RTC.localVideo.isMuted())
1120 1120
     {
1121 1121
         // Even if no change occurs, the specified callback is to be executed.
1122 1122
         // The specified callback may, optionally, return a successCallback
@@ -1292,19 +1292,19 @@ function sendKeyframe(pc) {
1292 1292
                         },
1293 1293
                         function (error) {
1294 1294
                             console.log('triggerKeyframe setLocalDescription failed', error);
1295
-                            UI.messageHandler.showError();
1295
+                            APP.UI.messageHandler.showError();
1296 1296
                         }
1297 1297
                     );
1298 1298
                 },
1299 1299
                 function (error) {
1300 1300
                     console.log('triggerKeyframe createAnswer failed', error);
1301
-                    UI.messageHandler.showError();
1301
+                    APP.UI.messageHandler.showError();
1302 1302
                 }
1303 1303
             );
1304 1304
         },
1305 1305
         function (error) {
1306 1306
             console.log('triggerKeyframe setRemoteDescription failed', error);
1307
-            UI.messageHandler.showError();
1307
+            APP.UI.messageHandler.showError();
1308 1308
         }
1309 1309
     );
1310 1310
 }

+ 1
- 1
modules/xmpp/xmpp.js 查看文件

@@ -246,7 +246,7 @@ var XMPP = {
246 246
         } else {
247 247
             // We are done immediately
248 248
             console.error("No conference handler");
249
-            UI.messageHandler.showError('Error',
249
+            APP.UI.messageHandler.showError('Error',
250 250
                 'Unable to switch video stream.');
251 251
             callback();
252 252
         }

正在加载...
取消
保存