Created
September 23, 2015 15:05
-
-
Save quadrophobiac/2d17531b99a8006a131a to your computer and use it in GitHub Desktop.
Rails & Bootstrap Magic in CSvlint Alphas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var r = new Resumable({ | |
// resumable initialised | |
}); | |
$('#standard_files').addClass('hidden'); | |
// Resumable.js isn't supported, fall back on a different method | |
if(!r.support) { | |
console.log("support error"); | |
$('#standard_files').removeClass('hidden'); | |
$('.resumable-error').show(); | |
} else { | |
$('#upload_button').removeClass('hidden'); | |
// Show a place for dropping/selecting files | |
r.assignBrowse(document.getElementById('upload_button')); | |
// https://github.com/theodi/csvlint/blob/master/app/views/application/index.html.erb#L88 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= file_field_tag 'files[]', title: 'Choose Files', id: 'standard_files', multiple: 'multiple' %> | |
<%= button_tag '<i class="glyphicon glyphicon-cloud-upload"></i> Choose a file'.html_safe, type: 'button', id: 'upload_button', class: 'btn-info btn-lg hidden' %> | |
<label style = "padding:8pt;" id="file_name"></label> | |
<div id="file_ids"></div> | |
# see https://github.com/theodi/csvlint/blob/master/app/views/application/index.html.erb#L26 |
Author
quadrophobiac
commented
Sep 23, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment