Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(currenthistorypage > playerhistory.length || currenthistorypage == playerhistory.length){
- playerhistory.push(_url);
- if(playerhistory.length > 10){
- playerhistory.shift();
- }
- currenthistorypage = playerhistory.length;
- }else{
- if(_url != playerhistory[currenthistorypage-1]){
- console.log(_url + playerhistory[currenthistorypage-1]);
- playerhistory.length=currenthistorypage;
- playerhistory.push(_url);
- currenthistorypage = playerhistory.length;
- }
- }
- console.log('length:' + playerhistory.length);
- console.log('historypage:' + currenthistorypage);
- if($('.ion-chevron-right').hasClass("disabled") && currenthistorypage > 1 && currenthistorypage < playerhistory.length){
- $('.ion-chevron-right').removeClass("disabled");
- }else if(!$('.ion-chevron-right').hasClass("disabled") && currenthistorypage == playerhistory.length){
- $('.ion-chevron-right').addClass('disabled');
- }
- if($('.ion-chevron-left').hasClass("disabled") && currenthistorypage > 1){
- $('.ion-chevron-left').removeClass("disabled");
- }else if(currenthistorypage <= 1){
- $('.ion-chevron-left').addClass('disabled');
- }
- if(_url.includes('?playlistID=')){
- var playlistname = $('#' + _url.substring(43, _url.length)).text();
- $('.headerText').html('<h5 class="playertruncate"><span><i class="ion-headphone"></i></span> Playlist - ' +playlistname+ '</h5>');
- }
- $(".ion-chevron-left").on("click", function() {
- if(currenthistorypage > 1){
- console.log('history back load '+ currenthistorypage);
- currenthistorypage -= 1;
- console.log('history back load '+ currenthistorypage + ' url ' + playerhistory[currenthistorypage-1]);
- var url = playerhistory[currenthistorypage-1];
- changeplayer(url);
- }
- return false;
- });
- $(".ion-chevron-right").on("click", function() {
- if(currenthistorypage < playerhistory.length){
- console.log('history forward load '+ currenthistorypage);
- currenthistorypage += 1;
- console.log('history forward load '+ currenthistorypage + ' url ' + playerhistory[currenthistorypage-1]);
- var url = playerhistory[currenthistorypage-1];
- changeplayer(url);
- }
- return false;
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement