Compare commits

...

37 Commits
3.4.0 ... 3.4.2

Author SHA1 Message Date
Jerry
4a69c623fc fix: 修復開啟gitalk評論數後與toc衝突的bug close #462
fix: 修復jquery在一些介面仍然載入問題
fix: 修復medium zoom 報錯的 bug
2020-12-27 15:51:00 +08:00
Jerry
eb823b0a2d Merge branch 'dev' into master 2020-12-15 18:54:32 +08:00
Jerry
83299dfd2f fix: 修復tabs 標簽外挂設爲-1時,按鈕點擊沒反應的bugs 2020-12-15 18:52:58 +08:00
Jerry
8f412c90da Merge branch 'dev' into master 2020-12-13 17:02:32 +08:00
Jerry
6a1330de84 Merge branch 'dev' into master 2020-11-03 22:21:43 +08:00
Jerry
eb5a356a4e Merge branch 'dev' into master 2020-10-28 14:37:18 +08:00
Jerry
f4b07340f7 label: 3.2.0 2020-09-28 22:02:11 +08:00
Jerry Wong
17d8062968 Merge pull request #360 from jerryc127/revert-358-customized-chang
Revert "Add a flag for allowing to disable aside.card_author.button"
2020-09-12 02:41:46 +08:00
Jerry Wong
d4b69051aa Revert "Add a flag for allowing to disable aside.card_author.button" 2020-09-12 02:41:12 +08:00
Jerry Wong
59f6ce63e3 Merge pull request #358 from gcmiao/customized-chang
Add a flag for allowing to disable aside.card_author.button
2020-09-11 19:02:33 +08:00
gcmiao
cd78f639dd Add a flag for allowing to disable aside.card_author.button 2020-09-10 21:09:23 +02:00
Jerry
8e4c20f6d4 label: 更新 3.1.1
chore: update hexo-renderer-stylus to 2.0.1
2020-09-06 22:13:37 +08:00
Jerry
e984efa35c fix: 修復開啟 prismjs 後, 在低版本的 safari 會出現 js 報錯的 Bugs 2020-09-06 22:11:59 +08:00
Jerry
863cf1e780 Merge branch 'dev' into master 2020-09-04 00:42:50 +08:00
Jerry
85b8a83371 Merge branch 'dev' into master 2020-08-31 13:41:47 +08:00
Jerry
d73960f2a2 Merge branch 'dev' into master 2020-08-11 21:20:01 +08:00
Jerry
fcd430902d Merge branch 'dev' into master 2020-08-05 22:04:47 +08:00
Jerry
ee45f6517f Merge branch 'dev' into master 2020-08-02 23:31:32 +08:00
Jerry
67201ac58d 📝 更改注釋文字 2020-08-01 22:47:34 +08:00
Jerry
315d3b50df Merge branch 'dev' into master 2020-08-01 14:44:06 +08:00
Jerry
727a2d97d9 🐛 修復子目錄下,404頁面的‘回到首頁’鏈接錯誤的bugs 2020-07-18 23:30:37 +08:00
Jerry
54b67987c1 Merge branch 'dev' 2020-06-24 00:52:33 +08:00
Jerry
26df41c772 Merge branch 'dev' 2020-06-20 22:10:55 +08:00
Jerry
4e7051ad77 Merge branch 'dev' 2020-06-20 14:01:45 +08:00
Jerry
955b4bae6a Merge branch 'dev' 2020-06-18 20:13:59 +08:00
Jerry
95ddf28f3b Merge branch 'dev' 2020-06-16 21:19:47 +08:00
Jerry
e901f9ad35 Merge branch 'dev' 2020-06-16 18:43:13 +08:00
Jerry
462422e279 Merge branch 'dev' 2020-05-21 16:29:44 +08:00
Jerry
bad24849bd Merge branch 'dev' 2020-05-01 19:00:12 +08:00
Jerry
eb242f0809 Merge branch 'dev' 2020-04-30 00:36:07 +08:00
Jerry
b1795e3def Merge branch 'dev' 2020-04-28 15:35:58 +08:00
Jerry
54b212ead3 Merge branch 'dev' 2020-04-27 14:45:26 +08:00
Jerry
4bbc035f54 Merge branch 'dev' 2020-04-27 02:40:24 +08:00
Jerry
40ba3bb92f 🏷️ 更新2.3.0 2020-04-26 23:42:52 +08:00
Jerry
e2cb0242bb 🏷️ 2.3.0發佈 2020-04-26 23:37:37 +08:00
Jerry
559afab632 🔖 2.2.5發佈
更新内容請看 https://github.com/jerryc127/hexo-theme-butterfly/releases
2020-03-28 03:20:36 +08:00
Jerry
c134d4fc86 🐛 fix: 修復highlight_shrink設為false時,導致script報錯的bug
🐛 fix: 修復highlight_shrink設為true時,按鈕點擊無反應,沒有打開代碼框的bug
🐛 fix: 修復自動切換darkmode時,切換按鈕icon沒有變更的bug
2020-03-24 19:03:51 +08:00
6 changed files with 45 additions and 43 deletions

View File

@@ -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')

View File

