mirror of
https://github.com/koodo-reader/koodo-reader.git
synced 2026-06-16 20:01:17 -04:00
fix bug
Former-commit-id: 00170948f9ad3ce71ce11adc530461fc57d88efa
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<div align="left">
|
||||
|
||||
[简体中文](https://github.com/troyeguo/koodo-reader/blob/master/README_cn.md) | English
|
||||
[简体中文](https://github.com/troyeguo/koodo-reader/blob/master/README_cn.md) | [Português](https://github.com/troyeguo/koodo-reader/blob/master/README_pt.md) |English
|
||||
|
||||
</div>
|
||||
|
||||
@@ -96,7 +96,7 @@ docker-compose up -d
|
||||
|
||||
## Develop
|
||||
|
||||
Make sure that you have installed yarn and git, node's version on your computer is larger than 14.0.0.
|
||||
Make sure that you have installed yarn and git, node's version on your computer is 14.x.x.
|
||||
|
||||
1. Download the repo
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div align="left">
|
||||
|
||||
简体中文 | [English](https://github.com/troyeguo/koodo-reader/blob/master/README.md)
|
||||
简体中文 | [Português](https://github.com/troyeguo/koodo-reader/blob/master/README_pt.md) | [English](https://github.com/troyeguo/koodo-reader/blob/master/README.md)
|
||||
|
||||
</div>
|
||||
|
||||
@@ -93,7 +93,7 @@ docker-compose up -d
|
||||
|
||||
## 运行源码
|
||||
|
||||
请确保您电脑的 node 的版本大于 10.0.0,已配置好 yarn,git 的运行环境。
|
||||
请确保您电脑的 node 的版本为 14.x.x,已配置好 yarn,git 的运行环境。
|
||||
|
||||
1. 将项目源码下载到本地
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div align="left">
|
||||
|
||||
[English](https://github.com/troyeguo/koodo-reader/blob/master/README.md) | English
|
||||
[简体中文](https://github.com/troyeguo/koodo-reader/blob/master/README_cn.md) | Português | [English](https://github.com/troyeguo/koodo-reader/blob/master/README.md)
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -332,7 +332,7 @@ class SettingDialog extends React.Component<
|
||||
this.handleChangeLocation();
|
||||
}}
|
||||
>
|
||||
<Trans>Change location</Trans>
|
||||
<Trans>Select</Trans>
|
||||
</span>
|
||||
</div>
|
||||
<div className="setting-dialog-location-title">
|
||||
|
||||
@@ -135,13 +135,14 @@
|
||||
opacity: 1;
|
||||
border-radius: 11px;
|
||||
position: relative;
|
||||
top: 4px;
|
||||
top: 0px;
|
||||
left: 2px;
|
||||
cursor: pointer;
|
||||
font-size: 13px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
line-height: 1;
|
||||
}
|
||||
.theme-setting-item {
|
||||
width: 25px;
|
||||
|
||||
@@ -64,6 +64,7 @@ class PopupMenu extends React.Component<PopupMenuProps, PopupMenuStates> {
|
||||
let doc = getIframeDoc();
|
||||
if (!doc) return;
|
||||
doc.addEventListener("mousedown", this.openMenu);
|
||||
doc.addEventListener("touchend", this.openMenu);
|
||||
if (this.props.currentBook.format === "PDF") {
|
||||
setTimeout(() => {
|
||||
this.renderHighlighters();
|
||||
|
||||
@@ -69,9 +69,10 @@ class PopupTrans extends React.Component<PopupTransProps, PopupTransState> {
|
||||
</p>
|
||||
<select
|
||||
className="booklist-shelf-list"
|
||||
style={{ width: "80px", marginLeft: "10px" }}
|
||||
style={{ width: "75px", marginLeft: "10px" }}
|
||||
onChange={(event: React.ChangeEvent<HTMLSelectElement>) => {
|
||||
StorageUtil.setReaderConfig("transService", event.target.value);
|
||||
StorageUtil.setReaderConfig("transTarget", "en");
|
||||
this.setState({ translateService: event.target.value });
|
||||
this.handleTrans(
|
||||
this.props.originalText.replace(/(\r\n|\n|\r)/gm, "")
|
||||
@@ -97,7 +98,7 @@ class PopupTrans extends React.Component<PopupTransProps, PopupTransState> {
|
||||
</select>
|
||||
<select
|
||||
className="booklist-shelf-list"
|
||||
style={{ width: "100px", marginLeft: "10px" }}
|
||||
style={{ width: "75px", marginLeft: "10px" }}
|
||||
onChange={(event: React.ChangeEvent<HTMLSelectElement>) => {
|
||||
let targetLang = event.target.value;
|
||||
StorageUtil.setReaderConfig("transTarget", targetLang);
|
||||
|
||||
@@ -28,6 +28,9 @@ class BookUtil {
|
||||
reader.onload = async (event) => {
|
||||
if (!event.target) return;
|
||||
try {
|
||||
if (!fs.existsSync(path.join(dataPath, "book"))) {
|
||||
fs.mkdirSync(path.join(dataPath, "book"));
|
||||
}
|
||||
fs.writeFileSync(
|
||||
path.join(dataPath, "book", key),
|
||||
Buffer.from(event.target.result as any)
|
||||
|
||||
@@ -62,6 +62,9 @@ export const moveData = (
|
||||
reader.readAsArrayBuffer(file);
|
||||
reader.onload = async (event) => {
|
||||
if (!event.target) return;
|
||||
if (!fs.existsSync(path.join(dirPath))) {
|
||||
fs.mkdirSync(path.join(dirPath));
|
||||
}
|
||||
fs.writeFileSync(
|
||||
path.join(dirPath, file.name),
|
||||
Buffer.from(event.target.result as any)
|
||||
@@ -134,6 +137,9 @@ export const syncData = (blob: Blob, books: BookModel[] = [], isSync: true) => {
|
||||
reader.readAsArrayBuffer(file);
|
||||
reader.onload = async (event) => {
|
||||
if (!event.target) return;
|
||||
if (!fs.existsSync(path.join(dataPath))) {
|
||||
fs.mkdirSync(path.join(dataPath));
|
||||
}
|
||||
fs.writeFileSync(
|
||||
path.join(dataPath, file.name),
|
||||
Buffer.from(event.target.result as any)
|
||||
|
||||
Reference in New Issue
Block a user