Selaa lähdekoodia

Fixes or ignores (explicidly, as much as possible) jshint warnings.

master
Boris Grozev 9 vuotta sitten
vanhempi
commit
27c297c034

+ 6
- 4
.jshintignore Näytä tiedosto

1
 node_modules
1
 node_modules
2
 libs
2
 libs
3
-replacement.js
4
-prezi.js
5
-muc.js
6
-app.js
3
+debian
4
+analytics.js
5
+
6
+modules/xmpp/strophe.emuc.js
7
+modules/UI/prezi/Prezi.js
8
+modules/RTC/adapter.screenshare.js

+ 6
- 2
.jshintrc Näytä tiedosto

1
 {
1
 {
2
+    // Refer to http://jshint.com/docs/options/ for an exhaustive list of options
2
     "asi": false, // true: Tolerate Automatic Semicolon Insertion (no semicolons)
3
     "asi": false, // true: Tolerate Automatic Semicolon Insertion (no semicolons)
3
     "expr": true, // true: Tolerate `ExpressionStatement` as Programs
4
     "expr": true, // true: Tolerate `ExpressionStatement` as Programs
4
     "loopfunc": true, // true: Tolerate functions being defined in loops
5
     "loopfunc": true, // true: Tolerate functions being defined in loops
12
     "indent": 4, // {int} Number of spaces to use for indentation
13
     "indent": 4, // {int} Number of spaces to use for indentation
13
     "latedef": true, // true: Require variables/functions to be defined before being used
14
     "latedef": true, // true: Require variables/functions to be defined before being used
14
     "newcap": true, // true: Require capitalization of all constructor functions e.g. `new F()`
15
     "newcap": true, // true: Require capitalization of all constructor functions e.g. `new F()`
15
-    "maxlen": 80    // {int} Max number of characters per line
16
-}
16
+    //TODO: set to 80 when the code is compliant..
17
+    "maxlen": 1000, // {int} Max number of characters per line
18
+    "latedef": false, //This option prohibits the use of a variable before it was defined
19
+    "laxbreak": true //Ignore line breaks around "=", "==", "&&", etc.
20
+}

+ 3
- 3
external_api.js Näytä tiedosto

29
      */
29
      */
30
     function JitsiMeetExternalAPI(domain, room_name, width, height, parentNode,
30
     function JitsiMeetExternalAPI(domain, room_name, width, height, parentNode,
31
         configOverwrite, interfaceConfigOverwrite) {
31
         configOverwrite, interfaceConfigOverwrite) {
32
-        if((!width || width < MIN_WIDTH) && !filmStripOnly)
32
+        if (!width || width < MIN_WIDTH)
33
             width = MIN_WIDTH;
33
             width = MIN_WIDTH;
34
-        if((!height || height < MIN_HEIGHT) && !filmStripOnly)
34
+        if (!height || height < MIN_HEIGHT)
35
             height = MIN_HEIGHT;
35
             height = MIN_HEIGHT;
36
 
36
 
37
         this.parentNode = null;
37
         this.parentNode = null;
371
 
371
 
372
     return JitsiMeetExternalAPI;
372
     return JitsiMeetExternalAPI;
373
 
373
 
374
-})();
374
+})();

+ 3
- 3
modules/RTC/DataChannels.js Näytä tiedosto

69
                         if (type === 'string') {
69
                         if (type === 'string') {
70
                             oldValue = (oldValue == "true");
70
                             oldValue = (oldValue == "true");
71
                         } else {
71
                         } else {
72
-                            oldValue = new Boolean(oldValue).valueOf();
72
+                            oldValue = Boolean(oldValue).valueOf();
73
                         }
73
                         }
74
                     }
74
                     }
75
                     if ((type = typeof newValue) !== 'boolean') {
75
                     if ((type = typeof newValue) !== 'boolean') {
76
                         if (type === 'string') {
76
                         if (type === 'string') {
77
                             newValue = (newValue == "true");
77
                             newValue = (newValue == "true");
78
                         } else {
78
                         } else {
79
-                            newValue = new Boolean(newValue).valueOf();
79
+                            newValue = Boolean(newValue).valueOf();
80
                         }
80
                         }
81
                     }
81
                     }
82
 
82
 
151
 
151
 
