Commit 846641e6 authored by Liang Ding's avatar Liang Ding

Merge remote-tracking branch 'origin/dev' into dev

parents 4626a92b 0f99591e
This diff is collapsed.
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* *
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a> * @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.5.0.0, Apr 12, 2020 * @version 1.5.1.0, Apr 13, 2020
*/ */
admin.editors = {} admin.editors = {}
...@@ -83,8 +83,10 @@ $.extend(SoloEditor.prototype, { ...@@ -83,8 +83,10 @@ $.extend(SoloEditor.prototype, {
url: Label.uploadURL, url: Label.uploadURL,
token: Label.uploadToken, token: Label.uploadToken,
filename: function (name) { filename: function (name) {
return name.replace(/[^(a-zA-Z0-9\u4e00-\u9fa5\.)]/g, '').replace(/[\?\\/:|<>\*\[\]\(\)\$%\{\}@~]/g, '').replace('/\\s/g', '') return name.replace(/[^(a-zA-Z0-9\u4e00-\u9fa5\.)]/g, '').
} replace(/[\?\\/:|<>\*\[\]\(\)\$%\{\}@~]/g, '').
replace('/\\s/g', '')
},
}, },
height: this.conf.height, height: this.conf.height,
counter: { counter: {
...@@ -100,35 +102,36 @@ $.extend(SoloEditor.prototype, { ...@@ -100,35 +102,36 @@ $.extend(SoloEditor.prototype, {
emoji: Label.emoji, emoji: Label.emoji,
}, },
toolbarConfig: { toolbarConfig: {
pin: true pin: true,
} },
after: () => {
if (typeof this.conf.fun === 'function') {
this.conf.fun()
}
},
} }
if ($(window).width() < 768) { if ($(window).width() < 768) {
options.toolbar = [ options.toolbar = [
"emoji", 'emoji',
"bold", 'bold',
"link", 'link',
"list", 'list',
"edit-mode", 'edit-mode',
"preview", 'preview',
"fullscreen", 'fullscreen',
] ]
options.resize.enable = false options.resize.enable = false
options.toolbarConfig.pin = true; options.toolbarConfig.pin = true
} }
if (typeof Vditor === 'undefined') { if (typeof Vditor === 'undefined') {
Util.loadVditor(() => { Util.loadVditor(() => {
this.editor = new Vditor(this.conf.id, options) this.editor = new Vditor(this.conf.id, options)
}); })
} else { } else {
this.editor = new Vditor(this.conf.id, options) this.editor = new Vditor(this.conf.id, options)
} }
if (typeof this.conf.fun === 'function') {
this.conf.fun()
}
}, },
/* /*
* @description 获取编辑器值 * @description 获取编辑器值
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment