Skip to content
Extraits de code Groupes Projets
Valider 81438678 rédigé par danielvincent's avatar danielvincent
Parcourir les fichiers

Refactored more photo js out to photos.js. That should be it for that refactor

parent 81edef9b
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
:javascript
$(function() {
$("#photo_image").html5_upload({
// WE INSERT ALBUM_ID PARAM HERE
url: "/photos?album_id=#{@album.id}",
sendBoundary: window.FormData || $.browser.mozilla,
setName: function(text) {
$("#progress_report_name").text(text);
},
onFinish: function(event, total){
$("#add_photo_button").html( "Add Photos" );
$("#add_photo_loader").fadeOut(400);
$("#photo_title_status").text("Done!");
$("#progress_report").html("Good job me!");
$("#add_photo_button").addClass("uploading_complete");
},
onStart: function(event, total){
$("#add_photo_button").html( "Uploading Photos" );
$("#add_photo_loader").fadeIn(400);
$("form.new_photo").fadeOut(0);
$("#progress_report").fadeIn(0);
$("#photo_title_status").text("Uploading...");
return true;
}
});
});
%h1
%span{:id=>"photo_title_status"}
Add photos to
......
......@@ -22,3 +22,30 @@ function reset_photo_fancybox(){
$("#new_photo_pane").html(ajax.responseText)
});
}
$("#photo_image").html5_upload({
// WE INSERT ALBUM_ID PARAM HERE
url: "/photos?album_id="+$(".album_id")[0].id,
sendBoundary: window.FormData || $.browser.mozilla,
setName: function(text) {
$("#progress_report_name").text(text);
},
onFinish: function(event, total){
$("#add_photo_button").html( "Add Photos" );
$("#add_photo_loader").fadeOut(400);
$("#photo_title_status").text("Done!");
$("#progress_report").html("Good job me!");
$("#add_photo_button").addClass("uploading_complete");
},
onStart: function(event, total){
$("#add_photo_button").html( "Uploading Photos" );
$("#add_photo_loader").fadeIn(400);
$("form.new_photo").fadeOut(0);
$("#progress_report").fadeIn(0);
$("#photo_title_status").text("Uploading...");
return true;
}
});
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter