AO Next/Prev Epp

Add to anime-odcinki.pl's players buttons: Prev & Next

Verze ze dne 05. 06. 2015. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name        AO Next/Prev Epp
// author       Wiktor Radecki
// @namespace   AnimeOdcinki
// @include     http://anime-odcinki.pl/*
// @version     1
// @grant       none
// @description Add to anime-odcinki.pl's players buttons: Prev & Next
// ==/UserScript==
$(document).ready(function(){
var linki = $('#edit-jump').children();
var isNext = false;
var isPrev = true;
for(var i = 0; i < linki.length; i++)
{
 var e = linki[i];
 if(typeof(e.attributes['selected']) != 'undefined'){
  isNext = true;
  isPrev = false;
  continue;
}

if(isPrev === true && e.value !== "")
 var next = e;
if(isNext === true){
 var prev = e;
 break;
}
}

$div = $('#video-player-control');

if(typeof(prev) !== "undefined")
{
 var plink = prev.value.split("::")[1];
 jQuery('<div/>', {
    id: 'video-player-mode',
    linkid: '1000',
    title: 'Poprzedni odcinek',
    rel: 'external',
    text: '<<',
    style: 'background-color: #126533',
    onclick: 'location.href="'.concat(plink).concat('";')
  }).prependTo($div);
}

if(typeof(next) !== "undefined")
{
 var nlink = next.value.split("::")[1];
 jQuery('<div/>', {
    id: 'video-player-mode',
    linkid: '1001',
    title: 'Nastepny odcinek',
    rel: 'external',
    text: '>>',
    style: 'background-color: #126533',
    onclick: 'location.href="'.concat(nlink).concat('";')
  }).appendTo($div);
}
});