diff --git a/layout/includes/additional-js.pug b/layout/includes/additional-js.pug index 3b3c52249..dec18e5a1 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 55bee14c2..94c05488b 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 00759a8a6..1204cdabf 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 e47aeeae7..1971c5ce6 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({