Thread Navigating by Arrow keys

Use ← or → and Ctrl to navigate to previous, next, first or last page

Verze ze dne 20. 06. 2017. Zobrazit nejnovější verzi.

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

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 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        Thread Navigating by Arrow keys
// @namespace   https://greasyfork.org/scripts/6849-thread-navigating-by-arrow-keys
// @description Use ← or → and Ctrl to navigate to previous, next, first or last page
// @author      theheroofvn
// @include     /^.*(thread|forum|diendan).*$/
// @include     http://www.vn-zoom.com/*
// @require     https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js
// @noframes
// @grant       GM_addStyle
// @version     6.3
// ==/UserScript==

$(document).ready(function(){function a(a){return $('script[src*="'+a+'"]').length>0}$(window).focus();var t,e,r,n,i;if(0===function(a){if(0===a.length)return 0;for(var o=0;o<a.length;o++)if(location.hostname==a[o].host)return t=a[o].prev,e=a[o].next,r=a[o].first,n=a[o].last,i=a[o].up,1;return 0}([{host:"www.webtretho.com",prev:"a.arrowPrePage",next:"a.arrowNextPage",first:"a.arrowFstPage",last:"a.arrowLstPage"},{host:"forum.bkav.com.vn",prev:"a.js-pagenav-prev-button",next:"a.js-pagenav-next-button",first:"a[data-page='1']",last:"a.js-pagenav-button:nth-last-child(2)",up:"#breadcrumbs a.crumb-link"}]))switch(function(){var t="";return a("vbulletin")?t="vbb":a("xenforo")?t="xenforo":a("general.js")?t="mybb":a("forum_fn.js")&&(t="phpbb"),t}()){case"vbb":t='a[rel="prev"]',e='a[rel="next"]',r='a[rel="start"]',n='a[title^="Last"], a[title*="uối"]',i="span.navbar a, li.navbit a";break;case"xenforo":t=".PageNav a.text:first-child",e=".PageNav a.text:last-child",n=".PageNav nav > a:nth-last-child(2)",r='a[rel="start"]',i="a.crumb";break;case"mybb":t="a.pagination_previous",e="a.pagination_next",r="a.pagination_first",n="a.pagination_last",i=".navigation > a";break;case"phpbb":t=".display-options a.left-box.left",e=".display-options a.right-box.right",r=".pagination > span > a:first-child",n=".pagination > span > a:last-child",i=".navlinks > .icon-home a";break;default:return}var o={prev:function(){return $(t)},next:function(){return $(e)},first:function(){if($(r).length>0)return $(r);var a=$(t).first();return a?(a.attr("href",function(a,t){return t.replace(/page=\d+/,"page=1")}),a):$()},last:function(){if($(n).length>0)return $(n);var a=$(e).first();return a?(a.attr("href",function(a,t){return t.replace(/page=\d+/,"page=9999")}),a):$()},up:function(){return $(i).length>0?$(i).last():$('[itemtype="http://data-vocabulary.org/Breadcrumb"] a').last()}},s=!0;$(document).keydown(function(a){if(s){s=!1;var t=a.keyCode,e=null;if(a.ctrlKey)s=!0,39==t?e="last":37==t?e="first":8==t&&(e="up");else if(39==t)e="next";else{if(37!=t)return;e="prev"}if(e&&"INPUT"!=a.target.tagName&&"TEXTAREA"!=a.target.tagName){var r=o[e]();r.length&&(window.location.href=r[0].href)}}}).keyup(function(a){s=!0})});