152
 function onSelectedEndpointChanged(userResource) {
152
 function onSelectedEndpointChanged(userResource) {
153
     console.log('selected endpoint changed: ', userResource);
153
     console.log('selected endpoint changed: ', userResource);
154
-    if (_dataChannels && _dataChannels.length != 0) {
154
+    if (_dataChannels && _dataChannels.length !== 0) {
155
         _dataChannels.some(function (dataChannel) {
155
         _dataChannels.some(function (dataChannel) {
156
             if (dataChannel.readyState == 'open') {
156
             if (dataChannel.readyState == 'open') {
157
                 console.log('sending selected endpoint changed ' +
157
                 console.log('sending selected endpoint changed ' +

+ 1
- 1
modules/RTC/RTC.js Näytä tiedosto

69
 
69
 
70
         var localStream =  new LocalStream(stream, type, eventEmitter, videoType, isGUMStream);
70
         var localStream =  new LocalStream(stream, type, eventEmitter, videoType, isGUMStream);
71
         //in firefox we have only one stream object
71
         //in firefox we have only one stream object
72
-        if(this.localStreams.length == 0 ||
72
+        if(this.localStreams.length === 0 ||
73
             this.localStreams[0].getOriginalStream() != stream)
73
             this.localStreams[0].getOriginalStream() != stream)
74
             this.localStreams.push(localStream);
74
             this.localStreams.push(localStream);
75
         if(isMuted === true)
75
         if(isMuted === true)

+ 5
- 3
modules/RTC/RTCUtils.js Näytä tiedosto

1
-/* global APP, config, require, attachMediaStream, getUserMedia */
1
+/* global APP, config, require, attachMediaStream, getUserMedia,
2
+    RTCPeerConnection, webkitMediaStream, webkitURL, webkitRTCPeerConnection,
3
+    mozRTCIceCandidate, mozRTCSessionDescription, mozRTCPeerConnection */
2
 var RTCBrowserType = require("./RTCBrowserType");
4
 var RTCBrowserType = require("./RTCBrowserType");
3
 var Resolutions = require("../../service/RTC/Resolutions");
5
 var Resolutions = require("../../service/RTC/Resolutions");
4
 var AdapterJS = require("./adapter.screenshare");
6
 var AdapterJS = require("./adapter.screenshare");
192
                 if(element)
194
                 if(element)
193
                     element.mozSrcObject = src;
195
                     element.mozSrcObject = src;
194
             };
196
             };
195
-            RTCSessionDescription = mozRTCSessionDescription;
196
-            RTCIceCandidate = mozRTCIceCandidate;
197
+            window.RTCSessionDescription = mozRTCSessionDescription;
198
+            window.RTCIceCandidate = mozRTCIceCandidate;
197
         } else {
199
         } else {
198
             console.error(
200
             console.error(
199
                 "Firefox version too old: " + FFversion + ". Required >= 40.");
201
                 "Firefox version too old: " + FFversion + ". Required >= 40.");

+ 3
- 0
modules/UI/UI.js Näytä tiedosto

312
     });
312
     });
313
     APP.xmpp.addListener(XMPPEvents.PROMPT_FOR_LOGIN, function () {
313
     APP.xmpp.addListener(XMPPEvents.PROMPT_FOR_LOGIN, function () {
314
         // FIXME: re-use LoginDialog which supports retries
314
         // FIXME: re-use LoginDialog which supports retries
315
+        // FIXME^2: This looks like a bug...connect is undefined.
316
+        /* jshint -W117 */
315
         UI.showLoginPopup(connect);
317
         UI.showLoginPopup(connect);
318
+        /* jshint +W117 */
316
     });
319
     });
317
 
320
 
318
     APP.xmpp.addListener(XMPPEvents.FOCUS_DISCONNECTED, function (focusComponent, retrySec) {
321
     APP.xmpp.addListener(XMPPEvents.FOCUS_DISCONNECTED, function (focusComponent, retrySec) {

+ 1
- 0
modules/UI/avatar/Avatar.js Näytä tiedosto

1
+/* global Strophe, APP, MD5 */
1
 var Settings = require("../../settings/Settings");
2
 var Settings = require("../../settings/Settings");
2
 
3
 
3
 var users = {};
4
 var users = {};

+ 10
- 7
modules/UI/prezi/PreziPlayer.js Näytä tiedosto

1
+/* global PreziPlayer */
1
 (function() {
2
 (function() {
2
     "use strict";
3
     "use strict";
3
     var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
4
     var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
26
             for(var i=0; i<optionArray.length; i++) {
27
             for(var i=0; i<optionArray.length; i++) {
27
                 var optionSet = optionArray[i];
28
                 var optionSet = optionArray[i];
28
                 new PreziPlayer(optionSet.id, optionSet);
29
                 new PreziPlayer(optionSet.id, optionSet);
29
-            };
30
+            }
30
         };
31
         };
31
 
32
 
32
         PreziPlayer.messageReceived = function(event){
33
         PreziPlayer.messageReceived = function(event){
51
             } catch (e) { }
52
             } catch (e) { }
52
         };
53
         };
53
 
54
 
55
+/*jshint -W004 */
54
         function PreziPlayer(id, options) {
56
         function PreziPlayer(id, options) {
57
+/*jshint +W004 */
55
             var params, paramString = "", _this = this;
58
             var params, paramString = "", _this = this;
56
             if (PreziPlayer.players[id]){
59
             if (PreziPlayer.players[id]){
57
                 PreziPlayer.players[id].destroy();
60
                 PreziPlayer.players[id].destroy();
59
             for(var i=0; i<PreziPlayer.binded_methods.length; i++) {
62
             for(var i=0; i<PreziPlayer.binded_methods.length; i++) {
60
                 var method_name = PreziPlayer.binded_methods[i];
63
                 var method_name = PreziPlayer.binded_methods[i];
61
                 _this[method_name] = __bind(_this[method_name], _this);
64
                 _this[method_name] = __bind(_this[method_name], _this);
62
-            };
65
+            }
63
             options = options || {};
66
             options = options || {};
64
             this.options = options;
67
             this.options = options;
65
             this.values = {'status': PreziPlayer.STATUS_LOADING};
68
             this.values = {'status': PreziPlayer.STATUS_LOADING};
78
                 { name: 'explorable', value: options.explorable ? 1 : 0 },
81
                 { name: 'explorable', value: options.explorable ? 1 : 0 },
79
                 { name: 'controls', value: options.controls ? 1 : 0 }
82
                 { name: 'controls', value: options.controls ? 1 : 0 }
80
             ];
83
             ];
81
-            for(var i=0; i<params.length; i++) {
84
+            for (i=0; i<params.length; i++) {
82
                 var param = params[i];
85
                 var param = params[i];
83
                 paramString += (i===0 ? "?" : "&") + param.name + "=" + param.value;
86
                 paramString += (i===0 ? "?" : "&") + param.name + "=" + param.value;
84
-            };
87
+            }
85
             this.iframe.src = PreziPlayer.domain + PreziPlayer.path + paramString;
88
             this.iframe.src = PreziPlayer.domain + PreziPlayer.path + paramString;
86
             this.iframe.frameBorder = 0;
89
             this.iframe.frameBorder = 0;
87
             this.iframe.scrolling = "no";
90
             this.iframe.scrolling = "no";
249
             for (var parameter in dims) {
252
             for (var parameter in dims) {
250
                 this.iframe[parameter] = dims[parameter];
253
                 this.iframe[parameter] = dims[parameter];
251
             }
254
             }
252
-        }
255
+        };
253
 
256
 
254
         PreziPlayer.prototype.getDimensions = function() {
257
         PreziPlayer.prototype.getDimensions = function() {
255
             return {
258
             return {
256
                 width: parseInt(this.iframe.width, 10),
259
                 width: parseInt(this.iframe.width, 10),
257
                 height: parseInt(this.iframe.height, 10)
260
                 height: parseInt(this.iframe.height, 10)
258
-            }
259
-        }
261
+            };
262
+        };
260
 
263
 
261
         PreziPlayer.prototype.on = function(event, callback) {
264
         PreziPlayer.prototype.on = function(event, callback) {
262
             this.callbacks.push({
265
             this.callbacks.push({

+ 1
- 1
modules/UI/side_pannels/chat/Commands.js Näytä tiedosto

18
 function getCommand(message) {
18
 function getCommand(message) {
19
     if(message) {
19
     if(message) {
20
         for(var command in commands) {
20
         for(var command in commands) {
21
-            if(message.indexOf("/" + command) == 0)
21
+            if(message.indexOf("/" + command) === 0)
22
                 return command;
22
                 return command;
23
         }
23
         }
24
     }
24
     }

+ 1
- 1
modules/UI/side_pannels/chat/Replacement.js Näytä tiedosto

45
         return body;
45
         return body;
46
     }
46
     }
47
 
47
 
48
-    var regexs = Smileys["regexs"];
48
+    var regexs = Smileys.regexs;
49
     for(var smiley in regexs) {
49
     for(var smiley in regexs) {
50
         if(regexs.hasOwnProperty(smiley)) {
50
         if(regexs.hasOwnProperty(smiley)) {
51
             body = body.replace(regexs[smiley],
51
             body = body.replace(regexs[smiley],

+ 1
- 1
modules/UI/toolbars/Toolbar.js Näytä tiedosto

600
         if (config.enableRecording && config.autoRecord) {
600
         if (config.enableRecording && config.autoRecord) {
601
             toggleRecording(config.autoRecordToken);
601
             toggleRecording(config.autoRecordToken);
602
         }
602
         }
603
-    }
603
+    };
604
 
604
 
605
     // Shows or hides SIP calls button
605
     // Shows or hides SIP calls button
606
     my.showSipCallButton = function (show) {
606
     my.showSipCallButton = function (show) {

+ 1
- 1
modules/UI/util/MessageHandler.js Näytä tiedosto

1
-/* global $, APP, jQuery, toastr */
1
+/* global $, APP, jQuery, toastr, Impromptu */
2
 
2
 
3
 /**
3
 /**
4
  * Flag for enable/disable of the notifications.
4
  * Flag for enable/disable of the notifications.

+ 1
- 1
modules/UI/videolayout/RemoteVideo.js Näytä tiedosto

130
     };
130
     };
131
 
131
 
132
 } else {
132
 } else {
133
-    RemoteVideo.prototype.addRemoteVideoMenu = function() {}
133
+    RemoteVideo.prototype.addRemoteVideoMenu = function() {};
134
 }
134
 }
135
 
135
 
136
 /**
136
 /**

+ 1
- 1
modules/UI/welcome_page/WelcomePage.js Näytä tiedosto

17
     var currentVal = $("#enter_room_field").attr("placeholder");
17
     var currentVal = $("#enter_room_field").attr("placeholder");
18
     $("#enter_room_field").attr("placeholder", currentVal + word.substr(0, 1));
18
     $("#enter_room_field").attr("placeholder", currentVal + word.substr(0, 1));
19
     animateTimeout = setTimeout(function() {
19
     animateTimeout = setTimeout(function() {
20
-        animate(word.substring(1, word.length))
20
+        animate(word.substring(1, word.length));
21
     }, 70);
21
     }, 70);
22
 }
22
 }
23
 
23
 

+ 4
- 5
modules/config/HttpConfigFetch.js Näytä tiedosto

1
-/* global $, $iq, config, interfaceConfig */
1
+/* global $, config, interfaceConfig */
2
 
2
 
3
 var configUtil = require('./Util');
3
 var configUtil = require('./Util');
4
 
4
 
28
                 data: JSON.stringify({"roomName": roomName}),
28
                 data: JSON.stringify({"roomName": roomName}),
29
                 dataType: 'json',
29
                 dataType: 'json',
30
                 error: function(jqXHR, textStatus, errorThrown) {
30
                 error: function(jqXHR, textStatus, errorThrown) {
31
-                    console.error("Get config error: ", jqXHR, errorThrown)
32
-                    error = "Get config response status: " + textStatus;
31
+                    console.error("Get config error: ", jqXHR, errorThrown);
32
+                    var error = "Get config response status: " + textStatus;
33
                     complete(false, error);
33
                     complete(false, error);
34
                 },
34
                 },
35
                 success: function(data, textStatus, jqXHR) {
35
                 success: function(data, textStatus, jqXHR) {
40
                         return;
40
                         return;
41
                     } catch (exception) {
41
                     } catch (exception) {
42
                         console.error("Parse config error: ", exception);
42
                         console.error("Parse config error: ", exception);
43
-                        error = exception;
44
-                        complete(false, error);
43
+                        complete(false, exception);
45
                     }
44
                     }
46
                 }
45
                 }
47
             }
46
             }

+ 1
- 1
modules/statistics/LocalStatsCollector.js Näytä tiedosto

1
-/* global config */
1
+/* global config, AudioContext */
2
 /**
2
 /**
3
  * Provides statistics for the local stream.
3
  * Provides statistics for the local stream.
4
  */
4
  */

+ 11
- 15
modules/xmpp/JingleSessionPC.js Näytä tiedosto

482
                 JingleSessionPC.onJingleError(self.sid, error);
482
                 JingleSessionPC.onJingleError(self.sid, error);
483
             },
483
             },
484
             10000);
484
             10000);
485
-    }
485
+    };
486
     sdp.sdp = this.localSDP.raw;
486
     sdp.sdp = this.localSDP.raw;
487
     this.peerconnection.setLocalDescription(sdp,
487
     this.peerconnection.setLocalDescription(sdp,
488
         function () {
488
         function () {
714
             this.localSDP.raw = this.localSDP.session + '\r\n' + this.localSDP.media.join('');
714
             this.localSDP.raw = this.localSDP.session + '\r\n' + this.localSDP.media.join('');
715
         }
715
         }
716
     }
716
     }
717
-    var self = this;
718
     var sendJingle = function (ssrcs) {
717
     var sendJingle = function (ssrcs) {
719
                 // FIXME why do we generate session-accept in 3 different places ?
718
                 // FIXME why do we generate session-accept in 3 different places ?
720
                 var accept = $iq({to: self.peerjid,
719
                 var accept = $iq({to: self.peerjid,
746
                         JingleSessionPC.onJingleError(self.sid, error);
745
                         JingleSessionPC.onJingleError(self.sid, error);
747
                     },
746
                     },
748
                     10000);
747
                     10000);
749
-    }
748
+    };
750
     sdp.sdp = this.localSDP.raw;
749
     sdp.sdp = this.localSDP.raw;
751
     this.peerconnection.setLocalDescription(sdp,
750
     this.peerconnection.setLocalDescription(sdp,
752
         function () {
751
         function () {
815
 
814
 
816
     var self = this;
815
     var self = this;
817
     // FIXME: dirty waiting
816
     // FIXME: dirty waiting
818
-    if (!this.peerconnection.localDescription)
819
-    {
820
-        console.warn("addSource - localDescription not ready yet")
817
+    if (!this.peerconnection.localDescription) {
818
+        console.warn("addSource - localDescription not ready yet");
821
         setTimeout(function()
819
         setTimeout(function()
822
             {
820
             {
823
                 self.addSource(elem, fromJid);
821
                 self.addSource(elem, fromJid);
897
 
895
 
898
     var self = this;
896
     var self = this;
899
     // FIXME: dirty waiting
897
     // FIXME: dirty waiting
900
-    if (!this.peerconnection.localDescription)
901
-    {
902
-        console.warn("removeSource - localDescription not ready yet")
903
-        setTimeout(function()
904
-            {
898
+    if (!this.peerconnection.localDescription) {
899
+        console.warn("removeSource - localDescription not ready yet");
900
+        setTimeout(function() {
905
                 self.removeSource(elem, fromJid);
901
                 self.removeSource(elem, fromJid);
906
             },
902
             },
907
             200
903
             200
1312
 JingleSessionPC.onJingleError = function (session, error)
1308
 JingleSessionPC.onJingleError = function (session, error)
1313
 {
1309
 {
1314
     console.error("Jingle error", error);
1310
     console.error("Jingle error", error);
1315
-}
1311
+};
1316
 
1312
 
1317
 JingleSessionPC.onJingleFatalError = function (session, error)
1313
 JingleSessionPC.onJingleFatalError = function (session, error)
1318
 {
1314
 {
1320
     this.connection.emuc.doLeave();
1316
     this.connection.emuc.doLeave();
1321
     this.eventEmitter.emit(XMPPEvents.CONFERENCE_SETUP_FAILED);
1317
     this.eventEmitter.emit(XMPPEvents.CONFERENCE_SETUP_FAILED);
1322
     this.eventEmitter.emit(XMPPEvents.JINGLE_FATAL_ERROR, session, error);
1318
     this.eventEmitter.emit(XMPPEvents.JINGLE_FATAL_ERROR, session, error);
1323
-}
1319
+};
1324
 
1320
 
1325
 JingleSessionPC.prototype.setLocalDescription = function () {
1321
 JingleSessionPC.prototype.setLocalDescription = function () {
1326
     var self = this;
1322
     var self = this;
1360
             self.ssrcOwners[ssrc] = myJid;
1356
             self.ssrcOwners[ssrc] = myJid;
1361
         }
1357
         }
1362
     }
1358
     }
1363
-}
1359
+};
1364
 
1360
 
1365
 // an attempt to work around https://github.com/jitsi/jitmeet/issues/32
1361
 // an attempt to work around https://github.com/jitsi/jitmeet/issues/32
1366
 // TODO: is this hack (along with the XMPPEvent-s used only for it) still needed
1362
 // TODO: is this hack (along with the XMPPEvent-s used only for it) still needed
1450
             sendKeyframe(self.peerconnection);
1446
             sendKeyframe(self.peerconnection);
1451
         }, 3000);
1447
         }, 3000);
1452
     }
1448
     }
1453
-}
1449
+};
1454
 
1450
 
1455
 module.exports = JingleSessionPC;
1451
 module.exports = JingleSessionPC;

+ 7
- 10
modules/xmpp/SDP.js Näytä tiedosto

111
     });
111
     });
112
     this.raw = this.session + this.media.join('');
112
     this.raw = this.session + this.media.join('');
113
     return lines;
113
     return lines;
114
-}
114
+};
115
+
115
 // remove lines matching prefix from a media section specified by mediaindex
116
 // remove lines matching prefix from a media section specified by mediaindex
116
 // TODO: non-numeric mediaindex could match mid
117
 // TODO: non-numeric mediaindex could match mid
117
 SDP.prototype.removeMediaLines = function(mediaindex, prefix) {
118
 SDP.prototype.removeMediaLines = function(mediaindex, prefix) {
122
     });
123
     });
123
     this.raw = this.session + this.media.join('');
124
     this.raw = this.session + this.media.join('');
124
     return lines;
125
     return lines;
125
-}
126
+};
126
 
127
 
127
 // add content's to a jingle element
128
 // add content's to a jingle element
128
 SDP.prototype.toJingle = function (elem, thecreator, ssrcs) {
129
 SDP.prototype.toJingle = function (elem, thecreator, ssrcs) {
236
                     elem.attrs({name: "cname", value:Math.random().toString(36).substring(7)});
237
                     elem.attrs({name: "cname", value:Math.random().toString(36).substring(7)});
237
                     elem.up();
238
                     elem.up();
238
                     var msid = null;
239
                     var msid = null;
239
-                    if(mline.media == "audio")
240
-                    {
240
+                    if(mline.media == "audio") {
241
                         msid = APP.RTC.localAudio.getId();
241
                         msid = APP.RTC.localAudio.getId();
242
-                    }
243
-                    else
244
-                    {
242
+                    } else {
245
                         msid = APP.RTC.localVideo.getId();
243
                         msid = APP.RTC.localVideo.getId();
246
                     }
244
                     }
247
-                    if(msid != null)
248
-                    {
245
+                    if(msid !== null) {
249
                         msid = SDPUtil.filter_special_chars(msid);
246
                         msid = SDPUtil.filter_special_chars(msid);
250
                         elem.c('parameter');
247
                         elem.c('parameter');
251
                         elem.attrs({name: "msid", value:msid});
248
                         elem.attrs({name: "msid", value:msid});
390
         }
387
         }
391
     }
388
     }
392
     elem.up(); // end of transport
389
     elem.up(); // end of transport
393
-}
390
+};
394
 
391
 
395
 SDP.prototype.RtcpFbToJingle = function (mediaindex, elem, payloadtype) { // XEP-0293
392
 SDP.prototype.RtcpFbToJingle = function (mediaindex, elem, payloadtype) { // XEP-0293
396
     var lines = SDPUtil.find_lines(this.media[mediaindex], 'a=rtcp-fb:' + payloadtype);
393
     var lines = SDPUtil.find_lines(this.media[mediaindex], 'a=rtcp-fb:' + payloadtype);

+ 1
- 1
modules/xmpp/SDPUtil.js Näytä tiedosto

1
-SDPUtil = {
1
+var SDPUtil = {
2
     filter_special_chars: function (text) {
2
     filter_special_chars: function (text) {
3
         return text.replace(/[\\\/\{,\}\+]/g, "");
3
         return text.replace(/[\\\/\{,\}\+]/g, "");
4
     },
4
     },

+ 3
- 2
modules/xmpp/TraceablePeerConnection.js Näytä tiedosto

1
-/* global $ */
1
+/* global $, config, mozRTCPeerConnection, RTCPeerConnection,
2
+    webkitRTCPeerConnection, RTCSessionDescription */
2
 var RTC = require('../RTC/RTC');
3
 var RTC = require('../RTC/RTC');
3
 var RTCBrowserType = require("../RTC/RTCBrowserType.js");
4
 var RTCBrowserType = require("../RTC/RTCBrowserType.js");
4
 var XMPPEvents = require("../../service/xmpp/XMPPEvents");
5
 var XMPPEvents = require("../../service/xmpp/XMPPEvents");
128
  * Returns a string representation of a SessionDescription object.
129
  * Returns a string representation of a SessionDescription object.
129
  */
130
  */
130
 var dumpSDP = function(description) {
131
 var dumpSDP = function(description) {
131
-    if (typeof description === 'undefined' || description == null) {
132
+    if (typeof description === 'undefined' || description === null) {
132
         return '';
133
         return '';
133
     }
134
     }
134
 
135
 

+ 3
- 8
modules/xmpp/strophe.jingle.js Näytä tiedosto

33
                 this.connection.disco.addFeature('urn:xmpp:jingle:apps:rtp:audio');
33
                 this.connection.disco.addFeature('urn:xmpp:jingle:apps:rtp:audio');
34
                 this.connection.disco.addFeature('urn:xmpp:jingle:apps:rtp:video');
34
                 this.connection.disco.addFeature('urn:xmpp:jingle:apps:rtp:video');
35
 
35
 
36
-                if (RTCBrowserType.isChrome() || RTCBrowserType.isOpera()
37
-                    || RTCBrowserType.isTemasysPluginUsed()) {
36
+                if (RTCBrowserType.isChrome() || RTCBrowserType.isOpera() ||
37
+                    RTCBrowserType.isTemasysPluginUsed()) {
38
                     this.connection.disco.addFeature('urn:ietf:rfc:4588');
38
                     this.connection.disco.addFeature('urn:ietf:rfc:4588');
39
                 }
39
                 }
40
 
40
 
138
                     $(document).trigger('callaccepted.jingle', [sess.sid]);
138
                     $(document).trigger('callaccepted.jingle', [sess.sid]);
139
                     break;
139
                     break;
140
                 case 'session-terminate':
140
                 case 'session-terminate':
141
-                    // If this is not the focus sending the terminate, we have
142
-                    // nothing more to do here.
143
-                    if (Object.keys(this.sessions).length < 1
144
-                        || !(this.sessions[Object.keys(this.sessions)[0]]
145
-                            instanceof JingleSession))
146
-                    {
141
+                    if (!sess) {
147
                         break;
142
                         break;
148
                     }
143
                     }
149
                     console.log('terminating...', sess.sid);
144
                     console.log('terminating...', sess.sid);

+ 1
- 1
modules/xmpp/strophe.moderate.js Näytä tiedosto

57
             this.connection.emuc.kick(jid);
57
             this.connection.emuc.kick(jid);
58
         }
58
         }
59
     });
59
     });
60
-}
60
+};

