DG IZ; few changes to uploader. added prefetching to photo prev/next links on photo show page

This commit is contained in:
danielvincent 2010-07-26 16:57:44 -07:00
parent f6687316d6
commit ec59b89e83
3 changed files with 25 additions and 13 deletions

View file

@ -1,14 +1,14 @@
module PhotosHelper
def linked_scaled_photo(photo, album)
link_to (image_tag photo.image.url(:scaled_full)), photo_path(album.next_photo(photo))
link_to (image_tag photo.image.url(:scaled_full)), photo_path(album.next_photo(photo)), :rel => "prefetch"
end
def link_to_prev(photo, album)
link_to "<< previous", photo_path(album.prev_photo(photo))
link_to "<< previous", photo_path(album.prev_photo(photo)), :rel => "prefetch"
end
def link_to_next(photo, album)
link_to "next >>", photo_path(album.next_photo(photo))
link_to "next >>", photo_path(album.next_photo(photo)), :rel => "prefetch"
end
end

View file

@ -18,10 +18,24 @@
},
onFinishOne: function(event, response, name, number, total) {
//alert(response);
},
onFinish: function(event, total){
$("#progress_report").delay(600).slideUp(200);
},
onStart: function(event, total){
$("#progress_report").slideDown(600);
return true;
}
});
});
:css
#progress_report_bar {
border-radius: 3px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
}
@ -33,10 +47,8 @@
%p
= f.file_field :image, :multiple => 'multiple'
#progress_report
#progress_report{ :style => "display:none;" }
#progress_report_name
#progress_report_status{ :style => "font-style: italic;" }
#progress_report_bar_container{ :style => "width: 90%; height: 5px;" }
#progress_report_bar{ :style => "background-color: blue; width: 0; height: 100%;" }
/= f.submit 'post it!', :class => 'button'
#progress_report_bar_container{ :style => "width: 90%; height: 15px;" }
#progress_report_bar{ :style => "background-color: #0A516D; width: 0; height: 100%;" }

View file

@ -27,10 +27,10 @@
fieldName: 'user_file[]',//ignore if sendBoundary is false
STATUSES: {
'STARTED': 'Запуск',
'PROGRESS': 'Загрузка',
'LOADED': 'Обработка',
'FINISHED': 'Завершено'
'STARTED': 'Started',
'PROGRESS': 'Uploading',
'LOADED': 'Processing',
'FINISHED': 'Finished!'
},
setName: function(text) {},
@ -38,7 +38,7 @@
setProgress: function(value) {},
genName: function(file, number, total) {
return file + "(" + (number+1) + " из " + total + ")";
return file + "(" + (number+1) + " of " + total + ")";
},
genStatus: function(progress, finished) {
if (finished) {