Skip to content

Commit

Permalink
Merge pull request #122 from TankNee/rebuild/fix
Browse files Browse the repository at this point in the history
2.1.4 Add translation and fix bugs
  • Loading branch information
TankNee authored Jul 9, 2021
2 parents 5abbbd3 + aa75ca8 commit d15c276
Show file tree
Hide file tree
Showing 46 changed files with 507 additions and 155 deletions.
Binary file removed README
Binary file not shown.
65 changes: 30 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<img title="" src="https://img.tanknee.cn/blogpicbed/2021/07/08/20210708fc3b67e797e90.png" alt="AppIcon" align="center" width="185">
<div align="center">
<img title="" src="https://img.tanknee.cn/blogpicbed/2021/07/08/20210708fc3b67e797e90.png" alt="AppIcon" align="center" width="185">
<h1>Memocast</h1>

# Memocast
![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/TankNee/Neeto-Vue/Neeto-Vue%20Release%20Action/master?label=REALSE%20ACTION&style=for-the-badge) ![GitHub Releases](https://img.shields.io/github/downloads/TankNee/Neeto-Vue/latest/total?style=for-the-badge) ![GitHub All Releases](https://img.shields.io/github/downloads/TankNee/Neeto-Vue/total?style=for-the-badge) ![GitHub Release Date](https://img.shields.io/github/release-date/TankNee/Neeto-Vue?style=for-the-badge) ![GitHub repo size](https://img.shields.io/github/repo-size/TankNee/Neeto-Vue?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/TankNee/Neeto-Vue?style=for-the-badge)

![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/TankNee/Neeto-Vue/Neeto-Vue%20Release%20Action/master?label=REALSE%20ACTION\&style=for-the-badge) ![GitHub Releases](https://img.shields.io/github/downloads/TankNee/Neeto-Vue/latest/total?style=for-the-badge) ![GitHub All Releases](https://img.shields.io/github/downloads/TankNee/Neeto-Vue/total?style=for-the-badge) ![GitHub Release Date](https://img.shields.io/github/release-date/TankNee/Neeto-Vue?style=for-the-badge) ![GitHub repo size](https://img.shields.io/github/repo-size/TankNee/Neeto-Vue?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/TankNee/Neeto-Vue?style=for-the-badge)

***
</div>

## Introduction

Expand All @@ -20,61 +20,60 @@ GitHub Release:[Releases · TankNee/Memocast · GitHub](https://github.com/Tan

1. 较为完整的为知服务的支持。

1. 笔记增删查改
1. 笔记增删查改

2. 文件夹增删
2. 文件夹增删

3. 笔记导出成 PNG、Markdown
3. 笔记导出成 PNG、Markdown

4. 笔记文件夹批量导出 Markdown
4. 笔记文件夹批量导出 Markdown

5. 支持为知图片服务
5. 支持为知图片服务

6. 笔记标签增删查改
6. 笔记标签增删查改

7. 私有化部署服务器的支持
7. 私有化部署服务器的支持

2. 良好的 Markdown 编辑器体验

1. 按下 @ 快捷输入
1. 按下 @ 快捷输入

2. 完整的快捷键支持,并在 macOS 下支持菜单和帮助查询。
2. 完整的快捷键支持,并在 macOS 下支持菜单和帮助查询。

3. 将为知的网页剪辑笔记轻松转换为可阅读的 Markdown 文件
3. 将为知的网页剪辑笔记轻松转换为可阅读的 Markdown 文件

4. 良好的图片支持,支持为知图片,支持 PicGo 上传图片,支持本地图片
4. 良好的图片支持,支持为知图片,支持 PicGo 上传图片,支持本地图片

5. 相比 marktext ,编辑器做了很多的优化和本地化
5. 相比 marktext ,编辑器做了很多的优化和本地化

6. 支持笔记目录,支持目录跳转
6. 支持笔记目录,支持目录跳转

7. 支持流程图,vega 图,mermaid 图等等
7. 支持流程图,vega 图,mermaid 图等等

8. 笔记锁定模式,锁定之后键盘无法输入,减少误触
8. 笔记锁定模式,锁定之后键盘无法输入,减少误触

9. 所见即所得,良好输入体验
9. 所见即所得,良好输入体验

10. 支持 PicGo 图片服务,将笔记图片上传到指定图床
10. 支持 PicGo 图片服务,将笔记图片上传到指定图床

11. 支持使用 pangu 格式化 markdown 文本,自动在中英文字符之间加入空格
11. 支持使用 pangu 格式化 markdown 文本,自动在中英文字符之间加入空格

```text
你好Memocast => 你好 Memocast
```
```text
你好Memocast => 你好 Memocast
```
3. 强大的源代码模式
1. 使用 Monaco 作为源代码编辑器
1. 使用 Monaco 作为源代码编辑器
2. 使用 `CmdOrCtrl + Shift + .` 快捷切换源代码模式和 markdown 模式
2. 使用 `CmdOrCtrl + Shift + .` 快捷切换源代码模式和 markdown 模式
3. 语法高亮
3. 语法高亮
4. 侧边栏预览
4. 侧边栏预览
4. 完整开源, 项目 All in Github, 在网络畅通的情况下可以使用内置的自动更新,快速将软件更新到最新版。
***
## Screenshot
Expand All @@ -96,22 +95,18 @@ GitHub Release:[Releases · TankNee/Memocast · GitHub](https://github.com/Tan
更多特色功能还请下载之后体验
***
## Reference
感谢 Quasar Framework、Monaco 以及 MarkText 项目,从他们身上学到了很多,Memocast 有很多的灵感都来自他们,笔记的所见即所得编辑器来自 MarkText 中的 Muya 编辑器,源代码模式使用的编辑器来自 Monaca-Editor 项目。
---
## Sponsor
| <img title="" src="https://avatars.githubusercontent.com/u/15263378?v=4" alt="" width="189" data-align="center"> |
|:----------------------------------------------------------------------------------------------------------------:|
| https://github.com/lifeend |
---
## Contributor
感谢所有Memocast和Neeto-Vue的贡献者!
Expand Down
49 changes: 39 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cn.memocast.app",
"version": "2.1.3",
"version": "2.1.4",
"description": "An Awesome WizNote Desktop Application",
"productName": "Memocast",
"author": "tanknee <nee@tanknee.cn>",
Expand All @@ -22,6 +22,7 @@
},
"dependencies": {
"@altairwei/wiz-markdown": "^1.0.13",
"@hfelix/electron-localshortcut": "^3.1.1",
"@quasar/extras": "^1.0.0",
"axios": "^0.21.1",
"cheerio": "^1.0.0-rc.3",
Expand Down
2 changes: 1 addition & 1 deletion share/channels.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export default {
exportMarkdownFile: 'export-markdown-file',
exportPng: 'export-png',
exportMarkdownFiles: 'export-markdown-files',
importImages: 'import-images',
importImage: 'import-image',
uploadImages: 'upload-images',
checkUpdate: 'check-update',
needUpdate: 'need-update',
Expand Down
17 changes: 9 additions & 8 deletions src-electron/main-process/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { checkUpdates, needUpdate, quitAndInstall } from './menu/actions/memocas
import { cacheNoteImage, saveTempImage, saveBuffer } from './utlis/helper'
import { uploadImagesByWiz } from './utlis/wiz-resource-helper'
import { execRequest } from './service/request'
import i18n from './i18n'

const { uploadImagesByPicGo } = require('./3rd-part/PicGoUtils')

Expand Down Expand Up @@ -51,7 +52,7 @@ export default {
*/
handleApi('export-markdown-file', (event, { content, title }) => {
return dialog.showSaveDialog({
title: 'Export',
title: i18n.t('export'),
defaultPath: path.join(app.getPath('documents'), `${title}`),
filters: [
{
Expand All @@ -67,7 +68,7 @@ export default {
type: 'positive',
icon: 'check',
filePath: result.filePath
}).catch(err => throw err)
}, event).catch(err => throw err)
})
.catch(err => {
sendNotification({
Expand All @@ -80,7 +81,7 @@ export default {
}).catch(err => throw err)
handleApi('export-png', (event, { content, title }) => {
return dialog.showSaveDialog({
title: 'Export',
title: i18n.t('export'),
defaultPath: path.join(app.getPath('documents'), `${title}`),
filters: [
{
Expand Down Expand Up @@ -115,7 +116,7 @@ export default {
*/
handleApi('export-markdown-files', (event, { contents, category }) => {
return dialog.showOpenDialog({
title: 'Export',
title: i18n.t('export'),
defaultPath: app.getPath('documents'),
properties: [
'openDirectory',
Expand Down Expand Up @@ -155,11 +156,11 @@ export default {
/**
* batch import images
*/
handleApi('import-images', async (event) => {
handleApi('import-image', async (event) => {
const result = await dialog.showOpenDialog({
title: 'Import Images',
title: i18n.t('importImage'),
defaultPath: app.getPath('pictures'),
properties: ['multiSelections', 'openFile']
properties: ['openFile']
})
if (result.canceled) return
return result.filePaths
Expand All @@ -172,7 +173,7 @@ export default {
const uploadResult = await uploadImagesByPicGo(imagePaths).catch(err => {
if (err.errno === 'ECONNREFUSED') {
sendNotification({
msg: 'PicGo Upload Server Not Found!',
msg: i18n.t('picgoServerNoteFound'),
type: 'negative',
icon: 'delete'
}, event).catch(err => throw err)
Expand Down
2 changes: 1 addition & 1 deletion src-electron/main-process/electron-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function createWindow () {
if (!process.env.PROD) {
mainWindow.webContents.openDevTools()
}
const menu = Menu.buildFromTemplate(configureMenu(new KeyBindings()))
const menu = Menu.buildFromTemplate(configureMenu(new KeyBindings(), mainWindow))
Menu.setApplicationMenu(menu)

mainWindow.isMainWindow = true
Expand Down
16 changes: 16 additions & 0 deletions src-electron/main-process/i18n/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import I18n from './lib'
import Store from 'electron-store'
import messages from './src'

const ClientFileStorage = new Store({
name: 'ClientFileStorage'
})
const locale = ClientFileStorage.get('language')
const i18n = new I18n({
locale: locale,
messages,
availableLocales: ['en-us', 'zh-cn']
})

export default i18n
// export { i18n }
23 changes: 23 additions & 0 deletions src-electron/main-process/i18n/lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export default class I18n {
constructor (options = {}) {
const {
locale,
availableLocales,
messages
} = options
this._locale = locale
this._availableLocales = availableLocales
this._messages = messages
}

/**
* translation
* @param {string} key
*/
t (key) {
if (this._messages[this._locale] && this._messages[this._locale][key]) {
return this._messages[this._locale][key]
}
return key
}
}
4 changes: 4 additions & 0 deletions src-electron/main-process/i18n/src/en-us/api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
importImage: 'Import Image',
picgoServerNoteFound: 'PicGo Server Not Found'
}
6 changes: 6 additions & 0 deletions src-electron/main-process/i18n/src/en-us/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import menu from './menu'
import api from './api'
export default {
...menu,
...api
}
Loading

0 comments on commit d15c276

Please sign in to comment.