a, s, e shortcut in dcinside

a키를 누르면 다음 개념글, s 키를 누르면 이전 념글, e 키를 누르면 개념글로 이동하고, 또 e키를 누르면 첫 번째 개념글을 선택합니다.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         a, s, e shortcut in dcinside
// @namespace    http://tampermonkey.net/
// @version      2024
// @description  a키를 누르면 다음 개념글, s 키를 누르면 이전 념글, e 키를 누르면 개념글로 이동하고, 또 e키를 누르면 첫 번째 개념글을 선택합니다.
// @author       You
// @match        https://gall.dcinside.com/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// ==/UserScript==

document.addEventListener('keydown', function (keyInput) {
    if (keyInput.key === 'a') {
        let elementNodeListOf = document.querySelectorAll('.gall_tit.ub-word');
        for (let a = 0; a < elementNodeListOf.length; a++) {
            if (document.URL === elementNodeListOf[a].querySelector('a').href) {
                elementNodeListOf[a + 1].querySelector('a').click();
            }
        }
    }
    if (keyInput.key === 's') {
        let elementNodeListOf = document.querySelectorAll('.gall_tit.ub-word');
        for (let a = 0; a < elementNodeListOf.length; a++) {
            if (document.URL === elementNodeListOf[a].querySelector('a').href) {
                elementNodeListOf[a - 1].querySelector('a').click();
            }
        }
    }

    if (keyInput.key === 'e') {
        let main = document.querySelector('.array_tab.left_box').querySelectorAll('button')[1];
        if (main.textContent === '개념글' && main.getAttribute('class') !== 'on') {
            document.querySelector('.array_tab.left_box').querySelectorAll('button')[1].onclick();
        } else {
            document.querySelector('tr[data-type="icon_recomimg"]').querySelector('.gall_tit.ub-word').querySelector('a').click();

        }
    }
});

// css title
document.querySelector('.title.ub-word').style.fontSize = 'xxx-large';