Commit 35287002 authored by Van's avatar Van

💄 #47

parent fe840024
src/main/resources/markdowns/* src/main/resources/markdowns/*
!src/main/resources/markdowns/README.md !src/main/resources/markdowns/README.md
src/main/resources/dist/
solo_h2_test/ solo_h2_test/
target/ target/
node_modules/ node_modules/
......
...@@ -8637,9 +8637,9 @@ ...@@ -8637,9 +8637,9 @@
"dev": true "dev": true
}, },
"uvstat": { "uvstat": {
"version": "1.0.0", "version": "1.0.6",
"resolved": "https://registry.npmjs.org/uvstat/-/uvstat-1.0.0.tgz", "resolved": "https://registry.npmjs.org/uvstat/-/uvstat-1.0.6.tgz",
"integrity": "sha512-cLbn3UBgaPI/+Q6ke2JQZF8tyItCQt6WNG09h6/9CoRUDJU8J9c1W+h/0VLW4DXIzxoPbx0HkOJ9nTMBd9UTUg==" "integrity": "sha512-Rl7ENBVv7ZtZ2kdDL5Vv4BVsbCP0qxcyOWhRBEpEfY5LHv5nB3iPMbBbSngLRsGPX2eAEboBwseScvIdu0i6eA=="
}, },
"v8-compile-cache": { "v8-compile-cache": {
"version": "2.0.3", "version": "2.0.3",
...@@ -8657,6 +8657,11 @@ ...@@ -8657,6 +8657,11 @@
"spdx-expression-parse": "^3.0.0" "spdx-expression-parse": "^3.0.0"
} }
}, },
"vcmt": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/vcmt/-/vcmt-1.0.6.tgz",
"integrity": "sha512-OKcnwcPHNJUenziaZzZ09jHB1R7F1E24rGFEDDpI95bVFjUtOTZ4M04GblOWZ4kysyZCVTOwpLRkE6mNB74UDA=="
},
"vditor": { "vditor": {
"version": "2.1.1", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/vditor/-/vditor-2.1.1.tgz", "resolved": "https://registry.npmjs.org/vditor/-/vditor-2.1.1.tgz",
......
...@@ -47,7 +47,8 @@ ...@@ -47,7 +47,8 @@
"dependencies": { "dependencies": {
"jquery": "^3.4.1", "jquery": "^3.4.1",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"uvstat": "^1.0.0", "uvstat": "^1.0.6",
"vcmt": "^1.0.6",
"vditor": "^2.1.1" "vditor": "^2.1.1"
} }
} }
...@@ -173,9 +173,10 @@ ...@@ -173,9 +173,10 @@
</div> </div>
</div> </div>
<#include "admin-label.ftl"> <#include "admin-label.ftl">
<script src="${staticServePath}/js/admin/admin.min.js${staticResourceVersion}"></script> <script src="${staticServePath}/js/admin/admin.min.js?${staticResourceVersion}"></script>
${plugins} ${plugins}
<script> <script>
admin.init()
admin.inited() admin.inited()
</script> </script>
</body> </body>
......
...@@ -99,5 +99,4 @@ ...@@ -99,5 +99,4 @@
Label.categoryTooLongLabel = "${categoryTooLongLabel}" Label.categoryTooLongLabel = "${categoryTooLongLabel}"
Label.descriptionLabel = "${descriptionLabel}" Label.descriptionLabel = "${descriptionLabel}"
Label.previewLabel = '${previewLabel}' Label.previewLabel = '${previewLabel}'
admin.init()
</script> </script>
...@@ -28,7 +28,8 @@ import '../lib/jquery/jquery.bowknot.min' ...@@ -28,7 +28,8 @@ import '../lib/jquery/jquery.bowknot.min'
*/ */
window.$ = $ window.$ = $
export const htmlDecode = function (code) { Util.init()
window.htmlDecode = function (code) {
var div = document.createElement('div') var div = document.createElement('div')
div.innerHTML = decodeURIComponent(code) div.innerHTML = decodeURIComponent(code)
return div.innerText return div.innerText
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a> * @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @version 1.3.0.1, Aug 6, 2019 * @version 1.3.0.1, Aug 6, 2019
*/ */
import Vditor from 'vditor'
admin.editors = {} admin.editors = {}
/* /*
...@@ -31,7 +31,7 @@ admin.editors = {} ...@@ -31,7 +31,7 @@ admin.editors = {}
* @param conf.id 编辑器渲染元素 id * @param conf.id 编辑器渲染元素 id
* @param conf.height 编辑器种类 * @param conf.height 编辑器种类
*/ */
var SoloEditor = function (conf) { window.SoloEditor = function (conf) {
this.conf = conf this.conf = conf
this.init() this.init()
} }
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
import $ from 'jquery' import $ from 'jquery'
import NProgress from 'nprogress' import NProgress from 'nprogress'
import pjax from './pjax' import pjax from './pjax'
import Uvstat from 'uvstat'
/** /**
* @fileoverview util and every page should be used. * @fileoverview util and every page should be used.
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -488,12 +488,7 @@ import jQuery from 'jquery' ...@@ -488,12 +488,7 @@ import jQuery from 'jquery'
}) })
$(this).addClass(styleClass.lineHoverClass) $(this).addClass(styleClass.lineHoverClass)
if ($(this).find('tr').length === 2) { if ($(this).find('tr').length === 2) {
if ($.browser.msie) { $(this).find('tr')[1].style.display = 'table-row'
if ($.browser.version > 7) {
$(this).
find('tr')[1].style.display = 'block'
}
} else {$(this).find('tr')[1].style.display = 'table-row'}
} }
} }
}) })
......
This source diff could not be displayed because it is too large. You can view the blob instead.
var Util = { import $ from 'jquery'
const pjaxUtil = {
support: { support: {
pjax: window.history && window.history.pushState && pjax: window.history && window.history.pushState &&
window.history.replaceState && !navigator.userAgent.match( window.history.replaceState && !navigator.userAgent.match(
...@@ -35,7 +36,7 @@ var Util = { ...@@ -35,7 +36,7 @@ var Util = {
}, },
// 清除所有的cache // 清除所有的cache
removeAllCache: function () { removeAllCache: function () {
if (!Util.support.storage) if (!pjaxUtil.support.storage)
return return
for (var name in localStorage) { for (var name in localStorage) {
if ((name.split('_') || [''])[0] === 'pjax') { if ((name.split('_') || [''])[0] === 'pjax') {
...@@ -46,23 +47,23 @@ var Util = { ...@@ -46,23 +47,23 @@ var Util = {
// 获取cache // 获取cache
getCache: function (src, time, flag) { getCache: function (src, time, flag) {
var item, vkey, tkey, tval var item, vkey, tkey, tval
time = Util.toInt(time) time = pjaxUtil.toInt(time)
if (src in Util.stack) { if (src in pjaxUtil.stack) {
item = Util.stack[src] item = pjaxUtil.stack[src]
const ctime = Util.getTime() const ctime = pjaxUtil.getTime()
if ((item.time + time * 1000) > ctime) { if ((item.time + time * 1000) > ctime) {
return item return item
} else { } else {
delete Util.stack[src] delete pjaxUtil.stack[src]
} }
} else if (flag && Util.support.storage) { // 从localStorage里查询 } else if (flag && pjaxUtil.support.storage) { // 从localStorage里查询
var l = Util.getLocalKey(src) var l = pjaxUtil.getLocalKey(src)
vkey = l.data vkey = l.data
tkey = l.time tkey = l.time
item = localStorage.getItem(vkey) item = localStorage.getItem(vkey)
if (item) { if (item) {
tval = Util.toInt(localStorage.getItem(tkey)) tval = pjaxUtil.toInt(localStorage.getItem(tkey))
if ((tval + time * 1000) > Util.getTime()) { if ((tval + time * 1000) > pjaxUtil.getTime()) {
return { return {
data: item, data: item,
title: localStorage.getItem(l.title), title: localStorage.getItem(l.title),
...@@ -78,14 +79,14 @@ var Util = { ...@@ -78,14 +79,14 @@ var Util = {
}, },
// 设置cache // 设置cache
setCache: function (src, data, title, flag) { setCache: function (src, data, title, flag) {
var time = Util.getTime(), key var time = pjaxUtil.getTime(), key
Util.stack[src] = { pjaxUtil.stack[src] = {
data: data, data: data,
title: title, title: title,
time: time, time: time,
} }
if (flag && Util.support.storage) { if (flag && pjaxUtil.support.storage) {
key = Util.getLocalKey(src) key = pjaxUtil.getLocalKey(src)
localStorage.setItem(key.data, data) localStorage.setItem(key.data, data)
localStorage.setItem(key.time, time) localStorage.setItem(key.time, time)
localStorage.setItem(key.title, title) localStorage.setItem(key.title, title)
...@@ -93,10 +94,10 @@ var Util = { ...@@ -93,10 +94,10 @@ var Util = {
}, },
// 清除cache // 清除cache
removeCache: function (src) { removeCache: function (src) {
src = Util.getRealUrl(src || location.href) src = pjaxUtil.getRealUrl(src || location.href)
delete Util.stack[src] delete pjaxUtil.stack[src]
if (Util.support.storage) { if (pjaxUtil.support.storage) {
var key = Util.getLocalKey(src) var key = pjaxUtil.getLocalKey(src)
localStorage.removeItem(key.data) localStorage.removeItem(key.data)
localStorage.removeItem(key.time) localStorage.removeItem(key.time)
localStorage.removeItem(key.title) localStorage.removeItem(key.title)
...@@ -129,8 +130,8 @@ var pjax = function (options) { ...@@ -129,8 +130,8 @@ var pjax = function (options) {
return true return true
} }
// 只是hash不同 // 只是hash不同
if (Util.getRealUrl(href) == Util.getRealUrl(location.href)) { if (pjaxUtil.getRealUrl(href) == pjaxUtil.getRealUrl(location.href)) {
var hash = Util.getUrlHash(href) var hash = pjaxUtil.getUrlHash(href)
if (hash) { if (hash) {
location.hash = hash location.hash = hash
options.callback && options.callback.call(this, { options.callback && options.callback.call(this, {
...@@ -295,7 +296,7 @@ pjax.success = function (data, isCached) { ...@@ -295,7 +296,7 @@ pjax.success = function (data, isCached) {
}, isCached) }, isCached)
// 设置cache // 设置cache
if (pjax.options.cache && !isCached) { if (pjax.options.cache && !isCached) {
Util.setCache(pjax.options.url, data, title, pjax.options.storage) pjaxUtil.setCache(pjax.options.url, data, title, pjax.options.storage)
} }
} }
...@@ -308,9 +309,9 @@ pjax.request = function (options) { ...@@ -308,9 +309,9 @@ pjax.request = function (options) {
options = $.extend(true, pjax.defaultOptions, options) options = $.extend(true, pjax.defaultOptions, options)
var cache, container = $(options.container) var cache, container = $(options.container)
options.oldUrl = options.url options.oldUrl = options.url
options.url = Util.getRealUrl(options.url) options.url = pjaxUtil.getRealUrl(options.url)
if ($(options.element).length) { if ($(options.element).length) {
cache = Util.toInt($(options.element).attr('data-pjax-cache')) cache = pjaxUtil.toInt($(options.element).attr('data-pjax-cache'))
if (cache) { if (cache) {
options.cache = cache options.cache = cache
} }
...@@ -318,10 +319,10 @@ pjax.request = function (options) { ...@@ -318,10 +319,10 @@ pjax.request = function (options) {
if (options.cache === true) { if (options.cache === true) {
options.cache = 24 * 3600 options.cache = 24 * 3600
} }
options.cache = Util.toInt(options.cache) options.cache = pjaxUtil.toInt(options.cache)
// 如果将缓存时间设为0,则将之前的缓存也清除 // 如果将缓存时间设为0,则将之前的缓存也清除
if (options.cache === 0) { if (options.cache === 0) {
Util.removeAllCache() pjaxUtil.removeAllCache()
} }
// 展现函数 // 展现函数
if (!options.showFn) { if (!options.showFn) {
...@@ -332,7 +333,7 @@ pjax.request = function (options) { ...@@ -332,7 +333,7 @@ pjax.request = function (options) {
pjax.options = options pjax.options = options
pjax.options.success = pjax.success pjax.options.success = pjax.success
if (options.cache && if (options.cache &&
(cache = Util.getCache(options.url, options.cache, options.storage))) { (cache = pjaxUtil.getCache(options.url, options.cache, options.storage))) {
options.beforeSend() options.beforeSend()
options.title = cache.title options.title = cache.title
pjax.success(cache.data, true) pjax.success(cache.data, true)
...@@ -373,7 +374,7 @@ $(window).bind('popstate', function (event) { ...@@ -373,7 +374,7 @@ $(window).bind('popstate', function (event) {
}) })
// not support // not support
if (!Util.support.pjax) { if (!pjaxUtil.support.pjax) {
pjax = function () { pjax = function () {
return true return true
} }
......
...@@ -1462,13 +1462,14 @@ a[class*=" icon-"]:hover { ...@@ -1462,13 +1462,14 @@ a[class*=" icon-"]:hover {
/* start first tab */ /* start first tab */
#tabs { #tabs {
height: 100%; height: 100%;
min-height: 468px;
width: 240px; width: 240px;
margin-top: 50px; margin-top: 50px;
position: fixed; position: fixed;
top: 0; top: 0;
background-color: #32323a; background-color: #32323a;
overflow: auto; } overflow: auto; }
#tabs::-webkit-scrollbar {
display: none; }
#tabs ul { #tabs ul {
list-style: none; } list-style: none; }
...@@ -1829,7 +1830,7 @@ button#submitArticle:hover { ...@@ -1829,7 +1830,7 @@ button#submitArticle:hover {
.dialog-panel { .dialog-panel {
display: none; display: none;
position: absolute; position: fixed;
z-index: 100; } z-index: 100; }
.dialog-title { .dialog-title {
......
...@@ -304,13 +304,15 @@ a[class*=" icon-"]:hover { ...@@ -304,13 +304,15 @@ a[class*=" icon-"]:hover {
/* start first tab */ /* start first tab */
#tabs { #tabs {
height: 100%; height: 100%;
min-height: 468px;
width: 240px; width: 240px;
margin-top: 50px; margin-top: 50px;
position: fixed; position: fixed;
top: 0; top: 0;
background-color: #32323a; background-color: #32323a;
overflow: auto; overflow: auto;
&::-webkit-scrollbar {
display: none;
}
} }
#tabs ul { #tabs ul {
...@@ -744,7 +746,7 @@ button#submitArticle:hover { ...@@ -744,7 +746,7 @@ button#submitArticle:hover {
.dialog-panel { .dialog-panel {
display: none; display: none;
position: absolute; position: fixed;
z-index: 100; z-index: 100;
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* @fileoverview webpack ipfs. * @fileoverview webpack ipfs.
* *
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a> * @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @version 3.2.0.0, Jan 8, 2020 * @version 0.1.0.0, Jan 18, 2020
*/ */
const path = require('path') const path = require('path')
...@@ -67,11 +67,11 @@ module.exports = { ...@@ -67,11 +67,11 @@ module.exports = {
'./src/main/resources/js/admin/plugin.js', './src/main/resources/js/admin/plugin.js',
'./src/main/resources/js/admin/main.js', './src/main/resources/js/admin/main.js',
'./src/main/resources/js/admin/about.js'], './src/main/resources/js/admin/about.js'],
// 'js/common': './src/main/resources/js/common.js', 'js/common': './src/main/resources/js/common.js',
// 'js/page': './src/main/resources/js/page.js', 'js/page': './src/main/resources/js/page.js',
'css/admin': './src/main/resources/scss/admin.scss', 'dist/admin': './src/main/resources/scss/admin.scss',
// 'css/base': './src/main/resources/scss/base.scss', 'dist/base': './src/main/resources/scss/base.scss',
// 'css/start': './src/main/resources/scss/start.scss', 'dist/start': './src/main/resources/scss/start.scss',
}), }),
module: { module: {
rules: [ rules: [
......
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