瀏覽代碼

jshint cleanups

- equality operators
- missing/excess semicolons
- trailing whitespace
master
Matthew Duggan 11 年之前
父節點
當前提交
8314936a14
共有 6 個檔案被更改,包括 75 行新增76 行删除
  1. 52
    52
      app.js
  2. 6
    6
      chat.js
  3. 2
    2
      estos_log.js
  4. 3
    3
      etherpad.js
  5. 1
    1
      muc.js
  6. 11
    12
      replacement.js

+ 52
- 52
app.js 查看文件

19
     if (RTC === null) {
19
     if (RTC === null) {
20
         window.location.href = 'webrtcrequired.html';
20
         window.location.href = 'webrtcrequired.html';
21
         return;
21
         return;
22
-    } else if (RTC.browser != 'chrome') {
22
+    } else if (RTC.browser !== 'chrome') {
23
         window.location.href = 'chromeonly.html';
23
         window.location.href = 'chromeonly.html';
24
         return;
24
         return;
25
     }
25
     }
26
-    RTCPeerconnection = TraceablePeerConnection; 
26
+    RTCPeerconnection = TraceablePeerConnection;
27
 
27
 
28
     connection = new Strophe.Connection(document.getElementById('boshURL').value || config.bosh || '/http-bind');
28
     connection = new Strophe.Connection(document.getElementById('boshURL').value || config.bosh || '/http-bind');
29
 
29
 
44
     var jid = document.getElementById('jid').value || config.hosts.domain || window.location.hostname;
44
     var jid = document.getElementById('jid').value || config.hosts.domain || window.location.hostname;
45
 
45
 
