Commit 30c7e749 authored by Van's avatar Van
parent 5200834c
This diff is collapsed.
......@@ -36,6 +36,6 @@
"gulp-uglify": "^3.0.2"
},
"dependencies": {
"vditor": "^1.7.25"
"vditor": "^1.8.5"
}
}
......@@ -165,7 +165,7 @@
</div>
</div>
<script src="${staticServePath}/js/lib/compress/admin-lib.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vditor@1.7.25/dist/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vditor@1.8.5/dist/index.min.js"></script>
<script src="${staticServePath}/js/common${miniPostfix}.js"></script>
<#if "" == miniPostfix>
<script src="${staticServePath}/js/admin/admin.js"></script>
......
This diff is collapsed.
......@@ -44,9 +44,6 @@ $.extend(SoloEditor.prototype, {
this.editor = new Vditor(this.conf.id, {
cache: true,
tab: '\t',
hint: {
emojiPath: Label.staticServePath + '/images/emoji'
},
preview: {
delay: 500,
mode: this.conf.previewMode,
......
......@@ -20,7 +20,7 @@
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.8.1.0, Aug 27, 2019
* @version 1.9.1.0, Sep 9, 2019
*/
/**
......@@ -150,31 +150,10 @@ var Util = {
if ($('.vditor-reset pre > code').length === 0) {
return
}
Util.addStyle('https://cdn.jsdelivr.net/npm/vditor/dist/js/highlight.js/styles/' +
Label.hljsStyle + '.css', 'vditorHljsStyle')
var initHljs = function () {
hljs.initHighlighting.called = false
hljs.initHighlighting()
}
if (!Label.markedAvailable) {
if (typeof hljs === 'undefined') {
$.ajax({
url: 'https://cdn.jsdelivr.net/npm/vditor/dist/js/highlight.js/highlight.pack.js',
dataType: 'script',
cache: true,
success: function () {
initHljs()
},
})
} else {
initHljs()
}
}
Vditor.highlightRender(Label.hljsStyle, !Label.markedAvailable, document)
},
/**
* 按需加载数学公式、代码复制、图标
* 按需加载数学公式、流程图、代码复制、五线谱、多媒体、图表
* @returns {undefined}
*/
parseMarkdown: function () {
......@@ -185,14 +164,15 @@ var Util = {
return
}
Util.addScript('https://cdn.jsdelivr.net/npm/vditor@1.7.25/dist/index.min.js',
'vditorScript')
Util.addScript('https://cdn.jsdelivr.net/npm/vditor@1.8.5/dist/method.min.js',
'vditorPreviewScript')
Vditor.mermaidRender(document.body)
Vditor.chartRender()
Vditor.abcRender()
Vditor.mathRender(document.body, Label.langLabel)
Vditor.codeRender(document.body, Label.langLabel)
Vditor.mathRender(document.body, Label.langLabel)
Vditor.abcRender()
Vditor.chartRender()
Vditor.mediaRender(document.body)
Vditor.mermaidRender(document.body)
},
/**
* @description IE6/7,跳转到 kill-browser 页面
......
This diff is collapsed.
......@@ -103,7 +103,7 @@ $.extend(Page.prototype, {
if (!$('#soloEditorComment').hasClass('vditor')) {
var that = this
Util.addScript(
'https://cdn.jsdelivr.net/npm/vditor@1.7.25/dist/index.min.js',
'https://cdn.jsdelivr.net/npm/vditor@1.8.5/dist/index.min.js',
'vditorScript')
var toolbar = [
'emoji',
......@@ -130,6 +130,7 @@ $.extend(Page.prototype, {
'|',
'both',
'preview',
'format',
'fullscreen',
'info',
'help',
......@@ -144,6 +145,7 @@ $.extend(Page.prototype, {
'check',
'link',
'preview',
'format',
'info',
'help',
]
......@@ -154,9 +156,6 @@ $.extend(Page.prototype, {
placeholder: that.tips.commentContentCannotEmptyLabel,
height: 180,
tab: '\t',
hint: {
emojiPath: Label.staticServePath + '/images/emoji',
},
esc: function () {
$('#soloEditorCancel').click()
},
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Subproject commit ab7b7a940c049a23441bfc192bd87f00f3d7b142
Subproject commit 5c864e88197b2ed78770ea9bb1983ccd33e09c9b
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