Skip to content

Commit 6d18613

Browse files
committed
feat: ✨ 增加「跳至上/下一话」快捷键
https://sleazyfork.org/scripts/374903/discussions/310020#comment-615011
1 parent 7073a0f commit 6d18613

7 files changed

Lines changed: 17 additions & 0 deletions

File tree

locales/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
"hotkeys": {
5050
"enter_read_mode": "Enter reading mode",
5151
"float_tag_list": "Floating tag list",
52+
"jump_next": "Jump to next chap",
53+
"jump_prev": "Jump to previous chap",
5254
"jump_to_end": "Jump to the last page",
5355
"jump_to_home": "Jump to the first page",
5456
"page_down": "Turn the page to the down",

locales/hu.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
"hotkeys": {
5050
"enter_read_mode": "进入阅读模式",
5151
"float_tag_list": "悬浮标签列表",
52+
"jump_next": "Ugrás a következő fejezetre",
53+
"jump_prev": "Ugrás az előző fejezetre",
5254
"jump_to_end": "跳至尾页",
5355
"jump_to_home": "跳至首页",
5456
"page_down": "向下翻页",

locales/ru.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
"hotkeys": {
5050
"enter_read_mode": "Режим чтения",
5151
"float_tag_list": "Плавающий список тегов",
52+
"jump_next": "Перейти к следующей главе",
53+
"jump_prev": "Перейти к предыдущей главе",
5254
"jump_to_end": "Перейти к последней странице",
5355
"jump_to_home": "Перейти к первой странице",
5456
"page_down": "Перелистнуть страницу вниз",

locales/ta.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
"hotkeys": {
5050
"enter_read_mode": "வாசிப்பு பயன்முறையை உள்ளிடவும்",
5151
"float_tag_list": "இடைநீக்க சிட்டை பட்டியல்",
52+
"jump_next": "அடுத்த அத்தியாயத்திற்குத் தாவு",
53+
"jump_prev": "முந்தைய அத்தியாயத்திற்குத் தாவு",
5254
"jump_to_end": "இறுதிவரை குதிக்கவும்",
5355
"jump_to_home": "முகப்புப்பக்கத்திற்கு செல்லவும்",
5456
"page_down": "பக்கங்கள் கீழே",

locales/zh.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
"hotkeys": {
5050
"enter_read_mode": "进入阅读模式",
5151
"float_tag_list": "悬浮标签列表",
52+
"jump_next": "跳至下一话",
53+
"jump_prev": "跳至上一话",
5254
"jump_to_end": "跳至尾页",
5355
"jump_to_home": "跳至首页",
5456
"page_down": "向下翻页",

src/components/Manga/actions/hotkeys.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ export const [defaultHotkeys, setDefaultHotkeys] = createSignal<
2727
translate_to_end: [],
2828
fullscreen: [],
2929
auto_scroll: [],
30+
jump_next: [],
31+
jump_prev: [],
3032
});
3133

3234
/** 快捷键配置 */

src/components/Manga/actions/operate.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,11 @@ export const handleHotkey = (hotkey: string, e?: KeyboardEvent) => {
212212
case 'fullscreen':
213213
return switchFullscreen();
214214

215+
case 'jump_next':
216+
return store.prop.onNext?.();
217+
case 'jump_prev':
218+
return store.prop.onPrev?.();
219+
215220
case 'switch_auto_enlarge':
216221
return setOption((draftOption) => {
217222
draftOption.disableZoom = !draftOption.disableZoom;

0 commit comments

Comments
 (0)