Skip to content

Commit

Permalink
v2.3.0 support more shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
hanFengSan committed Dec 1, 2018
1 parent dae013e commit 2e2ad07
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 37 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ehunter",
"version": "2.2.4",
"version": "2.3.0",
"description": "A Vue.js project",
"author": "Alex Chen <c360785655@gmail.com>",
"private": true,
Expand Down
9 changes: 3 additions & 6 deletions src/assets/value/bookInstrction.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
export default {
cn: `
可使用键盘的左右键翻页
![image-keyboard_arrow](https://raw.githubusercontent.com/hanFengSan/eHunter/master/github_image/keyboard_arrow.jpg)
支持\`A\`. \`D\`, \`Left(左)\`, \`Right(右)\`和\`Space(空格)\`键翻页.
`,
en: `
You can use the keyboard's left and right keys to page
![image-keyboard_arrow](https://raw.githubusercontent.com/hanFengSan/eHunter/master/github_image/keyboard_arrow.jpg)
You can use the keyboard's \`A\`, \`D\`, \`Left\`, \`Right\` and \`Space\` keys to page.
`,
jp: `
キーボードの左右のキーを使用してページングすることができます
![image-keyboard_arrow](https://raw.githubusercontent.com/hanFengSan/eHunter/master/github_image/keyboard_arrow.jpg)
You can use the keyboard's \`A\`, \`D\`, \`Left\`, \`Right\` and \`Space\` keys to page.
`
}
27 changes: 15 additions & 12 deletions src/assets/value/instruction.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ export default {
2.在页面右上角点击打开eHunter
![image-open_ehunter](https://raw.githubusercontent.com/hanFengSan/eHunter/master/github_image/open_ehunter.jpg)
3.在\`阅读模式\`为\`书本\`时, 可使用键盘的左右键翻页
![image-keyboard_arrow](https://raw.githubusercontent.com/hanFengSan/eHunter/master/github_image/keyboard_arrow.jpg)
3.\`滚动\`模式下, 支持\`A\`. \`D\`, \`Left(左)\`和\`Right(右)\`键翻页.
4.\`分卷页数\`对性能要求较高,请不要设置过高,可能会导致卡顿.
4.\`书页\`模式下, 支持\`A\`. \`D\`, \`Left(左)\`, \`Right(右)\`和\`Space(空格)\`键翻页.
5.在前页采用\`Normal\`模式查看缩略图可加速加载, 使用\`Large\`模式会慢一些.
5.\`分卷页数\`对性能要求较高,请不要设置过高,可能会导致卡顿.
6.在前页采用\`Normal\`模式查看缩略图可加速加载, 使用\`Large\`模式会慢一些.
### 反馈和建议
* 可在[Github](https://github.com/hanFengSan/eHunter)上开issue给我.
Expand All @@ -39,12 +40,13 @@ export default {
2.Click the button at the upper right corner of this page to open the eHunter
![image-open_ehunter](https://raw.githubusercontent.com/hanFengSan/eHunter/master/github_image/open_ehunter.jpg)
3.When the \`Mode\` is \`Book\`, you can use the keyboard's left and right keys to page
![image-keyboard_arrow](https://raw.githubusercontent.com/hanFengSan/eHunter/master/github_image/keyboard_arrow.jpg)
3.When the \`Mode\` is \`Scroll\`, you can use the keyboard's \`A\`, \`D\`, \`Left\` and \`Right\` keys to page.
4.When the \`Mode\` is \`Book\`, you can use the keyboard's \`A\`, \`D\`, \`Left\`, \`Right\` and \`Space\` keys to page.
4.This is a high performance requirements on \`Volume size\`. If too big, the program will be slow.
5.This is a high performance requirements on \`Volume size\`. If too big, the program will be slow.
5.You can use \`Normal\` mode of thumbnail in previous page to accelerate the load. If it's \`Large\` mode, the loading will be slow a bit.
6.You can use \`Normal\` mode of thumbnail in previous page to accelerate the load. If it's \`Large\` mode, the loading will be slow a bit.
### Feedback & Suggestion
* Open issue on [Github](https://github.com/hanFengSan/eHunter) to me.
Expand All @@ -67,12 +69,13 @@ If you like this extension, I hope you can give a five-star rating in store. 8-)
2.このページの右上隅にあるボタンをクリックしてeHunterを開きます
![image-open_ehunter](https://raw.githubusercontent.com/hanFengSan/eHunter/master/github_image/open_ehunter.jpg)
3.\`モード\`が\`スクロール\`のときは、キーボードの左右のキーを使用してページングすることができます
![image-keyboard_arrow](https://raw.githubusercontent.com/hanFengSan/eHunter/master/github_image/keyboard_arrow.jpg)
3.When the \`Mode\` is \`Scroll\`, you can use the keyboard's \`A\`, \`D\`, \`Left\` and \`Right\` keys to page.
4.When the \`Mode\` is \`Book\`, you can use the keyboard's \`A\`, \`D\`, \`Left\`, \`Right\` and \`Space\` keys to page.
4.これは\`ボリュームサイズ\`の高性能要件です。 大きすぎるとプログラムが遅くなります。
5.これは\`ボリュームサイズ\`の高性能要件です。 大きすぎるとプログラムが遅くなります。
5.前のページのサムネイルの「Normal」モードを使用して負荷を高速化することができます。「Large」モードの場合は、読み込みが少し遅くなります。
6.前のページのサムネイルの「Normal」モードを使用して負荷を高速化することができます。「Large」モードの場合は、読み込みが少し遅くなります。
### フィードバックと提案
* 私にGITHUBのオープンな問題
Expand Down
2 changes: 2 additions & 0 deletions src/assets/value/tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ export const DIALOG_OPERATION_TYPE_POSITIVE = 'DIALOG_OPERATION_TYPE_POSITIVE';
export const DIALOG_OPERATION_TYPE_WARNING = 'DIALOG_OPERATION_TYPE_WARNING';

export const TYPE_PROXY = 'TYPE_PROXY';

export const KEYBOARD = 'KEYBOARD';
10 changes: 6 additions & 4 deletions src/assets/value/version.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
export default {
cn: `
* 支持更多缩略图, 比如10rows/40rows
* 滚动模式下, 支持\`A\`和\`D\`键翻页.
* 书页模式下, 支持\`A\`键. \`D\`以及\`Space(空格)\`键翻页.
`,
en: `
* Support more thumbs, such as \`10rows\`, \`40rows\`.
* Support the keyboard's \`A\` and \`D\` keys to page in Scroll mode.
* Support the keyboard's \`A\`, \`D\` and \`Space\` keys to page in Book mode.
`,
jp: `
* Support more thumbs, such as \`10rows\`, \`40rows\`.
* Support the keyboard's \`A\` and \`D\` keys to page in Scroll mode.
* Support the keyboard's \`A\`, \`D\` and \`Space\` keys to page in Book mode.
`
}
6 changes: 6 additions & 0 deletions src/components/AlbumBookView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,19 @@ export default {
},
watchKeyboard(e) {
if (e.metaKey || e.ctrlKey) {
return;
}
switch (e.key) {
case 'ArrowLeft':
case 'a':
if (this.bookIndex > 0) {
this.setBookIndex(this.bookIndex - 1);
}
break;
case 'ArrowRight':
case 'd':
case ' ':
if (this.bookIndex < this.screens.length - 1) {
this.setBookIndex(this.bookIndex + 1);
}
Expand Down
25 changes: 25 additions & 0 deletions src/components/AlbumScrollView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ export default {
created() {
setTimeout(() => this.setIndex({ val: this.curIndex.val, updater: tags.SCROLL_VIEW_VOL }), 1000);
document.addEventListener('keydown', this.watchKeyboard);
},
destroyed() {
document.removeEventListener('keydown', this.watchKeyboard);
},
computed: {
Expand Down Expand Up @@ -213,6 +218,26 @@ export default {
if (await SettingService.getShowTopBar()) {
this.toggleTopBar(val);
}
},
watchKeyboard(e) {
if (e.metaKey || e.ctrlKey) {
return;
}
switch (e.key) {
case 'ArrowLeft':
case 'a':
if (this.centerIndex.val !== 0) {
this.setIndex({ val: this.centerIndex.val - 1, updater: tags.KEYBOARD });
}
break;
case 'ArrowRight':
case 'd':
if (this.centerIndex.val !== AlbumService.getPageCount()) {
this.setIndex({ val: this.centerIndex.val + 1, updater: tags.KEYBOARD });
}
break;
}
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
version: '2.2.4',
version: '2.3.0',
updateServer1: 'https://raw.githubusercontent.com/hanFengSan/eHunter/master/update.json',
updateServer2: 'https://raw.githubusercontent.com/hanFengSan/eHunter/master/update.json'
};
24 changes: 12 additions & 12 deletions update.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"cn":{
"title":"新版本: v2.2.4",
"version":"2.2.4",
"text":"支持更多缩略图",
"time":1543319008235,
"title":"新版本: v2.3.0",
"version":"2.3.0",
"text":"支持更多快捷键",
"time":1543726902266,
"duration":604800000,
"always":true,
"operations":[
Expand All @@ -26,10 +26,10 @@
]
},
"en":{
"title":"New version: v2.2.4",
"version":"2.2.3",
"text":"Support more thumbs",
"time":1543319008235,
"title":"New version: v3.3.0",
"version":"2.3.0",
"text":"Support more shortcuts",
"time":1543726902266,
"duration":604800000,
"always":true,
"operations":[
Expand All @@ -52,10 +52,10 @@
]
},
"jp":{
"title":"新しいバージョン: v2.2.4",
"version":"2.2.3",
"text":"Support more thumbs",
"time":1543319008235,
"title":"新しいバージョン: v2.3.0",
"version":"2.3.0",
"text":"Support more shortcuts",
"time":1543726902266,
"duration":604800000,
"always":true,
"operations":[
Expand Down
3 changes: 2 additions & 1 deletion yarn-error.log
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ Platform:
npm manifest:
{
"name": "ehunter",
"version": "2.2.4",
"version": "2.3.0",
"description": "A Vue.js project",
"author": "Alex Chen <c360785655@gmail.com>",
"private": true,
"scripts": {
"dev": "webpack --config build/webpack.dev.conf.js",
"build": "webpack --config build/webpack.prod.conf.js",
"publish": "npm run test && npm run build && web-ext build -s dist -a publish_output",
"publish_no_test": "npm run build && web-ext build -s dist -a publish_output",
"test": "npm run unit",
"unit": "cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run"
},
Expand Down

0 comments on commit 2e2ad07

Please sign in to comment.