Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <% @album.photos.each do |photo| %>
- <script>
- new Ajax.Request("/photo/generate_cache/<%= photo.id %>/<%= size %>",
- {
- asynchronous: true,
- onComplete: function () {
- temp = Math.round(count["<%= size %>"]++ / count["photos"] * 10000) / 100 + 1;
- temp2 = Math.round(count["total"]++ / (count["photos"] * <%= PHOTOS[:sizes].length %>) * 10000) / 100 + 1;
- <% if photo.last? -%>
- temp = 100;
- <% if size == PHOTOS[:sizes][PHOTOS[:sizes].length - 1] -%>
- temp2 = 100;
- $("main_loading").style.display = "none";
- <% end -%>
- <% end -%>
- $("current_progress_<%= size %>").innerHTML = temp + "%";
- $("current_progress_<%= size %>").style.width = temp + "%";
- $("total_progress").innerHTML = temp2 + "%";
- $("total_progress").style.width = temp2 + "%";
- }
- }
- )
- </script>
- <% end -%>
Add Comment
Please, Sign In to add comment