From 57fcee676ae8ccc68cf3a45f22e05d68ee9f5e8f Mon Sep 17 00:00:00 2001 From: hristoterezov Date: Fri, 6 Feb 2015 14:54:19 +0200 Subject: [PATCH] Fixes issues with accessing modules not from APP object. --- index.html | 2 +- libs/app.bundle.js | 36 +++++++++---------- modules/UI/prezi/Prezi.js | 8 ++--- .../side_pannels/contactlist/ContactList.js | 2 +- .../UI/side_pannels/settings/SettingsMenu.js | 4 +-- modules/UI/toolbars/Toolbar.js | 6 ++-- modules/xmpp/JingleSession.js | 10 +++--- modules/xmpp/xmpp.js | 2 +- 8 files changed, 35 insertions(+), 35 deletions(-) diff --git a/index.html b/index.html index a000f3981..e27b512b3 100644 --- a/index.html +++ b/index.html @@ -19,7 +19,7 @@ - + diff --git a/libs/app.bundle.js b/libs/app.bundle.js index cff90c2a6..00b374419 100644 --- a/libs/app.bundle.js +++ b/libs/app.bundle.js @@ -20,7 +20,7 @@ var APP = function init() { APP.RTC.start(); - APP.xmpp.start(APP.UI.getCreadentials); + APP.xmpp.start(APP.UI.getCredentials()); APP.statistics.start(); APP.connectionquality.init(); @@ -1800,7 +1800,7 @@ UI.connectionIndicatorShowMore = function(id) return VideoLayout.connectionIndicators[id].showMore(); }; -UI.getCreadentials = function () { +UI.getCredentials = function () { var settings = this.getSettings(); return { bosh: document.getElementById('boshURL').value, @@ -2781,7 +2781,7 @@ var Prezi = { "Remove", function(e,v,m,f) { if(v) { - xmpp.removePreziFromPresence(); + APP.xmpp.removePreziFromPresence(); } } ); @@ -2833,7 +2833,7 @@ var Prezi = { return false; } else { - xmpp.addToPresence("prezi", urlValue); + APP.xmpp.addToPresence("prezi", urlValue); $.prompt.close(); } } @@ -2891,7 +2891,7 @@ function presentationAdded(event, jid, presUrl, currentSlide) { VideoLayout.resizeThumbnails(); var controlsEnabled = false; - if (jid === xmpp.myJid()) + if (jid === APP.xmpp.myJid()) controlsEnabled = true; setPresentationVisible(true); @@ -2931,7 +2931,7 @@ function presentationAdded(event, jid, presUrl, currentSlide) { preziPlayer.on(PreziPlayer.EVENT_STATUS, function(event) { console.log("prezi status", event.value); if (event.value == PreziPlayer.STATUS_CONTENT_READY) { - if (jid != xmpp.myJid()) + if (jid != APP.xmpp.myJid()) preziPlayer.flyToStep(currentSlide); } }); @@ -4386,7 +4386,7 @@ var ContactList = { onDisplayNameChange: function (peerJid, displayName) { if (peerJid === 'localVideoContainer') - peerJid = xmpp.myJid(); + peerJid = APP.xmpp.myJid(); var resourceJid = Strophe.getResourceFromJid(peerJid); @@ -4480,7 +4480,7 @@ var SettingsMenu = { var email = Settings.setEmail(newEmail); - Avatar.setUserAvatar(xmpp.myJid(), email); + Avatar.setUserAvatar(APP.xmpp.myJid(), email); }, isVisible: function() { @@ -4494,7 +4494,7 @@ var SettingsMenu = { onDisplayNameChange: function(peerJid, newDisplayName) { if(peerJid === 'localVideoContainer' || - peerJid === xmpp.myJid()) { + peerJid === APP.xmpp.myJid()) { this.setDisplayName(newDisplayName); } } @@ -4640,7 +4640,7 @@ function hangup() { */ function toggleRecording() { - xmpp.toggleRecording(function (callback) { + APP.xmpp.toggleRecording(function (callback) { APP.UI.messageHandler.openTwoButtonDialog(null, '

Enter recording token

' + 'false */ JingleSession.prototype.isVideoMute = function () { - var tracks = RTC.localVideo.getVideoTracks(); + var tracks = APP.RTC.localVideo.getVideoTracks(); var mute = true; for (var i = 0; i < tracks.length; ++i) { @@ -12368,7 +12368,7 @@ JingleSession.prototype.setVideoMute = function (mute, callback, options) { return callback(mute) }; - if (mute == RTC.localVideo.isMuted()) + if (mute == APP.RTC.localVideo.isMuted()) { // Even if no change occurs, the specified callback is to be executed. // The specified callback may, optionally, return a successCallback @@ -12544,19 +12544,19 @@ function sendKeyframe(pc) { }, function (error) { console.log('triggerKeyframe setLocalDescription failed', error); - UI.messageHandler.showError(); + APP.UI.messageHandler.showError(); } ); }, function (error) { console.log('triggerKeyframe createAnswer failed', error); - UI.messageHandler.showError(); + APP.UI.messageHandler.showError(); } ); }, function (error) { console.log('triggerKeyframe setRemoteDescription failed', error); - UI.messageHandler.showError(); + APP.UI.messageHandler.showError(); } ); } @@ -15910,7 +15910,7 @@ var XMPP = { } else { // We are done immediately console.error("No conference handler"); - UI.messageHandler.showError('Error', + APP.UI.messageHandler.showError('Error', 'Unable to switch video stream.'); callback(); } diff --git a/modules/UI/prezi/Prezi.js b/modules/UI/prezi/Prezi.js index cb08543f8..a087611c5 100644 --- a/modules/UI/prezi/Prezi.js +++ b/modules/UI/prezi/Prezi.js @@ -39,7 +39,7 @@ var Prezi = { "Remove", function(e,v,m,f) { if(v) { - xmpp.removePreziFromPresence(); + APP.xmpp.removePreziFromPresence(); } } ); @@ -91,7 +91,7 @@ var Prezi = { return false; } else { - xmpp.addToPresence("prezi", urlValue); + APP.xmpp.addToPresence("prezi", urlValue); $.prompt.close(); } } @@ -149,7 +149,7 @@ function presentationAdded(event, jid, presUrl, currentSlide) { VideoLayout.resizeThumbnails(); var controlsEnabled = false; - if (jid === xmpp.myJid()) + if (jid === APP.xmpp.myJid()) controlsEnabled = true; setPresentationVisible(true); @@ -189,7 +189,7 @@ function presentationAdded(event, jid, presUrl, currentSlide) { preziPlayer.on(PreziPlayer.EVENT_STATUS, function(event) { console.log("prezi status", event.value); if (event.value == PreziPlayer.STATUS_CONTENT_READY) { - if (jid != xmpp.myJid()) + if (jid != APP.xmpp.myJid()) preziPlayer.flyToStep(currentSlide); } }); diff --git a/modules/UI/side_pannels/contactlist/ContactList.js b/modules/UI/side_pannels/contactlist/ContactList.js index 1e1a643b8..078dea58e 100644 --- a/modules/UI/side_pannels/contactlist/ContactList.js +++ b/modules/UI/side_pannels/contactlist/ContactList.js @@ -169,7 +169,7 @@ var ContactList = { onDisplayNameChange: function (peerJid, displayName) { if (peerJid === 'localVideoContainer') - peerJid = xmpp.myJid(); + peerJid = APP.xmpp.myJid(); var resourceJid = Strophe.getResourceFromJid(peerJid); diff --git a/modules/UI/side_pannels/settings/SettingsMenu.js b/modules/UI/side_pannels/settings/SettingsMenu.js index 704356fca..35e539cc4 100644 --- a/modules/UI/side_pannels/settings/SettingsMenu.js +++ b/modules/UI/side_pannels/settings/SettingsMenu.js @@ -19,7 +19,7 @@ var SettingsMenu = { var email = Settings.setEmail(newEmail); - Avatar.setUserAvatar(xmpp.myJid(), email); + Avatar.setUserAvatar(APP.xmpp.myJid(), email); }, isVisible: function() { @@ -33,7 +33,7 @@ var SettingsMenu = { onDisplayNameChange: function(peerJid, newDisplayName) { if(peerJid === 'localVideoContainer' || - peerJid === xmpp.myJid()) { + peerJid === APP.xmpp.myJid()) { this.setDisplayName(newDisplayName); } } diff --git a/modules/UI/toolbars/Toolbar.js b/modules/UI/toolbars/Toolbar.js index 2c54f7fab..64d095401 100644 --- a/modules/UI/toolbars/Toolbar.js +++ b/modules/UI/toolbars/Toolbar.js @@ -90,7 +90,7 @@ function hangup() { */ function toggleRecording() { - xmpp.toggleRecording(function (callback) { + APP.xmpp.toggleRecording(function (callback) { APP.UI.messageHandler.openTwoButtonDialog(null, '

Enter recording token

' + 'false */ JingleSession.prototype.isVideoMute = function () { - var tracks = RTC.localVideo.getVideoTracks(); + var tracks = APP.RTC.localVideo.getVideoTracks(); var mute = true; for (var i = 0; i < tracks.length; ++i) { @@ -1116,7 +1116,7 @@ JingleSession.prototype.setVideoMute = function (mute, callback, options) { return callback(mute) }; - if (mute == RTC.localVideo.isMuted()) + if (mute == APP.RTC.localVideo.isMuted()) { // Even if no change occurs, the specified callback is to be executed. // The specified callback may, optionally, return a successCallback @@ -1292,19 +1292,19 @@ function sendKeyframe(pc) { }, function (error) { console.log('triggerKeyframe setLocalDescription failed', error); - UI.messageHandler.showError(); + APP.UI.messageHandler.showError(); } ); }, function (error) { console.log('triggerKeyframe createAnswer failed', error); - UI.messageHandler.showError(); + APP.UI.messageHandler.showError(); } ); }, function (error) { console.log('triggerKeyframe setRemoteDescription failed', error); - UI.messageHandler.showError(); + APP.UI.messageHandler.showError(); } ); } diff --git a/modules/xmpp/xmpp.js b/modules/xmpp/xmpp.js index 7dcb653d3..859277f99 100644 --- a/modules/xmpp/xmpp.js +++ b/modules/xmpp/xmpp.js @@ -246,7 +246,7 @@ var XMPP = { } else { // We are done immediately console.error("No conference handler"); - UI.messageHandler.showError('Error', + APP.UI.messageHandler.showError('Error', 'Unable to switch video stream.'); callback(); }