hexo-theme-volantis 5.0.0-rc.5 → 5.0.0-rc.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_config.yml +2 -2
- package/layout/_meta/counter.ejs +17 -0
- package/layout/_partial/scripts/_ctrl/cdnCtrl.ejs +0 -1
- package/layout/_plugins/rightmenu/layout.ejs +3 -3
- package/package.json +4 -3
- package/scripts/filters/CSP.js +4 -1
- package/source/css/_style/_layout/article.styl +1 -1
- package/source/css/_style/_plugins/cursor.styl +0 -10
- package/source/css/_style/_plugins/index.styl +0 -2
- package/source/js/app.js +13 -12
- package/source/js/plugins/aplayer.js +0 -3
- package/source/js/plugins/rightMenu.js +23 -4
package/_config.yml
CHANGED
|
@@ -18,7 +18,7 @@ default:
|
|
|
18
18
|
############################### Volantis ###############################
|
|
19
19
|
info:
|
|
20
20
|
theme_name: Volantis # This is theme's name.
|
|
21
|
-
theme_version: '5.0.0-rc.
|
|
21
|
+
theme_version: '5.0.0-rc.6' # This is theme's version.
|
|
22
22
|
theme_docs: https://volantis.js.org/ # This is theme's URL.
|
|
23
23
|
theme_repo: https://github.com/volantis-x/hexo-theme-volantis
|
|
24
24
|
# Debug 调试模式
|
|
@@ -59,7 +59,7 @@ cdn:
|
|
|
59
59
|
# CDN 前缀,为空使用默认值,链接最后不加 "/",
|
|
60
60
|
# 例如: https://cdn.jsdelivr.net/gh/volantis-x/volantis-x.github.io@gh-page 填写最后编译生成的源码CDN地址前缀,此路径下应该含有/js与/css目录,
|
|
61
61
|
# 该配置默认值是:"https://cdn.jsdelivr.net/npm/hexo-theme-volantis@"+ theme.info.theme_version +"/source"
|
|
62
|
-
prefix: https://npm.elemecdn.com/hexo-theme-volantis@5.0.0-rc.
|
|
62
|
+
prefix: https://npm.elemecdn.com/hexo-theme-volantis@5.0.0-rc.6/source
|
|
63
63
|
# 以下配置可以覆盖 cdn.prefix,配置项的值可以为空,但是要使用CDN必须依据路径填写配置项的键
|
|
64
64
|
set:
|
|
65
65
|
js:
|
package/layout/_meta/counter.ejs
CHANGED
|
@@ -26,6 +26,23 @@
|
|
|
26
26
|
</p>
|
|
27
27
|
</a>
|
|
28
28
|
</div>
|
|
29
|
+
-<% } else if (theme.comments.service=='waline' && theme.comments.waline.visitor) { %>
|
|
30
|
+
<div class="new-meta-item browse">
|
|
31
|
+
<a class='notlink'>
|
|
32
|
+
<i class="<%- theme.article.body.meta_library.counter.icon %> fa-fw" aria-hidden="true"></i>
|
|
33
|
+
<%
|
|
34
|
+
var path = post.path || page.path;
|
|
35
|
+
if (path.length > 9 && (path.substring(path.length - 10) == 'index.html')) {
|
|
36
|
+
path = path.substring(0, path.length - 10);
|
|
37
|
+
}
|
|
38
|
+
%>
|
|
39
|
+
<span id="<%- url_for(path) %>" class="leancloud_visitors" data-flag-title="<%- post.title || page.title %>">
|
|
40
|
+
<p>
|
|
41
|
+
<span class="leancloud-visitors-count"></span>
|
|
42
|
+
</p>
|
|
43
|
+
</span>
|
|
44
|
+
</a>
|
|
45
|
+
</div>
|
|
29
46
|
<% } else if (theme.comments.service=='twikoo' && !!page.comments) { %>
|
|
30
47
|
<div class="new-meta-item browse">
|
|
31
48
|
<a class='notlink'>
|
|
@@ -89,7 +89,6 @@
|
|
|
89
89
|
theme.cdn.addJS("rightMenu", "plugins/rightMenu")
|
|
90
90
|
theme.cdn.addJS("contributors","plugins/contributors")
|
|
91
91
|
theme.cdn.addJS("message", "thirdparty/message")
|
|
92
|
-
theme.cdn.addJS("valine","thirdparty/valine",theme.comments.valine.js)
|
|
93
92
|
theme.cdn.addJS("search","search/"+theme.search.service,theme.search.js)
|
|
94
93
|
|
|
95
94
|
// 以下用于配置项 cdn.set 覆盖配置,下面是覆盖配置的方法
|
|
@@ -93,9 +93,9 @@
|
|
|
93
93
|
<p class='nav music-title fix-cursor-default'></p>
|
|
94
94
|
</li>
|
|
95
95
|
<li class='music ctrl'>
|
|
96
|
-
<a class='nav icon-only backward fix-cursor-default' onclick=
|
|
97
|
-
<a class='nav icon-only toggle fix-cursor-default' onclick=
|
|
98
|
-
<a class='nav icon-only forward fix-cursor-default' onclick=
|
|
96
|
+
<a class='nav icon-only backward fix-cursor-default' href="/" onclick="return false;" title="backward"><i class='<%= faIcon %> fa-step-backward fa-fw'></i></a>
|
|
97
|
+
<a class='nav icon-only toggle fix-cursor-default' href="/" onclick="return false;" title="toggle"><i class='<%= faIcon %> fa-play fa-fw'></i></a>
|
|
98
|
+
<a class='nav icon-only forward fix-cursor-default' href="/" onclick="return false;" title="forward"><i class='<%= faIcon %> fa-step-forward fa-fw'></i></a>
|
|
99
99
|
</li>
|
|
100
100
|
<li class='music volume'>
|
|
101
101
|
<div class='nav volume'>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hexo-theme-volantis",
|
|
3
|
-
"version": "5.0.0-rc.
|
|
3
|
+
"version": "5.0.0-rc.6",
|
|
4
4
|
"description": "Elegant and powerful theme for Hexo.",
|
|
5
5
|
"main": "package.json",
|
|
6
6
|
"scripts": {
|
|
@@ -22,8 +22,9 @@
|
|
|
22
22
|
},
|
|
23
23
|
"homepage": "https://volantis.js.org",
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"hexo": "^6.
|
|
25
|
+
"hexo": "^6.1.0",
|
|
26
26
|
"hexo-renderer-stylus": "^2.0.1",
|
|
27
|
-
"hexo-renderer-ejs": "^2.0.0"
|
|
27
|
+
"hexo-renderer-ejs": "^2.0.0",
|
|
28
|
+
"hexo-generator-json-content": "^4.2.3"
|
|
28
29
|
}
|
|
29
30
|
}
|
package/scripts/filters/CSP.js
CHANGED
|
@@ -13,6 +13,9 @@ let unsafe_script_list = [
|
|
|
13
13
|
"errorImgCover(this)",
|
|
14
14
|
"return false;",
|
|
15
15
|
"return!1",
|
|
16
|
+
"history.back()",
|
|
17
|
+
"history.forward()",
|
|
18
|
+
"window.location.reload()",
|
|
16
19
|
]
|
|
17
20
|
// script hash White list
|
|
18
21
|
let unsafe_script_hash = ["'sha256-MXV1jvkHrZruEyFEOrQRjKs9WlPZC1V/3RLoKrkoDFQ='"]
|
|
@@ -68,4 +71,4 @@ hexo.extend.filter.register('after_render:html', function(data) {
|
|
|
68
71
|
data = data.replace(/script-src 'self' https: 'unsafe-inline'/g, `script-src 'self' https: 'nonce-${nonce}' 'unsafe-hashes' ` + unsafe_script_hash.join(" "));
|
|
69
72
|
return data;
|
|
70
73
|
}
|
|
71
|
-
},99999999999999999);
|
|
74
|
+
},99999999999999999);
|
|
@@ -45,12 +45,10 @@ button[disabled],html input[disabled],
|
|
|
45
45
|
ul.list-v.rightmenu a,
|
|
46
46
|
span.btn a:not([href]),
|
|
47
47
|
div.tabs ul.nav-tabs li.tab.active a,
|
|
48
|
-
article#comments #valine_container .vcards .vhead span.vnick,
|
|
49
48
|
kbd,
|
|
50
49
|
.a > p,
|
|
51
50
|
.not-select,
|
|
52
51
|
.not-select p,
|
|
53
|
-
.MiniValine *,
|
|
54
52
|
.aplayer .aplayer-info .aplayer-music,
|
|
55
53
|
.gt-container a.is--active,
|
|
56
54
|
.iziToast,
|
|
@@ -104,14 +102,6 @@ div.tabs ul.nav-tabs li.tab a,
|
|
|
104
102
|
.aplayer .aplayer-list ol li .aplayer-list-index,
|
|
105
103
|
.waves-button, .waves-button-input, .waves-button:hover, .waves-button:visited,
|
|
106
104
|
.fancybox-button,
|
|
107
|
-
.MiniValine .vbtn,
|
|
108
|
-
.MiniValine .vcancel-comment-reply,
|
|
109
|
-
.MiniValine .vcancel-comment-reply svg,
|
|
110
|
-
.MiniValine .vlist .vcard .vcomment-body .vat,
|
|
111
|
-
.MiniValine .vlist .vcard .vcomment-body .vhead .vname,
|
|
112
|
-
.MiniValine .vinputs-area .btn-wrap .vfunction-btn svg,
|
|
113
|
-
.MiniValine .vinputs-area .vextra-area .vsmile-icons img,
|
|
114
|
-
.MiniValine .vlist .vcard .vcomment-body .text-wrapper .vcomment a,
|
|
115
105
|
.gt-container .gt-btn,
|
|
116
106
|
.gt-container .gt-user-inner,
|
|
117
107
|
.gt-container .gt-avatar-github,
|
|
@@ -10,8 +10,6 @@ if hexo-config('plugins.aplayer.enable')
|
|
|
10
10
|
@import 'aplayer'
|
|
11
11
|
if hexo-config('plugins.pjax.enable') and hexo-config('plugins.pjax.animation')
|
|
12
12
|
@import 'pjaxanimate'
|
|
13
|
-
if hexo-config('comments.service')=='valine'
|
|
14
|
-
@import 'valine'
|
|
15
13
|
if hexo-config('comments.service')=='gitalk'
|
|
16
14
|
@import 'gitalk'
|
|
17
15
|
if hexo-config('custom_css.cursor.enable')
|
package/source/js/app.js
CHANGED
|
@@ -88,15 +88,9 @@ const VolantisApp = (() => {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
// 消息提示 复制时弹出
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
VolantisApp.message(volantis.GLOBAL_CONFIG.plugins.message.copyright.title,
|
|
95
|
-
volantis.GLOBAL_CONFIG.plugins.message.copyright.message, {
|
|
96
|
-
icon: volantis.GLOBAL_CONFIG.plugins.message.copyright.icon
|
|
97
|
-
});
|
|
98
|
-
};
|
|
99
|
-
}
|
|
91
|
+
document.body.oncopy = function () {
|
|
92
|
+
fn.messageCopyright()
|
|
93
|
+
};
|
|
100
94
|
}
|
|
101
95
|
|
|
102
96
|
fn.restData = () => {
|
|
@@ -638,13 +632,19 @@ const VolantisApp = (() => {
|
|
|
638
632
|
}
|
|
639
633
|
|
|
640
634
|
// 消息提示:复制
|
|
635
|
+
let messageCopyrightShow = 0;
|
|
641
636
|
fn.messageCopyright = () => {
|
|
642
637
|
// 消息提示 复制时弹出
|
|
643
638
|
if (volantis.GLOBAL_CONFIG.plugins.message.enable
|
|
644
|
-
&& volantis.GLOBAL_CONFIG.plugins.message.copyright.enable
|
|
639
|
+
&& volantis.GLOBAL_CONFIG.plugins.message.copyright.enable
|
|
640
|
+
&& messageCopyrightShow < 3) {
|
|
641
|
+
messageCopyrightShow++;
|
|
645
642
|
VolantisApp.message(volantis.GLOBAL_CONFIG.plugins.message.copyright.title,
|
|
646
643
|
volantis.GLOBAL_CONFIG.plugins.message.copyright.message, {
|
|
647
|
-
icon: volantis.GLOBAL_CONFIG.plugins.message.copyright.icon
|
|
644
|
+
icon: volantis.GLOBAL_CONFIG.plugins.message.copyright.icon,
|
|
645
|
+
transitionIn: 'flipInX',
|
|
646
|
+
transitionOut: 'flipOutX',
|
|
647
|
+
displayMode: 1
|
|
648
648
|
});
|
|
649
649
|
}
|
|
650
650
|
}
|
|
@@ -678,7 +678,8 @@ const VolantisApp = (() => {
|
|
|
678
678
|
document.querySelector("#l_header .nav-main").querySelectorAll('.list-v:not(.menu-phone)').forEach(function (e) {
|
|
679
679
|
e.removeAttribute("style")
|
|
680
680
|
})
|
|
681
|
-
document.querySelector("#l_header .menu-phone.list-v").removeAttribute("style")
|
|
681
|
+
document.querySelector("#l_header .menu-phone.list-v").removeAttribute("style");
|
|
682
|
+
messageCopyrightShow = 0;
|
|
682
683
|
},
|
|
683
684
|
utilCopyCode: fn.utilCopyCode,
|
|
684
685
|
utilWriteClipText: fn.utilWriteClipText,
|
|
@@ -120,7 +120,6 @@ const RightMenuAplayer = (() => {
|
|
|
120
120
|
|
|
121
121
|
// 播放/暂停
|
|
122
122
|
fn.aplayerToggle = () => {
|
|
123
|
-
event.stopPropagation();
|
|
124
123
|
fn.checkAPlayer();
|
|
125
124
|
try {
|
|
126
125
|
APlayer.player.toggle();
|
|
@@ -131,7 +130,6 @@ const RightMenuAplayer = (() => {
|
|
|
131
130
|
|
|
132
131
|
// 上一曲
|
|
133
132
|
fn.aplayerBackward = () => {
|
|
134
|
-
event.stopPropagation();
|
|
135
133
|
fn.checkAPlayer();
|
|
136
134
|
try {
|
|
137
135
|
APlayer.player.skipBack();
|
|
@@ -143,7 +141,6 @@ const RightMenuAplayer = (() => {
|
|
|
143
141
|
|
|
144
142
|
// 下一曲
|
|
145
143
|
fn.aplayerForward = () => {
|
|
146
|
-
event.stopPropagation();
|
|
147
144
|
fn.checkAPlayer();
|
|
148
145
|
try {
|
|
149
146
|
APlayer.player.skipForward();
|
|
@@ -7,7 +7,6 @@ const RightMenu = (() => {
|
|
|
7
7
|
fn = {},
|
|
8
8
|
_rightMenuWrapper = document.getElementById('rightmenu-wrapper'),
|
|
9
9
|
_rightMenuContent = document.getElementById('rightmenu-content'),
|
|
10
|
-
_menuDarkBtn = document.getElementById('menuDarkBtn'),
|
|
11
10
|
_printHtml = document.getElementById('printHtml'),
|
|
12
11
|
_menuMusic = document.getElementById('menuMusic'),
|
|
13
12
|
_readingModel = document.getElementById('readingModel'),
|
|
@@ -24,7 +23,10 @@ const RightMenu = (() => {
|
|
|
24
23
|
_copyHref = document.querySelector('.menu-Option[data-fn-type="copyHref"]'),
|
|
25
24
|
_copySrc = document.querySelector('.menu-Option[data-fn-type="copySrc"]'),
|
|
26
25
|
_copyImg = document.querySelector('.menu-Option[data-fn-type="copyImg"]'),
|
|
27
|
-
_openTab = document.querySelector('.menu-Option[data-fn-type="openTab"]')
|
|
26
|
+
_openTab = document.querySelector('.menu-Option[data-fn-type="openTab"]'),
|
|
27
|
+
_backward = document.querySelector('#menuMusic .backward'),
|
|
28
|
+
_toggle = document.querySelector('#menuMusic .toggle'),
|
|
29
|
+
_forward = document.querySelector('#menuMusic .forward');
|
|
28
30
|
|
|
29
31
|
const urlRegx = /^((https|http)?:\/\/)+[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\':+!]*([^<>\"\"])*$/;
|
|
30
32
|
|
|
@@ -55,10 +57,27 @@ const RightMenu = (() => {
|
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
window.removeEventListener('blur', fn.hideMenu);
|
|
58
|
-
document.body.removeEventListener('click', fn.hideMenu);
|
|
59
|
-
|
|
60
60
|
window.addEventListener('blur', fn.hideMenu);
|
|
61
|
+
document.body.removeEventListener('click', fn.hideMenu);
|
|
61
62
|
document.body.addEventListener('click', fn.hideMenu);
|
|
63
|
+
|
|
64
|
+
if (_forward && _toggle && _forward) {
|
|
65
|
+
_backward.onclick = (e) => {
|
|
66
|
+
e.preventDefault();
|
|
67
|
+
e.stopPropagation();
|
|
68
|
+
RightMenuAplayer.aplayerBackward();
|
|
69
|
+
}
|
|
70
|
+
_toggle.onclick = (e) => {
|
|
71
|
+
e.preventDefault();
|
|
72
|
+
e.stopPropagation();
|
|
73
|
+
RightMenuAplayer.aplayerToggle();
|
|
74
|
+
}
|
|
75
|
+
_forward.onclick = (e) => {
|
|
76
|
+
e.preventDefault();
|
|
77
|
+
e.stopPropagation();
|
|
78
|
+
RightMenuAplayer.aplayerForward();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
62
81
|
}
|
|
63
82
|
|
|
64
83
|
// 菜单位置设定
|