Guest User

Untitled

a guest
Mar 18th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. var videos = $('#video'),
  2. sites = $('#videoLabels tbody tr'),
  3. visual_results = '';
  4. loadtime_results = '';
  5. // Inner functions as to not recreate them every iteration
  6. var title,
  7. fv,
  8. fv_location,
  9. fv_time_ele,
  10. fv_time_text,
  11. fl,
  12. fl_location,
  13. fl_time_ele,
  14. fl_time_text;
  15.  
  16. sites.each(function(index){
  17. var position = index - 1;
  18. if(index != 0){
  19.  
  20. title = $('.pagelink', $(this)).text();
  21. fv = $('tbody tr:eq(' + position + ') .thumbChanged', videos).first();
  22. fv_location = parseInt(fv.parents('td').index());
  23. fv_time_ele = $('thead tr th:eq(' + fv_location + ')', videos).prev();
  24. fv_time_text = fv_time_ele.text();
  25. fv_time_text = fv_time_text.replace('s', '');
  26.  
  27. fl = $('tbody tr:eq(' + position + ') td:empty', videos).first();
  28. fl_location = parseInt(fl.index());
  29. fl_time_ele = $('thead tr th:eq(' + fl_location + ')', videos).prev();
  30. fl_time_text = fl_time_ele.text();
  31. fl_time_text = fl_time_text.replace('s', '');
  32.  
  33. visual_results += index == 1 ? fv_time_text : '\n' + fv_time_text;
  34. loadtime_results += index == 1 ? fl_time_text : '\n' + fl_time_text;
  35. }
  36. }).promise().done(function(){
  37. console.log('Visual Load: \n' + visual_results);
  38. console.log('Final Load: \n' + loadtime_results);
  39. });
Add Comment
Please, Sign In to add comment