mirror of
https://github.com/purocean/yn.git
synced 2026-10-13 07:38:54 +08:00
Merge branch 'release/2.0.0-beta5.2'
This commit is contained in:
@@ -159,7 +159,7 @@ yarn run start
|
||||
## 更新日志
|
||||
[最新发布](https://github.com/purocean/yn/releases)
|
||||
|
||||
### [v2.0.0-beta5.1](https://github.com/purocean/yn/releases/tag/v2.0.0-beta5.1) 2019-08-14
|
||||
### [v2.0.0-beta5.2](https://github.com/purocean/yn/releases/tag/v2.0.0-beta5.2) 2019-08-14
|
||||
1. 增加 2.0 计划
|
||||
1. Electron 打包
|
||||
1. 增加 HTML 小工具渲染
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "yank.note.yang",
|
||||
"version": "2.0.0-beta5.1",
|
||||
"version": "2.0.0-beta5.2",
|
||||
"description": "Yank-Note",
|
||||
"main": "dist/app.js",
|
||||
"author": {
|
||||
|
||||
@@ -51,6 +51,30 @@ const createWindow = () => {
|
||||
win.on('closed', () => {
|
||||
win = null
|
||||
})
|
||||
|
||||
const selectionMenu = Menu.buildFromTemplate([
|
||||
{ role: 'copy', label: '复制' },
|
||||
])
|
||||
|
||||
const inputMenu = Menu.buildFromTemplate([
|
||||
{ role: 'copy', label: '复制' },
|
||||
{ role: 'paste', label: '粘贴' },
|
||||
{ role: 'cut', label: '剪切' },
|
||||
{ type: 'separator' },
|
||||
{ role: 'undo' , label: '撤销' },
|
||||
{ role: 'redo', label: '重做'},
|
||||
{ type: 'separator' },
|
||||
{ role: 'selectall', label: '全选' },
|
||||
])
|
||||
|
||||
win.webContents.on('context-menu', (e, props) => {
|
||||
const { selectionText, isEditable } = props
|
||||
if (isEditable) {
|
||||
inputMenu.popup({ window: win })
|
||||
} else if (selectionText && selectionText.trim() !== '') {
|
||||
selectionMenu.popup({ window: win })
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const showWindow = () => {
|
||||
|
||||
Reference in New Issue
Block a user