Skip to content

Commit c186c09

Browse files
added upload note
1 parent dfcb4b8 commit c186c09

File tree

5 files changed

+21
-4
lines changed

5 files changed

+21
-4
lines changed

lib/application/client/app/index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,20 @@ $(document).ready(function() {
3535
$('#messages').removeClass('filehover');
3636
},
3737

38-
uploadStartedCallback: function(i, file, len) {
38+
beforeEachCallback: function() {
39+
$('#uploadprogressarea').fadeIn();
3940
$('#messages').removeClass('filehover');
4041
},
4142

42-
progressUpdated: function(i, file, progress) {
43+
uploadStartedCallback: function(i, file, len) {
4344

4445
},
4546

46-
uploadFinishedCallback: function(i, file, response){
47+
progressUpdatedCallback: function(i, file, progress) {
48+
},
4749

50+
uploadFinishedCallback: function(i, file, response){
51+
$('#uploadprogressarea').fadeOut('slow');
4852
},
4953

5054
errorCallback: function(message) {

lib/application/client/css/index.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ a.brand span.subtitle {
3939
background-color: #eee;
4040
}
4141

42+
#uploadprogressarea {
43+
background-color: #beb;
44+
display: none;
45+
vertical-align: middle;
46+
text-align: center;
47+
font-weight: bold;
48+
}
49+
50+
4251
#messages {
4352
background-color: #fff;
4453
overflow-x: scroll;

lib/application/client/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ <h3>Choose a username</h3>
7676
chat. You can also drag multiple files.
7777
</p>
7878
</div>
79+
<div id="uploadprogressarea" class="well">
80+
Uploading...
81+
</div>
7982
</div>
8083
<div class="span8">
8184

lib/application/client/lib/fileupload.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ bivouac.fileupload = {
1616
url: options.targetUrl,
1717
dragEnter: options.dragEnterCallback,
1818
dragLeave: options.dragLeaveCallback,
19+
beforeEach: options.beforeEachCallback,
1920
uploadStarted: options.uploadStartedCallback,
2021
progressUpdated: options.progressUpdatedCallback,
2122
uploadFinished: options.uploadFinishedCallback,

lib/application/filesharing/filesharing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var handleUpload = function(request, response, inform) {
99
fs.rename(files.file.path, '/tmp/bivouac_upload_' + files.file.name, function(err) {
1010
inform(files.file.name, files.file.type);
1111
response.writeHead(200, {'content-type': 'text/plain'});
12-
response.end('ok');
12+
response.end(JSON.stringify('ok'));
1313
});
1414
});
1515
}

0 commit comments

Comments
 (0)