Added file upload button

This commit is contained in:
Josef Citrine 2016-05-02 01:45:29 +01:00
parent 91120e303b
commit 5add0a17c8
2 changed files with 8 additions and 0 deletions

View file

@ -3,6 +3,10 @@
<p>Drop files here to begin your upload!</p> <p>Drop files here to begin your upload!</p>
</div> </div>
<p><b>Having issues with our uploader? Click the button below to upload your files.</b></p>
<p><input type="file" name="file" onchange="angular.element(this).scope().fileChanged(this)" ng-model="file" multiple /></p>
<p>Our preferred formats are FLAC, WAV, AIFF, and ALAC (because lossless audio is awesome) but we accept a few others, too. Each file can be up to 200 MB in size.</p> <p>Our preferred formats are FLAC, WAV, AIFF, and ALAC (because lossless audio is awesome) but we accept a few others, too. Each file can be up to 200 MB in size.</p>
<p>Tracks must be a <strong>minimum</strong> of 30 seconds long.</p> <p>Tracks must be a <strong>minimum</strong> of 30 seconds long.</p>

View file

@ -18,4 +18,8 @@ module.exports = angular.module('ponyfm').controller "uploader", [
'$scope', 'auth', 'upload', '$state' '$scope', 'auth', 'upload', '$state'
($scope, auth, upload, $state) -> ($scope, auth, upload, $state) ->
$scope.data = upload $scope.data = upload
$scope.fileChanged = (e) ->
files = e.files
$scope.$apply -> upload.upload files
] ]