hexo-theme-volantis 5.0.0-rc.9 → 5.2.0
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/CHANGELOG.md +36 -0
- package/README.md +2 -1
- package/_config.yml +69 -46
- package/layout/_meta/counter.ejs +27 -5
- package/layout/_meta/walinecount.ejs +2 -1
- package/layout/_partial/article.ejs +2 -2
- package/layout/_partial/head.ejs +29 -28
- package/layout/_partial/header.ejs +1 -1
- package/layout/_partial/scripts/content-visibility-scroll-fix.ejs +71 -69
- package/layout/_partial/scripts/global.ejs +47 -23
- package/layout/_partial/scripts/index.ejs +22 -9
- package/layout/_partial/scripts/toc.ejs +61 -38
- package/layout/_plugins/_page_plugins/indent/index.ejs +1 -1
- package/layout/_plugins/_page_plugins/index.ejs +27 -7
- package/layout/_plugins/_page_plugins/snackbar/index.ejs +1 -1
- package/layout/_plugins/analytics/script.ejs +11 -1
- package/layout/_plugins/aplayer/script.ejs +1 -1
- package/layout/_plugins/comments/artalk/script.ejs +38 -11
- package/layout/_plugins/comments/beaudar/script.ejs +2 -2
- package/layout/_plugins/comments/discuss/script.ejs +30 -0
- package/layout/_plugins/comments/hashover/script.ejs +2 -2
- package/layout/_plugins/comments/index.ejs +4 -4
- package/layout/_plugins/comments/twikoo/script.ejs +1 -1
- package/layout/_plugins/comments/waline/script.ejs +40 -22
- package/layout/_plugins/parallax/script.ejs +1 -1
- package/layout/_plugins/pjax/index.ejs +4 -1
- package/layout/_plugins/rightmenu/layout.ejs +2 -2
- package/layout/_plugins/rightmenus/layout.ejs +17 -17
- package/layout/_widget/lastupdate.ejs +27 -27
- package/layout/_widget/webinfo.ejs +7 -7
- package/layout/layout.ejs +20 -3
- package/layout/tag.ejs +1 -1
- package/package.json +1 -1
- package/scripts/events/lib/check-configuration.js +43 -0
- package/scripts/events/lib/check-environment.js +20 -1
- package/scripts/events/lib/config.js +3 -0
- package/scripts/events/lib/render-stylus.js +1 -1
- package/scripts/filters/content-visibility.js +2 -2
- package/scripts/helpers/custom-files.js +3 -1
- package/scripts/helpers/head/generate_seo.js +1 -1
- package/scripts/helpers/structured-data/lib/blogposting.js +18 -6
- package/scripts/helpers/structured-data/lib/breadcrumblist.js +25 -1
- package/scripts/helpers/structured-data/lib/index.js +1 -9
- package/scripts/tags/fancybox.js +1 -1
- package/scripts/tags/tabs.js +85 -86
- package/source/css/_defines/AutoPrefixCSS.styl +16 -16
- package/source/css/_first/base_first.styl +6 -0
- package/source/css/_first/navbar_first.styl +1 -1
- package/source/css/_style/_base/base.styl +1 -1
- package/source/css/_style/_layout/toc.styl +2 -2
- package/source/css/_style/_plugins/_dark/dark_async.styl +1 -1
- package/source/css/_style/_plugins/_dark/dark_plugins.styl +8 -4
- package/source/css/_style/_plugins/_rightmenu/reading.styl +2 -2
- package/source/css/_style/_plugins/_rightmenu/rightmenu.styl +1 -1
- package/source/css/_style/_plugins/fontcolor.styl +1 -1
- package/source/css/first.styl +5 -7
- package/source/js/app.js +32 -35
- package/source/js/plugins/aplayer.js +1 -3
- package/source/js/plugins/rightMenu.js +22 -22
- package/source/js/plugins/rightMenus.js +115 -78
- package/source/js/search/hexo.js +3 -0
- package/layout/_partial/scripts/import.ejs +0 -3
package/scripts/tags/tabs.js
CHANGED
|
@@ -2,89 +2,88 @@
|
|
|
2
2
|
* tabs.js | https://theme-next.org/docs/tag-plugins/tabs
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
5
|
+
'use strict';
|
|
6
|
+
|
|
7
|
+
function postTabs(args, content) {
|
|
8
|
+
var tabBlock = /<!--\s*tab (.*?)\s*-->\n([\w\W\s\S]*?)<!--\s*endtab\s*-->/g;
|
|
9
|
+
|
|
10
|
+
if(/::/g.test(args)){
|
|
11
|
+
args = args.join(' ').split('::');
|
|
12
|
+
}
|
|
13
|
+
else{
|
|
14
|
+
args = args.join(' ').split(',');
|
|
15
|
+
}
|
|
16
|
+
var tabName = args[0];
|
|
17
|
+
var tabActive = Number(args[1]) || 0;
|
|
18
|
+
|
|
19
|
+
var matches = [];
|
|
20
|
+
var match;
|
|
21
|
+
var tabId = 0;
|
|
22
|
+
var tabNav = '';
|
|
23
|
+
var tabContent = '';
|
|
24
|
+
|
|
25
|
+
!tabName && hexo.log.warn('Tabs block must have unique name!');
|
|
26
|
+
|
|
27
|
+
while ((match = tabBlock.exec(content)) !== null) {
|
|
28
|
+
matches.push(match[1]);
|
|
29
|
+
matches.push(match[2]);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
for (var i = 0; i < matches.length; i += 2) {
|
|
33
|
+
var tabParameters = matches[i].split('@');
|
|
34
|
+
var postContent = matches[i + 1];
|
|
35
|
+
var tabCaption = tabParameters[0] || '';
|
|
36
|
+
var tabIcon = tabParameters[1] || '';
|
|
37
|
+
var tabHref = '';
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
// 兼容aplayer插件 https://github.com/volantis-x/hexo-theme-volantis/issues/575
|
|
41
|
+
var aplayerTag=0
|
|
42
|
+
var aplayerTagReg=/\<div.*class=\"aplayer aplayer-tag-marker\"(.|\n)*\<\/script\>/g
|
|
43
|
+
if(/class="aplayer aplayer-tag-marker"/g.test(postContent)){
|
|
44
|
+
aplayerTag=aplayerTagReg.exec(postContent)[0]
|
|
45
|
+
postContent=postContent.replace(aplayerTagReg,"@aplayerTag@")
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// 兼容 gallery 标签
|
|
49
|
+
var fancyboxTag=0
|
|
50
|
+
var fancyboxTagReg = /\<div.*galleryFlag(.|\n)*\<\/span\>\<\/div\>\<\/div\>/g
|
|
51
|
+
if(/galleryFlag/g.test(postContent)) {
|
|
52
|
+
fancyboxTag=fancyboxTagReg.exec(postContent)[0]
|
|
53
|
+
postContent=postContent.replace(fancyboxTagReg,"@fancyboxTag@")
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
postContent = hexo.render.renderSync({text: postContent, engine: 'markdown'}).trim();
|
|
57
|
+
|
|
58
|
+
if(aplayerTag){
|
|
59
|
+
postContent=postContent.replace(/\<pre\>\<code\>.*@aplayerTag@.*\<\/code><\/pre>/,aplayerTag)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if(fancyboxTag){
|
|
63
|
+
postContent=postContent.replace(/.*@fancyboxTag@.*/,fancyboxTag)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
tabId += 1;
|
|
67
|
+
tabHref = (tabName + ' ' + tabId).toLowerCase().split(' ').join('-');
|
|
68
|
+
|
|
69
|
+
((tabCaption.length === 0) && (tabIcon.length === 0)) && (tabCaption = tabName + ' ' + tabId);
|
|
70
|
+
|
|
71
|
+
var isOnlyicon = tabIcon.length > 0 && tabCaption.length === 0 ? ' style="text-align: center;"' : '';
|
|
72
|
+
let icon = tabIcon.trim();
|
|
73
|
+
icon = icon.startsWith('fa') ? icon : 'fa fa-' + icon;
|
|
74
|
+
tabIcon.length > 0 && (tabIcon = `<i class="${icon}"${isOnlyicon}></i>`);
|
|
75
|
+
|
|
76
|
+
var isActive = (tabActive > 0 && tabActive === tabId) || (tabActive === 0 && tabId === 1) ? ' active' : '';
|
|
77
|
+
tabNav += `<li class="tab${isActive}"><a class="#${tabHref}">${tabIcon + tabCaption.trim()}</a></li>`;
|
|
78
|
+
tabContent += `<div class="tab-pane${isActive}" id="${tabHref}">${postContent}</div>`;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
tabNav = `<ul class="nav-tabs">${tabNav}</ul>`;
|
|
82
|
+
tabContent = `<div class="tab-content">${tabContent}</div>`;
|
|
83
|
+
// https://github.com/volantis-x/hexo-theme-volantis/issues/703
|
|
84
|
+
return `<div class="tabs" id="tab-${tabName.toLowerCase().split(' ').join('-')}">${tabNav + tabContent}</div>`;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
hexo.extend.tag.register('tabs', postTabs, {ends: true});
|
|
88
|
+
hexo.extend.tag.register('subtabs', postTabs, {ends: true});
|
|
89
|
+
hexo.extend.tag.register('subsubtabs', postTabs, {ends: true});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// AutoPrefixCSS
|
|
1
|
+
// AutoPrefixCSS
|
|
2
2
|
// https://github.com/stylus/nib
|
|
3
3
|
|
|
4
4
|
vendor-prefixes ?= webkit khtml moz o ms
|
|
@@ -15,7 +15,7 @@ vendor(prop, only = null ,vendor-property = true, args)
|
|
|
15
15
|
|
|
16
16
|
animation()
|
|
17
17
|
vendor(prop:'animation', only: null, vendor-property: true, args:arguments)
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
// B
|
|
20
20
|
box-orient()
|
|
21
21
|
vendor(prop:'box-orient', only: webkit moz ms official, vendor-property: true, args:arguments)
|
|
@@ -28,7 +28,7 @@ border-radius()
|
|
|
28
28
|
|
|
29
29
|
box-shadow()
|
|
30
30
|
vendor(prop:'box-shadow', only: webkit official, vendor-property: true, args:arguments)
|
|
31
|
-
|
|
31
|
+
|
|
32
32
|
border-image()
|
|
33
33
|
vendor(prop:'border-image', only: webkit moz o official, vendor-property: true, args:arguments)
|
|
34
34
|
|
|
@@ -43,7 +43,7 @@ box-sizing()
|
|
|
43
43
|
|
|
44
44
|
backface-visibility()
|
|
45
45
|
vendor(prop:'backface-visibility', only: webkit moz ms official, vendor-property: true, args:arguments)
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
background-size()
|
|
48
48
|
vendor(prop:'background-size', only: webkit moz official, vendor-property: true, args:arguments)
|
|
49
49
|
|
|
@@ -116,7 +116,7 @@ display(value)
|
|
|
116
116
|
display -ms-flexbox /* TWEENER - IE 10 */
|
|
117
117
|
display -webkit-flex /* NEW - Chrome */
|
|
118
118
|
display flex /* NEW, Spec - Opera 12.1, Firefox 20+ */
|
|
119
|
-
|
|
119
|
+
|
|
120
120
|
if arguments != 'flex'
|
|
121
121
|
display: arguments;
|
|
122
122
|
else
|
|
@@ -160,7 +160,7 @@ flex-direction(value)
|
|
|
160
160
|
-webkit-flex-direction value
|
|
161
161
|
-ms-flex-direction value
|
|
162
162
|
flex-direction value
|
|
163
|
-
|
|
163
|
+
|
|
164
164
|
flexbox(value)
|
|
165
165
|
// Initializing a flexbox container
|
|
166
166
|
display -webkit-box /* OLD - iOS 6-, Safari 3.1-6 */
|
|
@@ -227,7 +227,7 @@ flex-group(value)
|
|
|
227
227
|
-ms-flex-order value
|
|
228
228
|
-webkit-order value
|
|
229
229
|
order value
|
|
230
|
-
|
|
230
|
+
|
|
231
231
|
flex-self(value)
|
|
232
232
|
// Function for aligning the flex elements (align-self)
|
|
233
233
|
if value == start or value == end
|
|
@@ -265,8 +265,8 @@ flex-justify(value)
|
|
|
265
265
|
-webkit-justify-content value
|
|
266
266
|
-ms-flex-pack distribute
|
|
267
267
|
justify-content value
|
|
268
|
-
|
|
269
|
-
|
|
268
|
+
|
|
269
|
+
|
|
270
270
|
font-smoothing()
|
|
271
271
|
vendor(prop:'font-smoothing', only: webkit, vendor-property: true, args:arguments)
|
|
272
272
|
// G
|
|
@@ -305,22 +305,22 @@ print-color-adjust()
|
|
|
305
305
|
// T
|
|
306
306
|
text-size-adjust()
|
|
307
307
|
vendor(prop:'text-size-adjust', only: null, vendor-property: true, args:arguments)
|
|
308
|
-
|
|
308
|
+
|
|
309
309
|
transition()
|
|
310
|
-
vendor(prop:'transition', only: null, vendor-property: true, args:arguments)
|
|
311
|
-
|
|
310
|
+
vendor(prop:'transition', only: null, vendor-property: true, args:arguments)
|
|
311
|
+
|
|
312
312
|
transition-property()
|
|
313
313
|
vendor(prop:'transition-property', only: null, vendor-property: true, args:arguments)
|
|
314
|
-
|
|
314
|
+
|
|
315
315
|
transition-duration()
|
|
316
316
|
vendor(prop:'transition-duration', only: null, vendor-property: true, args:arguments)
|
|
317
|
-
|
|
317
|
+
|
|
318
318
|
transition-timing-function()
|
|
319
319
|
vendor(prop:'transition-timing-function', only: null, vendor-property: true, args:arguments)
|
|
320
|
-
|
|
320
|
+
|
|
321
321
|
transition-delay()
|
|
322
322
|
vendor(prop:'transition-delay', only: null, vendor-property: true, args:arguments)
|
|
323
|
-
|
|
323
|
+
|
|
324
324
|
transform()
|
|
325
325
|
vendor(prop:'transform', only: null, vendor-property: true, args:arguments)
|
|
326
326
|
|
|
@@ -105,6 +105,12 @@ button
|
|
|
105
105
|
background: alpha($color-card, .9) !important
|
|
106
106
|
backdrop-filter: saturate(200%) blur(20px)
|
|
107
107
|
|
|
108
|
+
if hexo-config('comments.service')=='discuss' || hexo-config('comments.service')=='twikoo' || hexo-config('comments.service')=='waline'
|
|
109
|
+
.blur#comments
|
|
110
|
+
@supports (backdrop-filter: blur(20px))
|
|
111
|
+
backdrop-filter: unset
|
|
112
|
+
#layoutHelper-comments
|
|
113
|
+
margin-bottom: 100px
|
|
108
114
|
|
|
109
115
|
.shadow
|
|
110
116
|
box-shadow: $boxshadow-card
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
&:empty
|
|
84
84
|
display:none
|
|
85
85
|
|
|
86
|
-
.toc-child
|
|
86
|
+
.toc-child
|
|
87
87
|
font-size: 1rem
|
|
88
88
|
overflow: hidden
|
|
89
89
|
transition: max-height 0.6s ease-in
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
&>.toc-link
|
|
94
94
|
list_active()
|
|
95
95
|
border-left: $border-line solid $color-theme
|
|
96
|
-
&>.toc-child
|
|
96
|
+
&>.toc-child
|
|
97
97
|
max-height: 1000px
|
|
@@ -8,7 +8,7 @@ fa-thin,
|
|
|
8
8
|
fal,
|
|
9
9
|
fad,
|
|
10
10
|
fa,
|
|
11
|
-
svg.iconfont,
|
|
11
|
+
svg.iconfont,
|
|
12
12
|
img,
|
|
13
13
|
.lazyload
|
|
14
14
|
filter: brightness(convert(hexo-config('color_scheme.dark.brightness'))) !important
|
|
@@ -57,7 +57,7 @@ if hexo-config('plugins.code_highlight') == "highlightjs"
|
|
|
57
57
|
border-color: var(--color-site-bg) !important
|
|
58
58
|
blockquote p
|
|
59
59
|
color: var(--color-p)
|
|
60
|
-
|
|
60
|
+
|
|
61
61
|
// tags
|
|
62
62
|
#archive-page .archive .all-tags ul li span
|
|
63
63
|
color: var(--color-text)
|
|
@@ -111,7 +111,7 @@ if hexo-config('comments.service')=='twikoo'
|
|
|
111
111
|
border-top: 1px solid #4a4b50 !important
|
|
112
112
|
background:#4a4b50 !important
|
|
113
113
|
color: #ccc !important
|
|
114
|
-
.OwO-packages
|
|
114
|
+
.OwO-packages
|
|
115
115
|
li:hover
|
|
116
116
|
background-color: #252627 !important
|
|
117
117
|
.OwO-package-active
|
|
@@ -123,10 +123,14 @@ if hexo-config('comments.service')=='twikoo'
|
|
|
123
123
|
.OwO-items-image
|
|
124
124
|
.OwO-item:hover
|
|
125
125
|
background-color: #252627 !important
|
|
126
|
+
|
|
127
|
+
if hexo-config('comments.service')=='discuss'
|
|
128
|
+
#Discuss .D-emot
|
|
129
|
+
background: #333841
|
|
126
130
|
|
|
127
131
|
// Custom Files
|
|
128
132
|
for $injects_dark in hexo-config('injects.dark')
|
|
129
133
|
@import $injects_dark;
|
|
130
134
|
// eg:
|
|
131
135
|
// body
|
|
132
|
-
// --color-site-body: blue !important
|
|
136
|
+
// --color-site-body: blue !important
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
transition: opacity 1s cubic-bezier(.23,1,.32,1) 0ms !important
|
|
37
37
|
|
|
38
38
|
.common_read_hide
|
|
39
|
-
opacity: 0 !important
|
|
40
|
-
z-index: -2147483645 !important
|
|
39
|
+
opacity: 0 !important
|
|
40
|
+
z-index: -2147483645 !important
|
|
41
41
|
|
|
42
42
|
.common_read_main
|
|
43
43
|
width: 840px !important;
|
package/source/css/first.styl
CHANGED
|
@@ -3,17 +3,15 @@
|
|
|
3
3
|
}
|
|
4
4
|
// https://web.dev/content-visibility/
|
|
5
5
|
// https://www.caniuse.com/?search=content-visibility
|
|
6
|
-
/*
|
|
6
|
+
/*
|
|
7
7
|
* Workaround for Chrome bug, part 1
|
|
8
8
|
* Chunk rendering for all but the first article.
|
|
9
9
|
* /layout/_partial/scripts/content-visibility-scroll-fix.ejs
|
|
10
10
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
contain-intrinsic-size: 10px 500px;
|
|
16
|
-
}
|
|
11
|
+
.post-story + .post-story{
|
|
12
|
+
content-visibility: auto;
|
|
13
|
+
contain-intrinsic-size: 10px 500px;
|
|
14
|
+
}
|
|
17
15
|
|
|
18
16
|
@import '_defines/*'
|
|
19
17
|
|
package/source/js/app.js
CHANGED
|
@@ -29,10 +29,10 @@ const locationHash = () => {
|
|
|
29
29
|
if (target) {
|
|
30
30
|
setTimeout(() => {
|
|
31
31
|
if (window.location.hash.startsWith('#fn')) { // hexo-reference https://github.com/volantis-x/hexo-theme-volantis/issues/647
|
|
32
|
-
volantis.scroll.to(target, { addTop: - volantis.dom.header.offsetHeight - 5, behavior: 'instant' })
|
|
32
|
+
volantis.scroll.to(target, { addTop: - volantis.dom.header.offsetHeight - 5, behavior: 'instant', observer:true })
|
|
33
33
|
} else {
|
|
34
34
|
// 锚点中上半部有大片空白 高度大概是 volantis.dom.header.offsetHeight
|
|
35
|
-
volantis.scroll.to(target, { addTop: 5, behavior: 'instant' })
|
|
35
|
+
volantis.scroll.to(target, { addTop: 5, behavior: 'instant', observer:true })
|
|
36
36
|
}
|
|
37
37
|
}, 1000)
|
|
38
38
|
}
|
|
@@ -295,7 +295,7 @@ const VolantisApp = (() => {
|
|
|
295
295
|
let array = e.currentTarget.children
|
|
296
296
|
for (let index = 0; index < array.length; index++) {
|
|
297
297
|
const element = array[index];
|
|
298
|
-
if (volantis.dom.$(element).title === 'menu') { // 移动端菜单栏异常
|
|
298
|
+
if (volantis.dom.$(element).title === 'menu') { // 移动端菜单栏异常
|
|
299
299
|
volantis.dom.$(element).display = "flex" // https://github.com/volantis-x/hexo-theme-volantis/issues/706
|
|
300
300
|
} else {
|
|
301
301
|
volantis.dom.$(element).show()
|
|
@@ -437,36 +437,32 @@ const VolantisApp = (() => {
|
|
|
437
437
|
|
|
438
438
|
// 工具类:复制字符串到剪切板
|
|
439
439
|
fn.utilWriteClipText = (str) => {
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
.
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
.
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
return Promise.
|
|
440
|
+
return navigator.clipboard
|
|
441
|
+
.writeText(str)
|
|
442
|
+
.then(() => {
|
|
443
|
+
return Promise.resolve()
|
|
444
|
+
})
|
|
445
|
+
.catch(e => {
|
|
446
|
+
const input = document.createElement('textarea');
|
|
447
|
+
input.setAttribute('readonly', 'readonly');
|
|
448
|
+
document.body.appendChild(input);
|
|
449
|
+
input.innerHTML = str;
|
|
450
|
+
input.select();
|
|
451
|
+
try {
|
|
452
|
+
let result = document.execCommand('copy')
|
|
453
|
+
document.body.removeChild(input);
|
|
454
|
+
if (!result || result === 'unsuccessful') {
|
|
455
|
+
return Promise.reject('复制文本失败!')
|
|
456
|
+
} else {
|
|
457
|
+
return Promise.resolve()
|
|
458
|
+
}
|
|
459
|
+
} catch (e) {
|
|
460
|
+
document.body.removeChild(input);
|
|
461
|
+
return Promise.reject(
|
|
462
|
+
'当前浏览器不支持复制功能,请检查更新或更换其他浏览器操作!'
|
|
463
|
+
)
|
|
462
464
|
}
|
|
463
|
-
}
|
|
464
|
-
document.body.removeChild(input);
|
|
465
|
-
return Promise.reject(
|
|
466
|
-
'当前浏览器不支持复制功能,请检查更新或更换其他浏览器操作!'
|
|
467
|
-
)
|
|
468
|
-
}
|
|
469
|
-
}
|
|
465
|
+
})
|
|
470
466
|
}
|
|
471
467
|
|
|
472
468
|
// 工具类:返回时间间隔
|
|
@@ -637,7 +633,7 @@ const VolantisApp = (() => {
|
|
|
637
633
|
// 消息提示 复制时弹出
|
|
638
634
|
if (volantis.GLOBAL_CONFIG.plugins.message.enable
|
|
639
635
|
&& volantis.GLOBAL_CONFIG.plugins.message.copyright.enable
|
|
640
|
-
&& messageCopyrightShow <
|
|
636
|
+
&& messageCopyrightShow < 1) {
|
|
641
637
|
messageCopyrightShow++;
|
|
642
638
|
VolantisApp.message(volantis.GLOBAL_CONFIG.plugins.message.copyright.title,
|
|
643
639
|
volantis.GLOBAL_CONFIG.plugins.message.copyright.message, {
|
|
@@ -809,12 +805,12 @@ Object.freeze(VolantisFancyBox);
|
|
|
809
805
|
|
|
810
806
|
// highlightKeyWords 与 搜索功能搭配 https://github.com/next-theme/hexo-theme-next/blob/eb194a7258058302baf59f02d4b80b6655338b01/source/js/third-party/search/local-search.js
|
|
811
807
|
// Question: 锚点稳定性未知
|
|
812
|
-
// ToDo: 查找模式
|
|
808
|
+
// ToDo: 查找模式
|
|
813
809
|
// 0. (/////////要知道浏览器自带全页面查找功能 CTRL + F)
|
|
814
810
|
// 1. 右键开启查找模式 / 导航栏菜单开启?? / CTRL + F ???
|
|
815
811
|
// 2. 查找模式面板 (可拖动? or 固定?)
|
|
816
812
|
// 3. keyword mark id 从 0 开始编号 查找下一处 highlightKeyWords.scrollToNextHighlightKeywordMark() 查找上一处 scrollToPrevHighlightKeywordMark() 循环查找(取模%)
|
|
817
|
-
// 4. 可输入修改 查找关键词 keywords(type:list)
|
|
813
|
+
// 4. 可输入修改 查找关键词 keywords(type:list)
|
|
818
814
|
// 5. 区分大小写 caseSensitive (/ 全字匹配?? / 正则匹配??)
|
|
819
815
|
// 6. 在选定区域中查找 querySelector ??
|
|
820
816
|
// 7. 关闭查找模式
|
|
@@ -834,6 +830,7 @@ const highlightKeyWords = (() => {
|
|
|
834
830
|
fn.scrollToFirstHighlightKeywordMark()
|
|
835
831
|
}
|
|
836
832
|
fn.scrollToFirstHighlightKeywordMark = () => {
|
|
833
|
+
volantis.cleanContentVisibility();
|
|
837
834
|
let target = fn.scrollToNextHighlightKeywordMark("0");
|
|
838
835
|
if (!target) {
|
|
839
836
|
volantis.requestAnimationFrame(fn.scrollToFirstHighlightKeywordMark)
|
|
@@ -43,11 +43,9 @@ const RightMenuAplayer = (() => {
|
|
|
43
43
|
});
|
|
44
44
|
APlayer.player.on('volumechange', function (e) {
|
|
45
45
|
fn.onUpdateAPlayerVolume(e);
|
|
46
|
-
APlayer.status = 'volumechange';
|
|
47
46
|
});
|
|
48
47
|
APlayer.player.on('loadstart', function (e) {
|
|
49
48
|
fn.updateTitle(e);
|
|
50
|
-
APlayer.status = 'loadstart';
|
|
51
49
|
});
|
|
52
50
|
|
|
53
51
|
// 监听音量手势
|
|
@@ -185,4 +183,4 @@ Object.freeze(RightMenuAplayer);
|
|
|
185
183
|
|
|
186
184
|
volantis.requestAnimationFrame(() => {
|
|
187
185
|
RightMenuAplayer.checkAPlayer();
|
|
188
|
-
});
|
|
186
|
+
});
|