Commit bbaa696b authored by Liang Ding's avatar Liang Ding

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

parents fb4f68d7 11b45721
...@@ -8690,9 +8690,9 @@ ...@@ -8690,9 +8690,9 @@
} }
}, },
"vditor": { "vditor": {
"version": "3.2.4", "version": "3.2.6",
"resolved": "https://registry.npmjs.org/vditor/-/vditor-3.2.4.tgz", "resolved": "https://registry.npmjs.org/vditor/-/vditor-3.2.6.tgz",
"integrity": "sha512-XH5nOJ+F4fjCLKSATO436JidiN+eEipV3irWaKDQnU3xPdaFVQij+81YOnOfya5n8vzwbFk+OwYTPq0FWkiWQA==", "integrity": "sha512-PJjPe+DzCj8ZCZL7TAtXRsyNWg1Jkbvfsh9ZhAL0Yef25Uh1vUE9RJkcTUtClUfwtpOpgrfIVO61cdFPS1fSHA==",
"requires": { "requires": {
"diff-match-patch": "^1.0.4" "diff-match-patch": "^1.0.4"
} }
......
...@@ -55,6 +55,6 @@ ...@@ -55,6 +55,6 @@
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"uvstat": "^1.0.7", "uvstat": "^1.0.7",
"vcmt": "^1.2.1", "vcmt": "^1.2.1",
"vditor": "^3.2.4" "vditor": "^3.2.6"
} }
} }
This diff is collapsed.
...@@ -416,6 +416,7 @@ admin.article = { ...@@ -416,6 +416,7 @@ admin.article = {
// editor // editor
admin.editors.articleEditor = new SoloEditor({ admin.editors.articleEditor = new SoloEditor({
outline: true,
id: 'articleContent', id: 'articleContent',
height: 500, height: 500,
fun: fun, fun: fun,
......
...@@ -57,6 +57,7 @@ $.extend(SoloEditor.prototype, { ...@@ -57,6 +57,7 @@ $.extend(SoloEditor.prototype, {
}) })
const options = { const options = {
outline: this.conf.outline || false,
mode: Label.editorMode, mode: Label.editorMode,
typewriterMode: this.conf.typewriterMode, typewriterMode: this.conf.typewriterMode,
cache: { cache: {
...@@ -105,6 +106,51 @@ $.extend(SoloEditor.prototype, { ...@@ -105,6 +106,51 @@ $.extend(SoloEditor.prototype, {
toolbarConfig: { toolbarConfig: {
pin: true, pin: true,
}, },
toolbar:[
"emoji",
"headings",
"bold",
"link",
"|",
"list",
"ordered-list",
"check",
"outdent",
"indent",
"|",
"quote",
"code",
"insert-before",
"insert-after",
"|",
"upload",
"record",
"table",
"|",
"undo",
"redo",
"|",
"fullscreen",
"edit-mode",
{
name: "more",
toolbar: [
"italic",
"strike",
"line",
"inline-code",
"both",
"code-theme",
"content-theme",
"export",
"outline",
"preview",
"format",
"devtools",
"info",
"help",
],
}],
after: () => { after: () => {
if (typeof this.conf.fun === 'function') { if (typeof this.conf.fun === 'function') {
this.conf.fun() this.conf.fun()
......
...@@ -108,6 +108,7 @@ admin.themeList = { ...@@ -108,6 +108,7 @@ admin.themeList = {
cache: false, cache: false,
data: JSON.stringify(requestJSONObject), data: JSON.stringify(requestJSONObject),
success: function (result, textStatus) { success: function (result, textStatus) {
sessionStorage.removeItem('skin')
$('#tipMsg').text(result.msg) $('#tipMsg').text(result.msg)
if (!result.sc) { if (!result.sc) {
$('#loadMsg').text('') $('#loadMsg').text('')
......
...@@ -23,7 +23,7 @@ window.Vcomment = Vcomment ...@@ -23,7 +23,7 @@ window.Vcomment = Vcomment
* *
* @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 2.2.1.0, Apr 30, 2020 * @version 2.3.1.0, May 15, 2020
*/ */
/** /**
...@@ -306,7 +306,7 @@ window.Util = { ...@@ -306,7 +306,7 @@ window.Util = {
loadVditor: function (cb) { loadVditor: function (cb) {
$.ajax({ $.ajax({
method: 'GET', method: 'GET',
url: 'https://cdn.jsdelivr.net/npm/vditor@3.2.4/dist/index.min.js', url: 'https://cdn.jsdelivr.net/npm/vditor@3.2.6/dist/index.min.js',
dataType: 'script', dataType: 'script',
cache: true, cache: true,
success: () => { success: () => {
...@@ -317,9 +317,35 @@ window.Util = { ...@@ -317,9 +317,35 @@ window.Util = {
}, },
}) })
}, },
skinPreview: () => {
if (location.pathname === '/admin-index.do') {
return
}
const skinParam = location.search.split('skin=')
let skin = ''
let urlHasSkin = false
if (skinParam.length === 2) {
skin = skinParam[1].split('=')[0]
urlHasSkin = true
}
if (skin) {
sessionStorage.setItem('skin', skin)
} else {
skin = sessionStorage.getItem('skin')
}
if (!skin) {
return
}
if (!urlHasSkin) {
location.search = location.search
? location.search + '&skin=' + skin
: '?skin=' + skin
}
},
}; };
(() => { (() => {
Util.skinPreview()
if (typeof Vditor === 'undefined') { if (typeof Vditor === 'undefined') {
Util.loadVditor() Util.loadVditor()
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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