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}}
- {{view FileDrop.ProgressBarView}} - {{view FileDrop.PeerAvatarView}} + {{view FileDrop.App.ProgressBarView}} + {{view FileDrop.App.PeerAvatarView}}
@@ -23,4 +23,4 @@ {{/if}}
-{{view FileDrop.FileField action="uploadFile" file=transfer.file}} +{{view FileDrop.App.FileField action="uploadFile" file=transfer.file}} diff --git a/app/scripts/app/views/file_field.js b/app/scripts/app/views/file_field.js index f2fded0..11b4cd1 100644 --- a/app/scripts/app/views/file_field.js +++ b/app/scripts/app/views/file_field.js @@ -1,4 +1,4 @@ -FileDrop.FileField = Ember.TextField.extend({ +FileDrop.App.FileField = Ember.TextField.extend({ type: 'file', classNames: ['invisible'], diff --git a/app/scripts/app/views/peer_avatar_view.js b/app/scripts/app/views/peer_avatar_view.js index 1404698..8312a2f 100644 --- a/app/scripts/app/views/peer_avatar_view.js +++ b/app/scripts/app/views/peer_avatar_view.js @@ -1,4 +1,4 @@ -FileDrop.PeerAvatarView = Ember.View.extend(Ember.ViewTargetActionSupport, { +FileDrop.App.PeerAvatarView = Ember.View.extend(Ember.ViewTargetActionSupport, { tagName: 'img', classNames: ['gravatar', 'img-circle'], attributeBindings: [ diff --git a/app/scripts/app/views/peer_view.js b/app/scripts/app/views/peer_view.js index 34ebcd2..cbc3670 100644 --- a/app/scripts/app/views/peer_view.js +++ b/app/scripts/app/views/peer_view.js @@ -1,4 +1,4 @@ -FileDrop.PeerView = Ember.View.extend({ +FileDrop.App.PeerView = Ember.View.extend({ isConnected: Ember.computed.alias('controller.model.isConnected'), classNames: ['peer'], classNameBindings: ['isConnected:connected:disconnected'] diff --git a/app/scripts/app/views/progress_bar_view.js b/app/scripts/app/views/progress_bar_view.js index 90e4a6e..c58ca17 100644 --- a/app/scripts/app/views/progress_bar_view.js +++ b/app/scripts/app/views/progress_bar_view.js @@ -1,4 +1,4 @@ -FileDrop.ProgressBarView = Ember.View.extend({ +FileDrop.App.ProgressBarView = Ember.View.extend({ tagName: 'svg', templateName: 'progress-bar', diff --git a/app/scripts/app/views/user_view.js b/app/scripts/app/views/user_view.js index 0ac3c5f..c8af2ff 100644 --- a/app/scripts/app/views/user_view.js +++ b/app/scripts/app/views/user_view.js @@ -1,4 +1,4 @@ -FileDrop.UserView = Ember.View.extend({ +FileDrop.App.UserView = Ember.View.extend({ isConnected: Ember.computed.alias('controller.model.isConnected'), classNames: ['peer'], classNameBindings: ['isConnected:connected:disconnected'] diff --git a/app/scripts/initializer.js b/app/scripts/initializer.js deleted file mode 100644 index 9fffd48..0000000 --- a/app/scripts/initializer.js +++ /dev/null @@ -1,6 +0,0 @@ -// Clear HTML5 filesystem on page load -FileDrop.deferReadiness(); -FileDrop.File.removeAll().then(function () { - console.log("Cleared HTML5 filesystem"); - FileDrop.advanceReadiness(); -});