diff --git a/app/index.html b/app/index.html index a380e86..060e658 100644 --- a/app/index.html +++ b/app/index.html @@ -49,12 +49,12 @@ + - - + diff --git a/app/scripts/app.js b/app/scripts/app.js index 4b892b2..bdd6826 100644 --- a/app/scripts/app.js +++ b/app/scripts/app.js @@ -1 +1,8 @@ -window.FileDrop = Ember.Application.create(); +window.FileDrop.App = Ember.Application.create(); + +// Clear HTML5 filesystem on page load +FileDrop.App.deferReadiness(); +FileDrop.File.removeAll().then(function () { + console.log("Cleared HTML5 filesystem"); + FileDrop.App.advanceReadiness(); +}); diff --git a/app/scripts/app/components/confirm_popover_component.js b/app/scripts/app/components/confirm_popover_component.js index 02cf4eb..81a57f9 100644 --- a/app/scripts/app/components/confirm_popover_component.js +++ b/app/scripts/app/components/confirm_popover_component.js @@ -1,4 +1,4 @@ -FileDrop.ConfirmPopoverComponent = Ember.Component.extend({ +FileDrop.App.ConfirmPopoverComponent = Ember.Component.extend({ classNames: ['popover-confirm'], iconClass: function () { diff --git a/app/scripts/app/controllers/application_controller.js b/app/scripts/app/controllers/application_controller.js index da8d0d3..fc99cd3 100644 --- a/app/scripts/app/controllers/application_controller.js +++ b/app/scripts/app/controllers/application_controller.js @@ -1,8 +1,8 @@ -FileDrop.ApplicationController = Ember.Controller.extend({ +FileDrop.App.ApplicationController = Ember.Controller.extend({ init: function () { this._super(); - var you = FileDrop.User.create({ + var you = FileDrop.App.User.create({ email: localStorage.email || null }); diff --git a/app/scripts/app/controllers/index_controller.js b/app/scripts/app/controllers/index_controller.js index 437d217..17ab1d2 100644 --- a/app/scripts/app/controllers/index_controller.js +++ b/app/scripts/app/controllers/index_controller.js @@ -1,4 +1,4 @@ -FileDrop.IndexController = Ember.ArrayController.extend({ +FileDrop.App.IndexController = Ember.ArrayController.extend({ needs: ['application'], you: Ember.computed.alias('controllers.application.you'), @@ -63,7 +63,7 @@ FileDrop.IndexController = Ember.ArrayController.extend({ peer; delete attrs.peer; - peer = FileDrop.Peer.create(attrs); + peer = FileDrop.App.Peer.create(attrs); peer.get('peer').setProperties(peerAttrs); this.pushObject(peer); diff --git a/app/scripts/app/controllers/peer_controller.js b/app/scripts/app/controllers/peer_controller.js index 4de3ff8..5c49829 100644 --- a/app/scripts/app/controllers/peer_controller.js +++ b/app/scripts/app/controllers/peer_controller.js @@ -1,4 +1,4 @@ -FileDrop.PeerController = Ember.ObjectController.extend({ +FileDrop.App.PeerController = Ember.ObjectController.extend({ needs: 'index', webrtc: Ember.computed.alias('controllers.index.webrtc'), @@ -16,9 +16,7 @@ FileDrop.PeerController = Ember.ObjectController.extend({ // TODO: rename to something more meaningful (e.g. askIfWantToSendFile) uploadFile: function (data) { var peer = this.get('model'), - webrtc = this.get('webrtc'), - file = data.file, - info = webrtc.getFileInfo(file); + file = data.file; // Make file available when the response from the recipient comes in peer.set('transfer.file', file); diff --git a/app/scripts/app/models/peer.js b/app/scripts/app/models/peer.js index 714bdf1..378ad17 100644 --- a/app/scripts/app/models/peer.js +++ b/app/scripts/app/models/peer.js @@ -1,4 +1,4 @@ -FileDrop.Peer = Ember.Object.extend({ +FileDrop.App.Peer = Ember.Object.extend({ uuid: null, email: null, public_ip: null, diff --git a/app/scripts/app/models/user.js b/app/scripts/app/models/user.js index c39587c..1a19a14 100644 --- a/app/scripts/app/models/user.js +++ b/app/scripts/app/models/user.js @@ -1,4 +1,4 @@ -FileDrop.User = FileDrop.Peer.extend({ +FileDrop.App.User = FileDrop.App.Peer.extend({ room: null, serialize: function () { diff --git a/app/scripts/app/templates/peer.hbs b/app/scripts/app/templates/peer.hbs index f5b1395..7d96465 100644 --- a/app/scripts/app/templates/peer.hbs +++ b/app/scripts/app/templates/peer.hbs @@ -7,8 +7,8 @@ {{/confirm-popover}}