diff --git a/languages/en.yml b/languages/en.yml index b0e0d14127f91717d44ec12d95457d72657bcded..0f1fc40465a385d66add8ec7c51d12af0b3cc646 100644 --- a/languages/en.yml +++ b/languages/en.yml @@ -62,15 +62,20 @@ post: author: Author link: Link license_title: Copyright - license_content: 'All articles in this blog are licensed under - %s unless stating additionally' + license_content: All articles in this blog are licensed under + %s unless stating additionally -# Search +# Algolia search algolia_search: input_placeholder: Search for Posts hits_empty: "We didn't find any results for the search: ${query}" hits_stats: "${hits} results found in ${time} ms" +# Local search +local_search: + input_placeholder: Start to search + hits_empty: We didn't find any results for the search + # Reward reward: btn_text: Buy me a coffee @@ -87,7 +92,7 @@ back2top: Back to top # Site footer footer: - powered: 'Powered by %s' + powered: Powered by %s theme: Theme uv: Visitors pv: Views diff --git a/languages/zh-CN.yml b/languages/zh-CN.yml index 596aa1c56d03f1f11e7b6ee9148314ce80e5a464..2018eb7d06473115fa5643cbe18ca6e5cbef330a 100644 --- a/languages/zh-CN.yml +++ b/languages/zh-CN.yml @@ -56,14 +56,14 @@ post: read_more: 阅读全文 fire: 热度 sticky: 置顶文章 - untitled: ( 文章未命名 ) + untitled: ( 文章无标题 ) end: 本文结束,感谢您的阅读 copyright: author: 本文作者 link: 本文链接 license_title: 版权声明 - license_content: '本博客所有文章除特别声明外,均采用 - %s 许可协议。转载请注明出处!' + license_content: 本博客所有文章除特别声明外,均采用 + %s 许可协议。转载请注明出处! # Algolia 搜索 algolia_search: @@ -71,6 +71,11 @@ algolia_search: hits_empty: "没有找到任何搜索结果:${query}" hits_stats: "找到 ${hits} 条搜索结果,耗时 ${time} 毫秒" +# 本地搜索 +local_search: + input_placeholder: 开始搜索 + hits_empty: 没有找到任何搜索结果 + # 打赏 reward: btn_text: 请我喝杯咖啡~ @@ -87,7 +92,7 @@ back2top: 回到顶部 # 网站底部 footer: - powered: '由 %s 强力驱动' + powered: 由 %s 强力驱动 theme: 主题 uv: 访问人数 pv: 浏览总量 diff --git a/layout/_third-party/advertising/google_adsense.pug b/layout/_third-party/advertising/google-adsense.pug similarity index 100% rename from layout/_third-party/advertising/google_adsense.pug rename to layout/_third-party/advertising/google-adsense.pug diff --git a/layout/_third-party/advertising/index.pug b/layout/_third-party/advertising/index.pug index 358f14521b57b780eadaee92c41dcb0e3354b472..a7e88cabfbb4293a489375fb13e60302ca4d609d 100644 --- a/layout/_third-party/advertising/index.pug +++ b/layout/_third-party/advertising/index.pug @@ -1,2 +1,2 @@ if theme.google_adsense && theme.google_adsense.enable - include ./google_adsense.pug + include ./google-adsense.pug diff --git a/source/js/algolia-search.js b/source/js/algolia-search.js index 7c4d4c5d36559ad326445115d28e30ff420d6ae7..4b4208b53ea2e407dd14fa20b995a59730d0b9b8 100644 --- a/source/js/algolia-search.js +++ b/source/js/algolia-search.js @@ -1,5 +1,7 @@ $(document).ready(function () { - $('.header-nav-search').on('click', function () { + $('.header-nav-search').on('click', function (e) { + e.stopPropagation(); + $('body').css('overflow', 'hidden'); $('.algolia-popup') .velocity('stop') @@ -20,9 +22,7 @@ $(document).ready(function () { closeSearch(); }); - $(document).on('keydown', function (ev) { - var e = ev || window.event; - + $(document).on('keydown', function (e) { // Escape <=> 27 if (e.keyCode === Stun.utils.codeToKeyCode('Escape')) { closeSearch(); diff --git a/source/js/header.js b/source/js/header.js index c65b2a65088b3cb0c7bda0589af03bb1edf805e1..c2737b1e3d80c8c0bad95a2452736542e3a2f8e7 100644 --- a/source/js/header.js +++ b/source/js/header.js @@ -5,8 +5,7 @@ $(document).ready(function () { $menu.removeClass('show'); }); - $('.header-nav-menu a').on('click', function (ev) { - var e = ev || window.event; + $('.header-nav-menu a').on('click', function (e) { e.stopPropagation(); }); diff --git a/source/js/scroll.js b/source/js/scroll.js index 15802766f58b440f4d36e75cbd7b448dfb756a00..15ce68fa884ffee599be2077cd6f3300a615e7d2 100644 --- a/source/js/scroll.js +++ b/source/js/scroll.js @@ -17,9 +17,7 @@ $(document).ready(function () { }); // Click the post toc. - $('.toc-link').on('click', function (ev) { - var e = ev || window.event; - + $('.toc-link').on('click', function (e) { e.preventDefault(); scrollHeadingToTop($(this).attr('href')); }); diff --git a/source/js/utils.js b/source/js/utils.js index 9bba7bd2a71e3e1ccebdb871a72f163a8ab9064d..f3b41e1ed42d4ecd174e5e2a489fb0dd3f79aa23 100644 --- a/source/js/utils.js +++ b/source/js/utils.js @@ -74,7 +74,8 @@ Stun.utils = Stun.$u = { var codes = { ArrowLeft: 37, ArrowRight: 39, - Escape: 27 + Escape: 27, + Enter: 13 }; return codes[code]; @@ -264,8 +265,7 @@ Stun.utils = Stun.$u = { registerSwitchPost: function () { var _this = this; - $(document).on('keydown', function (ev) { - var e = ev || window.event; + $(document).on('keydown', function (e) { var isPrev = e.keyCode === _this.codeToKeyCode('ArrowLeft'); var isNext = e.keyCode === _this.codeToKeyCode('ArrowRight'); @@ -315,8 +315,7 @@ Stun.utils = Stun.$u = { closeZoom(); }); - $('.zoom-image').on('click', function (ev) { - var e = ev || window.event; + $('.zoom-image').on('click', function (e) { e.stopPropagation(); isZoom = true;