46
     connection.connect(jid, document.getElementById('password').value, function (status) {
46
     connection.connect(jid, document.getElementById('password').value, function (status) {
47
-        if (status == Strophe.Status.CONNECTED) {
47
+        if (status === Strophe.Status.CONNECTED) {
48
             console.log('connected');
48
             console.log('connected');
49
             if (config.useStunTurn) {
49
             if (config.useStunTurn) {
50
                 connection.jingle.getStunAndTurnCredentials();
50
                 connection.jingle.getStunAndTurnCredentials();
51
             }
51
             }
52
-            if (RTC.browser == 'firefox') {
52
+            if (RTC.browser === 'firefox') {
53
                 getUserMediaWithConstraints(['audio']);
53
                 getUserMediaWithConstraints(['audio']);
54
             } else {
54
             } else {
55
                 getUserMediaWithConstraints(['audio', 'video'], config.resolution || '360');
55
                 getUserMediaWithConstraints(['audio', 'video'], config.resolution || '360');
118
         updateLargeVideo($(this).attr('src'), true, 0);
118
         updateLargeVideo($(this).attr('src'), true, 0);
119
 
119
 
120
         $('video').each(function (idx, el) {
120
         $('video').each(function (idx, el) {
121
-            if (el.id.indexOf('mixedmslabel') != -1) {
121
+            if (el.id.indexOf('mixedmslabel') !== -1) {
122
                 el.volume = 0;
122
                 el.volume = 0;
123
                 el.volume = 1;
123
                 el.volume = 1;
124
-            } 
124
+            }
125
         });
125
         });
126
     });
126
     });
127
 
127
 
131
 $(document).bind('mediafailure.jingle', function () {
131
 $(document).bind('mediafailure.jingle', function () {
132
     // FIXME
132
     // FIXME
133
 });
133
 });
134
-  
134
+
135
 $(document).bind('remotestreamadded.jingle', function (event, data, sid) {
135
 $(document).bind('remotestreamadded.jingle', function (event, data, sid) {
136
     function waitForRemoteVideo(selector, sid) {
136
     function waitForRemoteVideo(selector, sid) {
137
         var sess = connection.jingle.sessions[sid];
137
         var sess = connection.jingle.sessions[sid];
138
-        if (data.stream.id == 'mixedmslabel') return;
138
+        if (data.stream.id === 'mixedmslabel') return;
139
         videoTracks = data.stream.getVideoTracks();
139
         videoTracks = data.stream.getVideoTracks();
140
         if (videoTracks.length === 0 || selector[0].currentTime > 0) {
140
         if (videoTracks.length === 0 || selector[0].currentTime > 0) {
141
             RTC.attachMediaStream(selector, data.stream); // FIXME: why do i have to do this for FF?
141
             RTC.attachMediaStream(selector, data.stream); // FIXME: why do i have to do this for FF?
148
     var sess = connection.jingle.sessions[sid];
148
     var sess = connection.jingle.sessions[sid];
149
 
149
 
150
     // look up an associated JID for a stream id
150
     // look up an associated JID for a stream id
151
-    if (data.stream.id.indexOf('mixedmslabel') == -1) {
151
+    if (data.stream.id.indexOf('mixedmslabel') === -1) {
152
         var ssrclines = SDPUtil.find_lines(sess.peerconnection.remoteDescription.sdp, 'a=ssrc');
152
         var ssrclines = SDPUtil.find_lines(sess.peerconnection.remoteDescription.sdp, 'a=ssrc');
153
         ssrclines = ssrclines.filter(function (line) {
153
         ssrclines = ssrclines.filter(function (line) {
154
-            return line.indexOf('mslabel:' + data.stream.label) != -1; 
154
+            return line.indexOf('mslabel:' + data.stream.label) !== -1;
155
                                      });
155
                                      });
156
         if (ssrclines.length) {
156
         if (ssrclines.length) {
157
             thessrc = ssrclines[0].substring(7).split(' ')[0];
157
             thessrc = ssrclines[0].substring(7).split(' ')[0];
179
             //console.log('found container for', data.peerjid);
179
             //console.log('found container for', data.peerjid);
180
         }
180
         }
181
     } else {
181
     } else {
182
-        if (data.stream.id != 'mixedmslabel') {
182
+        if (data.stream.id !== 'mixedmslabel') {
183
             console.warn('can not associate stream', data.stream.id, 'with a participant');
183
             console.warn('can not associate stream', data.stream.id, 'with a participant');
184
         }
184
         }
185
         // FIXME: for the mixed ms we dont need a video -- currently
185
         // FIXME: for the mixed ms we dont need a video -- currently
195
     vid.oncontextmenu = function () { return false; };
195
     vid.oncontextmenu = function () { return false; };
196
     container.appendChild(vid);
196
     container.appendChild(vid);
197
     // TODO: make mixedstream display:none via css?
197
     // TODO: make mixedstream display:none via css?
198
-    if (id.indexOf('mixedmslabel') != -1) {
198
+    if (id.indexOf('mixedmslabel') !== -1) {
199
         container.id = 'mixedstream';
199
         container.id = 'mixedstream';
200
         $(container).hide();
200
         $(container).hide();
201
     }
201
     }
232
         }
232
         }
233
     );
233
     );
234
     // an attempt to work around https://github.com/jitsi/jitmeet/issues/32
234
     // an attempt to work around https://github.com/jitsi/jitmeet/issues/32
235
-    if (data.peerjid && sess.peerjid == data.peerjid && 
236
-            data.stream.getVideoTracks().length == 0 && 
235
+    if (data.peerjid && sess.peerjid === data.peerjid &&
236
+            data.stream.getVideoTracks().length === 0 &&
237
             connection.jingle.localStream.getVideoTracks().length > 0) {
237
             connection.jingle.localStream.getVideoTracks().length > 0) {
238
         window.setTimeout(function() {
238
         window.setTimeout(function() {
239
             sendKeyframe(sess.peerconnection);
239
             sendKeyframe(sess.peerconnection);
244
 // an attempt to work around https://github.com/jitsi/jitmeet/issues/32
244
 // an attempt to work around https://github.com/jitsi/jitmeet/issues/32
245
 function sendKeyframe(pc) {
245
 function sendKeyframe(pc) {
246
     console.log('sendkeyframe', pc.iceConnectionState);
246
     console.log('sendkeyframe', pc.iceConnectionState);
247
-    if (pc.iceConnectionState != 'connected') return; // safe...
247
+    if (pc.iceConnectionState !== 'connected') return; // safe...
248
     pc.setRemoteDescription(
248
     pc.setRemoteDescription(
249
         pc.remoteDescription,
249
         pc.remoteDescription,
250
         function () {
250
         function () {
350
 });
350
 });
351
 
351
 
352
 $(document).bind('callactive.jingle', function (event, videoelem, sid) {
352
 $(document).bind('callactive.jingle', function (event, videoelem, sid) {
353
-    if (videoelem.attr('id').indexOf('mixedmslabel') == -1) {
353
+    if (videoelem.attr('id').indexOf('mixedmslabel') === -1) {
354
         // ignore mixedmslabela0 and v0
354
         // ignore mixedmslabela0 and v0
355
         videoelem.show();
355
         videoelem.show();
356
         resizeThumbnails();
356
         resizeThumbnails();
464
         $(container).hide();
464
         $(container).hide();
465
         resizeThumbnails();
465
         resizeThumbnails();
466
     }
466
     }
467
-    if (focus === null && connection.emuc.myroomjid == connection.emuc.list_members[0]) {
467
+    if (focus === null && connection.emuc.myroomjid === connection.emuc.list_members[0]) {
468
         console.log('welcome to our new focus... myself');
468
         console.log('welcome to our new focus... myself');
469
         focus = new ColibriFocus(connection, config.hosts.bridge);
469
         focus = new ColibriFocus(connection, config.hosts.bridge);
470
         if (Object.keys(connection.emuc.members).length > 0) {
470
         if (Object.keys(connection.emuc.members).length > 0) {
471
             focus.makeConference(Object.keys(connection.emuc.members));
471
             focus.makeConference(Object.keys(connection.emuc.members));
472
         }
472
         }
473
         $(document).trigger('focusechanged.muc', [focus]);
473
         $(document).trigger('focusechanged.muc', [focus]);
474
-    } 
474
+    }
475
     else if (focus && Object.keys(connection.emuc.members).length === 0) {
475
     else if (focus && Object.keys(connection.emuc.members).length === 0) {
476
         console.log('everyone left');
476
         console.log('everyone left');
477
         if (focus !== null) {
477
         if (focus !== null) {
478
-            // FIXME: closing the connection is a hack to avoid some 
478
+            // FIXME: closing the connection is a hack to avoid some
479
             // problemswith reinit
479
             // problemswith reinit
480
             if (focus.peerconnection !== null) {
480
             if (focus.peerconnection !== null) {
481
                 focus.peerconnection.close();
481
                 focus.peerconnection.close();
494
         ssrc2jid[ssrc.getAttribute('ssrc')] = jid;
494
         ssrc2jid[ssrc.getAttribute('ssrc')] = jid;
495
 
495
 
496
         // might need to update the direction if participant just went from sendrecv to recvonly
496
         // might need to update the direction if participant just went from sendrecv to recvonly
497
-        if (ssrc.getAttribute('type') == 'video') {
497
+        if (ssrc.getAttribute('type') === 'video') {
498
             var el = $('#participant_'  + Strophe.getResourceFromJid(jid) + '>video');
498
             var el = $('#participant_'  + Strophe.getResourceFromJid(jid) + '>video');
499
             switch(ssrc.getAttribute('direction')) {
499
             switch(ssrc.getAttribute('direction')) {
500
             case 'sendrecv':
500
             case 'sendrecv':
501
-                el.show(); 
501
+                el.show();
502
                 break;
502
                 break;
503
             case 'recvonly':
503
             case 'recvonly':
504
                 el.hide();
504
                 el.hide();
532
                     {
532
                     {
533
                         var lockKey = document.getElementById('lockKey');
533
                         var lockKey = document.getElementById('lockKey');
534
 
534
 
535
-                        if (lockKey.value != null)
535
+                        if (lockKey.value !== null)
536
                         {
536
                         {
537
                             setSharedKey(lockKey.value);
537
                             setSharedKey(lockKey.value);
538
                             connection.emuc.doJoin(jid, lockKey.value);
538
                             connection.emuc.doJoin(jid, lockKey.value);
551
     setPresentationVisible(false);
551
     setPresentationVisible(false);
552
     $('#participant_' + Strophe.getResourceFromJid(jid) + '_' + presId).remove();
552
     $('#participant_' + Strophe.getResourceFromJid(jid) + '_' + presId).remove();
553
     $('#presentation>iframe').remove();
553
     $('#presentation>iframe').remove();
554
-    if (preziPlayer != null) {
554
+    if (preziPlayer !== null) {
555
         preziPlayer.destroy();
555
         preziPlayer.destroy();
556
         preziPlayer = null;
556
         preziPlayer = null;
557
     }
557
     }
585
             else {
585
             else {
586
                 var e = event.toElement || event.relatedTarget;
586
                 var e = event.toElement || event.relatedTarget;
587
 
587
 
588
-                while(e && e.parentNode && e.parentNode != window) {
589
-                    if (e.parentNode == this ||  e ==  this) {
588
+                while(e && e.parentNode && e.parentNode !== window) {
589
+                    if (e.parentNode === this || e === this) {
590
                         return false;
590
                         return false;
591
                     }
591
                     }
592
                     e = e.parentNode;
592
                     e = e.parentNode;
608
 
608
 
609
     preziPlayer.on(PreziPlayer.EVENT_STATUS, function(event) {
609
     preziPlayer.on(PreziPlayer.EVENT_STATUS, function(event) {
610
         console.log("prezi status", event.value);
610
         console.log("prezi status", event.value);
611
-        if (event.value == PreziPlayer.STATUS_CONTENT_READY) {
612
-            if (jid != connection.emuc.myroomjid)
611
+        if (event.value === PreziPlayer.STATUS_CONTENT_READY) {
612
+            if (jid !== connection.emuc.myroomjid)
613
                 preziPlayer.flyToStep(currentSlide);
613
                 preziPlayer.flyToStep(currentSlide);
614
         }
614
         }
615
     });
615
     });
680
     }
680
     }
681
 }
681
 }
682
 
682
 
683
-var isPresentationVisible = function () {
684
-    return ($('#presentation>iframe') != null && $('#presentation>iframe').css('opacity') == 1);
683
+function isPresentationVisible() {
684
+    return ($('#presentation>iframe') !== null && $('#presentation>iframe').css('opacity') == 1);
685
 }
685
 }
686
 
686
 
687
 /**
687
 /**
692
 
692
 
693
     setPresentationVisible(false);
693
     setPresentationVisible(false);
694
 
694
 
695
-    if ($('#largeVideo').attr('src') != newSrc) {
695
+    if ($('#largeVideo').attr('src') !== newSrc) {
696
 
696
 
697
         document.getElementById('largeVideo').volume = vol;
697
         document.getElementById('largeVideo').volume = vol;
698
 
698
 
700
             $(this).attr('src', newSrc);
700
             $(this).attr('src', newSrc);
701
 
701
 
702
             var videoTransform = document.getElementById('largeVideo').style.webkitTransform;
702
             var videoTransform = document.getElementById('largeVideo').style.webkitTransform;
703
-            if (localVideo && videoTransform != 'scaleX(-1)') {
703
+            if (localVideo && videoTransform !== 'scaleX(-1)') {
704
                 document.getElementById('largeVideo').style.webkitTransform = "scaleX(-1)";
704
                 document.getElementById('largeVideo').style.webkitTransform = "scaleX(-1)";
705
             }
705
             }
706
-            else if (!localVideo && videoTransform == 'scaleX(-1)') {
706
+            else if (!localVideo && videoTransform === 'scaleX(-1)') {
707
                 document.getElementById('largeVideo').style.webkitTransform = "none";
707
                 document.getElementById('largeVideo').style.webkitTransform = "none";
708
             }
708
             }
709
 
709
 
880
  */
880
  */
881
 function openLockDialog() {
881
 function openLockDialog() {
882
     // Only the focus is able to set a shared key.
882
     // Only the focus is able to set a shared key.
883
-    if (focus == null) {
883
+    if (focus === null) {
884
         if (sharedKey)
884
         if (sharedKey)
885
             $.prompt("This conversation is currently protected by a shared secret key.",
885
             $.prompt("This conversation is currently protected by a shared secret key.",
886
                  {
886
                  {
981
                         }
981
                         }
982
              /*
982
              /*
983
                         var lockKey = document.getElementById('lockKey');
983
                         var lockKey = document.getElementById('lockKey');
984
-             
984
+
985
                         if (lockKey.value)
985
                         if (lockKey.value)
986
                         {
986
                         {
987
                             setSharedKey(lockKey.value);
987
                             setSharedKey(lockKey.value);
1013
             }
1013
             }
1014
         });
1014
         });
1015
     }
1015
     }
1016
-    else if (preziPlayer != null) {
1016
+    else if (preziPlayer !== null) {
1017
         $.prompt("Another participant is already sharing a Prezi." +
1017
         $.prompt("Another participant is already sharing a Prezi." +
1018
                 "This conference allows only one Prezi at a time.",
1018
                 "This conference allows only one Prezi at a time.",
1019
                  {
1019
                  {
1044
                         var urlValue
1044
                         var urlValue
1045
                             = encodeURI(Util.escapeHtml(preziUrl.value));
1045
                             = encodeURI(Util.escapeHtml(preziUrl.value));
1046
 
1046
 
1047
-                        if (urlValue.indexOf('http://prezi.com/') != 0
1048
-                            && urlValue.indexOf('https://prezi.com/') != 0)
1047
+                        if (urlValue.indexOf('http://prezi.com/') !== 0
1048
+                            && urlValue.indexOf('https://prezi.com/') !== 0)
1049
                         {
1049
                         {
1050
                             $.prompt.goToState('state1');
1050
                             $.prompt.goToState('state1');
1051
                             return false;
1051
                             return false;
1077
             defaultButton: 1,
1077
             defaultButton: 1,
1078
             submit:function(e,v,m,f) {
1078
             submit:function(e,v,m,f) {
1079
                 e.preventDefault();
1079
                 e.preventDefault();
1080
-                if(v==0)
1080
+                if (v === 0)
1081
                     $.prompt.close();
1081
                     $.prompt.close();
1082
                 else
1082
                 else
1083
                     $.prompt.goToState('state0');
1083
                     $.prompt.goToState('state0');
1127
  */
1127
  */
1128
 function showToolbar() {
1128
 function showToolbar() {
1129
     $('#toolbar').css({visibility:"visible"});
1129
     $('#toolbar').css({visibility:"visible"});
1130
-    if (focus != null)
1130
+    if (focus !== null)
1131
     {
1131
     {
1132
 //        TODO: Enable settings functionality. Need to uncomment the settings button in index.html.
1132
 //        TODO: Enable settings functionality. Need to uncomment the settings button in index.html.
1133
 //        $('#settingsButton').css({visibility:"visible"});
1133
 //        $('#settingsButton').css({visibility:"visible"});
1145
  * Warning to the user that the conference window is about to be closed.
1145
  * Warning to the user that the conference window is about to be closed.
1146
  */
1146
  */
1147
 function closePageWarning() {
1147
 function closePageWarning() {
1148
-    if (focus != null)
1148
+    if (focus !== null)
1149
         return "You are the owner of this conference call and you are about to end it.";
1149
         return "You are the owner of this conference call and you are about to end it.";
1150
     else
1150
     else
1151
         return "You are about to leave this conversation.";
1151
         return "You are about to leave this conversation.";
1157
  * from the connection.jingle.sessions.
1157
  * from the connection.jingle.sessions.
1158
  */
1158
  */
1159
 function showFocusIndicator() {
1159
 function showFocusIndicator() {
1160
-    if (focus != null) {
1160
+    if (focus !== null) {
1161
         var indicatorSpan = $('#localVideoContainer .focusindicator');
1161
         var indicatorSpan = $('#localVideoContainer .focusindicator');
1162
 
1162
 
1163
-        if (indicatorSpan.children().length == 0)
1163
+        if (indicatorSpan.children().length === 0)
1164
         {
1164
         {
1165
             createFocusIndicatorElement(indicatorSpan[0]);
1165
             createFocusIndicatorElement(indicatorSpan[0]);
1166
         }
1166
         }
1172
         var focusContainer = document.getElementById(focusId);
1172
         var focusContainer = document.getElementById(focusId);
1173
         var indicatorSpan = $('#' + focusId + ' .focusindicator');
1173
         var indicatorSpan = $('#' + focusId + ' .focusindicator');
1174
 
1174
 
1175
-        if (!indicatorSpan || indicatorSpan.length == 0) {
1175
+        if (!indicatorSpan || indicatorSpan.length === 0) {
1176
             indicatorSpan = document.createElement('span');
1176
             indicatorSpan = document.createElement('span');
1177
             indicatorSpan.className = 'focusindicator';
1177
             indicatorSpan.className = 'focusindicator';
1178
             focusContainer.appendChild(indicatorSpan);
1178
             focusContainer.appendChild(indicatorSpan);
1179
-            
1179
+
1180
             createFocusIndicatorElement(indicatorSpan);
1180
             createFocusIndicatorElement(indicatorSpan);
1181
         }
1181
         }
1182
     }
1182
     }
1197
 function createFocusIndicatorElement(parentElement) {
1197
 function createFocusIndicatorElement(parentElement) {
1198
     var focusIndicator = document.createElement('i');
1198
     var focusIndicator = document.createElement('i');
1199
     focusIndicator.className = 'fa fa-star';
1199
     focusIndicator.className = 'fa fa-star';
1200
-    focusIndicator.title = "The owner of this conference"
1200
+    focusIndicator.title = "The owner of this conference";
1201
     parentElement.appendChild(focusIndicator);
1201
     parentElement.appendChild(focusIndicator);
1202
 }
1202
 }
1203
 
1203
 
1204
 /**
1204
 /**
1205
- * Toggles the application in and out of full screen mode 
1205
+ * Toggles the application in and out of full screen mode
1206
  * (a.k.a. presentation mode in Chrome).
1206
  * (a.k.a. presentation mode in Chrome).
1207
  */
1207
  */
1208
 function toggleFullScreen() {
1208
 function toggleFullScreen() {
1214
         if (fsElement.mozRequestFullScreen) {
1214
         if (fsElement.mozRequestFullScreen) {
1215
 
1215
 
1216
             fsElement.mozRequestFullScreen();
1216
             fsElement.mozRequestFullScreen();
1217
-        } 
1217
+        }
1218
         else {
1218
         else {
1219
             fsElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
1219
             fsElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
1220
         }
1220
         }
1243
     if (nameSpan.length > 0) {
1243
     if (nameSpan.length > 0) {
1244
         var nameSpanElement = nameSpan.get(0);
1244
         var nameSpanElement = nameSpan.get(0);
1245
 
1245
 
1246
-        if (nameSpanElement.id == 'localDisplayName'
1247
-            && $('#localDisplayName').html() != escDisplayName)
1246
+        if (nameSpanElement.id === 'localDisplayName'
1247
+            && $('#localDisplayName').html() !== escDisplayName)
1248
             $('#localDisplayName').html(escDisplayName);
1248
             $('#localDisplayName').html(escDisplayName);
1249
         else
1249
         else
1250
             $('#' + videoSpanId + '_name').html(escDisplayName);
1250
             $('#' + videoSpanId + '_name').html(escDisplayName);
1252
     else {
1252
     else {
1253
         var editButton = null;
1253
         var editButton = null;
1254
 
1254
 
1255
-        if (videoSpanId == 'localVideoContainer') {
1255
+        if (videoSpanId === 'localVideoContainer') {
1256
             editButton = createEditDisplayNameButton();
1256
             editButton = createEditDisplayNameButton();
1257
         }
1257
         }
1258
         if (escDisplayName.length) {
1258
         if (escDisplayName.length) {
1289
                 $('#editDisplayName').select();
1289
                 $('#editDisplayName').select();
1290
 
1290
 
1291
                 var inputDisplayNameHandler = function(name) {
1291
                 var inputDisplayNameHandler = function(name) {
1292
-                    if (nickname != name) {
1292
+                    if (nickname !== name) {
1293
                         nickname = Util.escapeHtml(name);
1293
                         nickname = Util.escapeHtml(name);
1294
                         window.localStorage.displayname = nickname;
1294
                         window.localStorage.displayname = nickname;
1295
                         connection.emuc.addDisplayNameToPresence(nickname);
1295
                         connection.emuc.addDisplayNameToPresence(nickname);
1310
                 });
1310
                 });
1311
 
1311
 
1312
                 $('#editDisplayName').on('keydown', function (e) {
1312
                 $('#editDisplayName').on('keydown', function (e) {
1313
-                    if (e.keyCode == 13) {
1313
+                    if (e.keyCode === 13) {
1314
                         e.preventDefault();
1314
                         e.preventDefault();
1315
                         inputDisplayNameHandler(this.value);
1315
                         inputDisplayNameHandler(this.value);
1316
                     }
1316
                     }

+ 6
- 6
chat.js 查看文件

17
         }
17
         }
18
 
18
 
19
         $('#nickinput').keydown(function(event) {
19
         $('#nickinput').keydown(function(event) {
20
-            if (event.keyCode == 13) {
20
+            if (event.keyCode === 13) {
21
                 event.preventDefault();
21
                 event.preventDefault();
22
                 var val = Util.escapeHtml(this.value);
22
                 var val = Util.escapeHtml(this.value);
23
                 this.value = '';
23
                 this.value = '';
36
         });
36
         });
37
 
37
 
38
         $('#usermsg').keydown(function(event) {
38
         $('#usermsg').keydown(function(event) {
39
-            if (event.keyCode == 13) {
39
+            if (event.keyCode === 13) {
40
                 event.preventDefault();
40
                 event.preventDefault();
41
                 var message = Util.escapeHtml(this.value);
41
                 var message = Util.escapeHtml(this.value);
42
                 $('#usermsg').val('').trigger('autosize.resize');
42
                 $('#usermsg').val('').trigger('autosize.resize');
64
     my.updateChatConversation = function (from, displayName, message) {
64
     my.updateChatConversation = function (from, displayName, message) {
65
         var divClassName = '';
65
         var divClassName = '';
66
 
66
 
67
-        if (connection.emuc.myroomjid == from) {
67
+        if (connection.emuc.myroomjid === from) {
68
             divClassName = "localuser";
68
             divClassName = "localuser";
69
         }
69
         }
70
         else {
70
         else {
124
         }
124
         }
125
 
125
 
126
         // Request the focus in the nickname field or the chat input field.
126
         // Request the focus in the nickname field or the chat input field.
127
-        if ($('#nickname').css('visibility') == 'visible')
127
+        if ($('#nickname').css('visibility') === 'visible')
128
             $('#nickinput').focus();
128
             $('#nickinput').focus();
129
         else {
129
         else {
130
             $('#usermsg').focus();
130
             $('#usermsg').focus();
171
         $('#chatconversation').width($('#chatspace').width() - 10);
171
         $('#chatconversation').width($('#chatspace').width() - 10);
172
         $('#chatconversation')
172
         $('#chatconversation')
173
             .height(window.innerHeight - 50 - parseInt(usermsgHeight));
173
             .height(window.innerHeight - 50 - parseInt(usermsgHeight));
174
-    };
174
+    }
175
 
175
 
176
     /**
176
     /**
177
      * Shows/hides a visual notification, indicating that a message has arrived.
177
      * Shows/hides a visual notification, indicating that a message has arrived.
222
     }
222
     }
223
 
223
 
224
     return my;
224
     return my;
225
-}(Chat || {}));
225
+}(Chat || {}));

+ 2
- 2
estos_log.js 查看文件

4
     log: [],
4
     log: [],
5
     init: function (conn) {
5
     init: function (conn) {
6
         this.connection = conn;
6
         this.connection = conn;
7
-        this.connection.rawInput = this.log_incoming.bind(this);;
8
-        this.connection.rawOutput = this.log_outgoing.bind(this);;
7
+        this.connection.rawInput = this.log_incoming.bind(this);
8
+        this.connection.rawOutput = this.log_outgoing.bind(this);
9
     },
9
     },
10
     log_incoming: function (stanza) {
10
     log_incoming: function (stanza) {
11
         this.log.push([new Date().getTime(), 'incoming', stanza]);
11
         this.log.push([new Date().getTime(), 'incoming', stanza]);

+ 3
- 3
etherpad.js 查看文件

40
         else
40
         else
41
             largeVideo = $('#largeVideo');
41
             largeVideo = $('#largeVideo');
42
 
42
 
43
-        if ($('#etherpad>iframe').css('visibility') == 'hidden') {
43
+        if ($('#etherpad>iframe').css('visibility') === 'hidden') {
44
             largeVideo.fadeOut(300, function () {
44
             largeVideo.fadeOut(300, function () {
45
                 if (isPresentationVisible())
45
                 if (isPresentationVisible())
46
                     largeVideo.css({opacity:'0'});
46
                     largeVideo.css({opacity:'0'});
123
         if (!config.etherpad_base)
123
         if (!config.etherpad_base)
124
             return;
124
             return;
125
 
125
 
126
-        if (etherpadIFrame && etherpadIFrame.style.visibility != 'hidden')
126
+        if (etherpadIFrame && etherpadIFrame.style.visibility !== 'hidden')
127
             Etherpad.toggleEtherpad(isPresentation);
127
             Etherpad.toggleEtherpad(isPresentation);
128
     });
128
     });
129
 
129
 
130
     return my;
130
     return my;
131
-}(Etherpad || {}));
131
+}(Etherpad || {}));

+ 1
- 1
muc.js 查看文件

1
 /* jshint -W117 */
1
 /* jshint -W117 */
2
-/* a simple MUC connection plugin 
2
+/* a simple MUC connection plugin
3
  * can only handle a single MUC room
3
  * can only handle a single MUC room
4
  */
4
  */
5
 Strophe.addConnectionPlugin('emuc', {
5
 Strophe.addConnectionPlugin('emuc', {

+ 11
- 12
replacement.js 查看文件

5
 {
5
 {
6
     //make links clickable
6
     //make links clickable
7
     body = linkify(body);
7
     body = linkify(body);
8
-    
8
+
9
     //add smileys
9
     //add smileys
10
     body = smilify(body);
10
     body = smilify(body);
11
-    
11
+
12
     return body;
12
     return body;
13
 }
13
 }
14
 
14
 
15
 /**
15
 /**
16
- * Finds and replaces all links in the links in "body" 
16
+ * Finds and replaces all links in the links in "body"
17
  * with their <a href=""></a>
17
  * with their <a href=""></a>
18
  */
18
  */
19
 function linkify(inputText)
19
 function linkify(inputText)
20
 {
20
 {
21
     var replacedText, replacePattern1, replacePattern2, replacePattern3;
21
     var replacedText, replacePattern1, replacePattern2, replacePattern3;
22
-    
22
+
23
     //URLs starting with http://, https://, or ftp://
23
     //URLs starting with http://, https://, or ftp://
24
     replacePattern1 = /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim;
24
     replacePattern1 = /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim;
25
     replacedText = inputText.replace(replacePattern1, '<a href="$1" target="_blank">$1</a>');
25
     replacedText = inputText.replace(replacePattern1, '<a href="$1" target="_blank">$1</a>');
26
-    
26
+
27
     //URLs starting with "www." (without // before it, or it'd re-link the ones done above).
27
     //URLs starting with "www." (without // before it, or it'd re-link the ones done above).
28
     replacePattern2 = /(^|[^\/])(www\.[\S]+(\b|$))/gim;
28
     replacePattern2 = /(^|[^\/])(www\.[\S]+(\b|$))/gim;
29
     replacedText = replacedText.replace(replacePattern2, '$1<a href="http://$2" target="_blank">$2</a>');
29
     replacedText = replacedText.replace(replacePattern2, '$1<a href="http://$2" target="_blank">$2</a>');
30
-    
30
+
31
     //Change email addresses to mailto:: links.
31
     //Change email addresses to mailto:: links.
32
     replacePattern3 = /(([a-zA-Z0-9\-\_\.])+@[a-zA-Z\_]+?(\.[a-zA-Z]{2,6})+)/gim;
32
     replacePattern3 = /(([a-zA-Z0-9\-\_\.])+@[a-zA-Z\_]+?(\.[a-zA-Z]{2,6})+)/gim;
33
     replacedText = replacedText.replace(replacePattern3, '<a href="mailto:$1">$1</a>');
33
     replacedText = replacedText.replace(replacePattern3, '<a href="mailto:$1">$1</a>');
34
-    
34
+
35
     return replacedText;
35
     return replacedText;
36
 }
36
 }
37
 
37
 
42
 {
42
 {
43
     if(!body)
43
     if(!body)
44
         return body;
44
         return body;
45
-    
45
+
46
     body = body.replace(/(:\(|:\(\(|:-\(\(|:-\(|\(sad\))/gi, "<img src="+smiley1+ ">");
46
     body = body.replace(/(:\(|:\(\(|:-\(\(|:-\(|\(sad\))/gi, "<img src="+smiley1+ ">");
47
     body = body.replace(/(\(angry\))/gi, "<img src="+smiley2+ ">");
47
     body = body.replace(/(\(angry\))/gi, "<img src="+smiley2+ ">");
48
     body = body.replace(/(\(n\))/gi, "<img src="+smiley3+ ">");
48
     body = body.replace(/(\(n\))/gi, "<img src="+smiley3+ ">");
63
     body = body.replace(/(:-P|:P|:-p|:p)/gi, "<img src="+smiley18+ ">");
63
     body = body.replace(/(:-P|:P|:-p|:p)/gi, "<img src="+smiley18+ ">");
64
     body = body.replace(/(:-\0|\(shocked\))/gi, "<img src="+smiley19+ ">");
64
     body = body.replace(/(:-\0|\(shocked\))/gi, "<img src="+smiley19+ ">");
65
     body = body.replace(/(\(oops\))/gi, "<img src="+smiley20+ ">");
65
     body = body.replace(/(\(oops\))/gi, "<img src="+smiley20+ ">");
66
-                                  
67
-    return body
68
-};
69
-                                
66
+
67
+    return body;
68
+}

Loading…
取消
儲存