@@ -23,11 +23,11 @@ script.
const loadTwikoo = (bool = false) => { const loadTwikoo = (bool = false) => {
if (typeof twikoo === 'object') { if (typeof twikoo === 'object') {
init() init()
bool && $countDom && setTimeout(()=>{getCount()},0) bool && $countDom && setTimeout(getCount,0)
} else { } else {
getScript('!{theme.CDN.twikoo}').then(()=> { getScript('!{theme.CDN.twikoo}').then(()=> {
init() init()
bool && $countDom && setTimeout(()=>{getCount()},0) bool && $countDom && setTimeout(getCount,0)
}) })
} }
} }

View File

@@ -41,7 +41,7 @@ script.
if ('!{theme.comments.use[0]}' === 'Valine' || !!{theme.comments.lazyload}) { if ('!{theme.comments.use[0]}' === 'Valine' || !!{theme.comments.lazyload}) {
if (!{theme.comments.lazyload}) btf.loadComment(document.querySelector('#vcomment'),loadValine) if (!{theme.comments.lazyload}) btf.loadComment(document.querySelector('#vcomment'),loadValine)
else setTimeout(() => loadValine(), 0) else setTimeout(loadValine, 0)
} else { } else {
function loadOtherComment () { function loadOtherComment () {
loadValine() loadValine()

View File

@@ -1,6 +1,6 @@
{ {
"name": "hexo-theme-butterfly", "name": "hexo-theme-butterfly",
"version": "3.4.0", "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": {

View File

@@ -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)
}) })
} }
} }
@@ -471,7 +471,7 @@ document.addEventListener('DOMContentLoaded', function () {
const currentActive = $tocLink[currentIndex] const currentActive = $tocLink[currentIndex]
currentActive.classList.add('active') currentActive.classList.add('active')
setTimeout(function () { setTimeout(() => {
autoScrollToc(currentActive) autoScrollToc(currentActive)
}, 0) }, 0)
@@ -626,7 +626,7 @@ document.addEventListener('DOMContentLoaded', function () {
*/ */
const addRuntime = () => { const addRuntime = () => {
const $runtimeCount = document.getElementById('runtimeshow') const $runtimeCount = document.getElementById('runtimeshow')
if ($runtimeCount !== null) { if ($runtimeCount) {
const publishDate = $runtimeCount.getAttribute('data-publishDate') const publishDate = $runtimeCount.getAttribute('data-publishDate')
$runtimeCount.innerText = btf.diffDate(publishDate) + ' ' + GLOBAL_CONFIG.runtime $runtimeCount.innerText = btf.diffDate(publishDate) + ' ' + GLOBAL_CONFIG.runtime
} }
@@ -637,7 +637,7 @@ document.addEventListener('DOMContentLoaded', function () {
*/ */
const addLastPushDate = () => { const addLastPushDate = () => {
const $lastPushDateItem = document.getElementById('last-push-date') const $lastPushDateItem = document.getElementById('last-push-date')
if ($lastPushDateItem !== null) { if ($lastPushDateItem) {
const lastPushDate = $lastPushDateItem.getAttribute('data-lastPushDate') const lastPushDate = $lastPushDateItem.getAttribute('data-lastPushDate')
$lastPushDateItem.innerText = btf.diffDate(lastPushDate, true) $lastPushDateItem.innerText = btf.diffDate(lastPushDate, true)
} }
@@ -685,7 +685,8 @@ document.addEventListener('DOMContentLoaded', function () {
if (!$tabItem.classList.contains('active')) { if (!$tabItem.classList.contains('active')) {
const $tabContent = $tabItem.parentNode.nextElementSibling const $tabContent = $tabItem.parentNode.nextElementSibling
btf.siblings($tabItem, '.active')[0].classList.remove('active') const $siblings = btf.siblings($tabItem, '.active')[0]
$siblings && $siblings.classList.remove('active')
$tabItem.classList.add('active') $tabItem.classList.add('active')
const tabId = $this.getAttribute('data-href').replace('#', '') const tabId = $this.getAttribute('data-href').replace('#', '')
const childList = [...$tabContent.children] const childList = [...$tabContent.children]
@@ -712,7 +713,7 @@ document.addEventListener('DOMContentLoaded', function () {
const toggleCardCategory = function () { const toggleCardCategory = function () {
const $cardCategory = document.querySelectorAll('#aside-cat-list .card-category-list-item.parent i') const $cardCategory = document.querySelectorAll('#aside-cat-list .card-category-list-item.parent i')
if ($cardCategory.length > 0) { if ($cardCategory.length) {
$cardCategory.forEach(function (item) { $cardCategory.forEach(function (item) {
item.addEventListener('click', function (e) { item.addEventListener('click', function (e) {
e.preventDefault() e.preventDefault()

View File

@@ -88,8 +88,9 @@ document.addEventListener('DOMContentLoaded', function () {
translateButtonObject = document.getElementById('translateLink') translateButtonObject = document.getElementById('translateLink')
if (translateButtonObject) { if (translateButtonObject) {
if (currentEncoding !== targetEncoding) { if (currentEncoding !== targetEncoding) {
setTimeout(function () { translateBody() }, translateDelay) setTimeout(translateBody, translateDelay)
if (targetEncoding === 1) { translateButtonObject.innerHTML = msgToSimplifiedChinese } else translateButtonObject.innerHTML = msgToTraditionalChinese if (targetEncoding === 1) translateButtonObject.innerHTML = msgToSimplifiedChinese
else translateButtonObject.innerHTML = msgToTraditionalChinese
} }
translateButtonObject.addEventListener('click', translatePage, false) translateButtonObject.addEventListener('click', translatePage, false)
} }