Commit b4c2bcb2 authored by Liyuan Li's avatar Liyuan Li

vditor

parent b1fd2b65
......@@ -8676,17 +8676,17 @@
}
},
"vcmt": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/vcmt/-/vcmt-1.1.4.tgz",
"integrity": "sha512-SjNMjmkE/JwZxHNhl9AMmEPSbgHyzG1azx1qXUjpzRUp71X9/G4mMNNcvgTv75XoupTe6IjdQXy/JBjsC+/Kcw==",
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/vcmt/-/vcmt-1.1.5.tgz",
"integrity": "sha512-1+lCCu7kd7QjFRvzXUJISnc6yD3kVNGn1T+l9hpzDJmGe/+z/K1dpbjR7LWhg3YlDC2YrJi7Aad7VXtzGbxg3Q==",
"requires": {
"jquery": "^3.4.1"
}
},
"vditor": {
"version": "3.0.12",
"resolved": "https://registry.npmjs.org/vditor/-/vditor-3.0.12.tgz",
"integrity": "sha512-C/o5buMesljrbvqLg/dcwEv9VIrh+x19uxBEdipXXKzDXhrfAifoHeNbb76D0MEl33QSxqkFAcGjy4yFHZA4lw==",
"version": "3.1.5",
"resolved": "https://registry.npmjs.org/vditor/-/vditor-3.1.5.tgz",
"integrity": "sha512-Xzgo69TDTa7OyzMJFX38GpnGiNcibYPllZmFKNRV351o71+s+JGQs2BAQW2jBsbHz4FnEs+bm+90ybWs8NovLA==",
"requires": {
"diff-match-patch": "^1.0.4"
}
......
......@@ -54,7 +54,7 @@
"jquery": "^3.4.1",
"nprogress": "^0.2.0",
"uvstat": "^1.0.7",
"vcmt": "^1.1.4",
"vditor": "^3.0.12"
"vcmt": "^1.1.5",
"vditor": "^3.1.5"
}
}
This diff is collapsed.
......@@ -14,7 +14,7 @@
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.4.1.1, Feb 24, 2020
* @version 1.5.0.0, Apr 12, 2020
*/
admin.editors = {}
......@@ -87,7 +87,10 @@ $.extend(SoloEditor.prototype, {
}
},
height: this.conf.height,
counter: 102400,
counter: {
enable: true,
max: 102400,
},
resize: {
enable: this.conf.resize,
},
......@@ -96,23 +99,23 @@ $.extend(SoloEditor.prototype, {
emojiTail: `<a href="https://hacpai.com/settings/function" target="_blank">设置常用表情</a>`,
emoji: Label.emoji,
},
toolbarConfig: {
pin: true
}
}
if ($(window).width() < 768) {
options.toolbar = [
'emoji',
'bold',
'italic',
'link',
'list',
'check',
'upload',
'edit-mode',
'preview',
'fullscreen',
'help',
"emoji",
"bold",
"link",
"list",
"edit-mode",
"preview",
"fullscreen",
]
options.resize.enable = false
options.toolbarConfig.pin = true;
}
if (typeof Vditor === 'undefined') {
......
......@@ -301,7 +301,7 @@ window.Util = {
loadVditor: function (cb) {
$.ajax({
method: 'GET',
url: 'https://cdn.jsdelivr.net/npm/vditor@3.0.12/dist/index.min.js',
url: 'https://cdn.jsdelivr.net/npm/vditor@3.1.5/dist/index.min.js',
dataType: 'script',
cache: true,
success: () => {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -14,7 +14,7 @@
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 2.6.0.0, Jan 18, 2020
* @version 2.7.0.0, Apr 12, 2020
*/
window.Page = function (tips) {
this.currentCommentId = ''
......@@ -25,7 +25,7 @@ $.extend(Page.prototype, {
/**
* 第三方评论
*/
vcomment: function ( ) {
vcomment: function () {
const $vcomment = $('#vcomment')
if ($vcomment.length === 0) {
return
......@@ -88,7 +88,7 @@ $.extend(Page.prototype, {
'qriousScript')
}
if ($qrCode.css('background-image') === "none") {
if ($qrCode.css('background-image') === 'none') {
const qr = new QRious({
padding: 0,
element: $qrCode[0],
......@@ -143,6 +143,8 @@ $.extend(Page.prototype, {
'list',
'ordered-list',
'check',
'outdent',
'indent',
'|',
'quote',
'line',
......@@ -159,7 +161,6 @@ $.extend(Page.prototype, {
'format',
'|',
'fullscreen',
'devtools',
'info',
'help',
], resizeEnable = true
......@@ -167,14 +168,11 @@ $.extend(Page.prototype, {
toolbar = [
'emoji',
'bold',
'italic',
'link',
'list',
'check',
'edit-mode',
'preview',
'fullscreen',
'help',
]
resizeEnable = false
}
......@@ -204,7 +202,10 @@ $.extend(Page.prototype, {
Util.parseMarkdown()
},
},
counter: 500,
counter: {
enable: true,
max: 500,
},
resize: {
enable: resizeEnable,
position: 'top',
......@@ -213,7 +214,7 @@ $.extend(Page.prototype, {
toolbar: toolbar,
after: () => {
vditor.focus()
}
},
})
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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