Commit b58eff0f authored by Van's avatar Van

💄 #47

parent 24219959
{
"name": "Solo",
"name": "solo",
"version": "3.8.0",
"lockfileVersion": 1,
"requires": true,
......@@ -8658,9 +8658,12 @@
}
},
"vcmt": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/vcmt/-/vcmt-1.0.6.tgz",
"integrity": "sha512-OKcnwcPHNJUenziaZzZ09jHB1R7F1E24rGFEDDpI95bVFjUtOTZ4M04GblOWZ4kysyZCVTOwpLRkE6mNB74UDA=="
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/vcmt/-/vcmt-1.0.9.tgz",
"integrity": "sha512-ikSsf2H9CeVga+3Y45j8oBeSqiV2ibyFiCrXMpsvkUDtj/baLU/KUhHfpvzGwaSjYnxKJVotwa4hxcDYBm1OXg==",
"requires": {
"jquery": "^3.4.1"
}
},
"vditor": {
"version": "2.1.1",
......
{
"name": "Solo",
"name": "solo",
"version": "3.8.0",
"description": " 一款小而美的博客系统,专为程序员设计。",
"homepage": "https://github.com/88250/solo",
......@@ -48,7 +48,7 @@
"jquery": "^3.4.1",
"nprogress": "^0.2.0",
"uvstat": "^1.0.6",
"vcmt": "^1.0.6",
"vcmt": "^1.0.9",
"vditor": "^2.1.1"
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -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.1.0.0, Mar 17, 2019
* @version 1.2.0.0, Jan 18, 2020
*/
admin.comment = {
......@@ -95,7 +95,6 @@ admin.comment = {
$('#' + fromId + 'Comments').html(commentsHTML)
Util.parseMarkdown()
Util.parseLanguage()
$('#loadMsg').text('')
},
})
......
......@@ -111,7 +111,6 @@ admin.commentList = {
result.pagination)
Util.parseMarkdown()
Util.parseLanguage()
$('#loadMsg').text('')
},
})
......
......@@ -19,9 +19,8 @@
* @fileoverview editor
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @version 1.3.0.1, Aug 6, 2019
* @version 1.4.0.0, Jan 18, 2020
*/
import Vditor from 'vditor'
admin.editors = {}
/*
......@@ -57,7 +56,7 @@ $.extend(SoloEditor.prototype, {
if (element.style.display === 'none') {
return
}
Util.parseLanguage()
Util.parseMarkdown()
},
},
upload: {
......
......@@ -16,18 +16,22 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import $ from 'jquery'
window.$ = $
import NProgress from 'nprogress'
import Uvstat from 'uvstat'
import pjax from './pjax'
import Vditor from 'vditor'
import Vcomment from 'vcmt'
window.$ = $
window.Vditor = Vditor
window.Vcomment = Vcomment
/**
* @fileoverview util and every page should be used.
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 2.0.1.0, Jan 12, 2020
* @version 2.1.0.0, Jan 18, 2020
*/
/**
......@@ -114,7 +118,6 @@ window.Util = {
},
callback: function () {
Util.parseMarkdown()
Util.parseLanguage()
Util.uvstat.addStat()
Util.uvstat.renderStat()
Util.uvstat.renderCmtStat()
......@@ -142,21 +145,6 @@ window.Util = {
window.open(this.src)
})
},
/**
* 异步添加 css
* @param url css 文件访问地址
* @param id css 文件标示
*/
addStyle: function (url, id) {
if (!document.getElementById(id)) {
var styleElement = document.createElement('link')
styleElement.id = id
styleElement.setAttribute('rel', 'stylesheet')
styleElement.setAttribute('type', 'text/css')
styleElement.setAttribute('href', url)
document.getElementsByTagName('head')[0].appendChild(styleElement)
}
},
/**
* 异步添加 js
* @param url js 文件访问地址
......@@ -176,40 +164,15 @@ window.Util = {
document.getElementsByTagName('head')[0].appendChild(scriptElement)
}
},
/*
* @description 解析语法高亮
*/
parseLanguage: function () {
Vditor.highlightRender({
style: Label.hljsStyle,
enable: !Label.luteAvailable,
}, document)
},
/**
* 按需加载数学公式、流程图、代码复制、五线谱、多媒体、图表
* @returns {undefined}
*/
parseMarkdown: function () {
if (typeof Vditor === 'undefined') {
Util.addScript(
'https://cdn.jsdelivr.net/npm/vditor@2.1.1/dist/method.min.js',
'vditorPreviewScript')
}
Vditor.codeRender(document.body, Label.langLabel)
if (Label.luteAvailable) {
Vditor.mathRenderByLute(document.body)
} else {
Vditor.mathRender(document.body)
}
Vditor.abcRender()
Vditor.chartRender()
Vditor.mediaRender(document.body)
Vditor.mermaidRender(document.body)
document.querySelectorAll('.vditor-reset').forEach((e) => {
Vditor.speechRender(e, Label.langLabel)
Vcomment.parseMarkdown({
lang: Label.langLabel,
hljsEnable: !Label.luteAvailable,
hljsStyle: Label.hljsStyle,
})
},
/**
......@@ -221,14 +184,16 @@ window.Util = {
var left = ($(window).width() - 781) / 2,
top1 = ($(window).height() - 680) / 2
var killIEHTML = '<div class="killIEIframe" style=\'display: block; height: 100%; width: 100%; position: fixed; background-color: rgb(0, 0, 0); opacity: 0.6;filter: alpha(opacity=60); top: 0px;z-index:110\'></div>'
+ '<iframe class="killIEIframe" style=\'left:' + left + 'px;z-index:120;top: ' + top1 +
+ '<iframe class="killIEIframe" style=\'left:' + left +
'px;z-index:120;top: ' + top1 +
'px; position: fixed; border: 0px none; width: 781px; height: 680px;\' src=\'' +
Label.servePath + '/kill-browser\'></iframe>'
$('body').append(killIEHTML)
} catch (e) {
var left = 10, top1 = 0
var killIEHTML = '<div class="killIEIframe" style=\'display: block; height: 100%; width: 100%; position: fixed; background-color: rgb(0, 0, 0); opacity: 0.6;filter: alpha(opacity=60); top: 0px;z-index:110\'></div>'
+ '<iframe class="killIEIframe" style=\'left:' + left + 'px;z-index:120;top: ' + top1 +
+ '<iframe class="killIEIframe" style=\'left:' + left +
'px;z-index:120;top: ' + top1 +
'px; position: fixed; border: 0px none; width: 781px; height: 680px;\' src=\'' +
Label.servePath + '/kill-browser\'></iframe>'
document.body.innerHTML = document.body.innerHTML + killIEHTML
......@@ -285,7 +250,6 @@ window.Util = {
init: function () {
Util.killIE()
Util.parseMarkdown()
Util.parseLanguage()
Util.initSW()
Util.previewImg()
Util.initDebugInfo()
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -14,7 +14,13 @@
* limitations under the License.
*/
import $ from 'jquery';
/**
* @fileoverview 工具类
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 0.1.0.0, Jan 18, 2020
*/
(function (a) {
var b = function () {}
......@@ -39,7 +45,7 @@ import $ from 'jquery';
},
})
a.bowknot = new b
})(jQuery);
})($);
(function ($) {
$.fn.extend({paginate: {version: '0.0.0.8', author: 'v@b3log.org'}})
......@@ -270,7 +276,7 @@ import $ from 'jquery';
}
$.paginate = new Paginate()
window['DP_jQuery_' + dpuuid] = $
})(jQuery);
})($);
(function ($) {
$.fn.extend({table: {version: '0.0.1.0', author: 'v@b3log.org'}})
var n = new Date().getTime()
......@@ -681,7 +687,7 @@ import $ from 'jquery';
}
$.table = new p()
window['DP_jQuery_' + n] = $
})(jQuery);
})($);
(function ($) {
$.fn.extend({dialog: {version: '0.0.1.7', author: 'v@b3log.org'}})
var dpuuid = new Date().getTime()
......@@ -935,7 +941,7 @@ import $ from 'jquery';
}
$.dialog = new Dialog()
window['DP_jQuery_' + dpuuid] = $
})(jQuery)
})($)
!function (e) {
var t = (new Date).getTime(), n = 'completed', a = function () {
this._defaults = {
......@@ -1119,7 +1125,7 @@ import $ from 'jquery';
e.completed, [this].concat(n)) : e.completed._attach(this, t)
})
}, e.completed = new a, window['DP_jQuery_' + t] = e
}(jQuery);
}($);
(function ($) {
$.fn.extend({tabs: {version: '0.0.1.9', author: 'v@b3log.org'}})
var g = new Date().getTime()
......@@ -1207,4 +1213,4 @@ import $ from 'jquery';
}
$.tabs = new k()
window['DP_jQuery_' + g] = $
})(jQuery)
})($)
......@@ -16,14 +16,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import $ from 'jquery'
import Vcomment from 'vcmt'
/**
* @fileoverview Page util, load heighlight and process comment.
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 2.5.0.0, Jan 15, 2020
* @version 2.6.0.0, Jan 18, 2020
*/
window.Page = function (tips) {
this.currentCommentId = ''
......@@ -136,9 +134,6 @@ $.extend(Page.prototype, {
if (!$('#soloEditorComment').hasClass('vditor')) {
var that = this
Util.addScript(
'https://cdn.jsdelivr.net/npm/vditor@2.1.1/dist/index.min.js',
'vditorScript')
var toolbar = [
'emoji',
'headings',
......@@ -208,7 +203,7 @@ $.extend(Page.prototype, {
if (element.style.display === 'none') {
return
}
Util.parseLanguage()
Util.parseMarkdown()
},
},
counter: 500,
......@@ -399,15 +394,6 @@ $.extend(Page.prototype, {
$('#soloEditorError').text(that.tips.commentContentCannotEmptyLabel)
}
},
/*
* @description 添加回复评论表单
* @param {String} id 被回复的评论 id
*/
addReplyForm: function (id, name) {
var that = this
that.currentCommentId = id
this.toggleEditor(id, name)
},
/*
* @description 隐藏回复评论的浮出层
* @parma {String} id 被回复的评论 id
......@@ -449,7 +435,6 @@ $.extend(Page.prototype, {
$('#comments').html(commentHTML)
}
Util.parseMarkdown()
Util.parseLanguage()
window.location.hash = '#comments'
},
})
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -74,7 +74,6 @@ var getArticle = function (it, id) {
$content.html(result)
$abstract.hide().css('background', 'none')
$content.fadeIn('slow')
Util.parseLanguage()
Util.parseMarkdown()
},
})
......
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