From 20b504aacde96d5935eab406f3877dd788befd7b Mon Sep 17 00:00:00 2001 From: Simon Eisenmann Date: Thu, 22 May 2014 20:30:11 +0200 Subject: [PATCH] Fixed bunch of Javascript syntax issues. --- static/js/directives/chat.js | 2 +- static/js/directives/screenshare.js | 2 +- static/js/mediastream/utils.js | 4 +++- static/js/mediastream/webrtc.js | 2 +- static/js/services/desktopnotify.js | 2 +- static/js/services/fastscroll.js | 2 +- static/js/services/filedownload.js | 2 +- static/js/services/playsound.js | 2 +- static/js/services/randomgen.js | 3 +-- 9 files changed, 11 insertions(+), 10 deletions(-) diff --git a/static/js/directives/chat.js b/static/js/directives/chat.js index 72e810eb..eb30d0b5 100644 --- a/static/js/directives/chat.js +++ b/static/js/directives/chat.js @@ -209,7 +209,7 @@ define(['underscore', 'text!partials/chat.html', 'text!partials/chatroom.html'], mid = randomGen.random({ hex: true }); - }; + } if (peercall && peercall.peerconnection.datachannelReady) { subscope.p2p(true); // Send out stuff through data channel. diff --git a/static/js/directives/screenshare.js b/static/js/directives/screenshare.js index 2c7c3b61..82a37b2b 100644 --- a/static/js/directives/screenshare.js +++ b/static/js/directives/screenshare.js @@ -165,7 +165,7 @@ define(['jquery', 'underscore', 'text!partials/screenshare.html', 'text!partials if ($scope.layout.screenshare) { $scope.stopScreenshare(); - }; + } $scope.layout.screenshare = true; diff --git a/static/js/mediastream/utils.js b/static/js/mediastream/utils.js index 80b816c7..b07217c9 100644 --- a/static/js/mediastream/utils.js +++ b/static/js/mediastream/utils.js @@ -26,7 +26,9 @@ define(['jquery', 'underscore'], function($, _) { var merged = cons1; var name; for (name in cons2.mandatory) { - merged.mandatory[name] = cons2.mandatory[name]; + if (cons2.mandatory.hasOwnProperty(name)) { + merged.mandatory[name] = cons2.mandatory[name]; + } } merged.optional.concat(cons2.optional); return merged; diff --git a/static/js/mediastream/webrtc.js b/static/js/mediastream/webrtc.js index 39ca36dd..3afa1834 100644 --- a/static/js/mediastream/webrtc.js +++ b/static/js/mediastream/webrtc.js @@ -32,7 +32,7 @@ define([ 'mediastream/usermedia', 'mediastream/utils', 'mediastream/tokens', - 'webrtc.adapter', ], + 'webrtc.adapter'], function($, _, PeerCall, PeerConference, PeerXfer, PeerScreenshare, UserMedia, utils, tokens) { diff --git a/static/js/services/desktopnotify.js b/static/js/services/desktopnotify.js index 807767d6..5f584ed4 100644 --- a/static/js/services/desktopnotify.js +++ b/static/js/services/desktopnotify.js @@ -82,7 +82,7 @@ define(['jquery', 'underscore', 'desktop-notify'], function($, _) { if (!this.enabled()) { return this.dummy; - }; + } var opts = { body: body, diff --git a/static/js/services/fastscroll.js b/static/js/services/fastscroll.js index da6cb669..7e4f240a 100644 --- a/static/js/services/fastscroll.js +++ b/static/js/services/fastscroll.js @@ -43,7 +43,7 @@ */ define(["jquery"], function($) { - function dispatchClick(coords) { + var dispatchClick = function(coords) { var event = document.createEvent('MouseEvent'), elem = document.elementFromPoint(coords.x, coords.y); diff --git a/static/js/services/filedownload.js b/static/js/services/filedownload.js index fb259322..335d3c4f 100644 --- a/static/js/services/filedownload.js +++ b/static/js/services/filedownload.js @@ -186,7 +186,7 @@ define(["jquery", "underscore"], function($, _) { var idx = this.jobs.indexOf(job); if (~idx) { // Yay i love fancy code which is hard to understand! this.jobs.splice(idx, 1); - }; + } if (this.chunk >= this.end && this.jobs.length === 0) { //console.log("File done.") safeApply(this.scope, _.bind(function($scope) { diff --git a/static/js/services/playsound.js b/static/js/services/playsound.js index ffa67743..bb13ee55 100644 --- a/static/js/services/playsound.js +++ b/static/js/services/playsound.js @@ -97,7 +97,7 @@ define(['underscore', 'Howler', 'require'], function(_, Howler, require) { if (this.aliases.hasOwnProperty(id)) { return this.aliases[id]; - }; + } return id; }; diff --git a/static/js/services/randomgen.js b/static/js/services/randomgen.js index 4308c0b9..fb5114c1 100644 --- a/static/js/services/randomgen.js +++ b/static/js/services/randomgen.js @@ -34,8 +34,7 @@ define(["underscore"], function(_) { }; // Fast binary to hex function. - - function binStringToHex(s) { + var binStringToHex = function(s) { var s2 = '', c; for (var i = 0, l = s.length; i < l; ++i) {