Skip to content

Commit

Permalink
Open source
Browse files Browse the repository at this point in the history
  • Loading branch information
hotleave committed Mar 11, 2021
1 parent 38335cd commit 6e2407e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
12 changes: 8 additions & 4 deletions src/components/Racing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,15 @@ export default class Racing extends Vue {
case 'typing':
setTimeout(this.focus, 50)
break
case 'finished':
document.addEventListener('copy', this.copy, true)
document.execCommand('copy')
this.$notify({ title: '成功', message: this.result, type: 'success', duration: 10000, showClose: true })
case 'finished': {
const result = this.result
navigator.clipboard.writeText(result).then(() => result, () => {
document.addEventListener('copy', this.copy, true)
document.execCommand('copy')
})
this.$notify({ title: '成功', message: result, type: 'success', duration: 10000, showClose: true })
break
}
}
}
Expand Down
15 changes: 15 additions & 0 deletions src/docs/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ QuickTyping,中式英语,直译快打,快来打,打得快,越来越快
- [玫枫跟打器](https://kylebing.cn/tools/typepad/)
- [三码郑码](https://www.yuque.com/smzm/zhengma/el4l0a)

## Contributing

- 有问题,提个[Issue](https://gitee.com/hotleave/quick-typing/issues)
- 有想法,提个[Issue](https://gitee.com/hotleave/quick-typing/issues)
- 有能力,提个[PR](https://gitee.com/hotleave/quick-typing/pulls)

## 声明

1. 本程序系私人用途,非商业产品,即不提供相应的服务
Expand All @@ -26,6 +32,15 @@ QuickTyping,中式英语,直译快打,快来打,打得快,越来越快
- [ ] 词库练习
- [ ] 看打模式

## 浏览器要求

> `Chrome``Safari`最新版本下测试通过,`Edge`未经过测试
> **不支持`IE`**
- 支持[IndexedDB](https://caniuse.com/indexeddb)
- 支持[clipboard.writeText](https://caniuse.com/mdn-api_clipboard_writetext)
- 支持[clipboard.readText](https://caniuse.com/mdn-api_clipboard_readtext)

## 快速上手

- 复制要打的文字
Expand Down
5 changes: 2 additions & 3 deletions src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,9 @@ export default class Home extends Vue {
}
}
async loadFromClipboard () {
loadFromClipboard () {
try {
const text = await navigator.clipboard.readText()
this.loadArticle(text)
navigator.clipboard.readText().then(text => { this.loadArticle(text) })
} catch (err) {
console.error('Failed to read clipboard contents: ', err)
}
Expand Down

0 comments on commit 6e2407e

Please # to comment.