Skip to content

Commit

Permalink
v1.6.5
Browse files Browse the repository at this point in the history
[+] Added chapter title pattern detector for dynamically extracting chapter titles.
[+] Added filter bar and buttons for categorizing books.
[+] Added language detection before opening books.
[+] Added "Remove all books" functionality with confirmation prompt (with SweetAlert2).
[+] Added Alt/Option+click to force reprocess a book with tooltip.
[+] Added SVG stroke animation.
[*] Updated code logic for opening large books.
[*] Improved bookshelf button logic (no show after dragging books in).
[*] Fixed booklist scroll buttons bug.
[*] Enhanced indexDB operations.
[*] Made title pattern detection more reliable especially when no chapter titles are found.
[*] Fixed dropdown selector bug below settings menu elements.
[*] Resolved garbled first line bug.
[*] Optimized regex rules and performance of text-processor-worker.
[*] Utilized regex named groups.
[*] More efficent pagination calculation.
[*] Updated pagination logic for long content.
[*] Addressed pagination bugs and alignment issues with footnotes.
[*] Consolidated all SVGs into a single file.
[*] Fixed REGEX_IS_TITLE getter slow issue.
[-] Removed unnecessary extension permissions.
[-] Removed FangZheng fonts.
  • Loading branch information
henryxrl committed Dec 13, 2024
1 parent c2eb393 commit 4b2c6c0
Show file tree
Hide file tree
Showing 116 changed files with 12,175 additions and 2,879 deletions.
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,26 @@
.gitignore
.gitmodules

# vscode
.vscode/

# assets
**/assets/
**/dist/
**/manifests/
**/debug/
**/extension/
.vscode/
**/node_modules/
**/books/*
!**/books/
publish_extension.py
**/README.md
**/README_EN.md

# docker
Dockerfile

# Ignore Mac DS_Store files
**/.DS_Store
**/.cache-*
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
**/dist/
# **/publish_extension.py
.vscode/
**/books/*
!**/books/
**/node_modules/

# Ignore Mac DS_Store files
**/.DS_Store
Expand Down
34 changes: 24 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@

### 火狐插件

