Skip to content

Commit

Permalink
This wasn't working on IE8, and it looks like it isn't needed on mode…
Browse files Browse the repository at this point in the history
…rn browsers either. Hopefully fixes #1188.
  • Loading branch information
bobdenotter committed May 15, 2014
1 parent 900f776 commit c3ebe61
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions app/view/js/bolt.js
Expand Up @@ -366,27 +366,8 @@ function bindFileUpload(key) {
var progress = Math.round(100 * data._bitrateTimer.loaded / data.files[0].size);
$('#progress-' + key).show().addClass('progress-striped active');
$('#progress-' + key + ' div.bar').css('width', progress+"%");
})
.bind('fileuploadsubmit', function (e, data) {
var that = this,
fileTypes = $('#field-' + key).attr('accept');

if( typeof fileTypes !== 'undefined' ) {
var pattern = new RegExp( "(\.|\/)(" + fileTypes + ")$", "gi" );
$.each( data.files , function (index, file) {
if( !pattern.test(file.type) ) {
var message = "Oops! There was an error uploading the file. Make sure that the file type is correct."
+ "\n\n(accept type was: "
+ fileTypes + ")";
});

alert(message);
e.preventDefault();
return false;
}
});
}
})
;
}


Expand Down Expand Up @@ -709,7 +690,7 @@ var Stack = Backbone.Model.extend({
type = "other";
}

// We don't need 'files/' in the path. Accept intput with or without it, but strip
// We don't need 'files/' in the path. Accept input with or without it, but strip
// it out here..
filename = filename.replace(/files\//ig, '');

Expand Down Expand Up @@ -1131,3 +1112,4 @@ function openVideo(url) {
$('body').append(modal);

}

0 comments on commit c3ebe61

Please sign in to comment.