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