- [易笺 (v1.6.3)](https://addons.mozilla.org/zh-CN/firefox/addon/yijian/)
- [易笺 (v1.6.5)](https://addons.mozilla.org/zh-CN/firefox/addon/yijian/)

### Chrome 插件

- [易笺 (v1.6.3)](https://chrome.google.com/webstore/detail/%E6%98%93%E7%AC%BA/dbanahlbopbjpgdkecmclbbonhpohcaf)
- [易笺 (v1.6.5)](https://chrome.google.com/webstore/detail/%E6%98%93%E7%AC%BA/dbanahlbopbjpgdkecmclbbonhpohcaf)

### Edge 插件

- [易笺 (v1.6.3)](https://microsoftedge.microsoft.com/addons/detail/pabihehbdhldbdliffaddllmjlknmpak)
- [易笺 (v1.6.5)](https://microsoftedge.microsoft.com/addons/detail/pabihehbdhldbdliffaddllmjlknmpak)

### Docker

Expand Down Expand Up @@ -102,22 +102,36 @@ docker run -d --name simpletextreader \

[2] 文件在首次处理后,下次打开无需再次处理,加载速度更快(可以通过在 URL 末尾添加 `?always-process` 参数来关闭此功能)

- 如果需要手动强制重新处理一本书,请按住 **Alt** 键并点击(Windows/Linux)或按住 **Option** 键并点击(Mac)该书。这与添加 `?always-process` 参数的效果相同,但仅对单本书生效。

[3] 界面无任何卡顿现象

3. 全新的分页逻辑
3. 全新的章节标题提取逻辑

- 除了使用预定义的正则表达式外,v1.6.4 增加了自动从文档中识别标题规律的功能,大幅提升了标题提取的准确率。

4. 全新的目录显示:当鼠标指针位于目录区域外时,仅显示当前章节的简化名称,对中英文小说均有效。例如,`正文 第一卷 原上草 第一章 秦少爷初临宝地 防狼术小试牛刀` 将简化为 `秦少爷初临宝地 防狼术小试牛刀`。当鼠标移入目录区域时,会显示完整的章节名称。
4. 全新的分页逻辑

5. 全新的目录显示:当鼠标指针位于目录区域外时,仅显示当前章节的简化名称,对中英文小说均有效。例如,`正文 第一卷 原上草 第一章 秦少爷初临宝地 防狼术小试牛刀` 将简化为 `秦少爷初临宝地 防狼术小试牛刀`。当鼠标移入目录区域时,会显示完整的章节名称。
<img src="assets/5_TOC_zh.gif" alt="TOC" height="500" />

5. 新增“快读完”的阅读进度提示
6. 新增主界面功能栏,包含以下功能:

- 按阅读状态分类书籍

- 显示书籍数量统计

- 删除所有书籍功能,包含确认提示以防止误操作

7. 新增“快读完”的阅读进度提示

6. 优化书籍封面生成逻辑
8. 优化书籍封面生成逻辑

7. 更流畅的界面语言切换
9. 更流畅的界面语言切换

8. 改用京华老宋体作为默认字体,以规避可能的版权问题
10. 改用京华老宋体作为默认字体,以规避可能的版权问题

9. 修复若干 Bug,提升了稳定性和用户体验
11. 修复若干 Bug,提升了稳定性和用户体验

**注:从 v1.6 开始,不再支持无界面(No-UI)版本。无界面版本中的所有功能(包括通过 `file://*.txt` URL 打开本地 `.txt` 文件)现已完全集成到正常版本中。**

Expand Down
34 changes: 24 additions & 10 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ Big thanks to [Manjusaka](https://github.com/Zheaoli) for his amazing help and h

### Firefox

- [SimpleTextReader (v1.6.3)](https://addons.mozilla.org/en-US/firefox/addon/yijian/)
- [SimpleTextReader (v1.6.5)](https://addons.mozilla.org/en-US/firefox/addon/yijian/)

### Chrome

- [SimpleTextReader (v1.6.3)](https://chrome.google.com/webstore/detail/%E6%98%93%E7%AC%BA/dbanahlbopbjpgdkecmclbbonhpohcaf)
- [SimpleTextReader (v1.6.5)](https://chrome.google.com/webstore/detail/%E6%98%93%E7%AC%BA/dbanahlbopbjpgdkecmclbbonhpohcaf)

### Edge

- [SimpleTextReader (v1.6.3)](https://microsoftedge.microsoft.com/addons/detail/pabihehbdhldbdliffaddllmjlknmpak)
- [SimpleTextReader (v1.6.5)](https://microsoftedge.microsoft.com/addons/detail/pabihehbdhldbdliffaddllmjlknmpak)

### Docker

Expand Down Expand Up @@ -102,22 +102,36 @@ To use URL parameters, append `?param` to the end of the URL. To use multiple pa

[2] Previously processed files can be reopened without processing, further reducing loading time. This feature can be turned of by adding `?always-process` option at the end of the URL.

- To manually force reprocess a book, hold **Alt** and click (Windows/Linux) or **Option** and click (Mac) on the book. This achieves the same effect as adding the `?always-process` option but applies to a single book only.

[3] Interface operations are smooth and free from lag.

3. New pagination logic.
3. Enhanced chapter title detection logic.

- In addition to predefined regular expressions, v1.6.4 introduces the ability to automatically detect title patterns from the text file and dynamically add them to the regex rule library, significantly improving the accuracy of title extraction.

4. New table of contents display: When the cursor is outside the table of contents area, only the simplified chapter title is displayed, applicable to both Chinese and English novels. For example, `Chapter 6. The Deputy Procureur du Roi.` will be simplified to `The Deputy Procureur du Roi.`. When the cursor moves back into the table of contents area, the full chapter title will be displayed.
4. New pagination logic.

5. New table of contents display: When the cursor is outside the table of contents area, only the simplified chapter title is displayed, applicable to both Chinese and English novels. For example, `Chapter 6. The Deputy Procureur du Roi.` will be simplified to `The Deputy Procureur du Roi.`. When the cursor moves back into the table of contents area, the full chapter title will be displayed.
<img src="assets/5_TOC_en.gif" alt="TOC" height="500" />

5. "Finishing up" reading progress indicator.
6. Added a toolbar in the main interface with features including:

- Categorizing books by reading status

- Displaying book count statistics

- Providing a "remove all books" button with a confirmation prompt to prevent accidental actions

7. "Finishing up" reading progress indicator.

6. Optimized book cover generation.
8. Optimized book cover generation.

7. Smoother UI language switching.
9. Smoother UI language switching.

8. Updated default font to "Kinghwa Old Song" to avoid potential copyright issues.
10. Updated default font to "Kinghwa Old Song" to avoid potential copyright issues.

9. Resolved various minor bugs, enhancing stability and user experience.
11. Resolved various minor bugs, enhancing stability and user experience.

**NOTE: Starting from v1.6, the No-UI version has been discontinued. All features previously available in the No-UI version, including support for opening local `.txt` files via `file://*.txt` URLs, are now fully integrated into the Regular version.**

Expand Down
49 changes: 38 additions & 11 deletions css/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,72 +8,99 @@ The `css/` directory contains all stylesheets for the application. It is organiz

### 1. **Top-Level Files**

These styles define the core appearance and functionality of the application.
These styles define the core appearance and functionality of the application.

- **`ui.css`**

- General UI layout and structural styles.

- Handles global styling such as positioning, spacing, and typography.

- **`variables.css`**

- Contains CSS variables for colors, fonts, and other shared values.

- Serves as the central place to manage design tokens.

- **`buttons.css`**

- Styles specifically for buttons used throughout the application.

- Ensures consistent appearance and behavior.

- **`footnotes.css`**

- Styles related to the footnotes feature.

- Handles formatting and interaction for footnote elements.

- **`reader.css`**

- Styles specific to the reader interface.

- Includes text formatting, layout adjustments, and responsive behavior.

---

### 2. **`yaireo/` Directory**
### 2. **`lib/` Directory**

This directory contains third-party stylesheets used for specific UI components and features.

This directory contains third-party stylesheets used for specific UI components and features.
#### `yaireo/` Subdirectory

- **`color-picker.css`**

- Styles for the color picker widget.

- Part of the `yaireo` library integration.

- **`my-color.css`**

- Custom styles or overrides for the color picker.

- **`my-range.css`**

- Custom styles or overrides for range sliders.

- **`ui-range.css`**

- Styles for range sliders provided by the `yaireo` library.

#### Other External Libraries

- **`sweetalert2.css`**

- Styles for SweetAlert2 dialogs and notifications.

- Provides modern, customizable alert boxes.

- [Documentation](https://sweetalert2.github.io/#usage)

---

## Best Practices

1. **Consistency**:

- Keep global styles in `ui.css` and `variables.css`.
- Keep global styles in `ui.css` and `variables.css`.

- Place feature-specific styles (e.g., `reader.css`, `footnotes.css`) in dedicated files.
- Place feature-specific styles (e.g., `reader.css`, `footnotes.css`) in dedicated files.

2. **Modularity**:

- Avoid mixing unrelated styles within a single file.
- Avoid mixing unrelated styles within a single file.

- Use separate files for components, features, and third-party overrides.
- Use separate files for components, features, and third-party overrides.

3. **Third-Party Styles**:

- Maintain all third-party styles in the `yaireo/` directory to isolate them from custom code.
- Maintain all third-party styles in the `lib/` directory to isolate them from custom code.

- Avoid modifying third-party files directly; use separate overrides if necessary.
- Avoid modifying third-party files directly; use separate overrides if necessary.

4. **Scalability**:

- When adding new features, create dedicated CSS files to keep styles organized.
- When adding new features, create dedicated CSS files to keep styles organized.

---

Expand All @@ -83,4 +110,4 @@ The `css/` directory contains all stylesheets for the application. It is organiz

- Use `variables.css` to update themes or make global design changes efficiently.

- Refer to the `yaireo/` directory for styling specific to integrated third-party libraries.
- Refer to the `lib/` directory for styling specific to integrated third-party libraries.
13 changes: 12 additions & 1 deletion css/buttons.css
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ svg.icon {
#toggle:hover ~ #toggle-btn label,
.btn-icon:hover:not(:focus) {
/* light mode */
background: rgba(125, 125, 125, 0.1);
background: var(--btnHoverColor);
}

.btn-group {
Expand All @@ -108,3 +108,14 @@ svg.icon {
left: calc(var(--ui_btnGap) + var(--ui_scrollBarWidth) + var(--ui_btnOffset));
z-index: 1005;
}

svg .tofill {
stroke-dasharray: var(--ui_svgPathLength);
stroke-dashoffset: var(--ui_svgPathLength);
animation: stroke 2s forwards;
}
@keyframes stroke {
to {
stroke-dashoffset: 0;
}
}
Loading

0 comments on commit 4b2c6c0

Please sign in to comment.