浏览代码

Fixes issues with accessing modules not from APP object.

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

+ 1
- 1
index.html 查看文件

19
     <script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
19
     <script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
20
     <script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
20
     <script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
21
     <script src="interface_config.js?v=5"></script>
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
     <script src="analytics.js?v=1"></script><!-- google analytics plugin -->
24
     <script src="analytics.js?v=1"></script><!-- google analytics plugin -->
25
     <link rel="stylesheet" href="css/font.css?v=6"/>
25
     <link rel="stylesheet" href="css/font.css?v=6"/>

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

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

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

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

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

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

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

19
         var email = Settings.setEmail(newEmail);
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
     isVisible: function() {
25
     isVisible: function() {
33
 
33
 
34
     onDisplayNameChange: function(peerJid, newDisplayName) {
34
     onDisplayNameChange: function(peerJid, newDisplayName) {
35
         if(peerJid === 'localVideoContainer' ||
35
         if(peerJid === 'localVideoContainer' ||
36
-            peerJid === xmpp.myJid()) {
36
+            peerJid === APP.xmpp.myJid()) {
37
             this.setDisplayName(newDisplayName);
37
             this.setDisplayName(newDisplayName);
38
         }
38
         }
39
     }
39
     }

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

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

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

1064
  * disabled; otherwise, <tt>false</tt>
1064
  * disabled; otherwise, <tt>false</tt>
1065
  */
1065
  */
1066
 JingleSession.prototype.isVideoMute = function () {
1066
 JingleSession.prototype.isVideoMute = function () {
1067
-    var tracks = RTC.localVideo.getVideoTracks();
1067
+    var tracks = APP.RTC.localVideo.getVideoTracks();
1068
     var mute = true;
1068
     var mute = true;
1069
 
1069
 
1070
     for (var i = 0; i < tracks.length; ++i) {
1070
     for (var i = 0; i < tracks.length; ++i) {
1116
         return callback(mute)
1116
         return callback(mute)
1117
     };
1117
     };
1118
 
1118
 
1119
-    if (mute == RTC.localVideo.isMuted())
1119
+    if (mute == APP.RTC.localVideo.isMuted())
1120
     {
1120
     {
1121
         // Even if no change occurs, the specified callback is to be executed.
1121
         // Even if no change occurs, the specified callback is to be executed.
1122
         // The specified callback may, optionally, return a successCallback
1122
         // The specified callback may, optionally, return a successCallback
1292
                         },
1292
                         },
1293
                         function (error) {
1293
                         function (error) {
1294
                             console.log('triggerKeyframe setLocalDescription failed', error);
1294
                             console.log('triggerKeyframe setLocalDescription failed', error);
1295
-                            UI.messageHandler.showError();
1295
+                            APP.UI.messageHandler.showError();
1296
                         }
1296
                         }
1297
                     );
1297
                     );
1298
                 },
1298
                 },
1299
                 function (error) {
1299
                 function (error) {
1300
                     console.log('triggerKeyframe createAnswer failed', error);
1300
                     console.log('triggerKeyframe createAnswer failed', error);
1301
-                    UI.messageHandler.showError();
1301
+                    APP.UI.messageHandler.showError();
1302
                 }
1302
                 }
1303
             );
1303
             );
1304
         },
1304
         },
1305
         function (error) {
1305
         function (error) {
1306
             console.log('triggerKeyframe setRemoteDescription failed', error);
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
         } else {
246
         } else {
247
             // We are done immediately
247
             // We are done immediately
248
             console.error("No conference handler");
248
             console.error("No conference handler");
249
-            UI.messageHandler.showError('Error',
249
+            APP.UI.messageHandler.showError('Error',
250
                 'Unable to switch video stream.');
250
                 'Unable to switch video stream.');
251
             callback();
251
             callback();
252
         }
252
         }

正在加载...
取消
保存