AO Next/Prev Epp

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        AO Next/Prev Epp
// author       Wiktor Radecki
// @namespace   AnimeOdcinki
// @include     http://anime-odcinki.pl/*
// @version     4
// @grant       none
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @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('<a/>', {
      id: 'video-player-mode',
      linkid: '1000',
      title: 'Poprzedni odcinek',
      rel: 'external',
      text: '<<',
      class: 'prev-next',
      href: plink
    }).prependTo($div);
  }
  if (typeof (next) !== 'undefined')
  {
    var nlink = next.value.split('::') [1];
    jQuery('<a/>', {
      id: 'video-player-mode',
      linkid: '1001',
      title: 'Nastepny odcinek',
      rel: 'external',
      text: '>>',
      class: 'prev-next',
      href: nlink
    }).appendTo($div);
  }
});