a, s, e shortcut in dcinside

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

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==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';