weiqi auto jump

按下方向键右,可直接跳到下一题

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         weiqi auto jump
// @namespace    https://www.101weiqi.com/qday/
// @version      1.0
// @description  按下方向键右,可直接跳到下一题
// @author       Lennon
// @match        https://*.101weiqi.com/*
// @require      http://code.jquery.com/jquery-2.1.1.min.js
// @run-at       document-end
// @icon         https://deepmind.com/static/v0.0.0/appIcons/favicon.png
// ==/UserScript==
(function() {
    'use strict';

    var elementButton = $('a.btn-info');
    $(document).keyup(function(e) {
        switch (e.keyCode) {
                // arrow left
            case 37:
                elementButton[0].click();
                break;
                // arrow right
            case 39:
                if($('div[ng-click="startnext()"]').length) {
                    $('div[ng-click="startnext()"]').click();
                } else if ($(elementButton[1]).length) {
                    elementButton[1].click();
                } else if ($('div.huati_lei > span > a').attr('href').length) {
                    location.href = $('div.huati_lei > span > a').attr('href');
                }
                break;
        }

        return !0
    })
})();