From f3e19073df012767b788e0345b97dd8e111bbce8 Mon Sep 17 00:00:00 2001 From: qinhua <352484005@qq.com> Date: Sun, 28 Nov 2021 10:45:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A5=E5=BF=97=E5=9D=97?= =?UTF-8?q?=E9=AB=98=E5=BA=A6=E8=AE=A1=E7=AE=97=E4=B8=8D=E5=87=86=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/js/joe.journals.js | 2 +- source/js/min/joe.journals.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/js/joe.journals.js b/source/js/joe.journals.js index 0ac423f..8f780af 100644 --- a/source/js/joe.journals.js +++ b/source/js/joe.journals.js @@ -150,7 +150,7 @@ const journalContext = { $allBlocks.each(function () { const $this = $(this); if ( - $this[0].getBoundingClientRect().height > + $this[0].getBoundingClientRect().height >= ThemeConfig.journal_block_height ) { $this.siblings(".journal_content_expander").show(); diff --git a/source/js/min/joe.journals.min.js b/source/js/min/joe.journals.min.js index da9a938..4a97377 100644 --- a/source/js/min/joe.journals.min.js +++ b/source/js/min/joe.journals.min.js @@ -1 +1 @@ -!function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var o=n();for(var t in o)("object"==typeof exports?exports:e)[t]=o[t]}}(self,(function(){return n={initEffect:function(){ThemeConfig.enable_journal_effect&&($(".joe_loading").remove(),$(".joe_journals__list").removeClass("hidden"),new WOW({boxClass:"wow",animateClass:ThemeConfig.journal_list_effect_class||"fadeIn",offset:0,mobile:!0,live:!0}).init())},initLike:function(){if(ThemeConfig.enable_like_journal){var e=$(".joe_journal__item");e.length&&e.each((function(e,n){var o=$(this),t=o.attr("data-cid"),a=+(o.attr("data-clikes")||0),i=localStorage.getItem(encryption("agree-journal"))?JSON.parse(decrypt(localStorage.getItem(encryption("agree-journal")))):[],r=o.find(".journal-like"),l=o.find(".journal-unlike"),c=o.find(".journal-likes-num");i.includes(t)?(r.hide(),l.show()):(r.show(),l.hide()),c.html(a),r.on("click",(function(){var e=!1;if(!e){e=!0;var n=(i=localStorage.getItem(encryption("agree-journal"))?JSON.parse(decrypt(localStorage.getItem(encryption("agree-journal")))):[]).includes(t);$.ajax({url:"/api/content/journals/"+t+"/likes",type:"POST",dataType:"json",data:{type:n?"disagree":"agree"},success:function(e){if(200===e.status){var o=a;if(n){o--;var s=i.findIndex((function(e){return e===t}));i.splice(s,1),r.show(),l.hide()}else o++,i.push(t),r.hide(),l.show();var f=encryption("agree-journal"),u=encryption(JSON.stringify(i));localStorage.setItem(f,u),c.html(o)}},error:function(n){return e=!1,Qmsg.warning(n.responseJSON.message)},complete:function(){e=!1}})}}))}))}},initComment:function(){!ThemeConfig.enable_clean_mode&&ThemeConfig.enable_comment_journal&&$(".journal_comment_expander,.journal-comment").on("click",(function(){var e=$(this).parents(".footer-wrap"),n=e.find("halo-comment")[0]._wrapper.$refs.inner;e.hasClass("open")||n.loadComments(),e.toggleClass("open"),e.find(".journal_comment_expander_txt").html((e.hasClass("open")?"收起":"查看")+"评论")}))},initExpander:function(){$(".journal_content_expander i").on("click",(function(){$(this).parents(".joe_journal_body").toggleClass("open")}))},foldBlock:function(){$(".joe_journal_body .content-wrp").each((function(){var e=$(this);e[0].getBoundingClientRect().height>ThemeConfig.journal_block_height&&e.siblings(".journal_content_expander").show()}))}},e=["foldBlock"],document.addEventListener("DOMContentLoaded",(function(){Object.keys(n).forEach((function(o){return!e.includes(o)&&n[o]()}))})),window.addEventListener("load",(function(){n.foldBlock()})),{};var e,n})); \ No newline at end of file +!function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var o=n();for(var t in o)("object"==typeof exports?exports:e)[t]=o[t]}}(self,(function(){return n={initEffect:function(){ThemeConfig.enable_journal_effect&&($(".joe_loading").remove(),$(".joe_journals__list").removeClass("hidden"),new WOW({boxClass:"wow",animateClass:ThemeConfig.journal_list_effect_class||"fadeIn",offset:0,mobile:!0,live:!0}).init())},initLike:function(){if(ThemeConfig.enable_like_journal){var e=$(".joe_journal__item");e.length&&e.each((function(e,n){var o=$(this),t=o.attr("data-cid"),a=+(o.attr("data-clikes")||0),i=localStorage.getItem(encryption("agree-journal"))?JSON.parse(decrypt(localStorage.getItem(encryption("agree-journal")))):[],r=o.find(".journal-like"),l=o.find(".journal-unlike"),c=o.find(".journal-likes-num");i.includes(t)?(r.hide(),l.show()):(r.show(),l.hide()),c.html(a),r.on("click",(function(){var e=!1;if(!e){e=!0;var n=(i=localStorage.getItem(encryption("agree-journal"))?JSON.parse(decrypt(localStorage.getItem(encryption("agree-journal")))):[]).includes(t);$.ajax({url:"/api/content/journals/"+t+"/likes",type:"POST",dataType:"json",data:{type:n?"disagree":"agree"},success:function(e){if(200===e.status){var o=a;if(n){o--;var s=i.findIndex((function(e){return e===t}));i.splice(s,1),r.show(),l.hide()}else o++,i.push(t),r.hide(),l.show();var f=encryption("agree-journal"),u=encryption(JSON.stringify(i));localStorage.setItem(f,u),c.html(o)}},error:function(n){return e=!1,Qmsg.warning(n.responseJSON.message)},complete:function(){e=!1}})}}))}))}},initComment:function(){!ThemeConfig.enable_clean_mode&&ThemeConfig.enable_comment_journal&&$(".journal_comment_expander,.journal-comment").on("click",(function(){var e=$(this).parents(".footer-wrap"),n=e.find("halo-comment")[0]._wrapper.$refs.inner;e.hasClass("open")||n.loadComments(),e.toggleClass("open"),e.find(".journal_comment_expander_txt").html((e.hasClass("open")?"收起":"查看")+"评论")}))},initExpander:function(){$(".journal_content_expander i").on("click",(function(){$(this).parents(".joe_journal_body").toggleClass("open")}))},foldBlock:function(){$(".joe_journal_body .content-wrp").each((function(){var e=$(this);e[0].getBoundingClientRect().height>=ThemeConfig.journal_block_height&&e.siblings(".journal_content_expander").show()}))}},e=["foldBlock"],document.addEventListener("DOMContentLoaded",(function(){Object.keys(n).forEach((function(o){return!e.includes(o)&&n[o]()}))})),window.addEventListener("load",(function(){n.foldBlock()})),{};var e,n})); \ No newline at end of file