Commit 5c2c5a6d authored by Van's avatar Van

🎨 #12698

parent bc9e2e61
This diff is collapsed.
......@@ -36,6 +36,6 @@
"gulp-uglify": "^3.0.1"
},
"dependencies": {
"vditor": "^0.4.0"
"vditor": "^1.1.7"
}
}
......@@ -27,7 +27,7 @@
<img width="128" src="${staticServePath}/images/logo.png" alt="Solo" title="Solo" />
</a>
</div>
<div class="fn__left content-reset about__panel" style="margin-left: 20px;">
<div class="fn__left vditor-reset about__panel" style="margin-left: 20px;">
<div id="aboutLatest" class="about-margin fn__left">
${checkingVersionLabel}
</div>
......
......@@ -167,7 +167,7 @@
</div>
</div>
<script src="${staticServePath}/js/lib/compress/admin-lib.min.js"></script>
<script src="${staticServePath}/js/lib/vditor-0.4.0/index.min.js"></script>
<script src="${staticServePath}/js/lib/vditor-1.1.7/index.min.js"></script>
<script src="${staticServePath}/js/common${miniPostfix}.js"></script>
<#if "" == miniPostfix>
<script src="${staticServePath}/js/admin/admin.js"></script>
......
......@@ -58,7 +58,7 @@
(function () {
page.load();
// emotions
page.replaceCommentsEm("#comments .content-reset");
page.replaceCommentsEm("#comments .vditor-reset");
<#nested>
})();
</script>
......
This diff is collapsed.
......@@ -84,7 +84,7 @@ admin.commentList = {
commentsData[i] = {};
commentsData[i].content = '<div class="content-reset">' + Util.replaceEmString(comments[i].commentContent) +
commentsData[i].content = '<div class="vditor-reset">' + Util.replaceEmString(comments[i].commentContent) +
"</div><span class='table-tag'> on &nbsp;&nbsp;</span><a href='" + latkeConfig.servePath + comments[i].commentSharpURL +
"' target='_blank'>" + comments[i].commentTitle +
"</a>";
......
......@@ -51,17 +51,6 @@ $.extend(SoloEditor.prototype, {
delay: 500,
show: this.conf.previewShow,
url: latkeConfig.servePath + '/console/markdown/2html',
parse: function (element) {
if (element.style.display === 'none') {
return
}
Util.parseMarkdown('content-reset')
if (!Label.markedAvailable) {
hljs.initHighlighting.called = false
hljs.initHighlighting()
}
},
},
upload: {
max: 10 * 1024 * 1024,
......@@ -77,9 +66,6 @@ $.extend(SoloEditor.prototype, {
enable: this.conf.resize,
},
lang: Label.localeString,
classes: {
preview: 'content-reset',
},
})
if (typeof this.conf.fun === 'function') {
......
......@@ -97,92 +97,16 @@ var Util = {
* 图片预览
*/
previewImg:function () {
$('body').on('click', '.content-reset img', function () {
$('body').on('click', '.vditor-reset img', function () {
window.open(this.src);
});
},
/**
* 按需加载 MathJax 及 flow
* 按需加载 MathJax 及图标
* @returns {undefined}
*/
parseMarkdown: function () {
var hasMathJax = false
var hasFlow = false
var className = 'content-reset'
$('.' + className).each(function () {
$(this).find('p').each(function () {
if ($(this).text().split('$').length > 2 ||
($(this).text().split('\\(').length > 1 &&
$(this).text().split('\\)').length > 1)) {
hasMathJax = true
}
})
if ($(this).find('code.lang-flow, code.language-flow').length > 0) {
hasFlow = true
}
})
if (hasMathJax) {
var initMathJax = function () {
MathJax.Hub.Config({
tex2jax: {
inlineMath: [['$', '$'], ['\\(', '\\)']],
displayMath: [['$$', '$$']],
processEscapes: true,
processEnvironments: true,
skipTags: ['pre', 'code', 'script'],
},
asciimath2jax: {
delimiters: [['$', '$']],
},
})
MathJax.Hub.Typeset()
}
if (typeof MathJax !== 'undefined') {
initMathJax()
} else {
$.ajax({
method: 'GET',
url: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML',
dataType: 'script',
cache: true,
}).done(function () {
initMathJax()
})
}
}
if (hasFlow) {
var initFlow = function () {
$('.' + className + ' code.lang-flow, .' + className +
' code.language-flow').each(function (index) {
var $it = $(this)
var id = 'symFlow' + (new Date()).getTime() + index
$it.hide()
var diagram = flowchart.parse($.trim($it.text()))
$it.parent().
after('<div style="text-align: center" id="' + id + '"></div>')
diagram.drawSVG(id)
$it.parent().remove()
$('#' + id).find('svg').height('auto').width('auto')
})
}
if (typeof (flowchart) !== 'undefined') {
initFlow()
} else {
$.ajax({
method: 'GET',
url: latkeConfig.staticServePath +
'/js/lib/flowchart/flowchart.min.js',
dataType: 'script',
cache: true,
}).done(function () {
initFlow()
})
}
}
// TODO
},
/**
* @description IE6/7,跳转到 kill-browser 页面
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -45,7 +45,7 @@ $.extend(Page.prototype, {
*/
parseLanguage: function (obj) {
var isHljs = false
$('.content-reset pre').
$('.vditor-reset pre').
each(function () {
isHljs = true
})
......@@ -105,7 +105,7 @@ $.extend(Page.prototype, {
if (typeof Vditor === 'undefined') {
$.ajax({
method: 'GET',
url: latkeConfig.staticServePath + '/js/lib/vditor-0.4.0/index.min.js',
url: latkeConfig.staticServePath + '/js/lib/vditor-1.1.7/index.min.js',
dataType: 'script',
cache: true,
async: false,
......@@ -127,16 +127,6 @@ $.extend(Page.prototype, {
delay: 500,
show: false,
url: latkeConfig.servePath + '/console/markdown/2html',
parse: function (element) {
if (element.style.display === 'none') {
return
}
Util.parseMarkdown('content-reset')
if (!Label.markedAvailable) {
hljs.initHighlighting.called = false
hljs.initHighlighting()
}
},
},
counter: 500,
resize: {
......
This diff is collapsed.
/*
* Symphony - A modern community (forum/BBS/SNS/blog) platform written in Java.
* Copyright (C) 2012-2018, b3log.org & hacpai.com
*
* 本文件属于 Sym 商业版的一部分,请仔细阅读项目根文件夹的 LICENSE 并严格遵守相关约定
*/
/**
* Article reset style
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</ta>
* @version 0.2.1.2, Mar 3, 2019
*/
.content-reset {
word-wrap: break-word;
overflow: auto;
line-height: 1.65;
font-size: 16px;
word-break: break-word;
ul,
ol {
padding-left: 2em;
margin-top: 0;
margin-bottom: 16px;
}
li {
margin-top: 0.25em;
}
audio {
max-width: 100%;
}
video {
max-height: 90vh;
}
img {
cursor: zoom-in;
}
img.emoji {
cursor: auto;
max-width: 18px;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin-top: 24px;
margin-bottom: 16px;
font-weight: 600;
line-height: 1.25;
}
h1 {
padding-bottom: 0.3em;
font-size: 1.7em;
border-bottom: 1px solid #eee;
}
h2 {
padding-bottom: 0.3em;
font-size: 1.5em;
border-bottom: 1px solid #eee;
}
h3 {
font-size: 1.25em;
}
h4 {
font-size: 1em
}
h5 {
font-size: 0.875em;
}
h6 {
font-size: 0.85em;
}
hr {
height: 1px;
padding: 0;
margin: 24px 0;
background-color: #e7e7e7;
border: 0;
}
p {
margin-top: 0;
margin-bottom: 16px;
}
blockquote {
padding: 0 1em;
color: #777;
border-left: 0.25em solid #ddd;
margin-bottom: 16px;
}
blockquote p {
margin: 0;
}
ins > iframe {
border: 0;
}
iframe {
border: 1px solid rgba(0, 0, 0, .38);
}
table {
width: 100%;
border: 1px solid #dedede;
margin: 15px auto;
border-collapse: collapse;
empty-cells: show;
}
thead {
text-align: center;
}
td,
th {
height: 35px;
border: 1px solid #dedede;
padding: 0 10px;
}
th {
font-weight: bold;
text-align: center !important;
background: rgba(158, 188, 226, 0.2);
}
tbody tr:nth-child(2n) {
background: rgba(158, 188, 226, 0.12);
}
tr:hover {
background: #efefef;
}
code {
padding: .2em .4em;
margin: 0;
font-size: 85%;
background-color: rgba(27, 31, 35, .05);
border-radius: 3px;
font-family: mononoki, Consolas, Liberation Mono, Menlo, Courier, monospace;
word-break: break-word;
}
pre {
position: relative;
textarea {
position: absolute;
top: -100000px;
}
}
pre > code {
padding: 0.5em;
background-color: rgba(0, 0, 0, 0.04);
background-size: 20px 20px;
border-radius: 5px;
display: block;
}
kbd {
display: inline-block;
padding: 3px 5px;
font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
line-height: 10px;
color: #555;
vertical-align: middle;
background-color: #fcfcfc;
border: solid 1px rgba(0, 0, 0, .38);
border-bottom-color: #bbb;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #bbb;
}
&__task,
.task-list-item {
list-style: none;
margin-left: -1em;
}
}
.img-preview {
width: 100%;
height: 100%;
top: 0;
z-index: 211;
overflow: auto;
cursor: zoom-out;
transition: background-color .2s ease-in-out;
img {
max-width: inherit;
transition: transform .3s ease-in-out;
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -20,10 +20,9 @@
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 3.1.0.0, Feb 28, 2019
* @version 3.1.0.1, Mar 16, 2019
*/
@import "reset";
@import "reset-content";
@import "tooltipped";
@import "function";
@import "vditor/src/assets/scss/classic";
......@@ -619,11 +618,11 @@ button#submitArticle:hover {
margin: 20px 0;
}
.content-reset .about-list li {
.vditor-reset .about-list li {
border: 0;
}
.content-reset .about-list li:hover {
.vditor-reset .about-list li:hover {
background-color: #fff;
text-decoration: underline;
}
......
This diff is collapsed.
......@@ -19,11 +19,11 @@
* base style
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @version 2.0.0.0, Feb 21, 2019
* @version 2.0.0.1, Mar 16, 2019
*/
@import "../scss/reset";
@import "../scss/reset-content";
@import "vditor/src/assets/scss/classic";
textarea {
overflow: hidden;
......
This diff is collapsed.
......@@ -20,11 +20,11 @@
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 2.0.0.2, Mar 16, 2019
* @version 2.0.0.3, Mar 16, 2019
*/
@import "reset";
@import "reset-content";
@import "vditor/src/assets/scss/classic";
/* reset */
button {
......@@ -157,7 +157,7 @@ input[type=text]:focus {
float: right;
margin: -280px 0 0 0;
}
.content-reset {
.vditor-reset {
margin: 10px;
}
}
......
......@@ -67,7 +67,7 @@
${article.articleViewCount} ${viewLabel}
</div>
</header>
<div class="content-reset">
<div class="vditor-reset">
${article.articleAbstract}
</div>
<footer>
......
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