Skip to content

Commit

Permalink
【文档】新增程序逻辑图
Browse files Browse the repository at this point in the history
  • Loading branch information
PJ-568 committed Dec 16, 2024
1 parent 37d9fd3 commit 98d31c1
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
## 代码或内容贡献

欢迎每一位对本项目感兴趣的朋友贡献代码和内容。
请参阅[程序逻辑](doc/logic.md)

较为简单的提交贡献方法可查阅[贡献文档](CONTRIBUTING.md)以了解相关信息。

Expand Down
1 change: 1 addition & 0 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ This project aims to provide a low-dependency, simple deployment solution for re
## Code or Content Contributions

We welcome contributions of code and content from anyone interested in this project.
Please checkout [程序逻辑](doc/logic.md).

For a simpler way to contribute, please refer to the [Contribution Guide](CONTRIBUTING.md) for relevant information.

Expand Down
40 changes: 40 additions & 0 deletions doc/logic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 程序逻辑

- 初始化
- 初始化深色模式 (`initDarkmode`)
- 初始化返回首页按钮 (`initHomeBtn`)
- 初始化内容 (`initContent`)
- 显示 Markdown (`showMarkdown`)
- 获取 Markdown 路径 (`getPValue`)
- 解码 Markdown 路径 (`decodeMDPath`)
- 格式化路径 (`formatMDPath`)
- 获取 Markdown 内容 (`getMarkdown`)
- 解析 Markdown (`marked.parse`)
- 处理内部链接
- 更新页面内容
- 自定义推送状态 (`customPushState`)
- 初始化页面翻译 (`initTranslate`)
- 初始化 PJAX (`initPJAX`)
- 初始化自定义 PJAX (`initCustomPJAX`)
- 覆写 PJAX 处理响应的函数
- 监听自定义链接的点击事件
- 事件监听
- 网页加载完毕 (`DOMContentLoaded`)
- PJAX 开始 (`pjax:send`)
- 开始加载动画 (`startLoad`)
- PJAX 完成 (`pjax:complete`)
- 初始化自定义 PJAX (`initCustomPJAX`)
- 点击事件委托
- 返回上一页 (`#back-btn`)
- 刷新页面 (`#refresh-btn`)
- 切换深色模式 (`#dark_b`)
- 切换语言 (`#translate-switch`)
- 文档内容加载完毕 (`showMarkdownEnded`)
- 刷新翻译 (`refreshTranslate`)
- 检查并提示翻译 (`infoTranslate`)
- 执行翻译 (`translate.execute`)
- 结束加载动画 (`endLoad`)
- 添加 `loaded`
- 平滑滚动到顶部
- 浏览器返回 (`onpopstate`)
- 更新层级 (`level`)

0 comments on commit 98d31c1

Please sign in to comment.