From 995fc7cf9dfe7fe8efcbe54fda832c59c93bd86f Mon Sep 17 00:00:00 2001 From: Jerry Date: Sun, 22 Dec 2019 00:50:59 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E5=BE=A9=E7=95=B6valine=20backgr?= =?UTF-8?q?ound=20=E6=98=AF=E7=B5=95=E5=B0=8D=E5=9C=B0=E5=9D=80=E6=99=82?= =?UTF-8?q?=E7=84=A1=E6=B3=95=E9=A1=AF=E7=A4=BA=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layout/includes/additional-js.pug | 12 ++++++------ scripts/photo.js | 4 ---- source/css/_layout/comments.styl | 2 +- source/js/main.js | 2 +- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/layout/includes/additional-js.pug b/layout/includes/additional-js.pug index 3b3c522..dec18e5 100644 --- a/layout/includes/additional-js.pug +++ b/layout/includes/additional-js.pug @@ -1,3 +1,6 @@ +if theme.translate && theme.translate.enable + script(src=url_for(theme.CDN.translate)) + if (theme.medium_zoom && theme.medium_zoom.enable) script(src=url_for(theme.CDN.medium_zoom)) @@ -31,12 +34,6 @@ if theme.activate_power_mode.enable POWERMODE.shake = !{shake}; document.body.addEventListener('input', POWERMODE); -if theme.translate && theme.translate.enable - script(src=url_for(theme.CDN.translate)) - -if is_home() - include index-js.pug - if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv script(async src=url_for(theme.CDN.busuanzi)) @@ -52,3 +49,6 @@ if theme.click_heart && theme.click_heart.enable if theme.ClickShowText && theme.ClickShowText.enable script(src=url_for(theme.CDN.ClickShowText)) + +if is_home() + include index-js.pug \ No newline at end of file diff --git a/scripts/photo.js b/scripts/photo.js index 55bee14..94c0548 100644 --- a/scripts/photo.js +++ b/scripts/photo.js @@ -27,10 +27,6 @@ hexo.extend.filter.register('after_post_render', data => { } if (theme.medium_zoom.enable) { - images.each((i, o) => { - $(o).addClass('mediumZoom') - }) - var imgList = $(".justified-gallery img") if (imgList.length) { imgList.each((i, o) => { diff --git a/source/css/_layout/comments.styl b/source/css/_layout/comments.styl index 00759a8..1204cda 100644 --- a/source/css/_layout/comments.styl +++ b/source/css/_layout/comments.styl @@ -27,7 +27,7 @@ font-size: .7rem if hexo-config('valine.bg') - background: url(convert(hexo-config('valine.bg'))) 100% 100% no-repeat + background: url(hexo-config('valine.bg')) 100% 100% no-repeat .info display: none diff --git a/source/js/main.js b/source/js/main.js index e47aeea..1971c5c 100644 --- a/source/js/main.js +++ b/source/js/main.js @@ -258,7 +258,7 @@ $(function () { buttons: ['slideShow', 'fullScreen', 'thumbs', 'close'] }) } else if (isMediumZoom) { - const zoom = mediumZoom(document.querySelectorAll('.mediumZoom')) + const zoom = mediumZoom(document.querySelectorAll(':not(a)>img')) zoom.on('open', event => { const photoBg = $(document.documentElement).attr('data-theme') === 'dark' ? '#121212' : '#fff' zoom.update({