From 85c6b92ffe69e1852665d6d465504772c238b8d4 Mon Sep 17 00:00:00 2001 From: esofar Date: Fri, 2 Oct 2020 11:20:40 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=E4=BA=AE=E8=89=B2?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E6=95=88=E6=9E=9C=E6=97=A0=E6=B3=95=E9=9A=90?= =?UTF-8?q?=E8=97=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/silence.min.js | 2 +- src/modules/loader/index.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/silence.min.js b/dist/silence.min.js index 744b796..e3fb199 100644 --- a/dist/silence.min.js +++ b/dist/silence.min.js @@ -1 +1 @@ -!function(t){var e={};function a(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,a),s.l=!0,s.exports}a.m=t,a.c=e,a.d=function(t,e,n){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)a.d(n,s,function(e){return t[e]}.bind(null,s));return n},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="",a(a.s=14)}([function(t,e,a){},function(t,e,a){},function(t,e,a){},function(t,e,a){},function(t,e,a){},function(t,e,a){},function(t,e,a){},function(t,e,a){},function(t,e,a){},function(t,e,a){},function(t,e,a){},function(t,e,a){},function(t,e,a){},function(t,e,a){},function(t,e,a){"use strict";a.r(e);a(0);var n={version:"3.0.0",avatar:null,favicon:null,github:null,defaultMode:"auto",defaultTheme:"a",navbars:[],showNavAdmin:!0,catalog:{enable:!1,index:!0,active:!1,levels:["h2","h3","h4"]},signature:{enable:!0,author:null,license:["署名-非商业性使用-相同方式共享 4.0 国际","https://creativecommons.org/licenses/by-nc-sa/4.0/"],remark:null},sponsor:{enable:!1,text:"Buy me a cup of coffee ☕.",paypal:null,wechat:null,alipay:null}};function s(){return $("#topics").length>0}a(1);var i=function(){var t=n.github;t&&$("body").append(`\n \n `)};a(2);var l=function(){const t=n.navbars,e=$("#navList");t&&t.length&&(t.reverse().forEach(t=>{if(t.target=t.target||"_self",t.chilren&&t.chilren.length){var a=t.chilren.map((function(t){return t.target=t.target||"_self",`
  • ${t.title}
  • `}));e.find("li").eq(1).after(`\n
  • \n ${t.title}\n \n \n
      ${a.join("")}
    \n
  • `)}else e.find("li").eq(1).after(`
  • ${t.title}
  • `)}),$("li.esa-has-subnavs").hover((function(){$(this).find("svg").addClass("open"),$(this).find(".esa-sub-navs").fadeIn("fast")}),(function(){$(this).find("svg").removeClass("open"),$(this).find(".esa-sub-navs").hide()}))),$.each(e.children("li"),(t,e)=>{$(e).children("a").length?$(e).append(""):$(e).remove()}),$("#header").prepend('
    '),$(".esa-mobile-menu").on("click",()=>{$("#navigator").fadeToggle()}),n.showNavAdmin||$("#blog_nav_admin").parent().remove()};a(3);var o=function(){$("#footer").append(`& Theme Silence v${n.version}`)};a(4);var r=function(){const t=n.avatar,e=n.favicon;t&&$("#sideBarMain").prepend(``),e&&$("#favicon").attr("href",e)};a(5);var c=function(){const t=n.catalog;if(t.enable){const e=t.levels,a=e[0],n=e[1],s=e[2];let i=$("#cnblogs_post_body").find(e.join(","));if(!i.length)return!1;$("body").append(`
    `);let l=0,o=0,r=0,c="",$(".esa-contents").append(c)}};a(6);const d="https://unpkg.com/lightbox2@2.11.1/dist/css/lightbox.min.css",h="https://unpkg.com/lightbox2@2.11.1/dist/js/lightbox.min.js";var u=function(){$("head").append(``),$.getScript(h,()=>{$("#cnblogs_post_body").find("img").wrap((function(){return``})),$(".code_img_closed, .code_img_opened, .cnblogs_code_copy img").unwrap()})};a(7);var p=function(){let t=$(".postBody .cnblogs-markdown").find("pre code");if(!t.length)return!1;$.each(t,(t,e)=>{if(!$(e).hasClass("hljsln")){var a=$(e).html();a=function(t){var e=t.replace(/]*>|<\/span>/g,"");/\r|\n$/.test(e)&&(t+='');var a=1;return t=''+(t=''+(t=t.replace(/\r\n|\r|\n/g,(function(t){return t+''}))))}(a),$(e).html(a).addClass("hljsln");var n=$("span[data-num]:last");n.html()||n.remove()}})};a(8);var f=function(){const t=n.signature;if(t.enable){const e=$("#cb_post_title_url").attr("href"),a=`
    \n

    作者:${t.author||$("#profile_block a").eq(0).html()||"(*^_^*)"}

    \n

    出处:${e}

    \n

    版权:本作品采用「${t.license[0]}」许可协议进行许可。

    \n

    ${t.remark||""}

    \n
    `;$("#MySignature").html(a).show()}};a(9),a(10);function v(t){$("body").prepend(`
    ${t}
    `);let e=$(".esa-layer");e.slideDown(200),setTimeout(()=>{e.remove()},2e3)}var g=function(){const t=n.sponsor;if(!t.enable)return!1;$("#blog_post_info").prepend(`\n
    \n
    ${t.text}
    \n
      \n
    • \n
    • \n
    • \n
    \n
    \n \n
    \n
    `);var e=$(".esa-sponsor");e.find(".box li").hover((function(){const a=$(this).attr("class");if("paypal"==a&&!t.paypal)return v("未设置 PayPal 收款二维码");if("alipay"==a&&!t.alipay)return v("未设置支付宝收款二维码");if("wechat"==a&&!t.wechat)return v("未设置微信收款二维码");var n=null;switch(a){case"paypal":n=t.paypal;break;case"alipay":n=t.alipay;break;case"wechat":n=t.wechat}e.find(".qrshow").html(``).show()}),(function(){e.find(".qrshow").hide()}))};a(11);var m=function(){const t=".feedbackItem > .feedbackCon > .blog_comment_body",e=()=>{$(t).before("
    ");let e=$(".feedbackItem > .feedbackCon");$.each(e,(function(t,e){let a=null,n=$(e).find('span[id$="avatar"]');n.length&&(a=$.trim($(n).text())),$(e).find(".esa-comment-avatar img").attr("src",a||"https://pic.cnblogs.com/face/sample_face.gif");const s=$(e).parent().find(".comment_date").next().attr("href");$(e).find(".esa-comment-avatar a").attr("href",$.trim(s))}))};if($(t).length)e();else{let a=1,n=setInterval(()=>{$(t).length&&(clearInterval(n),e()),10==a&&clearInterval(n),a++},500)}};a(12);var b=function(){$("body").append('
    \n
    \n \n \n \n
    \n
    \n
    主题色彩
    \n
    \n \n \n \n \n \n \n \n \n \n \n
    \n
    \n
    \n
    \n ');const t=s()&&n.catalog.enable;t&&$(".esa-toolbar").append('');const e="silence-mode-"+currentBlogApp,a="silence-theme-"+currentBlogApp,i=(new Date).getHours(),l=sessionStorage.getItem(a)||n.defaultTheme,o=sessionStorage.getItem(e)||("auto"==n.defaultMode?i>=6&&i<18?"light":"dark":n.defaultMode);$("html").attr("mode",o),$("html").attr("theme",l);const r=$(".esa-toolbar"),c=$(".skin-popup");let d=!1;r.find(".bars").click((function(){d?(r.find(".bars").removeClass("bars-show"),r.find(".up").removeClass("up-show"),r.find(".mode").removeClass("mode-show"),r.find(".skin").removeClass("skin-show"),t&&r.find(".contents").removeClass("contents-show")):(r.find(".bars").addClass("bars-show"),r.find(".up").addClass("up-show"),r.find(".mode").addClass("mode-show"),r.find(".skin").addClass("skin-show"),t&&r.find(".contents").addClass("contents-show")),d=!d})),r.find(".up").click(()=>{$("html, body").animate({scrollTop:0},450)}),r.find(".mode").click(()=>{const t="light"==$("html").attr("mode")?"dark":"light";sessionStorage.setItem(e,t),$("html").attr("mode",t)}),r.find(".skin").click(()=>{c.slideToggle()}),c.find(".themes button").click((function(){const t=$(this).data("theme");sessionStorage.setItem(a,t),$("html").attr("theme",t)})),r.find(".contents").click(()=>{$(".esa-contents").toggleClass((function(){return $(this).hasClass("active")?($(this).removeClass("active"),"noactive"):($(this).removeClass("noactive"),"active")}))})};a(13);const w={show:()=>{$(".esa-loader, .dark-loading").show()},hide:()=>{$(".esa-loader, .dark-loading").fadeOut()}};var y=w;new class{constructor(){this.init()}init(){const t=window.$silence;t&&$.extend(!0,n,t),this.building()}building(){l(),o(),i(),r(),b(),s()?(c(),u(),p(),f(),g(),m()):($(".forFlow").css({marginLeft:"260px"}),$("#sideBar").show()),y.hide()}}}]); \ No newline at end of file +!function(t){var a={};function e(n){if(a[n])return a[n].exports;var s=a[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,e),s.l=!0,s.exports}e.m=t,e.c=a,e.d=function(t,a,n){e.o(t,a)||Object.defineProperty(t,a,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,a){if(1&a&&(t=e(t)),8&a)return t;if(4&a&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&a&&"string"!=typeof t)for(var s in t)e.d(n,s,function(a){return t[a]}.bind(null,s));return n},e.n=function(t){var a=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(a,"a",a),a},e.o=function(t,a){return Object.prototype.hasOwnProperty.call(t,a)},e.p="",e(e.s=14)}([function(t,a,e){},function(t,a,e){},function(t,a,e){},function(t,a,e){},function(t,a,e){},function(t,a,e){},function(t,a,e){},function(t,a,e){},function(t,a,e){},function(t,a,e){},function(t,a,e){},function(t,a,e){},function(t,a,e){},function(t,a,e){},function(t,a,e){"use strict";e.r(a);e(0);var n={version:"3.0.0",avatar:null,favicon:null,github:null,defaultMode:"auto",defaultTheme:"a",navbars:[],showNavAdmin:!0,catalog:{enable:!1,index:!0,active:!1,levels:["h2","h3","h4"]},signature:{enable:!0,author:null,license:["署名-非商业性使用-相同方式共享 4.0 国际","https://creativecommons.org/licenses/by-nc-sa/4.0/"],remark:null},sponsor:{enable:!1,text:"Buy me a cup of coffee ☕.",paypal:null,wechat:null,alipay:null}};function s(){return $("#topics").length>0}e(1);var i=function(){var t=n.github;t&&$("body").append(`\n \n `)};e(2);var l=function(){const t=n.navbars,a=$("#navList");t&&t.length&&(t.reverse().forEach(t=>{if(t.target=t.target||"_self",t.chilren&&t.chilren.length){var e=t.chilren.map((function(t){return t.target=t.target||"_self",`
  • ${t.title}
  • `}));a.find("li").eq(1).after(`\n
  • \n ${t.title}\n \n \n
      ${e.join("")}
    \n
  • `)}else a.find("li").eq(1).after(`
  • ${t.title}
  • `)}),$("li.esa-has-subnavs").hover((function(){$(this).find("svg").addClass("open"),$(this).find(".esa-sub-navs").fadeIn("fast")}),(function(){$(this).find("svg").removeClass("open"),$(this).find(".esa-sub-navs").hide()}))),$.each(a.children("li"),(t,a)=>{$(a).children("a").length?$(a).append(""):$(a).remove()}),$("#header").prepend('
    '),$(".esa-mobile-menu").on("click",()=>{$("#navigator").fadeToggle()}),n.showNavAdmin||$("#blog_nav_admin").parent().remove()};e(3);var o=function(){$("#footer").append(`& Theme Silence v${n.version}`)};e(4);var c=function(){const t=n.avatar,a=n.favicon;t&&$("#sideBarMain").prepend(``),a&&$("#favicon").attr("href",a)};e(5);var r=function(){const t=n.catalog;if(t.enable){const a=t.levels,e=a[0],n=a[1],s=a[2];let i=$("#cnblogs_post_body").find(a.join(","));if(!i.length)return!1;$("body").append(`
    `);let l=0,o=0,c=0,r="",$(".esa-contents").append(r)}};e(6);const d="https://unpkg.com/lightbox2@2.11.1/dist/css/lightbox.min.css",h="https://unpkg.com/lightbox2@2.11.1/dist/js/lightbox.min.js";var u=function(){$("head").append(``),$.getScript(h,()=>{$("#cnblogs_post_body").find("img").wrap((function(){return``})),$(".code_img_closed, .code_img_opened, .cnblogs_code_copy img").unwrap()})};e(7);var p=function(){let t=$(".postBody .cnblogs-markdown").find("pre code");if(!t.length)return!1;$.each(t,(t,a)=>{if(!$(a).hasClass("hljsln")){var e=$(a).html();e=function(t){var a=t.replace(/]*>|<\/span>/g,"");/\r|\n$/.test(a)&&(t+='');var e=1;return t=''+(t=''+(t=t.replace(/\r\n|\r|\n/g,(function(t){return t+''}))))}(e),$(a).html(e).addClass("hljsln");var n=$("span[data-num]:last");n.html()||n.remove()}})};e(8);var f=function(){const t=n.signature;if(t.enable){const a=$("#cb_post_title_url").attr("href"),e=`
    \n

    作者:${t.author||$("#profile_block a").eq(0).html()||"(*^_^*)"}

    \n

    出处:${a}

    \n

    版权:本作品采用「${t.license[0]}」许可协议进行许可。

    \n

    ${t.remark||""}

    \n
    `;$("#MySignature").html(e).show()}};e(9),e(10);function v(t){$("body").prepend(`
    ${t}
    `);let a=$(".esa-layer");a.slideDown(200),setTimeout(()=>{a.remove()},2e3)}var g=function(){const t=n.sponsor;if(!t.enable)return!1;$("#blog_post_info").prepend(`\n
    \n
    ${t.text}
    \n
      \n
    • \n
    • \n
    • \n
    \n
    \n \n
    \n
    `);var a=$(".esa-sponsor");a.find(".box li").hover((function(){const e=$(this).attr("class");if("paypal"==e&&!t.paypal)return v("未设置 PayPal 收款二维码");if("alipay"==e&&!t.alipay)return v("未设置支付宝收款二维码");if("wechat"==e&&!t.wechat)return v("未设置微信收款二维码");var n=null;switch(e){case"paypal":n=t.paypal;break;case"alipay":n=t.alipay;break;case"wechat":n=t.wechat}a.find(".qrshow").html(``).show()}),(function(){a.find(".qrshow").hide()}))};e(11);var m=function(){const t=".feedbackItem > .feedbackCon > .blog_comment_body",a=()=>{$(t).before("
    ");let a=$(".feedbackItem > .feedbackCon");$.each(a,(function(t,a){let e=null,n=$(a).find('span[id$="avatar"]');n.length&&(e=$.trim($(n).text())),$(a).find(".esa-comment-avatar img").attr("src",e||"https://pic.cnblogs.com/face/sample_face.gif");const s=$(a).parent().find(".comment_date").next().attr("href");$(a).find(".esa-comment-avatar a").attr("href",$.trim(s))}))};if($(t).length)a();else{let e=1,n=setInterval(()=>{$(t).length&&(clearInterval(n),a()),10==e&&clearInterval(n),e++},500)}};e(12);var b=function(){$("body").append('
    \n
    \n \n \n \n
    \n
    \n
    主题色彩
    \n
    \n \n \n \n \n \n \n \n \n \n \n
    \n
    \n
    \n
    \n ');const t=s()&&n.catalog.enable;t&&$(".esa-toolbar").append('');const a="silence-mode-"+currentBlogApp,e="silence-theme-"+currentBlogApp,i=(new Date).getHours(),l=sessionStorage.getItem(e)||n.defaultTheme,o=sessionStorage.getItem(a)||("auto"==n.defaultMode?i>=6&&i<18?"light":"dark":n.defaultMode);$("html").attr("mode",o),$("html").attr("theme",l);const c=$(".esa-toolbar"),r=$(".skin-popup");let d=!1;c.find(".bars").click((function(){d?(c.find(".bars").removeClass("bars-show"),c.find(".up").removeClass("up-show"),c.find(".mode").removeClass("mode-show"),c.find(".skin").removeClass("skin-show"),t&&c.find(".contents").removeClass("contents-show")):(c.find(".bars").addClass("bars-show"),c.find(".up").addClass("up-show"),c.find(".mode").addClass("mode-show"),c.find(".skin").addClass("skin-show"),t&&c.find(".contents").addClass("contents-show")),d=!d})),c.find(".up").click(()=>{$("html, body").animate({scrollTop:0},450)}),c.find(".mode").click(()=>{const t="light"==$("html").attr("mode")?"dark":"light";sessionStorage.setItem(a,t),$("html").attr("mode",t)}),c.find(".skin").click(()=>{r.slideToggle()}),r.find(".themes button").click((function(){const t=$(this).data("theme");sessionStorage.setItem(e,t),$("html").attr("theme",t)})),c.find(".contents").click(()=>{$(".esa-contents").toggleClass((function(){return $(this).hasClass("active")?($(this).removeClass("active"),"noactive"):($(this).removeClass("noactive"),"active")}))})};e(13);const w={show:()=>{$(".light-loading, .dark-loading").show()},hide:()=>{$(".light-loading, .dark-loading").fadeOut()}};var y=w;new class{constructor(){this.init()}init(){const t=window.$silence;t&&$.extend(!0,n,t),this.building()}building(){l(),o(),i(),c(),b(),s()?(r(),u(),p(),f(),g(),m()):($(".forFlow").css({marginLeft:"260px"}),$("#sideBar").show()),y.hide()}}}]); \ No newline at end of file diff --git a/src/modules/loader/index.js b/src/modules/loader/index.js index 6218192..8aeee97 100644 --- a/src/modules/loader/index.js +++ b/src/modules/loader/index.js @@ -4,11 +4,11 @@ const loader = { } loader.show = () => { - $('.esa-loader, .dark-loading').show(); + $('.light-loading, .dark-loading').show(); } loader.hide = () => { - $('.esa-loader, .dark-loading').fadeOut(); + $('.light-loading, .dark-loading').fadeOut(); } export default loader; \ No newline at end of file