Advertisement
Guest User

Untitled

a guest
Jan 16th, 2019
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 2.29 KB | None | 0 0
  1. if(currenthistorypage > playerhistory.length || currenthistorypage == playerhistory.length){
  2.                         playerhistory.push(_url);
  3.                         if(playerhistory.length > 10){
  4.                             playerhistory.shift();
  5.                         }
  6.                         currenthistorypage = playerhistory.length;
  7.                     }else{
  8.                         if(_url != playerhistory[currenthistorypage-1]){
  9.                             console.log(_url + playerhistory[currenthistorypage-1]);
  10.                         playerhistory.length=currenthistorypage;
  11.                         playerhistory.push(_url);
  12.                         currenthistorypage = playerhistory.length; 
  13.                         }
  14.                     }
  15.                     console.log('length:' + playerhistory.length);
  16.                     console.log('historypage:' + currenthistorypage);
  17.                     if($('.ion-chevron-right').hasClass("disabled") && currenthistorypage > 1 && currenthistorypage < playerhistory.length){
  18.                         $('.ion-chevron-right').removeClass("disabled");
  19.                     }else if(!$('.ion-chevron-right').hasClass("disabled") && currenthistorypage == playerhistory.length){
  20.                         $('.ion-chevron-right').addClass('disabled');
  21.                     }
  22.                     if($('.ion-chevron-left').hasClass("disabled") && currenthistorypage > 1){
  23.                         $('.ion-chevron-left').removeClass("disabled");
  24.                     }else if(currenthistorypage <= 1){
  25.                         $('.ion-chevron-left').addClass('disabled');
  26.                     }
  27.                     if(_url.includes('?playlistID=')){
  28.                         var playlistname = $('#' + _url.substring(43, _url.length)).text();
  29.                         $('.headerText').html('<h5 class="playertruncate"><span><i class="ion-headphone"></i></span> &nbsp;&nbsp; Playlist - ' +playlistname+ '</h5>');
  30.                     }
  31.  
  32.             $(".ion-chevron-left").on("click", function() {
  33.                 if(currenthistorypage > 1){
  34.                     console.log('history back load '+ currenthistorypage);
  35.                     currenthistorypage -= 1;
  36.                     console.log('history back load '+ currenthistorypage + ' url ' + playerhistory[currenthistorypage-1]);                 
  37.                     var url = playerhistory[currenthistorypage-1];             
  38.                     changeplayer(url);
  39.                 }
  40.                 return false;
  41.             });
  42.             $(".ion-chevron-right").on("click", function() {
  43.                 if(currenthistorypage < playerhistory.length){
  44.                     console.log('history forward load '+ currenthistorypage);
  45.                     currenthistorypage += 1;
  46.                     console.log('history forward load '+ currenthistorypage + ' url ' + playerhistory[currenthistorypage-1]);
  47.                     var url = playerhistory[currenthistorypage-1];             
  48.                     changeplayer(url);
  49.                 }
  50.                 return false;
  51.             });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement