Browse Source

Fixed JSHint errors and warnings.

pull/145/head
Simon Eisenmann 11 years ago
parent
commit
9f8bb75f21
  1. 2
      static/js/controllers/chatroomcontroller.js
  2. 6
      static/js/controllers/mediastreamcontroller.js
  3. 6
      static/js/directives/buddypicturecapture.js
  4. 2
      static/js/directives/chat.js
  5. 2
      static/js/directives/fileinfo.js
  6. 2
      static/js/directives/roombar.js
  7. 1
      static/js/directives/screenshare.js
  8. 6
      static/js/directives/youtubevideo.js
  9. 10
      static/js/main.js
  10. 2
      static/js/mediastream/connector.js
  11. 2
      static/js/mediastream/peerconference.js
  12. 6
      static/js/mediastream/peerconnection.js
  13. 8
      static/js/mediastream/tokens.js
  14. 6
      static/js/mediastream/usermedia.js
  15. 2
      static/js/mediastream/utils.js
  16. 8
      static/js/mediastream/webrtc.js
  17. 2
      static/js/services/buddydata.js
  18. 2
      static/js/services/buddylist.js
  19. 2
      static/js/services/buddypicture.js
  20. 2
      static/js/services/contactdata.js
  21. 4
      static/js/services/contacts.js
  22. 14
      static/js/services/desktopnotify.js
  23. 6
      static/js/services/filedata.js
  24. 2
      static/js/services/localstatus.js
  25. 16
      static/js/services/mediasources.js
  26. 3
      static/js/services/mediastream.js

2
static/js/controllers/chatroomcontroller.js

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
define(['underscore', 'moment', 'text!partials/fileinfo.html', 'text!partials/contactrequest.html', 'text!partials/geolocation.html'], function(_, moment, templateFileInfo, templateContactRequest, templateGeolocation) {
define(['jquery', 'underscore', 'moment', 'text!partials/fileinfo.html', 'text!partials/contactrequest.html', 'text!partials/geolocation.html'], function($, _, moment, templateFileInfo, templateContactRequest, templateGeolocation) {
// ChatroomController
return ["$scope", "$element", "$window", "safeMessage", "safeDisplayName", "$compile", "$filter", "translation", function($scope, $element, $window, safeMessage, safeDisplayName, $compile, $filter, translation) {

6
static/js/controllers/mediastreamcontroller.js

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
define(['underscore', 'bigscreen', 'moment', 'sjcl', 'modernizr', 'webrtc.adapter'], function(_, BigScreen, moment, sjcl, Modernizr) {
define(['jquery', 'underscore', 'angular', 'bigscreen', 'moment', 'sjcl', 'modernizr', 'webrtc.adapter'], function($, _, angular, BigScreen, moment, sjcl, Modernizr) {
return ["$scope", "$rootScope", "$element", "$window", "$timeout", "safeDisplayName", "safeApply", "mediaStream", "appData", "playSound", "desktopNotify", "alertify", "toastr", "translation", "fileDownload", "localStorage", "screensharing", "userSettingsData", "localStatus", "dialogs", "rooms", function($scope, $rootScope, $element, $window, $timeout, safeDisplayName, safeApply, mediaStream, appData, playSound, desktopNotify, alertify, toastr, translation, fileDownload, localStorage, screensharing, userSettingsData, localStatus, dialogs, rooms) {
@ -225,13 +225,13 @@ define(['underscore', 'bigscreen', 'moment', 'sjcl', 'modernizr', 'webrtc.adapte @@ -225,13 +225,13 @@ define(['underscore', 'bigscreen', 'moment', 'sjcl', 'modernizr', 'webrtc.adapte
var iceServers = [];
var iceServer;
if ($scope.stun.length) {
iceServer = createIceServers($scope.stun);
iceServer = $window.createIceServers($scope.stun);
if (iceServer.length) {
iceServers.push.apply(iceServers, iceServer);
}
}
if ($scope.turn.urls && $scope.turn.urls.length) {
iceServer = createIceServers($scope.turn.urls, $scope.turn.username, $scope.turn.password);
iceServer = $window.createIceServers($scope.turn.urls, $scope.turn.username, $scope.turn.password);
if (iceServer.length) {
iceServers.push.apply(iceServers, iceServer);
}

6
static/js/directives/buddypicturecapture.js

@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
define(['jquery', 'underscore', 'text!partials/buddypicturecapture.html'], function($, _, template) {
// buddyPictureCapture
return ["$compile", function($compile) {
return ["$compile", "$window", function($compile, $window) {
var controller = ['$scope', 'safeApply', '$timeout', '$q', function($scope, safeApply, $timeout, $q) {
@ -124,13 +124,13 @@ define(['jquery', 'underscore', 'text!partials/buddypicturecapture.html'], funct @@ -124,13 +124,13 @@ define(['jquery', 'underscore', 'text!partials/buddypicturecapture.html'], funct
}]
};
}
getUserMedia({
$window.getUserMedia({
video: videoConstraints
}, function(stream) {
$scope.showTakePicture = true;
localStream = stream;
$scope.waitingForPermission = false;
attachMediaStream($scope.video, stream);
$window.attachMediaStream($scope.video, stream);
safeApply($scope);
videoAllowed.resolve(true);
}, function(error) {

2
static/js/directives/chat.js

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
define(['underscore', 'text!partials/chat.html', 'text!partials/chatroom.html'], function(_, templateChat, templateChatroom) {
define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatroom.html'], function($, _, templateChat, templateChatroom) {
return ["$compile", "safeDisplayName", "mediaStream", "safeApply", "desktopNotify", "translation", "playSound", "fileUpload", "randomGen", "buddyData", "appData", "$timeout", "geolocation", function($compile, safeDisplayName, mediaStream, safeApply, desktopNotify, translation, playSound, fileUpload, randomGen, buddyData, appData, $timeout, geolocation) {

2
static/js/directives/fileinfo.js

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
define(['jquery', 'underscore'], function($, _) {
define(['jquery', 'underscore', 'moment'], function($, _, moment) {
return ["fileData", "fileUpload", "fileDownload", "mediaStream", "$window", "alertify", "translation", function(fileData, fileUpload, fileDownload, mediaStream, $window, alertify, translation) {

2
static/js/directives/roombar.js

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
define(['underscore', 'text!partials/roombar.html'], function(_, template) {
define(['underscore', 'angular', 'text!partials/roombar.html'], function(_, angular, template) {
// roomBar
return ["$window", "rooms", function($window, rooms) {

1
static/js/directives/screenshare.js

@ -246,7 +246,6 @@ define(['jquery', 'underscore', 'text!partials/screenshare.html', 'text!partials @@ -246,7 +246,6 @@ define(['jquery', 'underscore', 'text!partials/screenshare.html', 'text!partials
mediaStream.tokens.off(token, handler);
mediaStream.webrtc.e.off("statechange", updater);
handler = null;
updated = null;
// Send by to all connected peers.
_.each(screenshares, function(peerscreenshare) {
peerscreenshare.send({

6
static/js/directives/youtubevideo.js

@ -273,7 +273,7 @@ define(['jquery', 'underscore', 'text!partials/youtubevideo.html', 'bigscreen'], @@ -273,7 +273,7 @@ define(['jquery', 'underscore', 'text!partials/youtubevideo.html', 'bigscreen'],
isYouTubeIframeAPIReady.done(function() {
if (!player) {
var origin = $window.location.protocol + "//" + $window.location.host;
player = new YT.Player("youtubeplayer", {
player = new $window.YT.Player("youtubeplayer", {
height: "390",
width: "640",
playerVars: {
@ -563,11 +563,7 @@ define(['jquery', 'underscore', 'text!partials/youtubevideo.html', 'bigscreen'], @@ -563,11 +563,7 @@ define(['jquery', 'underscore', 'text!partials/youtubevideo.html', 'bigscreen'],
$scope.toggleFullscreen = function(elem) {
if (BigScreen.enabled) {
if (elem) {
BigScreen.toggle(elem);
} else {
BigScreen.toggle(pane.get(0));
}
}
};

10
static/js/main.js

@ -123,9 +123,9 @@ require.config({ @@ -123,9 +123,9 @@ require.config({
exports: 'odf',
init: function() {
return {
webodf: webodf,
odf: odf,
runtime: runtime
webodf: this.webodf,
odf: this.odf,
runtime: this.runtime
};
}
},
@ -171,7 +171,7 @@ require.onError = (function() { @@ -171,7 +171,7 @@ require.onError = (function() {
return;
}
if (err.requireType === "timeout" || err.requireType === "scripterror") {
alert('Failed to load application. Confirm to retry.');
window.alert('Failed to load application. Confirm to retry.');
retrying = true;
document.location.reload(true);
} else {
@ -274,5 +274,5 @@ if (Object.create) { @@ -274,5 +274,5 @@ if (Object.create) {
});
} else {
alert("Your browser does not support this application. Please update your browser to the latest version.");
window.alert("Your browser does not support this application. Please update your browser to the latest version.");
}

2
static/js/mediastream/connector.js

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
define(['jquery', 'underscore'], function($, _, uaparser) {
define(['jquery', 'underscore'], function($, _) {
var timeout = 5000;
var timeout_max = 20000;

2
static/js/mediastream/peerconference.js

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
define(['underscore', 'mediastream/peercall'], function(_, PeerCall) {
define(['jquery', 'underscore', 'mediastream/peercall'], function($, _, PeerCall) {
//NOTE(longsleep): This id should be changed to something undeterministic.
var conferences = 0;

6
static/js/mediastream/peerconnection.js

@ -54,7 +54,7 @@ define(['jquery', 'underscore', 'webrtc.adapter'], function($, _) { @@ -54,7 +54,7 @@ define(['jquery', 'underscore', 'webrtc.adapter'], function($, _) {
console.log('Creating RTCPeerConnnection with:\n' +
' config: \'' + JSON.stringify(currentcall.pcConfig) + '\';\n' +
' constraints: \'' + JSON.stringify(currentcall.pcConstraints) + '\'.');
pc = this.pc = new RTCPeerConnection(currentcall.pcConfig, currentcall.pcConstraints);
pc = this.pc = new window.RTCPeerConnection(currentcall.pcConfig, currentcall.pcConstraints);
} catch (e) {
console.error('Failed to create PeerConnection, exception: ' + e.message);
pc = this.pc = null;
@ -70,7 +70,7 @@ define(['jquery', 'underscore', 'webrtc.adapter'], function($, _) { @@ -70,7 +70,7 @@ define(['jquery', 'underscore', 'webrtc.adapter'], function($, _) {
// for example https://bugzilla.mozilla.org/show_bug.cgi?id=998546.
pc.onaddstream = _.bind(this.onRemoteStreamAdded, this);
pc.onremovestream = _.bind(this.onRemoteStreamRemoved, this);
if (webrtcDetectedBrowser === "firefox") {
if (window.webrtcDetectedBrowser === "firefox") {
// NOTE(longsleep): onnegotiationneeded is not supported by Firefox. We trigger it
// manually when a stream is added or removed.
// https://bugzilla.mozilla.org/show_bug.cgi?id=840728
@ -103,7 +103,7 @@ define(['jquery', 'underscore', 'webrtc.adapter'], function($, _) { @@ -103,7 +103,7 @@ define(['jquery', 'underscore', 'webrtc.adapter'], function($, _) {
// Create default data channel when we are in initiate mode.
if (currentcall.initiate) {
if (webrtcDetectedBrowser !== "chrome" || !webrtcDetectedAndroid || (webrtcDetectedBrowser === "chrome" && webrtcDetectedVersion >= 33)) {
if (window.webrtcDetectedBrowser !== "chrome" || !window.webrtcDetectedAndroid || (window.webrtcDetectedBrowser === "chrome" && window.webrtcDetectedVersion >= 33)) {
// NOTE(longsleep): Android (Chrome 32) does have broken SCTP data channels
// which makes connection fail because of sdp set error for answer/offer.
// See https://code.google.com/p/webrtc/issues/detail?id=2253 Lets hope the

8
static/js/mediastream/tokens.js

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
define(['jquery', 'underscore'], function(jquery, _) {
define(['jquery', 'underscore'], function($, _) {
var Token = function(handlerKey) {
this.e = $({});
@ -147,7 +147,7 @@ define(['jquery', 'underscore'], function(jquery, _) { @@ -147,7 +147,7 @@ define(['jquery', 'underscore'], function(jquery, _) {
// Set message implementation.
handler.messageHandler = _.bind(obj.trigger, obj);
}
handler.setRemoteDescription(new RTCSessionDescription(data), _.bind(function() {
handler.setRemoteDescription(new window.RTCSessionDescription(data), _.bind(function() {
handler.createAnswer(_.bind(function(sessionDescription, currenthandler) {
//console.log("Sending handler answer", sessionDescription, currenthandler.id);
webrtc.api.sendAnswer(from, sessionDescription);
@ -159,10 +159,10 @@ define(['jquery', 'underscore'], function(jquery, _) { @@ -159,10 +159,10 @@ define(['jquery', 'underscore'], function(jquery, _) {
if (!handler.messageHandler) {
handler.messageHandler = _.bind(obj.trigger, obj);
}
handler.setRemoteDescription(new RTCSessionDescription(data));
handler.setRemoteDescription(new window.RTCSessionDescription(data));
break;
case "Candidate":
var candidate = new RTCIceCandidate({
var candidate = new window.RTCIceCandidate({
sdpMLineIndex: data.sdpMLineIndex,
sdpMid: data.sdpMid,
candidate: data.candidate

6
static/js/mediastream/usermedia.js

@ -126,7 +126,7 @@ define(['jquery', 'underscore', 'audiocontext', 'webrtc.adapter'], function($, _ @@ -126,7 +126,7 @@ define(['jquery', 'underscore', 'audiocontext', 'webrtc.adapter'], function($, _
error_cb.apply(this, args);
};
try {
getUserMedia({
window.getUserMedia({
video: true,
audio: true
}, success_helper, error_helper);
@ -171,7 +171,7 @@ define(['jquery', 'underscore', 'audiocontext', 'webrtc.adapter'], function($, _ @@ -171,7 +171,7 @@ define(['jquery', 'underscore', 'audiocontext', 'webrtc.adapter'], function($, _
try {
console.log('Requesting access to local media with mediaConstraints:\n' +
' \'' + JSON.stringify(constraints) + '\'', constraints);
getUserMedia(constraints, _.bind(this.onUserMediaSuccess, this), _.bind(this.onUserMediaError, this));
window.getUserMedia(constraints, _.bind(this.onUserMediaSuccess, this), _.bind(this.onUserMediaError, this));
this.started = true;
return true;
} catch (e) {
@ -390,7 +390,7 @@ define(['jquery', 'underscore', 'audiocontext', 'webrtc.adapter'], function($, _ @@ -390,7 +390,7 @@ define(['jquery', 'underscore', 'audiocontext', 'webrtc.adapter'], function($, _
UserMedia.prototype.attachMediaStream = function(video) {
attachMediaStream(video, this.localStream);
window.attachMediaStream(video, this.localStream);
};

2
static/js/mediastream/utils.js

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
define(['jquery', 'underscore'], function($, _) {
define([], function() {
var Utils = function() {}

8
static/js/mediastream/webrtc.js

@ -237,7 +237,7 @@ function($, _, PeerCall, PeerConference, PeerXfer, PeerScreenshare, UserMedia, u @@ -237,7 +237,7 @@ function($, _, PeerCall, PeerConference, PeerXfer, PeerScreenshare, UserMedia, u
targetcall = this.findTargetCall(from);
if (targetcall) {
// Hey we know this call.
targetcall.setRemoteDescription(new RTCSessionDescription(data), _.bind(function(sessionDescription, currentcall) {
targetcall.setRemoteDescription(new window.RTCSessionDescription(data), _.bind(function(sessionDescription, currentcall) {
if (currentcall === this.currentcall) {
// Main call.
this.e.triggerHandler("peercall", [this.currentcall]);
@ -253,7 +253,7 @@ function($, _, PeerCall, PeerConference, PeerXfer, PeerScreenshare, UserMedia, u @@ -253,7 +253,7 @@ function($, _, PeerCall, PeerConference, PeerXfer, PeerScreenshare, UserMedia, u
console.log("Received conference Offer -> auto.", from, data._conference);
// Clean own internal data before feeding into browser.
delete data._conference;
this.currentconference.autoAnswer(from, new RTCSessionDescription(data));
this.currentconference.autoAnswer(from, new window.RTCSessionDescription(data));
break;
}
// Cannot do anything with this offer, reply with busy.
@ -268,7 +268,7 @@ function($, _, PeerCall, PeerConference, PeerXfer, PeerScreenshare, UserMedia, u @@ -268,7 +268,7 @@ function($, _, PeerCall, PeerConference, PeerXfer, PeerScreenshare, UserMedia, u
console.warn("Received Candidate for unknown id -> ignore.", from);
return;
}
var candidate = new RTCIceCandidate({
var candidate = new window.RTCIceCandidate({
sdpMLineIndex: data.sdpMLineIndex,
sdpMid: data.sdpMid,
candidate: data.candidate
@ -288,7 +288,7 @@ function($, _, PeerCall, PeerConference, PeerXfer, PeerScreenshare, UserMedia, u @@ -288,7 +288,7 @@ function($, _, PeerCall, PeerConference, PeerXfer, PeerScreenshare, UserMedia, u
}
// TODO(longsleep): In case of negotiation this could switch offer and answer
// and result in a offer sdp sent as answer data. We need to handle this.
targetcall.setRemoteDescription(new RTCSessionDescription(data), function() {
targetcall.setRemoteDescription(new window.RTCSessionDescription(data), function() {
// Received remote description as answer.
console.log("Received answer after we sent offer", data);
});

2
static/js/services/buddydata.js

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
define(['underscore'], function(underscore) {
define(['underscore'], function(_) {
// buddyData
return ["appData", "contactData", "mediaStream", "$rootScope", function(appData, contactData, mediaStream, $rootScope) {

2
static/js/services/buddylist.js

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
define(['angular', 'underscore', 'modernizr', 'avltree', 'text!partials/buddy.html', 'text!partials/buddyactions.html', 'text!partials/buddyactionsforaudiomixer.html'], function(angular, _, Modernizr, AvlTree, templateBuddy, templateBuddyActions, templateBuddyActionsForAudioMixer) {
define(['jquery', 'angular', 'underscore', 'modernizr', 'avltree', 'text!partials/buddy.html', 'text!partials/buddyactions.html', 'text!partials/buddyactionsforaudiomixer.html'], function($, angular, _, Modernizr, AvlTree, templateBuddy, templateBuddyActions, templateBuddyActionsForAudioMixer) {
var BuddyTree = function() {

2
static/js/services/buddypicture.js

@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
*
*/
define(['underscore'], function(underscore) {
define([], function() {
// buddyPicture
return ["$window", "restURL", function($window, restURL) {

2
static/js/services/contactdata.js

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
define(['underscore', 'jquery'], function(underscore, $) {
define(['underscore', 'jquery'], function(_, $) {
// contactData
return [function() {

4
static/js/services/contacts.js

@ -26,7 +26,7 @@ define(['underscore', 'jquery', 'modernizr', 'sjcl', 'text!partials/contactsmana @@ -26,7 +26,7 @@ define(['underscore', 'jquery', 'modernizr', 'sjcl', 'text!partials/contactsmana
this.db = null;
this.name = name;
this.e = $({});
var request = indexedDB.open(this.name, this.version);
var request = window.indexedDB.open(this.name, this.version);
var that = this;
request.onupgradeneeded = function(event) {
var db = event.target.result;
@ -90,7 +90,7 @@ define(['underscore', 'jquery', 'modernizr', 'sjcl', 'text!partials/contactsmana @@ -90,7 +90,7 @@ define(['underscore', 'jquery', 'modernizr', 'sjcl', 'text!partials/contactsmana
Database.prototype.all = function(storename, iteratorCallback, errorCallback) {
var transaction = this.db.transaction(storename);
var store = transaction.objectStore(storename);
var keyRange = IDBKeyRange.lowerBound(0);
var keyRange = window.IDBKeyRange.lowerBound(0);
var cursorRequest = store.openCursor(keyRange);
cursorRequest.onsuccess = function(event) {
var result = event.target.result;

14
static/js/services/desktopnotify.js

@ -35,7 +35,7 @@ define(['jquery', 'underscore', 'desktop-notify'], function($, _, notify) { @@ -35,7 +35,7 @@ define(['jquery', 'underscore', 'desktop-notify'], function($, _, notify) {
var helper = notify;
var desktopNotify = function() {
var DesktopNotify = function() {
this.asked = false;
this.windowHasFocus = true;
@ -51,7 +51,7 @@ define(['jquery', 'underscore', 'desktop-notify'], function($, _, notify) { @@ -51,7 +51,7 @@ define(['jquery', 'underscore', 'desktop-notify'], function($, _, notify) {
};
desktopNotify.prototype.enabled = function() {
DesktopNotify.prototype.enabled = function() {
if (this.level === "default") {
this.asked = true;
@ -61,14 +61,14 @@ define(['jquery', 'underscore', 'desktop-notify'], function($, _, notify) { @@ -61,14 +61,14 @@ define(['jquery', 'underscore', 'desktop-notify'], function($, _, notify) {
};
desktopNotify.prototype.refresh = function() {
DesktopNotify.prototype.refresh = function() {
this.supported = helper.isSupported;
this.level = helper.permissionLevel();
};
desktopNotify.prototype.requestPermission = function(cb) {
DesktopNotify.prototype.requestPermission = function(cb) {
//console.log("request permission");
return helper.requestPermission(_.bind(function() {
@ -83,13 +83,13 @@ define(['jquery', 'underscore', 'desktop-notify'], function($, _, notify) { @@ -83,13 +83,13 @@ define(['jquery', 'underscore', 'desktop-notify'], function($, _, notify) {
};
desktopNotify.prototype.createNotification = function(title, options) {
DesktopNotify.prototype.createNotification = function(title, options) {
return helper.createNotification(title, options);
};
desktopNotify.prototype.notify = function(title, body, options) {
DesktopNotify.prototype.notify = function(title, body, options) {
if (!this.enabled()) {
return this.dummy;
@ -113,7 +113,7 @@ define(['jquery', 'underscore', 'desktop-notify'], function($, _, notify) { @@ -113,7 +113,7 @@ define(['jquery', 'underscore', 'desktop-notify'], function($, _, notify) {
};
return new desktopNotify();
return new DesktopNotify();
}];

6
static/js/services/filedata.js

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
define(["jquery", "underscore", "sha", "webrtc.adapter"], function($, _, jsSHA) {
define(["jquery", "underscore", "sha", "webrtc.adapter"], function($, _, JsSHA) {
var requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem || null;
if (!requestFileSystem) {
@ -27,7 +27,7 @@ define(["jquery", "underscore", "sha", "webrtc.adapter"], function($, _, jsSHA) @@ -27,7 +27,7 @@ define(["jquery", "underscore", "sha", "webrtc.adapter"], function($, _, jsSHA)
// NOTE(longsleep): A single chunk is 60k - https://code.google.com/p/webrtc/issues/detail?id=2270
// also Firefox does only support 16k maximum sents. See https://code.google.com/p/webrtc/issues/detail?id=2279.
var fileChunkSize = webrtcDetectedBrowser === "chrome" ? 60000 : 16000;
var fileChunkSize = window.webrtcDetectedBrowser === "chrome" ? 60000 : 16000;
// Fake implementation for browsers which do not support FileSystem API.
var FileWriterFake = function(owner) {
@ -423,7 +423,7 @@ define(["jquery", "underscore", "sha", "webrtc.adapter"], function($, _, jsSHA) @@ -423,7 +423,7 @@ define(["jquery", "underscore", "sha", "webrtc.adapter"], function($, _, jsSHA)
},
createFile: function(namespace, data) {
var id = namespace + "_" + (fileCount++);
var shaObj = new jsSHA(id, "TEXT");
var shaObj = new JsSHA(id, "TEXT");
var token = shaObj.getHMAC(randomSecret, "TEXT", "SHA-384", "HEX");
var file = filesTable[token] = new File(token, data);
return file;

2
static/js/services/localstatus.js

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
define(['angular', 'underscore'], function(angular, underscore) {
define(['angular', 'underscore'], function(angular, _) {
// localStatus
return ["mediaStream", "$window", function(mediaStream, $window) {

16
static/js/services/mediasources.js

@ -22,15 +22,15 @@ define(['jquery', 'underscore'], function($, _) { @@ -22,15 +22,15 @@ define(['jquery', 'underscore'], function($, _) {
return ["$window", function($window) {
var mediaSources = function() {
var MediaSources = function() {
this.supported = window.MediaStreamTrack && window.MediaStreamTrack.getSources
this.supported = $window.MediaStreamTrack && $window.MediaStreamTrack.getSources
this.audio = [];
this.video = [];
};
mediaSources.prototype.refresh = function(cb) {
MediaSources.prototype.refresh = function(cb) {
if (!this.supported) {
if (cb) {
@ -53,9 +53,9 @@ define(['jquery', 'underscore'], function($, _) { @@ -53,9 +53,9 @@ define(['jquery', 'underscore'], function($, _) {
};
mediaSources.prototype._refresh = function(cb) {
MediaSources.prototype._refresh = function(cb) {
MediaStreamTrack.getSources(_.bind(function(sources) {
$window.MediaStreamTrack.getSources(_.bind(function(sources) {
var audio = this.audio = [];
var video = this.video = [];
_.each(sources, function(source) {
@ -78,7 +78,7 @@ define(['jquery', 'underscore'], function($, _) { @@ -78,7 +78,7 @@ define(['jquery', 'underscore'], function($, _) {
};
mediaSources.prototype.hasAudioId = function(id) {
MediaSources.prototype.hasAudioId = function(id) {
var i;
for (i = 0; i < this.audio.length; i++) {
@ -90,7 +90,7 @@ define(['jquery', 'underscore'], function($, _) { @@ -90,7 +90,7 @@ define(['jquery', 'underscore'], function($, _) {
};
mediaSources.prototype.hasVideoId = function(id) {
MediaSources.prototype.hasVideoId = function(id) {
var i;
for (i = 0; i < this.video.length; i++) {
@ -103,7 +103,7 @@ define(['jquery', 'underscore'], function($, _) { @@ -103,7 +103,7 @@ define(['jquery', 'underscore'], function($, _) {
};
return new mediaSources();
return new MediaSources();
}];

3
static/js/services/mediastream.js

@ -22,10 +22,11 @@ define([ @@ -22,10 +22,11 @@ define([
'jquery',
'underscore',
'ua-parser',
'sjcl',
'modernizr',
'mediastream/tokens'
], function($, _, uaparser, Modernizr, tokens) {
], function($, _, uaparser, sjcl, Modernizr, tokens) {
return ["globalContext", "connector", "api", "webrtc", "$rootScope", "$route", "$location", "$window", "visibility", "alertify", "$http", "safeApply", "$timeout", "$sce", "localStorage", "continueConnector", "restURL", function(context, connector, api, webrtc, $rootScope, $route, $location, $window, visibility, alertify, $http, safeApply, $timeout, $sce, localStorage, continueConnector, restURL) {

Loading…
Cancel
Save