Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. const sRequestFiltreEpizodes = x => {
  2. $.post(window.location.href, {
  3.  
  4. voice: $('#voice').val(),
  5. quality: $('#quality').val(),
  6. source: $('#source').val()
  7.  
  8. }, response => {
  9.  
  10. if(x === 'voice') {
  11. $('#quality')[0].innerHTML = $(response).find('#quality')[0].innerHTML;
  12. $('#source')[0].innerHTML = $(response).find('#source')[0].innerHTML;
  13. }
  14.  
  15. else if(x === 'quality') {
  16. $('#source')[0].innerHTML = $(response).find('#source')[0].innerHTML;
  17. }
  18.  
  19. document.getElementsByClassName('episode-list')[0].innerHTML = $(response).find('.episode-list')[0].innerHTML;
  20.  
  21. });
  22. }
  23.  
  24. $(document).ready(() => {
  25.  
  26. $('body').on('click', '.watch-link', function () {
  27.  
  28. const episode_link = $(this).data('link'),
  29. video_wrapper = $('.content_bg')[0];
  30.  
  31. if(!episode_link) {
  32. alert('Cannot find this epizode!'); return;
  33. }
  34.  
  35. video_wrapper.innerHTML = `<iframe width="598" height="337" frameborder="0" src="${ episode_link }" allowfullscreen></iframe>`;
  36. });
  37.  
  38.  
  39. $('body').on('change', '#voice, #quality, #source', function () {
  40.  
  41. sRequestFiltreEpizodes(this.getAttribute('id'));
  42.  
  43. });
  44.  
  45. sRequestFiltreEpizodes();
  46.  
  47. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement