forked from AmineB/ycombinator-keys
Compare commits
3 Commits
9a2b786bae
...
0f0a94d993
Author | SHA1 | Date | |
---|---|---|---|
0f0a94d993
|
|||
3ee61aa074
|
|||
6cc8a1a877
|
@ -5,7 +5,7 @@
|
|||||||
// @match *://news.ycombinator.com/*
|
// @match *://news.ycombinator.com/*
|
||||||
// @icon https://gitea.amine-bouabdallaoui.fr/AmineB/ycombinator-keys/raw/branch/main/icons/48.png
|
// @icon https://gitea.amine-bouabdallaoui.fr/AmineB/ycombinator-keys/raw/branch/main/icons/48.png
|
||||||
// @grant none
|
// @grant none
|
||||||
// @version 6
|
// @version 7
|
||||||
// @author AmineB
|
// @author AmineB
|
||||||
// @description Ycombinator keyboard nav.
|
// @description Ycombinator keyboard nav.
|
||||||
// @downloadURL https://gitea.amine-bouabdallaoui.fr/brian6932/ycombinator-keys/raw/branch/main/keyboard-watcher.user.js
|
// @downloadURL https://gitea.amine-bouabdallaoui.fr/brian6932/ycombinator-keys/raw/branch/main/keyboard-watcher.user.js
|
||||||
@ -43,7 +43,9 @@ const
|
|||||||
query[selected].style.boxShadow = ''
|
query[selected].style.boxShadow = ''
|
||||||
|
|
||||||
while (selected < query.length && query[++selected].classList.contains('noshow'));
|
while (selected < query.length && query[++selected].classList.contains('noshow'));
|
||||||
highlightSelected()
|
|
||||||
|
if (!query[selected].classList.contains('noshow'))
|
||||||
|
highlightSelected()
|
||||||
return
|
return
|
||||||
case 'k':
|
case 'k':
|
||||||
if (selected <= 0)
|
if (selected <= 0)
|
||||||
@ -51,7 +53,9 @@ const
|
|||||||
|
|
||||||
query[selected].style.boxShadow = ''
|
query[selected].style.boxShadow = ''
|
||||||
while (selected >= 0 && query[--selected].classList.contains('noshow'));
|
while (selected >= 0 && query[--selected].classList.contains('noshow'));
|
||||||
highlightSelected()
|
|
||||||
|
if (!query[selected].classList.contains('noshow'))
|
||||||
|
highlightSelected()
|
||||||
return
|
return
|
||||||
case 'h':
|
case 'h':
|
||||||
if (globalThis.location.pathname === '/hidden')
|
if (globalThis.location.pathname === '/hidden')
|
||||||
@ -62,7 +66,8 @@ const
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
query[selected].nextSibling.querySelector('a.clicky.hider')?.click()
|
query[selected].nextSibling.querySelector('a.clicky.hider')?.click()
|
||||||
if (selected + 1 <= query.length)
|
|
||||||
|
if (selected + 1 <= query.length && !query[selected].classList.contains('noshow'))
|
||||||
highlightSelected()
|
highlightSelected()
|
||||||
return
|
return
|
||||||
case 'c':
|
case 'c':
|
||||||
|
Reference in New Issue
Block a user