Guest User

Untitled

a guest
Feb 20th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. <% @album.photos.each do |photo| %>
  2. <script>
  3. new Ajax.Request("/photo/generate_cache/<%= photo.id %>/<%= size %>",
  4. {
  5. asynchronous: true,
  6. onComplete: function () {
  7. temp = Math.round(count["<%= size %>"]++ / count["photos"] * 10000) / 100 + 1;
  8. temp2 = Math.round(count["total"]++ / (count["photos"] * <%= PHOTOS[:sizes].length %>) * 10000) / 100 + 1;
  9. <% if photo.last? -%>
  10. temp = 100;
  11. <% if size == PHOTOS[:sizes][PHOTOS[:sizes].length - 1] -%>
  12. temp2 = 100;
  13. $("main_loading").style.display = "none";
  14. <% end -%>
  15. <% end -%>
  16. $("current_progress_<%= size %>").innerHTML = temp + "%";
  17. $("current_progress_<%= size %>").style.width = temp + "%";
  18. $("total_progress").innerHTML = temp2 + "%";
  19. $("total_progress").style.width = temp2 + "%";
  20. }
  21. }
  22. )
  23. </script>
  24. <% end -%>
Add Comment
Please, Sign In to add comment