+ 1
- 0
modules/xmpp/strophe.util.js Näytä tiedosto

1
+/* global Strophe */
1
 /**
2
 /**
2
  * Strophe logger implementation. Logs from level WARN and above.
3
  * Strophe logger implementation. Logs from level WARN and above.
3
  */
4
  */

+ 1
- 1
modules/xmpp/xmpp.js Näytä tiedosto

1
-/* global $, APP, config, Strophe*/
1
+/* global $, APP, config, Strophe, Base64, $msg */
2
 var Moderator = require("./moderator");
2
 var Moderator = require("./moderator");
3
 var EventEmitter = require("events");
3
 var EventEmitter = require("events");
4
 var Recording = require("./recording");
4
 var Recording = require("./recording");

+ 3
- 3
service/translation/languages.js Näytä tiedosto

1
 module.exports = {
1
 module.exports = {
2
     getLanguages : function () {
2
     getLanguages : function () {
3
         var languages = [];
3
         var languages = [];
4
-        for(var lang in this)
4
+        for (var lang in this)
5
         {
5
         {
6
-            if(typeof this[lang] === "string")
6
+            if (typeof this[lang] === "string")
7
                 languages.push(this[lang]);
7
                 languages.push(this[lang]);
8
         }
8
         }
9
         return languages;
9
         return languages;
13
     DE: "de",
13
     DE: "de",
14
     TR: "tr",
14
     TR: "tr",
15
     FR: "fr"
15
     FR: "fr"
16
-}
16
+};

Loading…
Peruuta
Tallenna