mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 20:30:53 +08:00
Compare commits
36 Commits
copilot/fi
...
3.4.2
@@ -77,7 +77,7 @@
|
|||||||
else if whichCount === 'Gitalk'
|
else if whichCount === 'Gitalk'
|
||||||
+countBlock
|
+countBlock
|
||||||
a(href=url_for(page.path) + '#post-comment')
|
a(href=url_for(page.path) + '#post-comment')
|
||||||
span.gitalk-#card-toc
|
span.gitalk-comment-count
|
||||||
else if whichCount === 'Twikoo'
|
else if whichCount === 'Twikoo'
|
||||||
+countBlock
|
+countBlock
|
||||||
a(href=url_for(page.path) + '#post-comment')
|
a(href=url_for(page.path) + '#post-comment')
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hexo-theme-butterfly",
|
"name": "hexo-theme-butterfly",
|
||||||
"version": "3.4.1",
|
"version": "3.4.2",
|
||||||
"description": "A Simple and Card UI Design theme for Hexo",
|
"description": "A Simple and Card UI Design theme for Hexo",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -247,7 +247,6 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
* fancybox和 mediumZoom
|
* fancybox和 mediumZoom
|
||||||
*/
|
*/
|
||||||
const addFancybox = function (ele) {
|
const addFancybox = function (ele) {
|
||||||
if (ele.length) {
|
|
||||||
const runFancybox = (ele) => {
|
const runFancybox = (ele) => {
|
||||||
ele.each(function (i, o) {
|
ele.each(function (i, o) {
|
||||||
const $this = $(o)
|
const $this = $(o)
|
||||||
@@ -275,12 +274,11 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
runFancybox($(ele))
|
runFancybox($(ele))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const addMediumZoom = () => {
|
const addMediumZoom = () => {
|
||||||
const zoom = mediumZoom(document.querySelectorAll('#article-container :not(a)>img'))
|
const zoom = mediumZoom(document.querySelectorAll('#article-container :not(a)>img'))
|
||||||
zoom.on('open', e => {
|
zoom.on('open', e => {
|
||||||
const photoBg = $(document.documentElement).attr('data-theme') === 'dark' ? '#121212' : '#fff'
|
const photoBg = document.documentElement.getAttribute('data-theme') === 'dark' ? '#121212' : '#fff'
|
||||||
zoom.update({
|
zoom.update({
|
||||||
background: photoBg
|
background: photoBg
|
||||||
})
|
})
|
||||||
@@ -288,15 +286,17 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const jqLoadAndRun = () => {
|
const jqLoadAndRun = () => {
|
||||||
const isFancybox = GLOBAL_CONFIG.lightbox === 'fancybox'
|
const $fancyboxEle = GLOBAL_CONFIG.lightbox === 'fancybox'
|
||||||
const $fancyboxEle = isFancybox ? document.querySelectorAll('#article-container :not(a):not(.gallery-group) > img, #article-container > img') : null
|
? document.querySelectorAll('#article-container :not(a):not(.gallery-group) > img, #article-container > img')
|
||||||
|
: []
|
||||||
|
const fbLengthNoZero = $fancyboxEle.length > 0
|
||||||
const $jgEle = document.querySelectorAll('#article-container .justified-gallery')
|
const $jgEle = document.querySelectorAll('#article-container .justified-gallery')
|
||||||
const jgEleLength = $jgEle.length
|
const jgLengthNoZero = $jgEle.length > 0
|
||||||
|
|
||||||
if (jgEleLength || $fancyboxEle !== null) {
|
if (jgLengthNoZero || fbLengthNoZero) {
|
||||||
btf.isJqueryLoad(() => {
|
btf.isJqueryLoad(() => {
|
||||||
jgEleLength && runJustifiedGallery($jgEle)
|
jgLengthNoZero && runJustifiedGallery($jgEle)
|
||||||
isFancybox && addFancybox($fancyboxEle)
|
fbLengthNoZero && addFancybox($fancyboxEle)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user