26 lines
909 B
Text
26 lines
909 B
Text
:javascript
|
|
$(function() {
|
|
$("#photo_image").html5_upload({
|
|
// WE INSERT ALBUM_ID PARAM HERE
|
|
url: "/photos?album_id=#{album.id}",
|
|
sendBoundary: window.FormData || $.browser.mozilla,
|
|
onStart: function(event, total) {
|
|
return confirm("You are about to upload " + total + " photos. Are you sure?");
|
|
},
|
|
onFinish: function(event, total){
|
|
$("#add_photo_button .button").html( "Add Photos" );
|
|
$("#add_photo_loader").fadeOut(0);
|
|
},
|
|
onStart: function(event, total){
|
|
$("#add_photo_pane").fadeOut(400);
|
|
$("#add_photo_button .button").html( "Uploading Photos" );
|
|
$("#add_photo_loader").fadeIn(400);
|
|
return true;
|
|
}
|
|
});
|
|
});
|
|
|
|
= form_for photo, :html => {:multipart => true} do |f|
|
|
= f.error_messages
|
|
= f.hidden_field :album_id, :value => album.id
|
|
= f.file_field :image, :multiple => 'multiple'
|