Merge branch 'release/2.0.0-beta8.4'

This commit is contained in:
purocean
2019-08-28 11:51:52 +08:00
4 changed files with 48 additions and 31 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
# Yank Note Markdown 编辑器
> 一款面向程序员的 Markdown 编辑器 <a target="_blank" href="https://shang.qq.com/wpa/qunwpa?idkey=a9420c90783ac22699ff8ce1868c5a9bbc185b437f66abfe3e7d9d918b04f295"><img border="0" src="https://pub.idqqimg.com/wpa/images/group.png" alt="Yank Note 交流群" title="Yank Note 交流群"></a>
> 一款面向程序员的 Markdown 编辑器 <a target="_blank" href="https://shang.qq.com/wpa/qunwpa?idkey=a9420c90783ac22699ff8ce1868c5a9bbc185b437f66abfe3e7d9d918b04f295"><img border="0" src="https://pub.idqqimg.com/wpa/images/group.png" style="display: inline-block" alt="Yank Note 交流群" title="Yank Note 交流群"></a>
[toc]{level: [2]}
@@ -147,7 +147,7 @@ yarn run start
## 更新日志
[最新发布](https://github.com/purocean/yn/releases)
### [v2.0.0-beta8.3](https://github.com/purocean/yn/releases/tag/v2.0.0-beta8.3) 2019-08-28
### [v2.0.0-beta8.4](https://github.com/purocean/yn/releases/tag/v2.0.0-beta8.4) 2019-08-28
1. 增加 2.0 计划
1. Electron 打包
1. 增加 HTML 小工具渲染
+39 -22
View File
@@ -33,7 +33,7 @@
</div>
</div>
<div :class="{'scroll-to-top': true, 'hide': scrollTop < 30}" :style="{top: (height - 40) + 'px'}" @click="scrollToTop">TOP</div>
<article ref="view" class="markdown-body" @click="handleClick"></article>
<article ref="view" class="markdown-body" @click.capture="handleClick"></article>
</div>
</template>
@@ -180,7 +180,7 @@ export default {
if (this.fileRepo === '__help__') {
return md.replace(/\[([^\]]*)\]\((\.\/[^)]*)\)/g, `[$1](api/help/file?path=$2)`)
.replace(/<img([^>]*)src=["']?([^\s'"]*)["']?/ig, `<img$1src="api/help/file?path=$2"`)
.replace(/<img([^>]*)src=["']?(\.\/[^\s'"]*)["']?/ig, `<img$1src="api/help/file?path=$2"`)
}
if (!this.filePath) {
@@ -267,36 +267,53 @@ export default {
}
},
handleClick (e) {
if (e.target.tagName === 'A' && e.target.classList.contains('open')) {
fetch(e.target.href.replace('api/attachment', 'api/open'))
e.preventDefault()
return
}
const target = e.target
console.log(env.isElectron, target.tagName, target.getAttribute('href'), /^(http:|https:|ftp:)\/\//i.test(target.getAttribute('href') || ''))
if (env.isElectron && e.target.tagName === 'A' && /^(http:|https:|ftp:)\/\//i.test(e.target.getAttribute('href') || '')) {
env.require && env.require('opn')(e.target.href)
e.preventDefault()
return
}
if (e.target.tagName === 'IMG') {
const img = e.target
if (e.ctrlKey && e.shiftKey) { // 转换外链图片到本地
this.transformImgOutLink(img)
const handleLink = link => {
if (link.tagName === 'A' && link.classList.contains('open')) {
fetch(link.href.replace('api/attachment', 'api/open'))
e.preventDefault()
e.stopPropagation()
return
}
env.openAlwaysOnTopWindow(img.src)
if (env.isElectron && link.tagName === 'A' && /^(http:|https:|ftp:)\/\//i.test(link.getAttribute('href') || '')) {
env.require && env.require('opn')(link.href)
e.preventDefault()
e.stopPropagation()
return
}
}
if (target.tagName === 'A') {
handleLink(target)
}
if (target.tagName === 'IMG') {
const img = target
if (e.ctrlKey && e.shiftKey) { // 转换外链图片到本地
this.transformImgOutLink(img)
} else if (img.parentElement.tagName === 'A') {
handleLink(img.parentElement)
} else {
env.openAlwaysOnTopWindow(img.src)
}
e.stopPropagation()
return
}
if (e.target.tagName === 'INPUT' && e.target.parentElement.classList.contains('source-line')) {
this.switchTodo(parseInt(e.target.parentElement.dataset['sourceLine']), e.target.checked)
if (target.tagName === 'INPUT' && target.parentElement.classList.contains('source-line')) {
this.switchTodo(parseInt(target.parentElement.dataset['sourceLine']), target.checked)
e.preventDefault()
e.stopPropagation()
return
}
if (e.target.classList.contains('source-line') && window.getSelection().toString().length < 1) {
this.syncScroll(parseInt(e.target.dataset['sourceLine']))
if (target.classList.contains('source-line') && window.getSelection().toString().length < 1) {
this.syncScroll(parseInt(target.dataset['sourceLine']))
e.stopPropagation()
e.preventDefault()
}
},
+6 -6
View File
@@ -3282,7 +3282,7 @@ follow-redirects@^1.0.0:
for-in@^1.0.2:
version "1.0.2"
resolved "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"
resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"
forever-agent@~0.6.1:
version "0.6.1"
@@ -4000,7 +4000,7 @@ is-extendable@^0.1.0, is-extendable@^0.1.1:
is-extendable@^1.0.1:
version "1.0.1"
resolved "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4"
resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4"
dependencies:
is-plain-object "^2.0.4"
@@ -4062,7 +4062,7 @@ is-plain-obj@^1.0.0:
is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4:
version "2.0.4"
resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677"
resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677"
dependencies:
isobject "^3.0.1"
@@ -4134,7 +4134,7 @@ isobject@^2.0.0:
isobject@^3.0.0, isobject@^3.0.1:
version "3.0.1"
resolved "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"
resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"
isstream@~0.1.2:
version "0.1.2"
@@ -4774,8 +4774,8 @@ mississippi@^3.0.0:
through2 "^2.0.0"
mixin-deep@^1.2.0:
version "1.3.1"
resolved "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe"
version "1.3.2"
resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566"
dependencies:
for-in "^1.0.2"
is-extendable "^1.0.1"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "yank.note.yang",
"version": "2.0.0-beta8.3",
"version": "2.0.0-beta8.4",
"description": "Yank-Note",
"main": "dist/app.js",
"license": "Apache-2.0",