Переглянути джерело

[eslint] spaced-comment

dev1
Lyubo Marinov 8 роки тому
джерело
коміт
14147059b3

+ 1
- 0
.eslintrc.js Переглянути файл

@@ -158,6 +158,7 @@ module.exports = {
158 158
         'quote-props': 0,
159 159
         'semi': [ 'error', 'always' ],
160 160
         'space-unary-ops': 2,
161
+        'spaced-comment': 2,
161 162
         'unicode-bom': 0,
162 163
         'wrap-regex': 0,
163 164
 

+ 2
- 2
JitsiConference.js Переглянути файл

@@ -414,12 +414,12 @@ JitsiConference.prototype.setSubject = function (subject) {
414 414
 JitsiConference.prototype.getTranscriber = function(){
415 415
     if (this.transcriber === undefined){
416 416
         this.transcriber = new Transcriber();
417
-        //add all existing local audio tracks to the transcriber
417
+        // add all existing local audio tracks to the transcriber
418 418
         const localAudioTracks = this.getLocalTracks(MediaType.AUDIO);
419 419
         for (const localAudio of localAudioTracks) {
420 420
             this.transcriber.addTrack(localAudio);
421 421
         }
422
-        //and all remote audio tracks
422
+        // and all remote audio tracks
423 423
         const remoteAudioTracks = this.rtc.getRemoteTracks(MediaType.AUDIO);
424 424
         for (const remoteTrack of remoteAudioTracks){
425 425
             this.transcriber.addTrack(remoteTrack);

+ 1
- 1
JitsiConferenceEventManager.js Переглянути файл

@@ -20,7 +20,7 @@ const logger = getLogger(__filename);
20 20
 function JitsiConferenceEventManager(conference) {
21 21
     this.conference = conference;
22 22
 
23
-    //Listeners related to the conference only
23
+    // Listeners related to the conference only
24 24
     conference.on(JitsiConferenceEvents.TRACK_MUTE_CHANGED,
25 25
         function (track) {
26 26
             if(!track.isLocal() || !conference.statistics) {

+ 2
- 2
JitsiParticipant.js Переглянути файл

@@ -157,8 +157,8 @@ export default class JitsiParticipant {
157 157
     }
158 158
 
159 159
     // Gets a link to an etherpad instance advertised by the participant?
160
-    //getEtherpad() {
161
-    //}
160
+    // getEtherpad() {
161
+    // }
162 162
 
163 163
     /**
164 164
      * @returns {Boolean} Whether this participant has muted their audio.

+ 4
- 4
modules/RTC/DataChannels.js Переглянути файл

@@ -20,7 +20,7 @@ function DataChannels(peerConnection, emitter) {
20 20
     // and peer as single channel can be used for sending and receiving data.
21 21
     // So either channel opened by the bridge or the one opened here is enough
22 22
     // for communication with the bridge.
23
-    /*var dataChannelOptions =
23
+    /* var dataChannelOptions =
24 24
      {
25 25
      reliable: true
26 26
      };
@@ -53,9 +53,9 @@ DataChannels.prototype.onDataChannel = function (event) {
53 53
 
54 54
         // Code sample for sending string and/or binary data
55 55
         // Sends String message to the bridge
56
-        //dataChannel.send("Hello bridge!");
56
+        // dataChannel.send("Hello bridge!");
57 57
         // Sends 12 bytes binary message to the bridge
58
-        //dataChannel.send(new ArrayBuffer(12));
58
+        // dataChannel.send(new ArrayBuffer(12));
59 59
 
60 60
         self.eventEmitter.emit(RTCEvents.DATA_CHANNEL_OPEN);
61 61
     };
@@ -64,7 +64,7 @@ DataChannels.prototype.onDataChannel = function (event) {
64 64
         // FIXME: this one seems to be generated a bit too often right now
65 65
         // so we are temporarily commenting it before we have more clarity
66 66
         // on which of the errors we absolutely need to report
67
-        //GlobalOnErrorHandler.callErrorHandler(
67
+        // GlobalOnErrorHandler.callErrorHandler(
68 68
         //        new Error("Data Channel Error:" + error));
69 69
         logger.error("Data Channel Error:", error, dataChannel);
70 70
     };

+ 2
- 2
modules/RTC/JitsiLocalTrack.js Переглянути файл

@@ -303,7 +303,7 @@ JitsiLocalTrack.prototype._setMute = function (mute) {
303 303
             this.dontFireRemoveEvent = true;
304 304
             promise = new Promise( (resolve, reject) => {
305 305
                 this._removeStreamFromConferenceAsMute(() => {
306
-                    //FIXME: Maybe here we should set the SRC for the containers
306
+                    // FIXME: Maybe here we should set the SRC for the containers
307 307
                     // to something
308 308
                     this._stopMediaStream();
309 309
                     this._setStream(null);
@@ -563,7 +563,7 @@ JitsiLocalTrack.prototype._setByteSent = function (bytesSent) {
563 563
     if(this._testByteSent && "connected" === iceConnectionState) {
564 564
         setTimeout(function () {
565 565
             if(this._bytesSent <= 0){
566
-                //we are not receiving anything from the microphone
566
+                // we are not receiving anything from the microphone
567 567
                 this._fireNoDataFromSourceEvent();
568 568
             }
569 569
         }.bind(this), 3000);

+ 1
- 1
modules/RTC/JitsiTrack.js Переглянути файл

@@ -12,7 +12,7 @@ const logger = getLogger(__filename);
12 12
  * Maps our handler types to MediaStreamTrack properties.
13 13
  */
14 14
 var trackHandler2Prop = {
15
-    "track_mute": "onmute",//Not supported on FF
15
+    "track_mute": "onmute",// Not supported on FF
16 16
     "track_unmute": "onunmute",
17 17
     "track_ended": "onended"
18 18
 };

+ 1
- 1
modules/RTC/RTC.js Переглянути файл

@@ -54,7 +54,7 @@ export default class RTC extends Listenable {
54 54
         this.peerConnectionIdCounter = 1;
55 55
 
56 56
         this.localTracks = [];
57
-        //FIXME: We should support multiple streams per jid.
57
+        // FIXME: We should support multiple streams per jid.
58 58
         this.remoteTracks = {};
59 59
         this.options = options;
60 60
         // A flag whether we had received that the data channel had opened

+ 4
- 4
modules/RTC/RTCUtils.js Переглянути файл

@@ -186,7 +186,7 @@ function getConstraints(um, options) {
186 186
             // for some cameras it might be necessary to request 30fps
187 187
             // so they choose 30fps mjpg over 10fps yuy2
188 188
             if (options.minFps || options.fps) {
189
-                options.minFps = options.minFps || options.fps; //Fall back to options.fps for backwards compatibility
189
+                options.minFps = options.minFps || options.fps; // Fall back to options.fps for backwards compatibility
190 190
                 constraints.video.mandatory.minFrameRate = options.minFps;
191 191
             }
192 192
             if (options.maxFps) {
@@ -285,7 +285,7 @@ function getConstraints(um, options) {
285 285
 
286 286
     if (options.bandwidth) {
287 287
         if (!constraints.video) {
288
-            //same behaviour as true
288
+            // same behaviour as true
289 289
             constraints.video = {mandatory: {}, optional: []};
290 290
         }
291 291
         constraints.video.optional.push({bandwidth: options.bandwidth});
@@ -297,7 +297,7 @@ function getConstraints(um, options) {
297 297
     if(RTCBrowserType.isFirefox() && options.firefox_fake_device) {
298 298
         // seems to be fixed now, removing this experimental fix, as having
299 299
         // multiple audio tracks brake the tests
300
-        //constraints.audio = true;
300
+        // constraints.audio = true;
301 301
         constraints.fake = true;
302 302
     }
303 303
 
@@ -728,7 +728,7 @@ function defaultSetVideoSrc(element, stream) {
728 728
     element.src = src || '';
729 729
 }
730 730
 
731
-//Options parameter is to pass config options. Currently uses only "useIPv6".
731
+// Options parameter is to pass config options. Currently uses only "useIPv6".
732 732
 class RTCUtils extends Listenable {
733 733
     constructor() {
734 734
         super(eventEmitter);

+ 2
- 2
modules/RTC/TraceablePeerConnection.js Переглянути файл

@@ -89,7 +89,7 @@ function TraceablePeerConnection(rtc, id, signalingLayer, ice_config,
89 89
 
90 90
     // override as desired
91 91
     this.trace = function (what, info) {
92
-        /*logger.warn('WTRACE', what, info);
92
+        /* logger.warn('WTRACE', what, info);
93 93
         if (info && RTCBrowserType.isIExplorer()) {
94 94
             if (info.length > 1024) {
95 95
                 logger.warn('WTRACE', what, info.substr(1024));
@@ -890,7 +890,7 @@ TraceablePeerConnection.prototype.createAnswer
890 890
 TraceablePeerConnection.prototype.addIceCandidate
891 891
         // eslint-disable-next-line no-unused-vars
892 892
         = function (candidate, successCallback, failureCallback) {
893
-    //var self = this;
893
+    // var self = this;
894 894
             this.trace('addIceCandidate', JSON.stringify(candidate, null, ' '));
895 895
             this.peerconnection.addIceCandidate(candidate);
896 896
     /* maybe later

+ 3
- 3
modules/connectivity/ConnectionQuality.js Переглянути файл

@@ -371,9 +371,9 @@ export default class ConnectionQuality {
371 371
             // send the statistics again after a few seconds, and the error is
372 372
             // already logged elsewhere. So just ignore it.
373 373
 
374
-            //let errorMsg = "Failed to broadcast local stats";
375
-            //logger.error(errorMsg, e);
376
-            //GlobalOnErrorHandler.callErrorHandler(
374
+            // let errorMsg = "Failed to broadcast local stats";
375
+            // logger.error(errorMsg, e);
376
+            // GlobalOnErrorHandler.callErrorHandler(
377 377
             //    new Error(errorMsg + ": " + e));
378 378
         }
379 379
     }

+ 1
- 1
modules/statistics/CallStats.js Переглянути файл

@@ -159,7 +159,7 @@ var CallStats = _try_catch(function(jingleSession, options) {
159 159
         this.callStatsSecret = options.callStatsSecret;
160 160
 
161 161
         CallStats.initializeInProgress = true;
162
-        //userID is generated or given by the origin server
162
+        // userID is generated or given by the origin server
163 163
         callStats.initialize(this.callStatsID,
164 164
             this.callStatsSecret,
165 165
             this.userID,

+ 6
- 6
modules/statistics/RTPStatsCollector.js Переглянути файл

@@ -276,10 +276,10 @@ StatsCollector.prototype.start = function (startAudioLevelStats) {
276 276
                         var results = null;
277 277
                         if (!report || !report.result ||
278 278
                             typeof report.result != 'function') {
279
-                            //firefox
279
+                            // firefox
280 280
                             results = report;
281 281
                         } else {
282
-                            //chrome
282
+                            // chrome
283 283
                             results = report.result();
284 284
                         }
285 285
                         self.currentStatsReport = results;
@@ -406,7 +406,7 @@ StatsCollector.prototype.processStatsReport = function () {
406 406
                     "upload": Math.round(sendBandwidth / 1000)
407 407
                 };
408 408
             }
409
-        } catch(e){/*not supported*/}
409
+        } catch(e){/* not supported*/}
410 410
 
411 411
         if(now.type == 'googCandidatePair') {
412 412
             var ip, type, localip, active;
@@ -415,7 +415,7 @@ StatsCollector.prototype.processStatsReport = function () {
415 415
                 type = getStatValue(now, "transportType");
416 416
                 localip = getStatValue(now, "localAddress");
417 417
                 active = getStatValue(now, "activeConnection");
418
-            } catch(e){/*not supported*/}
418
+            } catch(e){/* not supported*/}
419 419
             if(!ip || !type || !localip || active != "true") {
420 420
                 continue;
421 421
             }
@@ -536,7 +536,7 @@ StatsCollector.prototype.processStatsReport = function () {
536 536
                 resolution.height = height;
537 537
                 resolution.width = width;
538 538
             }
539
-        } catch(e){/*not supported*/}
539
+        } catch(e){/* not supported*/}
540 540
 
541 541
         if (resolution.height && resolution.width) {
542 542
             ssrcStats.setResolution(resolution);
@@ -638,7 +638,7 @@ StatsCollector.prototype.processAudioLevelReport = function () {
638 638
             var audioLevel
639 639
                 = getStatValue(now, 'audioInputLevel')
640 640
                     || getStatValue(now, 'audioOutputLevel');
641
-        } catch(e) {/*not supported*/
641
+        } catch(e) {/* not supported*/
642 642
             logger.warn("Audio Levels are not available in the statistics.");
643 643
             clearInterval(this.audioLevelsIntervalId);
644 644
             return;

+ 1
- 1
modules/statistics/statistics.js Переглянути файл

@@ -208,7 +208,7 @@ Statistics.prototype.stopRemoteStats = function () {
208 208
     this.rtpStats = null;
209 209
 };
210 210
 
211
-//CALSTATS METHODS
211
+// CALSTATS METHODS
212 212
 
213 213
 /**
214 214
  * Initializes the callstats.io API.

+ 21
- 20
modules/transcription/audioRecorder.js Переглянути файл

@@ -21,10 +21,10 @@ var TrackRecorder = function(track){
21 21
     // The array of data chunks recorded from the stream
22 22
     // acts as a buffer until the data is stored on disk
23 23
     this.data = null;
24
-    //the name of the person of the JitsiTrack. This can be undefined and/or
25
-    //not unique
24
+    // the name of the person of the JitsiTrack. This can be undefined and/or
25
+    // not unique
26 26
     this.name = null;
27
-    //the time of the start of the recording
27
+    // the time of the start of the recording
28 28
     this.startTime = null;
29 29
 };
30 30
 
@@ -71,8 +71,8 @@ function instantiateTrackRecorder(track) {
71 71
     // Create the MediaRecorder
72 72
     trackRecorder.recorder = new MediaRecorder(stream,
73 73
         {mimeType: audioRecorder.fileType});
74
-    //array for holding the recorder data. Resets it when
75
-    //audio already has been recorder once
74
+    // array for holding the recorder data. Resets it when
75
+    // audio already has been recorder once
76 76
     trackRecorder.data = [];
77 77
     // function handling a dataEvent, e.g the stream gets new data
78 78
     trackRecorder.recorder.ondataavailable = function (dataEvent) {
@@ -110,13 +110,13 @@ var audioRecorder = function(jitsiConference){
110 110
     // holds the JitsiTrack, MediaRecorder and recorder data
111 111
     this.recorders = [];
112 112
 
113
-    //get which file type is supported by the current browser
113
+    // get which file type is supported by the current browser
114 114
     this.fileType = determineCorrectFileType();
115 115
 
116
-    //boolean flag for active recording
116
+    // boolean flag for active recording
117 117
     this.isRecording = false;
118 118
 
119
-    //the jitsiconference the object is recording
119
+    // the jitsiconference the object is recording
120 120
     this.jitsiConference = jitsiConference;
121 121
 };
122 122
 
@@ -132,13 +132,14 @@ audioRecorder.determineCorrectFileType = determineCorrectFileType;
132 132
  */
133 133
 audioRecorder.prototype.addTrack = function (track) {
134 134
     if(track.isAudioTrack()) {
135
-        //create the track recorder
135
+        // create the track recorder
136 136
         var trackRecorder = instantiateTrackRecorder(track);
137
-        //push it to the local array of all recorders
137
+        // push it to the local array of all recorders
138 138
         this.recorders.push(trackRecorder);
139
-        //update the name of the trackRecorders
139
+        // update the name of the trackRecorders
140 140
         this.updateNames();
141
-        //if we're already recording, immediately start recording this new track
141
+        // If we're already recording, immediately start recording this new
142
+        // track.
142 143
         if(this.isRecording){
143 144
             startRecorder(trackRecorder);
144 145
         }
@@ -159,7 +160,7 @@ audioRecorder.prototype.removeTrack = function(track){
159 160
     if(track.isVideoTrack()){
160 161
         return;
161 162
     }
162
-    
163
+
163 164
     var array = this.recorders;
164 165
     var i;
165 166
     for(i = 0; i < array.length; i++) {
@@ -168,13 +169,13 @@ audioRecorder.prototype.removeTrack = function(track){
168 169
             if(this.isRecording){
169 170
                 stopRecorder(recorderToRemove);
170 171
             } else {
171
-                //remove the TrackRecorder from the array
172
+                // remove the TrackRecorder from the array
172 173
                 array.splice(i, 1);
173 174
             }
174 175
         }
175 176
     }
176 177
 
177
-    //make sure the names are up to date
178
+    // make sure the names are up to date
178 179
     this.updateNames();
179 180
 };
180 181
 
@@ -209,11 +210,11 @@ audioRecorder.prototype.start = function () {
209 210
     // set boolean isRecording flag to true so if new participants join the
210 211
     // conference, that track can instantly start recording as well
211 212
     this.isRecording = true;
212
-    //start all the mediaRecorders
213
+    // start all the mediaRecorders
213 214
     this.recorders.forEach(function(trackRecorder){
214 215
         startRecorder(trackRecorder);
215 216
     });
216
-    //log that recording has started
217
+    // log that recording has started
217 218
     console.log("Started the recording of the audio. There are currently " +
218 219
         this.recorders.length + " recorders active.");
219 220
 };
@@ -222,9 +223,9 @@ audioRecorder.prototype.start = function () {
222 223
  * Stops the audio recording of every local and remote track
223 224
  */
224 225
 audioRecorder.prototype.stop = function() {
225
-    //set the boolean flag to false
226
+    // set the boolean flag to false
226 227
     this.isRecording = false;
227
-    //stop all recorders
228
+    // stop all recorders
228 229
     this.recorders.forEach(function(trackRecorder){
229 230
         stopRecorder(trackRecorder);
230 231
     });
@@ -259,7 +260,7 @@ audioRecorder.prototype.getRecordingResults = function () {
259 260
         throw new Error("cannot get blobs because the AudioRecorder is still" +
260 261
             "recording!");
261 262
     }
262
-    //make sure the names are up to date before sending them off
263
+    // make sure the names are up to date before sending them off
263 264
     this.updateNames();
264 265
 
265 266
     var array = [];

+ 48
- 48
modules/transcription/transcriber.js Переглянути файл

@@ -7,7 +7,7 @@ var RECORDING_STATE = "recording";
7 7
 var TRANSCRIBING_STATE = "transcribing";
8 8
 var FINISHED_STATE = "finished";
9 9
 
10
-//the amount of characters each line in the transcription will have
10
+// the amount of characters each line in the transcription will have
11 11
 var MAXIMUM_SENTENCE_LENGTH = 80;
12 12
 
13 13
 /**
@@ -18,27 +18,27 @@ var MAXIMUM_SENTENCE_LENGTH = 80;
18 18
  * @param {AudioRecorder} audioRecorder An audioRecorder recording a conference
19 19
  */
20 20
 var transcriber = function() {
21
-    //the object which can record all audio in the conference
21
+    // the object which can record all audio in the conference
22 22
     this.audioRecorder = new AudioRecorder();
23
-    //this object can send the recorder audio to a speech-to-text service
23
+    // this object can send the recorder audio to a speech-to-text service
24 24
     this.transcriptionService = new SphinxService();
25
-    //holds a counter to keep track if merging can start
25
+    // holds a counter to keep track if merging can start
26 26
     this.counter = null;
27
-    //holds the date when transcription started which makes it possible
28
-    //to calculate the offset between recordings
27
+    // holds the date when transcription started which makes it possible
28
+    // to calculate the offset between recordings
29 29
     this.startTime = null;
30
-    //will hold the transcription once it is completed
30
+    // will hold the transcription once it is completed
31 31
     this.transcription = null;
32
-    //this will be a method which will be called once the transcription is done
33
-    //with the transcription as parameter
32
+    // this will be a method which will be called once the transcription is done
33
+    // with the transcription as parameter
34 34
     this.callback = null;
35
-    //stores all the retrieved speech-to-text results to merge together
36
-    //this value will store an Array<Word> object
35
+    // stores all the retrieved speech-to-text results to merge together
36
+    // this value will store an Array<Word> object
37 37
     this.results = [];
38 38
     // Stores the current state of the transcription process
39 39
     this.state = BEFORE_STATE;
40
-    //Used in the updateTranscription method to add a new line when the
41
-    //sentence becomes to long
40
+    // Used in the updateTranscription method to add a new line when the
41
+    // sentence becomes to long
42 42
     this.lineLength = 0;
43 43
 };
44 44
 
@@ -70,10 +70,10 @@ transcriber.prototype.stop = function stop(callback) {
70 70
             "\"" + RECORDING_STATE + "\" state. It's currently in the " +
71 71
             "\"" + this.state + "\" state");
72 72
     }
73
-    //stop the recording
73
+    // stop the recording
74 74
     console.log("stopping recording and sending audio files");
75 75
     this.audioRecorder.stop();
76
-    //and send all recorded audio the the transcription service
76
+    // and send all recorded audio the the transcription service
77 77
     var t = this;
78 78
 
79 79
     var callBack = blobCallBack.bind(this);
@@ -81,9 +81,9 @@ transcriber.prototype.stop = function stop(callback) {
81 81
         t.transcriptionService.send(recordingResult, callBack);
82 82
         t.counter++;
83 83
     });
84
-    //set the state to "transcribing" so that maybeMerge() functions correctly
84
+    // set the state to "transcribing" so that maybeMerge() functions correctly
85 85
     this.state = TRANSCRIBING_STATE;
86
-    //and store the callback for later
86
+    // and store the callback for later
87 87
     this.callback = callback;
88 88
 };
89 89
 
@@ -100,14 +100,14 @@ transcriber.prototype.stop = function stop(callback) {
100 100
 var blobCallBack = function(answer){
101 101
     console.log("retrieved an answer from the transcription service. The" +
102 102
         " answer has an array of length: " + answer.wordArray.length);
103
-    //first add the offset between the start of the transcription and
104
-    //the start of the recording to all start and end times
103
+    // first add the offset between the start of the transcription and
104
+    // the start of the recording to all start and end times
105 105
     if(answer.wordArray.length > 0) {
106 106
         var offset = answer.startTime.getUTCMilliseconds() -
107 107
             this.startTime.getUTCMilliseconds();
108
-        //transcriber time will always be earlier
108
+        // transcriber time will always be earlier
109 109
         if (offset < 0) {
110
-            offset = 0; //presume 0 if it somehow not earlier
110
+            offset = 0; // presume 0 if it somehow not earlier
111 111
         }
112 112
 
113 113
         var array = "[";
@@ -118,16 +118,16 @@ var blobCallBack = function(answer){
118 118
         });
119 119
         array += "]";
120 120
         console.log(array);
121
-        //give a name value to the Array object so that the merging can access
122
-        //the name value without having to use the whole recordingResult object
123
-        //in the algorithm
121
+        // give a name value to the Array object so that the merging can access
122
+        // the name value without having to use the whole recordingResult object
123
+        // in the algorithm
124 124
         answer.wordArray.name = answer.name;
125 125
     }
126
-    //then store the array and decrease the counter
126
+    // then store the array and decrease the counter
127 127
     this.results.push(answer.wordArray);
128 128
     this.counter--;
129 129
     console.log("current counter: " + this.counter);
130
-    //and check if all results have been received.
130
+    // and check if all results have been received.
131 131
     this.maybeMerge();
132 132
 };
133 133
 
@@ -137,8 +137,8 @@ var blobCallBack = function(answer){
137 137
  */
138 138
 transcriber.prototype.maybeMerge = function(){
139 139
     if(this.state === TRANSCRIBING_STATE && this.counter === 0){
140
-        //make sure to include the events in the result arrays before
141
-        //merging starts
140
+        // make sure to include the events in the result arrays before
141
+        // merging starts
142 142
         this.merge();
143 143
     }
144 144
 };
@@ -151,47 +151,47 @@ transcriber.prototype.merge = function() {
151 151
     console.log("starting merge process!\n The length of the array: " +
152 152
         this.results.length);
153 153
     this.transcription = "";
154
-    //the merging algorithm will look over all Word objects who are at pos 0 in
155
-    //every array. It will then select the one closest in time to the
156
-    //previously placed word, while removing the selected word from its array
157
-    //note: words can be skipped the skipped word's begin and end time somehow
158
-    //end up between the closest word start and end time
154
+    // the merging algorithm will look over all Word objects who are at pos 0 in
155
+    // every array. It will then select the one closest in time to the
156
+    // previously placed word, while removing the selected word from its array
157
+    // note: words can be skipped the skipped word's begin and end time somehow
158
+    // end up between the closest word start and end time
159 159
     var arrays = this.results;
160
-    //arrays of Word objects
161
-    var potentialWords = []; //array of the first Word objects
162
-    //check if any arrays are already empty and remove them
160
+    // arrays of Word objects
161
+    var potentialWords = []; // array of the first Word objects
162
+    // check if any arrays are already empty and remove them
163 163
     hasPopulatedArrays(arrays);
164 164
 
165
-    //populate all the potential Words for a first time
165
+    // populate all the potential Words for a first time
166 166
     arrays.forEach(function (array){
167 167
         pushWordToSortedArray(potentialWords, array);
168 168
     });
169 169
 
170
-    //keep adding words to transcription until all arrays are exhausted
170
+    // keep adding words to transcription until all arrays are exhausted
171 171
     var lowestWordArray;
172 172
     var wordToAdd;
173 173
     var foundSmaller;
174 174
     while(hasPopulatedArrays(arrays)){
175
-        //first select the lowest array;
175
+        // first select the lowest array;
176 176
         lowestWordArray = arrays[0];
177 177
         arrays.forEach(function(wordArray){
178 178
             if(wordArray[0].begin < lowestWordArray[0].begin){
179 179
                 lowestWordArray = wordArray;
180 180
             }
181 181
         });
182
-        //put the word in the transcription
182
+        // put the word in the transcription
183 183
         wordToAdd = lowestWordArray.shift();
184 184
         this.updateTranscription(wordToAdd,lowestWordArray.name);
185 185
 
186
-        //keep going until a word in another array has a smaller time
187
-        //or the array is empty
186
+        // keep going until a word in another array has a smaller time
187
+        // or the array is empty
188 188
         while(!foundSmaller && lowestWordArray.length > 0){
189 189
             arrays.forEach(function(wordArray){
190 190
                 if(wordArray[0].begin < lowestWordArray[0].begin){
191 191
                     foundSmaller = true;
192 192
                 }
193 193
             });
194
-            //add next word if no smaller time has been found
194
+            // add next word if no smaller time has been found
195 195
             if(!foundSmaller){
196 196
                 wordToAdd = lowestWordArray.shift();
197 197
                 this.updateTranscription(wordToAdd, null);
@@ -200,7 +200,7 @@ transcriber.prototype.merge = function() {
200 200
 
201 201
     }
202 202
 
203
-    //set the state to finished and do the necessary left-over tasks
203
+    // set the state to finished and do the necessary left-over tasks
204 204
     this.state = FINISHED_STATE;
205 205
     if(this.callback){
206 206
         this.callback(this.transcription);
@@ -216,14 +216,14 @@ transcriber.prototype.merge = function() {
216 216
 transcriber.prototype.updateTranscription = function(word, name){
217 217
     if(name !== undefined && name !== null){
218 218
         this.transcription += "\n" + name + ":";
219
-        this.lineLength = name.length + 1; //+1 for the semi-colon
219
+        this.lineLength = name.length + 1; // +1 for the semi-colon
220 220
     }
221 221
     if(this.lineLength + word.word.length > MAXIMUM_SENTENCE_LENGTH){
222 222
         this.transcription += "\n    ";
223
-        this.lineLength = 4; //because of the 4 spaces after the new line
223
+        this.lineLength = 4; // because of the 4 spaces after the new line
224 224
     }
225 225
     this.transcription += " " + word.word;
226
-    this.lineLength += word.word.length + 1; //+1 for the space
226
+    this.lineLength += word.word.length + 1; // +1 for the space
227 227
 };
228 228
 
229 229
 /**
@@ -267,7 +267,7 @@ var pushWordToSortedArray = function(array, word){
267 267
                 return;
268 268
             }
269 269
         }
270
-        array.push(word); //fail safe
270
+        array.push(word); // fail safe
271 271
     }
272 272
 };
273 273
 

+ 9
- 9
modules/transcription/transcriptionServices/SphinxTranscriptionService.js Переглянути файл

@@ -8,7 +8,7 @@ var audioRecorder = require("./../audioRecorder");
8 8
  * Implements a TranscriptionService for a Sphinx4 http server
9 9
  */
10 10
 var SphinxService = function() {
11
-    //set the correct url
11
+    // set the correct url
12 12
     this.url = getURL();
13 13
 };
14 14
 
@@ -41,7 +41,7 @@ SphinxService.prototype.sendRequest = function(audioFileBlob, callback) {
41 41
             throw new Error("unable to accept response from sphinx server." +
42 42
                 "status: " + request.status);
43 43
         }
44
-        //if not ready no point to throw an error
44
+        // if not ready no point to throw an error
45 45
     };
46 46
     request.open("POST", this.url);
47 47
     request.setRequestHeader("Content-Type",
@@ -58,8 +58,8 @@ SphinxService.prototype.sendRequest = function(audioFileBlob, callback) {
58 58
  */
59 59
 SphinxService.prototype.formatResponse = function(response) {
60 60
     var result = JSON.parse(response).objects;
61
-    //make sure to delete the session id object, which is always
62
-    //the first value in the JSON array
61
+    // make sure to delete the session id object, which is always
62
+    // the first value in the JSON array
63 63
     result.shift();
64 64
     var array = [];
65 65
     result.forEach(function(word){
@@ -77,11 +77,11 @@ SphinxService.prototype.formatResponse = function(response) {
77 77
  */
78 78
 SphinxService.prototype.verify = function(response){
79 79
     console.log("response from server:" + response.toString());
80
-    //test if server responded with a string object
80
+    // test if server responded with a string object
81 81
     if(typeof response !== "string"){
82 82
         return false;
83 83
     }
84
-    //test if the string can be parsed into valid JSON
84
+    // test if the string can be parsed into valid JSON
85 85
     var json;
86 86
     try{
87 87
         json = JSON.parse(response);
@@ -89,16 +89,16 @@ SphinxService.prototype.verify = function(response){
89 89
         console.log(error);
90 90
         return false;
91 91
     }
92
-    //check if the JSON has a "objects" value
92
+    // check if the JSON has a "objects" value
93 93
     if(json.objects === undefined){
94 94
         return false;
95 95
     }
96
-    //get the "objects" value and check for a session ID
96
+    // get the "objects" value and check for a session ID
97 97
     var array = json.objects;
98 98
     if(!(array[0] && array[0]["session-id"])){
99 99
         return false;
100 100
     }
101
-    //everything seems to be in order
101
+    // everything seems to be in order
102 102
     return true;
103 103
 };
104 104
 

+ 2
- 2
modules/util/EventEmitterForwarder.js Переглянути файл

@@ -26,9 +26,9 @@ EventEmitterForwarder.prototype.forward = function () {
26 26
     // This line is only for fixing jshint errors.
27 27
     var args = arguments;
28 28
     var srcEvent = args[0];
29
-    //This will be the "this" value for emit function.
29
+    // This will be the "this" value for emit function.
30 30
     args[0] = this.dest;
31
-    //Using bind.apply to pass the arguments as Array-like object ("arguments")
31
+    // Using bind.apply to pass the arguments as Array-like object ("arguments")
32 32
     this.src.addListener(srcEvent,
33 33
         Function.prototype.bind.apply(this.dest.emit, args));
34 34
 };

+ 1
- 1
modules/xmpp/Caps.js Переглянути файл

@@ -164,7 +164,7 @@ export default class Caps extends Listenable {
164 164
      * Handles this.version changes.
165 165
      */
166 166
     _notifyVersionChanged() {
167
-        //update the version for all rooms
167
+        // update the version for all rooms
168 168
         this.rooms.forEach(room => this._fixChatRoomPresenceMap(room));
169 169
         this.submit();
170 170
     }

+ 1
- 1
modules/xmpp/ChatRoom.js Переглянути файл

@@ -628,7 +628,7 @@ export default class ChatRoom extends Listenable {
628 628
     }
629 629
 
630 630
     lockRoom (key, onSuccess, onError, onNotSupported) {
631
-        //http://xmpp.org/extensions/xep-0045.html#roomconfig
631
+        // http://xmpp.org/extensions/xep-0045.html#roomconfig
632 632
         var ob = this;
633 633
         this.connection.sendIQ($iq({to: this.roomjid, type: 'get'}).c('query', {xmlns: 'http://jabber.org/protocol/muc#owner'}),
634 634
             function (res) {

+ 6
- 6
modules/xmpp/JingleSessionPC.js Переглянути файл

@@ -310,7 +310,7 @@ export default class JingleSessionPC extends JingleSession {
310 310
         }
311 311
         // might merge last-candidate notification into this, but it is called
312 312
         // a lot later. See webrtc issue #2340
313
-        //logger.log('was this the last candidate', this.lasticecandidate);
313
+        // logger.log('was this the last candidate', this.lasticecandidate);
314 314
         this.connection.sendIQ(
315 315
             cand, null, this.newJingleErrorHandler(cand, function (error) {
316 316
                 GlobalOnErrorHandler.callErrorHandler(
@@ -620,8 +620,8 @@ export default class JingleSessionPC extends JingleSession {
620 620
         this.state = 'ended';
621 621
 
622 622
         // Do something with reason and reasonCondition when we start to care
623
-        //this.reasonCondition = reasonCondition;
624
-        //this.reasonText = reasonText;
623
+        // this.reasonCondition = reasonCondition;
624
+        // this.reasonText = reasonText;
625 625
         logger.info("Session terminated", this, reasonCondition, reasonText);
626 626
 
627 627
         this.close();
@@ -867,7 +867,7 @@ export default class JingleSessionPC extends JingleSession {
867 867
             sdp: remoteSdp.raw
868 868
         });
869 869
 
870
-        //TODO(brian): in the code below there are 2 chunks of code that relate
870
+        // TODO(brian): in the code below there are 2 chunks of code that relate
871 871
         //  to observing changes in local and remove ufrags.  since they
872 872
         //  just need to read and observe the SDPs, we should create the
873 873
         //  notion of an SDP observer in TraceablePeerConnection that
@@ -1137,7 +1137,7 @@ export default class JingleSessionPC extends JingleSession {
1137 1137
      * @param stream: webrtc media stream
1138 1138
      */
1139 1139
     _handleFirefoxRemoveStream(stream) {
1140
-        if (!stream) { //There is nothing to be changed
1140
+        if (!stream) { // There is nothing to be changed
1141 1141
             return;
1142 1142
         }
1143 1143
         let sender = null;
@@ -1548,7 +1548,7 @@ export default class JingleSessionPC extends JingleSession {
1548 1548
                     const sourceNode
1549 1549
                         = desc.find(">source[ssrc=\"" + ssrc + "\"]");
1550 1550
                     if (!sourceNode || !sourceNode.length) {
1551
-                        //Maybe we have to include cname, msid, etc here?
1551
+                        // Maybe we have to include cname, msid, etc here?
1552 1552
                         desc.append(
1553 1553
                             "<source " +
1554 1554
                             "xmlns=\"urn:xmpp:jingle:apps:rtp:ssma:0\" " +

+ 3
- 3
modules/xmpp/RtxModifier.spec.js Переглянути файл

@@ -1,5 +1,5 @@
1
-/*eslint-disable max-len*/
2
-/*jshint maxlen:false*/
1
+/* eslint-disable max-len*/
2
+/* jshint maxlen:false*/
3 3
 import RtxModifier from "./RtxModifier.js";
4 4
 import * as SampleSdpStrings from "./SampleSdpStrings.js";
5 5
 import * as transform from 'sdp-transform';
@@ -307,4 +307,4 @@ describe ("RtxModifier", function() {
307 307
     });
308 308
 });
309 309
 
310
-/*eslint-enable max-len*/
310
+/* eslint-enable max-len*/

+ 1
- 1
modules/xmpp/SDPUtil.js Переглянути файл

@@ -326,7 +326,7 @@ var SDPUtil = {
326 326
             protocol = 'tcp';
327 327
         }
328 328
 
329
-        line += protocol; //.toUpperCase(); // chrome M23 doesn't like this
329
+        line += protocol; // .toUpperCase(); // chrome M23 doesn't like this
330 330
         line += ' ';
331 331
         line += cand.getAttribute('priority');
332 332
         line += ' ';

+ 3
- 3
modules/xmpp/SampleSdpStrings.js Переглянути файл

@@ -1,5 +1,5 @@
1
-/*eslint-disable max-len*/
2
-/*jshint maxlen:false*/
1
+/* eslint-disable max-len*/
2
+/* jshint maxlen:false*/
3 3
 import * as transform from 'sdp-transform';
4 4
 
5 5
 // A generic sdp session block
@@ -199,4 +199,4 @@ export const plainVideoSdp = transform.parse(plainVideoSdpStr);
199 199
 export const rtxVideoSdp = transform.parse(rtxVideoSdpStr);
200 200
 export const multiCodecVideoSdp = transform.parse(multiCodecVideoSdpStr);
201 201
 
202
-/*eslint-enable max-len*/
202
+/* eslint-enable max-len*/

+ 4
- 3
modules/xmpp/moderator.js Переглянути файл

@@ -41,7 +41,7 @@ function Moderator(roomName, xmpp, emitter, options) {
41 41
 
42 42
     this.connection = this.xmppService.connection;
43 43
     this.focusUserJid;
44
-    //FIXME:
44
+    // FIXME:
45 45
     // Message listener that talks to POPUP window
46 46
     function listener(event) {
47 47
         if (event.data && event.data.sessionId) {
@@ -329,7 +329,8 @@ Moderator.prototype._allocateConferenceFocusError = function (error, callback) {
329 329
         logger.warn("Unauthorized to start the conference", error);
330 330
         var toDomain = Strophe.getDomainFromJid(error.getAttribute('to'));
331 331
         if (toDomain !== this.options.connection.hosts.anonymousdomain) {
332
-            //FIXME "is external" should come either from the focus or config.js
332
+            // FIXME "is external" should come either from the focus or
333
+            // config.js
333 334
             this.externalAuthEnabled = true;
334 335
         }
335 336
         this.eventEmitter.emit(XMPPEvents.AUTHENTICATION_REQUIRED);
@@ -342,7 +343,7 @@ Moderator.prototype._allocateConferenceFocusError = function (error, callback) {
342 343
     // Show message
343 344
     var focusComponent = this.getFocusComponent();
344 345
     var retrySec = waitMs / 1000;
345
-    //FIXME: message is duplicated ? Do not show in case of session invalid
346
+    // FIXME: message is duplicated ? Do not show in case of session invalid
346 347
     // which means just a retry
347 348
     if (!invalidSession) {
348 349
         this.eventEmitter.emit(

+ 1
- 1
modules/xmpp/strophe.ping.js Переглянути файл

@@ -106,7 +106,7 @@ class PingConnectionPlugin extends ConnectionPlugin {
106 106
                     // Not really sure what's the right thing to do in that
107 107
                     // situation, but just closing the connection makes no
108 108
                     // sense.
109
-                    //self.connection.disconnect();
109
+                    // self.connection.disconnect();
110 110
                 } else {
111 111
                     logger.warn(errmsg, error);
112 112
                 }

+ 3
- 3
modules/xmpp/xmpp.js Переглянути файл

@@ -72,14 +72,14 @@ export default class XMPP extends Listenable {
72 72
 
73 73
         // this is dealt with by SDP O/A so we don't need to announce this
74 74
         // XEP-0293
75
-        //this.caps.addFeature('urn:xmpp:jingle:apps:rtp:rtcp-fb:0');
75
+        // this.caps.addFeature('urn:xmpp:jingle:apps:rtp:rtcp-fb:0');
76 76
         // XEP-0294
77
-        //this.caps.addFeature('urn:xmpp:jingle:apps:rtp:rtp-hdrext:0');
77
+        // this.caps.addFeature('urn:xmpp:jingle:apps:rtp:rtp-hdrext:0');
78 78
 
79 79
         this.caps.addFeature('urn:ietf:rfc:5761'); // rtcp-mux
80 80
         this.caps.addFeature('urn:ietf:rfc:5888'); // a=group, e.g. bundle
81 81
 
82
-        //this.caps.addFeature('urn:ietf:rfc:5576'); // a=ssrc
82
+        // this.caps.addFeature('urn:ietf:rfc:5576'); // a=ssrc
83 83
 
84 84
         // Enable Lipsync ?
85 85
         if (RTCBrowserType.isChrome() && false !== this.options.enableLipSync) {

Завантаження…
Відмінити
Зберегти