mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 18:40:53 +08:00
Compare commits
83 Commits
13
.github/FUNDING.yml
vendored
Normal file
13
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
||||
custom: ['https://buy.stripe.com/3cs6rP6YA91sbbG5kk','https://jsd.012700.xyz/gh/jerryc127/CDN/Photo/wechat.jpg'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||
9
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
9
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -53,6 +53,15 @@ body:
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: dependencies
|
||||
attributes:
|
||||
label: 依賴插件 | Package dependencies Information
|
||||
description: 在 Hexo 根目錄下執行`npm ls --depth 0` | Run `npm ls --depth 0` in Hexo root directory
|
||||
render: Text
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
|
||||
8
.github/ISSUE_TEMPLATE/config.yml
vendored
8
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -12,11 +12,7 @@ contact_links:
|
||||
url: https://t.me/bu2fly
|
||||
about: 'Official Telegram Group'
|
||||
|
||||
- name: QQ 1群
|
||||
- name: QQ 群
|
||||
url: https://jq.qq.com/?_wv=1027&k=KU9105XR
|
||||
about: '群號 1070540070,不要兩個Q群都添加'
|
||||
|
||||
- name: QQ 2群
|
||||
url: https://jq.qq.com/?_wv=1027&k=r1nK0DQz
|
||||
about: '群號 978221020,不要兩個Q群都添加'
|
||||
about: '群號 1070540070'
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ theme: butterfly
|
||||
- [x] 多種在線聊天(Chatra/Tidio/Daovoice/Crisp/messenger)
|
||||
- [x] 多種分析系統
|
||||
- [x] 谷歌廣告/手動廣告位置
|
||||
- [x] 各種站長驗證(Google/Bing/Baidu/360/Yandex)
|
||||
- [x] 各種站長驗證
|
||||
- [x] 修改網站配色
|
||||
- [x] 打字特效 activate_power_mode
|
||||
- [x] 多種背景特效(靜止彩帶/動態彩帶/Canvas Nest)
|
||||
|
||||
@@ -266,6 +266,7 @@ aside:
|
||||
sort_order: # Don't modify the setting unless you know how it works
|
||||
card_post_series:
|
||||
enable: true
|
||||
series_title: false # The title shows the series name
|
||||
orderBy: 'date' # Order by title or date
|
||||
order: -1 # Sort of order. 1, asc for ascending; -1, desc for descending
|
||||
|
||||
@@ -929,7 +930,7 @@ CDN:
|
||||
third_party_provider: jsdelivr
|
||||
|
||||
# Add version number to url, true or false
|
||||
version: false
|
||||
version: true
|
||||
|
||||
# Custom format
|
||||
# For example: https://cdn.staticfile.org/${cdnjs_name}/${version}/${min_cdnjs_file}
|
||||
|
||||
@@ -40,7 +40,7 @@ if (theme.pwa && theme.pwa.enable)
|
||||
|
||||
//- main css
|
||||
link(rel='stylesheet', href=url_for(theme.asset.main_css))
|
||||
link(rel='stylesheet', href=url_for(theme.asset.fontawesome) media="print" onload="this.media='all'")
|
||||
link(rel='stylesheet', href=url_for(theme.asset.fontawesome))
|
||||
|
||||
if (theme.snackbar && theme.snackbar.enable)
|
||||
link(rel='stylesheet', href=url_for(theme.asset.snackbar_css) media="print" onload="this.media='all'")
|
||||
|
||||
@@ -78,9 +78,11 @@
|
||||
}
|
||||
|
||||
let highlight = 'undefined';
|
||||
if ((config.highlight && config.highlight.enable) || (config.prismjs && config.prismjs.enable)) {
|
||||
let syntaxHighlighter = config.syntax_highlighter;
|
||||
let highlightEnable = syntaxHighlighter ? ['highlight.js', 'prismjs'].includes(syntaxHighlighter) : (config.highlight.enable || config.prismjs.enable);
|
||||
if (highlightEnable) {
|
||||
highlight = JSON.stringify({
|
||||
plugin: config.highlight.enable ? 'highlighjs' : 'prismjs',
|
||||
plugin: syntaxHighlighter ? syntaxHighlighter : config.highlight.enable ? 'highlight.js' : 'prismjs',
|
||||
highlightCopy: theme.highlight_copy,
|
||||
highlightLang: theme.highlight_lang,
|
||||
highlightHeightLimit: theme.highlight_height_limit
|
||||
|
||||
@@ -140,5 +140,5 @@
|
||||
when 'Artalk'
|
||||
+countBlock
|
||||
a(href=url_for(page.path) + '#post-comment')
|
||||
span.artalk-count
|
||||
span#ArtalkCount
|
||||
i.fa-solid.fa-spinner.fa-spin
|
||||
@@ -45,16 +45,16 @@ mixin postUI(posts)
|
||||
if (theme.post_meta.page.categories && article.categories.data.length > 0)
|
||||
span.article-meta
|
||||
span.article-meta-separator |
|
||||
i.fas.fa-inbox
|
||||
each item, index in article.categories.data
|
||||
i.fas.fa-inbox
|
||||
a(href=url_for(item.path)).article-meta__categories #[=item.name]
|
||||
if (index < article.categories.data.length - 1)
|
||||
i.fas.fa-angle-right.article-meta-link
|
||||
if (theme.post_meta.page.tags && article.tags.data.length > 0)
|
||||
span.article-meta.tags
|
||||
span.article-meta-separator |
|
||||
i.fas.fa-tag
|
||||
each item, index in article.tags.data
|
||||
i.fas.fa-tag
|
||||
a(href=url_for(item.path)).article-meta__tags #[=item.name]
|
||||
if (index < article.tags.data.length - 1)
|
||||
span.article-meta-link #[='•']
|
||||
|
||||
@@ -8,19 +8,15 @@ script.
|
||||
const keyArray = Array.from(eleGroup).map(i => i.getAttribute('data-page-key'))
|
||||
|
||||
const headerList = {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Origin': window.location.origin
|
||||
},
|
||||
body: new URLSearchParams({
|
||||
'site_name': '!{site}',
|
||||
'type':'page_comment',
|
||||
'page_keys': keyArray
|
||||
})
|
||||
method: 'GET',
|
||||
}
|
||||
|
||||
const res = await fetch('!{server}/api/stat', headerList)
|
||||
const searchParams = new URLSearchParams({
|
||||
'site_name': '!{site}',
|
||||
'page_keys': keyArray
|
||||
})
|
||||
|
||||
const res = await fetch(`!{server}/api/v2/stats/page_comment?${searchParams}`, headerList)
|
||||
const result = await res.json()
|
||||
|
||||
keyArray.forEach((key, index) => {
|
||||
|
||||
27
layout/includes/third-party/comments/artalk.pug
vendored
27
layout/includes/third-party/comments/artalk.pug
vendored
@@ -3,29 +3,33 @@
|
||||
|
||||
script.
|
||||
(() => {
|
||||
let artalkItem = null
|
||||
const initArtalk = () => {
|
||||
window.artalkItem = new Artalk(Object.assign({
|
||||
artalkItem = Artalk.init(Object.assign({
|
||||
el: '#artalk-wrap',
|
||||
server: '!{server}',
|
||||
site: '!{site}',
|
||||
pageKey: location.pathname,
|
||||
darkMode: document.documentElement.getAttribute('data-theme') === 'dark',
|
||||
countEl: '.artalk-count'
|
||||
},!{JSON.stringify(option)}))
|
||||
|
||||
if (GLOBAL_CONFIG.lightbox === 'null') return
|
||||
window.artalkItem.use(ctx => {
|
||||
ctx.on('list-loaded', () => {
|
||||
ctx.getCommentList().forEach(comment => {
|
||||
const $content = comment.getRender().$content
|
||||
btf.loadLightbox($content.querySelectorAll('img:not([atk-emoticon])'))
|
||||
})
|
||||
artalkItem.on('list-loaded', () => {
|
||||
artalkItem.ctx.get('list').getCommentNodes().forEach(comment => {
|
||||
const $content = comment.getRender().$content
|
||||
btf.loadLightbox($content.querySelectorAll('img:not([atk-emoticon])'))
|
||||
})
|
||||
})
|
||||
|
||||
const destroyArtalk = () => {
|
||||
artalkItem.destroy()
|
||||
}
|
||||
|
||||
btf.addGlobalFn('pjax', destroyArtalk, 'destroyArtalk')
|
||||
}
|
||||
|
||||
const loadArtalk = async () => {
|
||||
if (typeof window.artalkItem === 'object') initArtalk()
|
||||
if (typeof Artalk === 'object') initArtalk()
|
||||
else {
|
||||
await getCSS('!{theme.asset.artalk_css}')
|
||||
await getScript('!{theme.asset.artalk_js}')
|
||||
@@ -37,12 +41,11 @@ script.
|
||||
const artalkWrap = document.getElementById('artalk-wrap')
|
||||
if (!(artalkWrap && artalkWrap.children.length)) return
|
||||
const isDark = theme === 'dark'
|
||||
window.artalkItem.setDarkMode(isDark)
|
||||
artalkItem.setDarkMode(isDark)
|
||||
}
|
||||
|
||||
|
||||
btf.addGlobalFn('themeChange', artalkChangeMode, 'artalk')
|
||||
|
||||
|
||||
if ('!{use[0]}' === 'Artalk' || !!{lazyload}) {
|
||||
if (!{lazyload}) btf.loadComment(document.getElementById('artalk-wrap'), loadArtalk)
|
||||
else loadArtalk()
|
||||
|
||||
39
layout/includes/third-party/comments/twikoo.pug
vendored
39
layout/includes/third-party/comments/twikoo.pug
vendored
@@ -3,22 +3,6 @@
|
||||
|
||||
script.
|
||||
(() => {
|
||||
const init = () => {
|
||||
twikoo.init(Object.assign({
|
||||
el: '#twikoo-wrap',
|
||||
envId: '!{envId}',
|
||||
region: '!{region}',
|
||||
onCommentLoaded: () => {
|
||||
btf.loadLightbox(document.querySelectorAll('#twikoo .tk-content img:not(.tk-owo-emotion)'))
|
||||
}
|
||||
}, !{JSON.stringify(option)}))
|
||||
}
|
||||
|
||||
const loadTwikoo = () => {
|
||||
if (typeof twikoo === 'object') setTimeout(init,0)
|
||||
else getScript('!{url_for(theme.asset.twikoo)}').then(init)
|
||||
}
|
||||
|
||||
const getCount = () => {
|
||||
const countELement = document.getElementById('twikoo-count')
|
||||
if(!countELement) return
|
||||
@@ -34,12 +18,27 @@ script.
|
||||
})
|
||||
}
|
||||
|
||||
const init = () => {
|
||||
twikoo.init(Object.assign({
|
||||
el: '#twikoo-wrap',
|
||||
envId: '!{envId}',
|
||||
region: '!{region}',
|
||||
onCommentLoaded: () => {
|
||||
btf.loadLightbox(document.querySelectorAll('#twikoo .tk-content img:not(.tk-owo-emotion)'))
|
||||
}
|
||||
}, !{JSON.stringify(option)}))
|
||||
|
||||
!{count ? 'GLOBAL_CONFIG_SITE.isPost && getCount()' : ''}
|
||||
}
|
||||
|
||||
const loadTwikoo = () => {
|
||||
if (typeof twikoo === 'object') setTimeout(init,0)
|
||||
else getScript('!{url_for(theme.asset.twikoo)}').then(init)
|
||||
}
|
||||
|
||||
if ('!{use[0]}' === 'Twikoo' || !!{lazyload}) {
|
||||
if (!{lazyload}) btf.loadComment(document.getElementById('twikoo-wrap'), loadTwikoo)
|
||||
else {
|
||||
loadTwikoo()
|
||||
!{count ? 'GLOBAL_CONFIG_SITE.isPost && getCount()' : ''}
|
||||
}
|
||||
else loadTwikoo()
|
||||
} else {
|
||||
window.loadOtherComment = loadTwikoo
|
||||
}
|
||||
|
||||
20
layout/includes/third-party/comments/waline.pug
vendored
20
layout/includes/third-party/comments/waline.pug
vendored
@@ -3,8 +3,10 @@
|
||||
|
||||
script.
|
||||
(() => {
|
||||
const initWaline = () => {
|
||||
const waline = Waline.init(Object.assign({
|
||||
let initFn = window.walineFn || null
|
||||
|
||||
const initWaline = (Fn) => {
|
||||
const waline = Fn(Object.assign({
|
||||
el: '#waline-wrap',
|
||||
serverURL: '!{serverURL}',
|
||||
pageview: !{lazyload ? false : pageview},
|
||||
@@ -12,14 +14,22 @@ script.
|
||||
path: window.location.pathname,
|
||||
comment: !{lazyload ? false : count},
|
||||
}, !{JSON.stringify(option)}))
|
||||
|
||||
const destroyWaline = () => {
|
||||
waline.destroy()
|
||||
}
|
||||
|
||||
btf.addGlobalFn('pjax', destroyWaline, 'destroyWaline')
|
||||
}
|
||||
|
||||
const loadWaline = async () => {
|
||||
if (typeof Waline === 'object') initWaline()
|
||||
if (initFn) initWaline(initFn)
|
||||
else {
|
||||
await getCSS('!{url_for(theme.asset.waline_css)}')
|
||||
await getScript('!{url_for(theme.asset.waline_js)}')
|
||||
initWaline()
|
||||
const { init } = await import('!{url_for(theme.asset.waline_js)}')
|
||||
initFn = init || Waline.init
|
||||
initWaline(initFn)
|
||||
window.walineFn = initFn
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,14 +40,14 @@ script.
|
||||
}
|
||||
|
||||
let $dom = document.querySelector('#card-newest-comments .aside-list')
|
||||
$dom.innerHTML= result
|
||||
$dom && ($dom && ($dom.innerHTML= result))
|
||||
window.lazyLoadInstance && window.lazyLoadInstance.update()
|
||||
window.pjax && window.pjax.refresh($dom)
|
||||
}
|
||||
|
||||
const getSetting = async () => {
|
||||
try {
|
||||
const res = await fetch('!{server}/api/conf', { method: 'GET' })
|
||||
const res = await fetch('!{server}/api/v2/conf', { method: 'GET' })
|
||||
return await res.json()
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
@@ -55,24 +55,20 @@ script.
|
||||
}
|
||||
|
||||
const headerList = {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Origin': window.location.origin
|
||||
},
|
||||
body: new URLSearchParams({
|
||||
'site_name': '!{site}',
|
||||
'limit': '!{theme.newest_comments.limit}',
|
||||
'type':'latest_comments'
|
||||
})
|
||||
method: 'GET',
|
||||
}
|
||||
|
||||
const searchParams = new URLSearchParams({
|
||||
'site_name': '!{site}',
|
||||
'limit': '!{theme.newest_comments.limit}',
|
||||
})
|
||||
|
||||
const getComment = async () => {
|
||||
try {
|
||||
const res = await fetch('!{server}/api/stat', headerList)
|
||||
const res = await fetch(`!{server}/api/v2/stats/latest_comments?${searchParams}`, headerList)
|
||||
const result = await res.json()
|
||||
const avatarStr = await getSetting()
|
||||
const { mirror, params, default:defaults } = avatarStr.data.frontend_conf.gravatar
|
||||
const { mirror, params, default:defaults } = avatarStr.frontend_conf.gravatar
|
||||
const avatarCdn = !{avatarCdn} || mirror
|
||||
let avatarDefault = !{avatarDefault} || params || defaults
|
||||
avatarDefault = avatarDefault.startsWith('d=') ? avatarDefault : `d=${avatarDefault}`
|
||||
@@ -90,7 +86,7 @@ script.
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
const $dom = document.querySelector('#card-newest-comments .aside-list')
|
||||
$dom.innerHTML= "!{_p('aside.card_newest_comments.error')}"
|
||||
$dom.textContent= "!{_p('aside.card_newest_comments.error')}"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ script.
|
||||
}
|
||||
|
||||
let $dom = document.querySelector('#card-newest-comments .aside-list')
|
||||
$dom.innerHTML= result
|
||||
$dom && ($dom.innerHTML= result)
|
||||
window.lazyLoadInstance && window.lazyLoadInstance.update()
|
||||
window.pjax && window.pjax.refresh($dom)
|
||||
}
|
||||
|
||||
@@ -17,7 +17,10 @@ script.
|
||||
const findTrueUrl = (array) => {
|
||||
Promise.all(array.map(item =>
|
||||
fetch(item.url).then(resp => resp.json()).then(data => {
|
||||
const urlArray = data.body.match(/(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?/ig)
|
||||
let urlArray = data.body ? data.body.match(/(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?/ig) : []
|
||||
if (!Array.isArray(urlArray) || urlArray.length === 0) {
|
||||
urlArray = [`${data.html_url}`]
|
||||
}
|
||||
if (data.user.login === 'utterances-bot') {
|
||||
return urlArray.pop()
|
||||
} else {
|
||||
@@ -48,7 +51,7 @@ script.
|
||||
const githubArray = data.map(item => {
|
||||
return {
|
||||
'avatar': item.user.avatar_url,
|
||||
'content': changeContent(item.body_html),
|
||||
'content': changeContent(item.body_html || item.body),
|
||||
'nick': item.user.login,
|
||||
'url': item.issue_url,
|
||||
'date': item.updated_at,
|
||||
@@ -84,7 +87,7 @@ script.
|
||||
}
|
||||
|
||||
let $dom = document.querySelector('#card-newest-comments .aside-list')
|
||||
$dom.innerHTML= result
|
||||
$dom && ($dom.innerHTML= result)
|
||||
window.lazyLoadInstance && window.lazyLoadInstance.update()
|
||||
window.pjax && window.pjax.refresh($dom)
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ script.
|
||||
}
|
||||
|
||||
let $dom = document.querySelector('#card-newest-comments .aside-list')
|
||||
$dom.innerHTML= result
|
||||
$dom && ($dom.innerHTML= result)
|
||||
window.lazyLoadInstance && window.lazyLoadInstance.update()
|
||||
window.pjax && window.pjax.refresh($dom)
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ script.
|
||||
}
|
||||
|
||||
let $dom = document.querySelector('#card-newest-comments .aside-list')
|
||||
$dom.innerHTML= result
|
||||
$dom && ($dom.innerHTML= result)
|
||||
window.lazyLoadInstance && window.lazyLoadInstance.update()
|
||||
window.pjax && window.pjax.refresh($dom)
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ script.
|
||||
}
|
||||
|
||||
let $dom = document.querySelector('#card-newest-comments .aside-list')
|
||||
$dom.innerHTML= result
|
||||
$dom && ($dom.innerHTML= result)
|
||||
window.lazyLoadInstance && window.lazyLoadInstance.update()
|
||||
window.pjax && window.pjax.refresh($dom)
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ script.
|
||||
}
|
||||
|
||||
let $dom = document.querySelector('#card-newest-comments .aside-list')
|
||||
$dom.innerHTML= result
|
||||
$dom && ($dom.innerHTML= result)
|
||||
window.lazyLoadInstance && window.lazyLoadInstance.update()
|
||||
window.pjax && window.pjax.refresh($dom)
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ if theme.aside.card_post_series.enable
|
||||
.card-widget.card-post-series
|
||||
.item-headline
|
||||
i.fa-solid.fa-layer-group
|
||||
span= _p('aside.card_post_series')
|
||||
span= theme.aside.card_post_series.series_title ? page.series : _p('aside.card_post_series')
|
||||
.aside-list
|
||||
each item in array[page.series]
|
||||
- const { path, title = _p('no_title'), cover, cover_type, date:dateA } = item
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
- let tocNumber = page.toc_number !== undefined ? page.toc_number : theme.toc.number
|
||||
- let tocExpand = page.toc_expand !== undefined ? page.toc_expand : theme.toc.expand
|
||||
- let tocNumber = typeof page.toc_number === 'boolean' ? page.toc_number : theme.toc.number
|
||||
- let tocExpand = typeof page.toc_expand === 'boolean' ? page.toc_expand : theme.toc.expand
|
||||
- let tocExpandClass = tocExpand ? 'is-expand' : ''
|
||||
|
||||
#card-toc.card-widget
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hexo-theme-butterfly",
|
||||
"version": "4.10.0",
|
||||
"version": "4.13.0",
|
||||
"description": "A Simple and Card UI Design theme for Hexo",
|
||||
"main": "package.json",
|
||||
"scripts": {
|
||||
@@ -23,7 +23,7 @@
|
||||
"email": "my@crazywong.com"
|
||||
},
|
||||
"dependencies": {
|
||||
"hexo-renderer-stylus": "^3.0.0",
|
||||
"hexo-renderer-stylus": "^3.0.1",
|
||||
"hexo-renderer-pug": "^3.0.0"
|
||||
},
|
||||
"homepage": "https://butterfly.js.org/",
|
||||
|
||||
32
plugins.yml
32
plugins.yml
@@ -1,11 +1,11 @@
|
||||
algolia_search:
|
||||
name: algoliasearch
|
||||
file: dist/algoliasearch-lite.umd.js
|
||||
version: 4.20.0
|
||||
version: 4.22.1
|
||||
instantsearch:
|
||||
name: instantsearch.js
|
||||
file: dist/instantsearch.production.min.js
|
||||
version: 4.57.0
|
||||
version: 4.65.0
|
||||
pjax:
|
||||
name: pjax
|
||||
file: pjax.min.js
|
||||
@@ -37,17 +37,17 @@ disqusjs_css:
|
||||
twikoo:
|
||||
name: twikoo
|
||||
file: dist/twikoo.all.min.js
|
||||
version: 1.6.22
|
||||
version: 1.6.31
|
||||
waline_js:
|
||||
name: '@waline/client'
|
||||
file: dist/waline.js
|
||||
other_name: waline
|
||||
version: 2.15.8
|
||||
version: 3.1.2
|
||||
waline_css:
|
||||
name: '@waline/client'
|
||||
file: dist/waline.css
|
||||
other_name: waline
|
||||
version: 2.15.8
|
||||
version: 3.1.2
|
||||
sharejs:
|
||||
name: butterfly-extsrc
|
||||
file: sharejs/dist/js/social-share.min.js
|
||||
@@ -73,7 +73,7 @@ katex_copytex:
|
||||
mermaid:
|
||||
name: mermaid
|
||||
file: dist/mermaid.min.js
|
||||
version: 10.5.0
|
||||
version: 10.8.0
|
||||
canvas_ribbon:
|
||||
name: butterfly-extsrc
|
||||
file: dist/canvas-ribbon.min.js
|
||||
@@ -105,7 +105,7 @@ clickShowText:
|
||||
lazyload:
|
||||
name: vanilla-lazyload
|
||||
file: dist/lazyload.iife.min.js
|
||||
version: 17.8.4
|
||||
version: 17.8.8
|
||||
instantpage:
|
||||
name: instant.page
|
||||
file: instantpage.js
|
||||
@@ -113,7 +113,7 @@ instantpage:
|
||||
typed:
|
||||
name: typed.js
|
||||
file: dist/typed.umd.js
|
||||
version: 2.0.16
|
||||
version: 2.1.0
|
||||
pangu:
|
||||
name: pangu
|
||||
file: dist/browser/pangu.min.js
|
||||
@@ -121,17 +121,17 @@ pangu:
|
||||
fancybox_css:
|
||||
name: '@fancyapps/ui'
|
||||
file: dist/fancybox/fancybox.css
|
||||
version: 5.0.24
|
||||
version: 5.0.33
|
||||
other_name: fancyapps-ui
|
||||
fancybox:
|
||||
name: '@fancyapps/ui'
|
||||
file: dist/fancybox/fancybox.umd.js
|
||||
version: 5.0.24
|
||||
version: 5.0.33
|
||||
other_name: fancyapps-ui
|
||||
medium_zoom:
|
||||
name: medium-zoom
|
||||
file: dist/medium-zoom.min.js
|
||||
version: 1.0.8
|
||||
version: 1.1.0
|
||||
snackbar_css:
|
||||
name: node-snackbar
|
||||
file: dist/snackbar.min.css
|
||||
@@ -144,12 +144,12 @@ fontawesome:
|
||||
name: '@fortawesome/fontawesome-free'
|
||||
file: css/all.min.css
|
||||
other_name: font-awesome
|
||||
version: 6.4.2
|
||||
version: 6.5.1
|
||||
egjs_infinitegrid:
|
||||
name: '@egjs/infinitegrid'
|
||||
other_name: egjs-infinitegrid
|
||||
file: dist/infinitegrid.min.js
|
||||
version: 4.10.1
|
||||
version: 4.11.1
|
||||
aplayer_css:
|
||||
name: aplayer
|
||||
file: dist/APlayer.min.css
|
||||
@@ -180,11 +180,11 @@ prismjs_autoloader:
|
||||
artalk_js:
|
||||
name: artalk
|
||||
file: dist/Artalk.js
|
||||
version: 2.6.3
|
||||
version: 2.8.2
|
||||
artalk_css:
|
||||
name: artalk
|
||||
file: dist/Artalk.css
|
||||
version: 2.6.3
|
||||
version: 2.8.2
|
||||
pace_js:
|
||||
name: pace-js
|
||||
other_name: pace
|
||||
@@ -208,4 +208,4 @@ docsearch_css:
|
||||
abcjs_basic_js:
|
||||
name: abcjs
|
||||
file: dist/abcjs-basic-min.js
|
||||
version: 6.2.2
|
||||
version: 6.3.0
|
||||
|
||||
545
scripts/events/merge_config.js
Normal file
545
scripts/events/merge_config.js
Normal file
@@ -0,0 +1,545 @@
|
||||
hexo.extend.filter.register('before_generate', () => {
|
||||
const defaultConfig = {
|
||||
nav: {
|
||||
logo: null,
|
||||
display_title: true,
|
||||
fixed: false
|
||||
},
|
||||
menu: null,
|
||||
highlight_theme: 'light',
|
||||
highlight_copy: true,
|
||||
highlight_lang: true,
|
||||
highlight_shrink: false,
|
||||
highlight_height_limit: false,
|
||||
code_word_wrap: false,
|
||||
social: null,
|
||||
favicon: '/img/favicon.png',
|
||||
avatar: {
|
||||
img: 'https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png',
|
||||
effect: false
|
||||
},
|
||||
disable_top_img: false,
|
||||
index_img: null,
|
||||
default_top_img: null,
|
||||
archive_img: null,
|
||||
tag_img: null,
|
||||
tag_per_img: null,
|
||||
category_img: null,
|
||||
category_per_img: null,
|
||||
cover: {
|
||||
index_enable: true,
|
||||
aside_enable: true,
|
||||
archives_enable: true,
|
||||
position: 'both',
|
||||
default_cover: null
|
||||
},
|
||||
error_img: {
|
||||
flink: '/img/friend_404.gif',
|
||||
post_page: '/img/404.jpg'
|
||||
},
|
||||
error_404: {
|
||||
enable: false,
|
||||
subtitle: 'Page Not Found',
|
||||
background: 'https://i.loli.net/2020/05/19/aKOcLiyPl2JQdFD.png'
|
||||
},
|
||||
post_meta: {
|
||||
page: {
|
||||
date_type: 'created',
|
||||
date_format: 'date',
|
||||
categories: true,
|
||||
tags: false,
|
||||
label: true
|
||||
},
|
||||
post: {
|
||||
date_type: 'both',
|
||||
date_format: 'date',
|
||||
categories: true,
|
||||
tags: true,
|
||||
label: true
|
||||
}
|
||||
},
|
||||
index_post_content: {
|
||||
method: 3,
|
||||
length: 500
|
||||
},
|
||||
anchor: {
|
||||
auto_update: false,
|
||||
click_to_scroll: false
|
||||
},
|
||||
photofigcaption: false,
|
||||
copy: {
|
||||
enable: true,
|
||||
copyright: {
|
||||
enable: false,
|
||||
limit_count: 50
|
||||
}
|
||||
},
|
||||
toc: {
|
||||
post: true,
|
||||
page: false,
|
||||
number: true,
|
||||
expand: false,
|
||||
style_simple: false,
|
||||
scroll_percent: true
|
||||
},
|
||||
post_copyright: {
|
||||
enable: true,
|
||||
decode: false,
|
||||
author_href: null,
|
||||
license: 'CC BY-NC-SA 4.0',
|
||||
license_url: 'https://creativecommons.org/licenses/by-nc-sa/4.0/'
|
||||
},
|
||||
reward: {
|
||||
enable: false,
|
||||
text: null,
|
||||
QR_code: null
|
||||
},
|
||||
post_edit: {
|
||||
enable: false,
|
||||
url: null
|
||||
},
|
||||
related_post: {
|
||||
enable: true,
|
||||
limit: 6,
|
||||
date_type: 'created'
|
||||
},
|
||||
post_pagination: 1,
|
||||
noticeOutdate: {
|
||||
enable: false,
|
||||
style: 'flat',
|
||||
limit_day: 500,
|
||||
position: 'top',
|
||||
message_prev: 'It has been',
|
||||
message_next: 'days since the last update, the content of the article may be outdated.'
|
||||
},
|
||||
footer: {
|
||||
owner: {
|
||||
enable: true,
|
||||
since: 2020
|
||||
},
|
||||
custom_text: null,
|
||||
copyright: true
|
||||
},
|
||||
aside: {
|
||||
enable: true,
|
||||
hide: false,
|
||||
button: true,
|
||||
mobile: true,
|
||||
position: 'right',
|
||||
display: {
|
||||
archive: true,
|
||||
tag: true,
|
||||
category: true
|
||||
},
|
||||
card_author: {
|
||||
enable: true,
|
||||
description: null,
|
||||
button: {
|
||||
enable: true,
|
||||
icon: 'fab fa-github',
|
||||
text: 'Follow Me',
|
||||
link: 'https://github.com/xxxxxx'
|
||||
}
|
||||
},
|
||||
card_announcement: {
|
||||
enable: true,
|
||||
content: 'This is my Blog'
|
||||
},
|
||||
card_recent_post: {
|
||||
enable: true,
|
||||
limit: 5,
|
||||
sort: 'date',
|
||||
sort_order: null
|
||||
},
|
||||
card_categories: {
|
||||
enable: true,
|
||||
limit: 8,
|
||||
expand: 'none',
|
||||
sort_order: null
|
||||
},
|
||||
card_tags: {
|
||||
enable: true,
|
||||
limit: 40,
|
||||
color: false,
|
||||
orderby: 'random',
|
||||
order: 1,
|
||||
sort_order: null
|
||||
},
|
||||
card_archives: {
|
||||
enable: true,
|
||||
type: 'monthly',
|
||||
format: 'MMMM YYYY',
|
||||
order: -1,
|
||||
limit: 8,
|
||||
sort_order: null
|
||||
},
|
||||
card_webinfo: {
|
||||
enable: true,
|
||||
post_count: true,
|
||||
last_push_date: true,
|
||||
sort_order: null
|
||||
},
|
||||
card_post_series: {
|
||||
enable: true,
|
||||
series_title: false,
|
||||
orderBy: 'date',
|
||||
order: -1
|
||||
}
|
||||
},
|
||||
busuanzi: {
|
||||
site_uv: true,
|
||||
site_pv: true,
|
||||
page_pv: true
|
||||
},
|
||||
runtimeshow: {
|
||||
enable: false,
|
||||
publish_date: null
|
||||
},
|
||||
newest_comments: {
|
||||
enable: false,
|
||||
sort_order: null,
|
||||
limit: 6,
|
||||
storage: 10,
|
||||
avatar: true
|
||||
},
|
||||
translate: {
|
||||
enable: false,
|
||||
default: '繁',
|
||||
defaultEncoding: 2,
|
||||
translateDelay: 0,
|
||||
msgToTraditionalChinese: '繁',
|
||||
msgToSimplifiedChinese: '簡'
|
||||
},
|
||||
readmode: true,
|
||||
darkmode: {
|
||||
enable: true,
|
||||
button: true,
|
||||
autoChangeMode: false,
|
||||
start: null,
|
||||
end: null
|
||||
},
|
||||
rightside_scroll_percent: false,
|
||||
rightside_item_order: {
|
||||
enable: false,
|
||||
hide: null,
|
||||
show: null
|
||||
},
|
||||
mathjax: {
|
||||
enable: false,
|
||||
per_page: false
|
||||
},
|
||||
katex: {
|
||||
enable: false,
|
||||
per_page: false,
|
||||
hide_scrollbar: true
|
||||
},
|
||||
algolia_search: {
|
||||
enable: false,
|
||||
hits: {
|
||||
per_page: 6
|
||||
}
|
||||
},
|
||||
local_search: {
|
||||
enable: false,
|
||||
preload: false,
|
||||
top_n_per_article: 1,
|
||||
unescape: false,
|
||||
CDN: null
|
||||
},
|
||||
docsearch: {
|
||||
enable: false,
|
||||
appId: null,
|
||||
apiKey: null,
|
||||
indexName: null,
|
||||
option: null
|
||||
},
|
||||
sharejs: {
|
||||
enable: true,
|
||||
sites: 'facebook,twitter,wechat,weibo,qq'
|
||||
},
|
||||
addtoany: {
|
||||
enable: false,
|
||||
item: 'facebook,twitter,wechat,sina_weibo,facebook_messenger,email,copy_link'
|
||||
},
|
||||
comments: {
|
||||
use: null,
|
||||
text: true,
|
||||
lazyload: false,
|
||||
count: false,
|
||||
card_post_count: false
|
||||
},
|
||||
disqus: {
|
||||
shortname: null,
|
||||
apikey: null
|
||||
},
|
||||
disqusjs: {
|
||||
shortname: null,
|
||||
apikey: null,
|
||||
option: null
|
||||
},
|
||||
livere: {
|
||||
uid: null
|
||||
},
|
||||
gitalk: {
|
||||
client_id: null,
|
||||
client_secret: null,
|
||||
repo: null,
|
||||
owner: null,
|
||||
admin: null,
|
||||
option: null
|
||||
},
|
||||
valine: {
|
||||
appId: null,
|
||||
appKey: null,
|
||||
avatar: 'monsterid',
|
||||
serverURLs: null,
|
||||
bg: null,
|
||||
visitor: false,
|
||||
option: null
|
||||
},
|
||||
waline: {
|
||||
serverURL: null,
|
||||
bg: null,
|
||||
pageview: false,
|
||||
option: null
|
||||
},
|
||||
utterances: {
|
||||
repo: null,
|
||||
issue_term: 'pathname',
|
||||
light_theme: 'github-light',
|
||||
dark_theme: 'photon-dark'
|
||||
},
|
||||
facebook_comments: {
|
||||
app_id: null,
|
||||
user_id: null,
|
||||
pageSize: 10,
|
||||
order_by: 'social',
|
||||
lang: 'zh_TW'
|
||||
},
|
||||
twikoo: {
|
||||
envId: null,
|
||||
region: null,
|
||||
visitor: false,
|
||||
option: null
|
||||
},
|
||||
giscus: {
|
||||
repo: null,
|
||||
repo_id: null,
|
||||
category_id: null,
|
||||
theme: {
|
||||
light: 'light',
|
||||
dark: 'dark'
|
||||
},
|
||||
option: null
|
||||
},
|
||||
remark42: {
|
||||
host: null,
|
||||
siteId: null,
|
||||
option: null
|
||||
},
|
||||
artalk: {
|
||||
server: null,
|
||||
site: null,
|
||||
visitor: false,
|
||||
option: null
|
||||
},
|
||||
chat_btn: false,
|
||||
chat_hide_show: false,
|
||||
chatra: {
|
||||
enable: false,
|
||||
id: null
|
||||
},
|
||||
tidio: {
|
||||
enable: false,
|
||||
public_key: null
|
||||
},
|
||||
daovoice: {
|
||||
enable: false,
|
||||
app_id: null
|
||||
},
|
||||
crisp: {
|
||||
enable: false,
|
||||
website_id: null
|
||||
},
|
||||
messenger: {
|
||||
enable: false,
|
||||
pageID: null,
|
||||
lang: 'zh_TW'
|
||||
},
|
||||
baidu_analytics: null,
|
||||
google_analytics: null,
|
||||
cloudflare_analytics: null,
|
||||
microsoft_clarity: null,
|
||||
google_adsense: {
|
||||
enable: false,
|
||||
auto_ads: true,
|
||||
js: 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js',
|
||||
client: null,
|
||||
enable_page_level_ads: true
|
||||
},
|
||||
site_verification: null,
|
||||
index_site_info_top: null,
|
||||
index_top_img_height: null,
|
||||
category_ui: null,
|
||||
tag_ui: null,
|
||||
text_align_justify: false,
|
||||
background: null,
|
||||
footer_bg: false,
|
||||
mask: {
|
||||
header: true,
|
||||
footer: true
|
||||
},
|
||||
rightside_bottom: null,
|
||||
enter_transitions: true,
|
||||
activate_power_mode: {
|
||||
enable: false,
|
||||
colorful: true,
|
||||
shake: true,
|
||||
mobile: false
|
||||
},
|
||||
canvas_ribbon: {
|
||||
enable: false,
|
||||
size: 150,
|
||||
alpha: 0.6,
|
||||
zIndex: -1,
|
||||
click_to_change: false,
|
||||
mobile: false
|
||||
},
|
||||
canvas_fluttering_ribbon: {
|
||||
enable: false,
|
||||
mobile: false
|
||||
},
|
||||
canvas_nest: {
|
||||
enable: false,
|
||||
color: '0,0,255',
|
||||
opacity: 0.7,
|
||||
zIndex: -1,
|
||||
count: 99,
|
||||
mobile: false
|
||||
},
|
||||
fireworks: {
|
||||
enable: false,
|
||||
zIndex: 9999,
|
||||
mobile: false
|
||||
},
|
||||
click_heart: {
|
||||
enable: false,
|
||||
mobile: false
|
||||
},
|
||||
clickShowText: {
|
||||
enable: false,
|
||||
text: null,
|
||||
fontSize: '15px',
|
||||
random: false,
|
||||
mobile: false
|
||||
},
|
||||
display_mode: 'light',
|
||||
beautify: {
|
||||
enable: false,
|
||||
field: 'post',
|
||||
'title-prefix-icon': null,
|
||||
'title-prefix-icon-color': null
|
||||
},
|
||||
font: {
|
||||
'global-font-size': null,
|
||||
'code-font-size': null,
|
||||
'font-family': null,
|
||||
'code-font-family': null
|
||||
},
|
||||
blog_title_font: {
|
||||
font_link: null,
|
||||
'font-family': null
|
||||
},
|
||||
hr_icon: {
|
||||
enable: true,
|
||||
icon: null,
|
||||
'icon-top': null
|
||||
},
|
||||
subtitle: {
|
||||
enable: false,
|
||||
effect: true,
|
||||
typed_option: null,
|
||||
source: false,
|
||||
sub: null
|
||||
},
|
||||
preloader: {
|
||||
enable: false,
|
||||
source: 1,
|
||||
pace_css_url: null
|
||||
},
|
||||
wordcount: {
|
||||
enable: false,
|
||||
post_wordcount: true,
|
||||
min2read: true,
|
||||
total_wordcount: true
|
||||
},
|
||||
medium_zoom: false,
|
||||
fancybox: true,
|
||||
series: {
|
||||
enable: true,
|
||||
orderBy: 'title',
|
||||
order: 1,
|
||||
number: true
|
||||
},
|
||||
abcjs: {
|
||||
enable: false,
|
||||
per_page: true
|
||||
},
|
||||
mermaid: {
|
||||
enable: false,
|
||||
theme: {
|
||||
light: 'default',
|
||||
dark: 'dark'
|
||||
}
|
||||
},
|
||||
note: {
|
||||
style: 'flat',
|
||||
icons: true,
|
||||
border_radius: 3,
|
||||
light_bg_offset: 0
|
||||
},
|
||||
pjax: {
|
||||
enable: false,
|
||||
exclude: null
|
||||
},
|
||||
aplayerInject: {
|
||||
enable: false,
|
||||
per_page: true
|
||||
},
|
||||
snackbar: {
|
||||
enable: false,
|
||||
position: 'bottom-left',
|
||||
bg_light: '#49b1f5',
|
||||
bg_dark: '#1f1f1f'
|
||||
},
|
||||
instantpage: false,
|
||||
pangu: {
|
||||
enable: false,
|
||||
field: 'site'
|
||||
},
|
||||
lazyload: {
|
||||
enable: false,
|
||||
field: 'site',
|
||||
placeholder: null,
|
||||
blur: false
|
||||
},
|
||||
Open_Graph_meta: {
|
||||
enable: true,
|
||||
option: null
|
||||
},
|
||||
css_prefix: true,
|
||||
inject: {
|
||||
head: null,
|
||||
bottom: null
|
||||
},
|
||||
CDN: {
|
||||
internal_provider: 'local',
|
||||
third_party_provider: 'jsdelivr',
|
||||
version: true,
|
||||
custom_format: null,
|
||||
option: null
|
||||
}
|
||||
}
|
||||
|
||||
hexo.theme.config = Object.assign(defaultConfig, hexo.theme.config)
|
||||
}, 1)
|
||||
@@ -5,8 +5,15 @@
|
||||
'use strict'
|
||||
|
||||
hexo.extend.filter.register('stylus:renderer', style => {
|
||||
const { enable: highlightEnable, line_number: highlightLineNumber } = hexo.config.highlight
|
||||
const { enable: prismjsEnable, line_number: prismjsLineNumber } = hexo.config.prismjs
|
||||
const { syntax_highlighter: syntaxHighlighter, highlight, prismjs } = hexo.config
|
||||
let { enable: highlightEnable, line_number: highlightLineNumber } = highlight
|
||||
let { enable: prismjsEnable, line_number: prismjsLineNumber } = prismjs
|
||||
|
||||
// for hexo > 7.0
|
||||
if (syntaxHighlighter) {
|
||||
highlightEnable = syntaxHighlighter === 'highlight.js'
|
||||
prismjsEnable = syntaxHighlighter === 'prismjs'
|
||||
}
|
||||
|
||||
style.define('$highlight_enable', highlightEnable)
|
||||
.define('$highlight_line_number', highlightLineNumber)
|
||||
|
||||
@@ -99,14 +99,9 @@
|
||||
|
||||
#post-info
|
||||
position: absolute
|
||||
bottom: 100px
|
||||
bottom: 30px
|
||||
padding: 0 8%
|
||||
width: 100%
|
||||
text-align: center
|
||||
|
||||
+maxWidth900()
|
||||
bottom: 30px
|
||||
text-align: left
|
||||
|
||||
+maxWidth768()
|
||||
bottom: 22px
|
||||
|
||||
@@ -109,14 +109,26 @@ beautify()
|
||||
line-height: 1em
|
||||
|
||||
if hexo-config('anchor.click_to_scroll')
|
||||
a.headerlink
|
||||
position: absolute
|
||||
top: 0
|
||||
right: 0
|
||||
left 0
|
||||
bottom: 0
|
||||
width 100%
|
||||
height: 100%
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6
|
||||
width: fit-content
|
||||
|
||||
a:not(.headerlink)
|
||||
position relative
|
||||
z-index 10
|
||||
|
||||
a.headerlink
|
||||
position: absolute
|
||||
top: 0
|
||||
right: 0
|
||||
left 0
|
||||
bottom: 0
|
||||
width 100%
|
||||
height: 100%
|
||||
|
||||
ol,
|
||||
ul
|
||||
|
||||
@@ -33,15 +33,16 @@
|
||||
margin: 20px auto
|
||||
|
||||
.menus_items
|
||||
padding: 0 5px
|
||||
padding: 0 10px
|
||||
|
||||
.site-page
|
||||
@extend .limit-one-line
|
||||
position: relative
|
||||
display: block
|
||||
padding: 6px 30px 6px 22px
|
||||
padding: 3px 28px 3px 20px
|
||||
color: var(--font-color)
|
||||
font-size: 1.15em
|
||||
border-radius: 6px
|
||||
|
||||
&:hover
|
||||
background: var(--text-bg-hover)
|
||||
|
||||
@@ -53,7 +53,6 @@
|
||||
|
||||
.search-result
|
||||
margin: 0 0 8px
|
||||
word-break: break-word
|
||||
|
||||
.search-result-list
|
||||
overflow-y: overlay
|
||||
|
||||
@@ -66,7 +66,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
const { highlightCopy, highlightLang, highlightHeightLimit, plugin } = highLight
|
||||
const isHighlightShrink = GLOBAL_CONFIG_SITE.isHighlightShrink
|
||||
const isShowTool = highlightCopy || highlightLang || isHighlightShrink !== undefined
|
||||
const $figureHighlight = plugin === 'highlighjs' ? document.querySelectorAll('figure.highlight') : document.querySelectorAll('pre[class*="language-"]')
|
||||
const $figureHighlight = plugin === 'highlight.js' ? document.querySelectorAll('figure.highlight') : document.querySelectorAll('pre[class*="language-"]')
|
||||
|
||||
if (!((isShowTool || highlightHeightLimit) && $figureHighlight.length)) return
|
||||
|
||||
@@ -75,23 +75,23 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
const highlightShrinkEle = isHighlightShrink !== undefined ? '<i class="fas fa-angle-down expand"></i>' : ''
|
||||
const highlightCopyEle = highlightCopy ? '<div class="copy-notice"></div><i class="fas fa-paste copy-button"></i>' : ''
|
||||
|
||||
const copy = (text, ctx) => {
|
||||
const alertInfo = (ele, text) => {
|
||||
if (GLOBAL_CONFIG.Snackbar !== undefined) {
|
||||
btf.snackbarShow(text)
|
||||
} else {
|
||||
const prevEle = ele.previousElementSibling
|
||||
prevEle.textContent = text
|
||||
prevEle.style.opacity = 1
|
||||
setTimeout(() => { prevEle.style.opacity = 0 }, 800)
|
||||
}
|
||||
}
|
||||
|
||||
const copy = ctx => {
|
||||
if (document.queryCommandSupported && document.queryCommandSupported('copy')) {
|
||||
document.execCommand('copy')
|
||||
if (GLOBAL_CONFIG.Snackbar !== undefined) {
|
||||
btf.snackbarShow(GLOBAL_CONFIG.copy.success)
|
||||
} else {
|
||||
const prevEle = ctx.previousElementSibling
|
||||
prevEle.textContent = GLOBAL_CONFIG.copy.success
|
||||
prevEle.style.opacity = 1
|
||||
setTimeout(() => { prevEle.style.opacity = 0 }, 700)
|
||||
}
|
||||
alertInfo(ctx, GLOBAL_CONFIG.copy.success)
|
||||
} else {
|
||||
if (GLOBAL_CONFIG.Snackbar !== undefined) {
|
||||
btf.snackbarShow(GLOBAL_CONFIG.copy.noSupport)
|
||||
} else {
|
||||
ctx.previousElementSibling.textContent = GLOBAL_CONFIG.copy.noSupport
|
||||
}
|
||||
alertInfo(ctx, GLOBAL_CONFIG.copy.noSupport)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,8 +105,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
range.selectNodeContents($buttonParent.querySelectorAll(`${preCodeSelector}`)[0])
|
||||
selection.removeAllRanges()
|
||||
selection.addRange(range)
|
||||
const text = selection.toString()
|
||||
copy(text, ele.lastChild)
|
||||
copy(ele.lastChild)
|
||||
selection.removeAllRanges()
|
||||
$buttonParent.classList.remove('copy-true')
|
||||
}
|
||||
@@ -783,7 +782,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
const commentContainer = document.getElementById('post-comment')
|
||||
const handleSwitchBtn = () => {
|
||||
commentContainer.classList.toggle('move')
|
||||
if (!switchDone) {
|
||||
if (!switchDone && typeof loadOtherComment === 'function') {
|
||||
switchDone = true
|
||||
loadOtherComment()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user