Version Description
Download this release
Release Info
Developer | AdvancedCoding |
Plugin | Comments – wpDiscuz |
Version | 7.3.3 |
Comparing to | |
See all releases |
Code changes from version 7.3.2 to 7.3.3
- assets/js/wpdiscuz-combo.min.js +1 -1
- assets/js/wpdiscuz.js +3 -2
- assets/js/wpdiscuz.min.js +1 -1
- class.WpdiscuzCore.php +3 -4
- forms/wpdFormAttr/Login/SocialLogin.php +1 -1
- readme.txt +16 -7
- utils/class.WpdiscuzCache.php +7 -0
assets/js/wpdiscuz-combo.min.js
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
/* Autogrow */
|
8 |
jQuery.fn.autoGrow=function(){return this.each(function(){var createMirror=function(textarea){jQuery(textarea).after('<div class="autogrow-textarea-mirror"></div>');return jQuery(textarea).next(".autogrow-textarea-mirror")[0]};var sendContentToMirror=function(textarea){mirror.innerHTML=String(textarea.value).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\n/g,"<br />")+".<br/>.";if(jQuery(textarea).height()!=jQuery(mirror).height())jQuery(textarea).height(jQuery(mirror).height())};var growTextarea=function(){sendContentToMirror(this)};var mirror=createMirror(this);mirror.style.display="none";mirror.style.wordWrap="break-word";mirror.style.padding=jQuery(this).css("padding");mirror.style.width=jQuery(this).css("width");mirror.style.fontFamily=jQuery(this).css("font-family");mirror.style.fontSize=jQuery(this).css("font-size");mirror.style.lineHeight=jQuery(this).css("line-height");this.style.overflow="hidden";this.style.minHeight=this.rows+"em";this.onkeydown=growTextarea;sendContentToMirror(this)})};
|
9 |
/* wpDiscuz */
|
10 |
-
var wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor);if(wpdiscuzLoadRichEditor)var wpDiscuzEditor=new WpdEditor;function wpdMessagesOnInit(e,t){wpdiscuzAjaxObj.setCommentMessage(e,t),setTimeout(function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)},3e3)}wpdiscuzAjaxObj.setCommentMessage=function(e,t,a){var o="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?o="wpdiscuz-message-success":"warning"===t[n]&&(o="wpdiscuz-message-warning"):"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(a instanceof Array?a[n]:a||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e).prependTo("#wpdiscuz-comment-message").delay(a||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},wpdiscuzAjaxObj.applyFilterOnPhrase=function(e,t,a){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,function(o){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]]&&(e=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]](e,t,a))}),e},jQuery(document).ready(function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType),s=parseInt(wpdiscuzAjaxObj.wc_post_id),d=parseInt(wpdiscuzAjaxObj.commentListUpdateType),c=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer),p=parseInt(wpdiscuzAjaxObj.liveUpdateGuests),r=wpdiscuzAjaxObj.loadLastCommentId,l=r,m=parseInt(wpdiscuzAjaxObj.firstLoadWithAjax);Cookies.get("wpdiscuz_comments_sorting")&&Cookies.remove("wpdiscuz_comments_sorting",{path:""}),Cookies.get("wordpress_last_visit")&&Cookies.remove("wordpress_last_visit",{path:""}),Cookies.get("wpdiscuz_last_visit")&&Cookies.remove("wpdiscuz_last_visit",{path:""});var w,u=wpdiscuzAjaxObj.storeCommenterData,f=parseInt(wpdiscuzAjaxObj.wmuEnabled),h=wpdiscuzAjaxObj.isCookiesEnabled,b=!0,_=wpdiscuzAjaxObj.cookiehash,g=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),z=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,v=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),j=parseInt(wpdiscuzAjaxObj.enableBubble),x=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),C=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),k=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,y=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),O=wpdiscuzAjaxObj.bubbleLocation,A=wpdiscuzAjaxObj.inlineFeedbackAttractionType,I=(I=parseInt(wpdiscuzAjaxObj.scrollSize))||32,T=[],D=[],F=[],E=!1,M=1,L=e("html").css("scroll-behavior"),R=e("body").css("scroll-behavior");(e(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?e(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .the_champ_login_container").length?e(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .social_connect_form").length?e(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&e(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",function(t){var a=e(".wpd-form").not(":hidden");if(a.length)if(wpdiscuzLoadRichEditor){for(var o=0;o<a.length;o++)if("\n"!==wpDiscuzEditor.createEditor(e(a[o]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(o=0;o<a.length;o++)if(e(a[o]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")}),wpdiscuzLoadRichEditor||(e(document).delegate("textarea.wc_comment","input",function(){me(e(this))}),e.each(e("textarea.wc_comment"),function(){me(e(this))})),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(z)}),e(document).on("focus","#wpdcom textarea",function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()}),t)||H({comment_author:Cookies.get("comment_author_"+_),comment_author_email:Cookies.get("comment_author_email_"+_),comment_author_url:Cookies.get("comment_author_url_"+_)});if(e(".wpd-vote-down.wpd-dislike-hidden").remove(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),e(document).on("click","#wpd-editor-source-code-wrapper-bg",function(){e(this).hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")}),wpdiscuzLoadRichEditor&&e(document).on("click","#wpd-insert-source-code",function(){var t=wpDiscuzEditor.createEditor("#"+e("#wpd-editor-uid").val());t.deleteText(0,t.getLength(),Quill.sources.USER);var a=e("#wpd-editor-source-code").val();a.length&&t.clipboard.dangerouslyPasteHTML(0,a,Quill.sources.USER),t.update(),e("#wpd-editor-source-code-wrapper-bg").hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")}),e(document).on("click",".wpd-reply-button",function(){var i=$(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()},z):setTimeout(function(){e("#wc-textarea-"+i).trigger("focus")},z),e("#wpd-secondary-form-wrapper-"+i).slideToggle(z)):function(a){var o=$(a,0);e("#wpdiscuz_form_anchor-"+o).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(o));var n=e("#wpd-secondary-form-wrapper-"+o);if(!t){var i={comment_author:Cookies.get("comment_author_"+_),comment_author_email:Cookies.get("comment_author_email_"+_),comment_author_url:Cookies.get("comment_author_url_"+_)};H(i)}wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+o).focus()},z):setTimeout(function(){e("#wc-textarea-"+o).trigger("focus")},z);n.slideToggle(z,function(){a.addClass("wpdiscuz-clonned")})}(e(this)),function(t){if((a||o)&&"2.0"===n){var i=X(t);setTimeout(function(){if(!D[i])try{D[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){e("#wpdiscuz-recaptcha-field-"+t).val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-"+t).val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3)}}(i)}),e(document).on("click","#wpdcom .wpd-comment-link [data-comment-url]",function(){var t=e(this).data("comment-url"),a=e("<input/>");a.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),a.trigger("select"),document.execCommand("copy"),a.remove(),wpdiscuzAjaxObj.setCommentMessage(t+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)}),e(document).on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",function(e){e.preventDefault()}),e(document).on("click",".wpd-toggle.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked");var a=$(e(this),0),o=e(this),n=e(".fas",o);!o.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&g?function(t,a){var o=X(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",o),ue(v,!0,n).done(function(o){a.addClass("wpd_not_clicked"),"object"==typeof o&&o.success&&(e("#wpd-comm-"+t).replaceWith(o.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle .wpd-view-replies .wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),e("#wpd-comm-"+t+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),we(o)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,n){console.log(n),a.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}(a,t):e("#wpd-comm-"+a+"> .wpd-reply").slideToggle(700,function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),o.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),o.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),t.addClass("wpd_not_clicked")})}),e(document).on("mouseenter",".wpd-new-loaded-comment",function(){e(this).removeClass("wpd-new-loaded-comment")}),e(document).on("click",".wpd-sbs-toggle",function(){e(".wpdiscuz-subscribe-bar").slideToggle(z)}),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm)&&!t&&wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&e("#wpdiscuz-subscribe-form").length&&("2.0"===n?(setTimeout(function(){try{grecaptcha.render("wpdiscuz-recaptcha-subscribe-form",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-subscribe-form").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val()?e(".wpdiscuz-recaptcha",e(this)).css("border","none"):(e(".wpdiscuz-recaptcha",e(this)).css("border","1px solid red"),t.preventDefault())})):"3.0"===n&&e(document).on("click","#wpdiscuz_subscription_button",function(t){var a=e(this).parents("#wpdiscuz-subscribe-form");t.preventDefault();try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then(function(e){console.log(5555),document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=e,a.trigger("submit")},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}})),(a||o)&&"2.0"===n){var S=e(window).width(),P=e("#wpdcom").width();P>=1100&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"65%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"35%"})),P>=940&&P<1100&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"60%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"40%"})),P>=810&&P<940&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"40%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"60%"})),P>=730&&P<810&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"45%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"55%"})),P>=610&&P<730&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.85)","-webkit-transform":"scale(0.85)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"43%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"55%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"})),S>650&&(P>=510&&P<610&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"35%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"63%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%",position:"relative",right:"-60px"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),P>=470&&P<510&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"40%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"60%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd_main_comm_form .wc-form-footer").css({"margin-left":"0px"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),P<470&&(e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({margin:"0px auto","transform-origin":"center 0","-webkit-transform-origin":"center 0"}),e("#wpdcom .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"}),e("#wpdcom .wpd-secondary-form-wrapper .wc_notification_checkboxes").css({"text-align":"center"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-field-submit").css({"text-align":"center"})))}function q(t,a,o){ue(v||f,!1,a).done(function(a){if(e(o).addClass("wpd_not_clicked"),"object"==typeof a)if(a.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(z),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),e(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html);var n=z;a.data.is_main?oe(a.data.message):(n=z+700,e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).slideToggle(700),1==a.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).after(a.data.message):e("#wpd-comm-"+a.data.uniqueid).after(a.data.message)),function(e){if(!e.data.held_moderate){var t=new FormData;t.append("action","wpdCheckNotificationType"),t.append("comment_id",e.data.new_comment_id),t.append("email",e.data.comment_author_email),t.append("isParent",e.data.is_main),ue(v,!0,t)}}(a),function(e){if(e.data.redirect>0&&e.data.new_comment_id){var t=new FormData;t.append("action","wpdRedirect"),t.append("commentId",e.data.new_comment_id),ue(v,!0,t).done(function(e){"object"==typeof e&&e.success&&setTimeout(function(){location.href=e.data},2e3)}).fail(function(e,t,a){console.log(a)})}}(a),h&&b?function(t){var a=t.comment_author_email,o=t.comment_author,n=t.comment_author_url;null==u?(Cookies.set("comment_author_email_"+_,a),Cookies.set("comment_author_"+_,o),n.length&&Cookies.set("comment_author_url_"+_,n)):(u=parseInt(u),Cookies.set("comment_author_email_"+_,a,{expires:u,path:"/"}),Cookies.set("comment_author_"+_,o,{expires:u,path:"/"}),n.length&&Cookies.set("comment_author_url_"+_,n,{expires:u,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(a.data):b||e(".wpd-cookies-checkbox").prop("checked",!1),t.get(0).reset(),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]):me(t.find(".wc_comment")),H(a.data),e(".wmu-preview-wrap",t).remove(),T.length&&(T.forEach(function(e){e.parents(".wpd-field-checkbox").remove()}),T=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){te(),e("html, body").animate({scrollTop:e("#comment-"+a.data.new_comment_id).offset().top-I},1e3,ae)},n),we(a,t)}else a.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"),we(a,t));else wpdiscuzAjaxObj.setCommentMessage(a,"error");e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,a,n){console.log(n),e(o).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}function H(t){e(".wpd_comm_form .wc_name").val(t.comment_author),t.comment_author_email&&t.comment_author_email.indexOf("@example.com")<0&&e(".wpd_comm_form .wc_email").val(t.comment_author_email),t.comment_author_url&&e(".wpd_comm_form .wc_website").val(t.comment_author_url)}function U(t,a){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(a),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}e(document).on("click",".wc_comm_submit.wpd_not_clicked",function(){var i=e(this),s=1,d=e(this).parents("form");if(d.hasClass("wpd_main_comm_form")||(s=function(t){var a=t.attr("class").split(" "),o="";return e.each(a,function(e,t){"wpd_comment_level"===Y(t,!1)&&(o=Y(t,!0))}),parseInt(o)+1}(e(this).parents(".wpd-comment"))),ee(d,"#wpd-editor-"+e(".wpdiscuz_unique_id",d).val()),d.on("submit",function(e){e.preventDefault()}),""!==e(".wc_comment",d).val().trim()){if(d[0].checkValidity()&&(p=d,r=!0,"2.0"===n&&e("input[name=wc_captcha]",p).length&&!e("input[name=wc_captcha]",p).val().length?(r=!1,e(".wpdiscuz-recaptcha",p).css("border","1px solid red")):"2.0"===n&&e("input[name=wc_captcha]",p).length&&e(".wpdiscuz-recaptcha",p).css("border","none"),r)){E=!0,function(t){e(".wpd-agreement-checkbox",t).each(function(){e(this).hasClass("wpd_agreement_hide")&&h&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+_,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each(function(){T.push(e(this))}))})}(d),e(i).removeClass("wpd_not_clicked");var c=new FormData;if(c.append("action","wpdAddComment"),e(":input",d).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&c.append(this.name+"",e(this).val().trim()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&c.append(this.name+"",e(this).val())}),c.append("wpd_comment_depth",s),wpdiscuzAjaxObj.wpdiscuz_zs&&c.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),e(".wpd-cookies-checkbox",d).length?e(".wpd-cookies-checkbox",d).prop("checked")||(b=!1):t&&(b=!1),e("#wpdiscuz-loading-bar").show(),wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&"3.0"===n&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/addComment"}).then(function(e){c.append("g-recaptcha-response",e),q(d,c,i)},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error"),e("#wpdiscuz-loading-bar").fadeOut(250)}else q(d,c,i)}var p,r;!function(e){if((a||o)&&"2.0"===n){var t=X(e);grecaptcha.reset(D[t])}}(e(".wpdiscuz_unique_id",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wc_msg_required_fields,"wc_msg_required_fields",d),"error")}),e(document).on("click",".wpd_editable_comment",function(){w&&e(".wpdiscuz-edit-form-wrap").length&&U($(e(".wpdiscuz-edit-form-wrap"),0),w);var t=e(this),a=$(t,0),o=X(a),n=new FormData;n.append("action","wpdEditComment"),n.append("commentId",o),w=e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-text").get(0),ue(v,!0,n).done(function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){var n=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+a);n.clipboard.dangerouslyPasteHTML(0,o.data.content),n.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+a).val(o.data.content),me(e("#wc-textarea-edit_"+a));e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wc_save_edited_comment",function(){var t=e(this),a=$(t),o=X(a),n=e("#wpd-comm-"+a+" #wpdiscuz-edit-form");if(ee(n,"#wpd-editor-edit_"+a),n.on("submit",function(e){e.preventDefault()}),n[0].checkValidity()){var i=new FormData;i.append("action","wpdSaveEditedComment"),i.append("commentId",o),e(":input",n).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&i.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&i.append(this.name+"",e(this).val())}),ue(v,!0,i).done(function(n){"object"==typeof n?(n.success?(U(a,n.data.message),n.data.lastEdited&&(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(n.data.lastEdited).insertAfter("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),n.data.twitterShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",n.data.twitterShareLink),n.data.whatsappShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",n.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error"),we(n,o)):console.log(n),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=$(e(this));U(t,w),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!wpdiscuzAjaxObj.wordpressIsPaginate&&m&&(M=0,1==m?setTimeout(function(){B(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),B(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&B(!1,t,"wpd-loaded","wpd-loading")});var W=!1;function V(){var t=e("#wpdiscuzHasMoreComments").val(),a=e(document).height(),o=e(window).height()+e(window).scrollTop();a&&o&&(100*o/a>=80&&!1===W&&1==t&&(W=!0,B(!1,e(".wpd-load-more-submit"))))}function B(t,a,o,n){a&&(a.toggleClass(o),a.toggleClass(n));var s=new FormData;s.append("action","wpdLoadMoreComments");var d=e(".wpdiscuz-sort-button-active").attr("data-sorting");d&&s.append("sorting",d),s.append("offset",M),s.append("lastParentId",e(".wpd-load-more-submit").attr("data-lastparentid")),s.append("isFirstLoad",t?1:0);var c=e(".wpdf-active").attr("data-filter-type");s.append("wpdType",c||""),ue(v,!t||1!=m,s).done(function(s){"object"==typeof s&&s.success&&(M++,t&&e(".wpd-comment").remove(),e(".wpdiscuz_single").remove(),e(".wpdiscuz-comment-pagination").before(s.data.comment_list),K(s,t&&2!==i),W=!1,s.data.loadLastCommentId&&(r=s.data.loadLastCommentId),we(s),t&&Q(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))}).fail(function(t,i,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))})}function K(t,a){var o;0==t.data.is_show_load_more?(e("#wpdiscuzHasMoreComments").val(0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()):(o=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",o),2!==i&&e(".wpdiscuz-comment-pagination").show(),e("#wpdiscuzHasMoreComments").val(1),a&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show()),we(t)}function Q(t){var a=location.href.match(/#comment\-(\d+)/);if(null!==a){var o=a[1];if(e("#comment-"+o).length)setTimeout(function(){te(),e("html, body").animate({scrollTop:e("#comment-"+o).parents("[id^=wpd-comm-]").offset().top-I},1e3,ae),t&&N(o)},500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",o),ue(v,!0,n).done(function(a){if("object"==typeof a&&a.success){var n="#comment-"+o;e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),we(a),te(),e("html, body").animate({scrollTop:e(n).offset().top-I},1e3,ae),t&&N(o)}e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}}function N(t){setTimeout(function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")},1100)}function G(e){if(void 0!==e.data.message)for(var t,a=e.data.message,o=0;o<a.length;o++)J((t=a[o]).comment_parent,t.comment_html)}function $(e,t){var a="";return(a=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(a.lastIndexOf("-")+1)}function X(e){return e.substring(0,e.indexOf("_"))}function Y(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function J(t,a){if(0==t)oe(a);else{var o=$(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+o).after(a)}}function Z(){var t=[];return e(".wpd-comment-right").each(function(){t.push(X($(e(this),0)))}),t.join(",")}function ee(t,a){var o=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(a+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),a=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");a=(a=(a=(a=a.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),t.val(a)}(t),e.each(o,function(){e("input",this).prop("required",!1),0===e("input:checked",this).length?e("input",e(this)).prop("required",!0):e(".wpd-field-invalid",this).remove()})}function te(){e("html, body").css("scroll-behavior","unset")}function ae(){e("html").css("scroll-behavior",L),e("body").css("scroll-behavior",R)}function oe(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function ne(t){t?t.prop("required")||(t.val()?t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):e.each(e(".wc_email"),function(t,a){var o=e(a);o.prop("required")||(o.val()?o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==i||wpdiscuzAjaxObj.wordpressIsPaginate||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),V(),e(window).scroll(function(){V()})),wpdiscuzAjaxObj.setLoadMoreVisibility=K,e(document).on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",function(){var t=e(this);e(t).removeClass("wpd_not_clicked");var a,o=X($(t));a=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",o),n.append("voteType",a),ue(v,!0,n).done(function(n){if(e(t).addClass("wpd_not_clicked"),"object"==typeof n){if(n.success){if("total"===n.data.buttonsStyle){var i=e(".wpd-comment-footer .wpd-vote-result",e("#comment-"+o)),s=n.data.votes;i.text(n.data.votesHumanReadable),i.attr("title",s),i.removeClass("wpd-up wpd-down"),s>0&&i.addClass("wpd-up"),s<0&&i.addClass("wpd-down")}else{var d=e(".wpd-comment-footer .wpd-vote-result-like",e("#comment-"+o)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+o));d.text(n.data.likeCountHumanReadable),d.attr("title",n.data.likeCount),c.text(n.data.dislikeCountHumanReadable),c.attr("title",n.data.dislikeCount),parseInt(n.data.likeCount)>0?d.addClass("wpd-up"):d.removeClass("wpd-up"),parseInt(n.data.dislikeCount)<0?c.addClass("wpd-down"):c.removeClass("wpd-down")}var p=e(".wpd-comment-footer .wpd-vote-up",e("#comment-"+o)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+o));p.removeClass("wpd-up"),r.removeClass("wpd-down"),n.data.curUserReaction>0?p.addClass("wpd-up"):n.data.curUserReaction<0&&r.addClass("wpd-down")}else n.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error");we(n,o,a)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,o,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click","body",function(t){var a=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?a.css({display:a.is(":visible")?"none":"flex"}):a.hide()}),e(document).on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var t=e(this),a=e(this).attr("data-sorting");if(a){e(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),t.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var o=new FormData;o.append("action","wpdSorting"),o.append("sorting",a);var n=e(".wpdf-active").attr("data-filter-type");o.append("wpdType",n||""),ue(v,!0,o).done(function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),K(t,!1),M=1),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){Q(!1)},1!=m&&Q(!1),e(document).on("click",".wpdiscuz-readmore",function(){var t=$(e(this)),a=X(t),o=new FormData;o.append("action","wpdReadMore"),o.append("commentId",a),ue(v,!0,o).done(function(o){"object"==typeof o?(o.success?(e("#comment-"+a+" .wpd-comment-text").replaceWith(" "+o.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(o.data),we(o)):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("change",".wpd-required-group",function(){0!==e("input:checked",this).length?e("input",e(this)).prop("required",!1):e("input",e(this)).prop("required",!0)}),e(document).on("click",".wpdiscuz-spoiler",function(){e(this).next().slideToggle(),e(this).hasClass("wpdiscuz-spoiler-closed")?e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"):e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"),e(this).toggleClass("wpdiscuz-spoiler-closed")}),e(document).on("click",".wpd-tools i",function(){var t=e(this).siblings(".wpd-tools-actions");t.is(":visible")||e(this).parents(".wpd-comment-right").attr("id")!==e("[id^=comment-]","#wpdcom").last().attr("id")||e("#comments").css({paddingBottom:"160px"}),t.css({display:t.is(":visible")?"none":"flex"})}),e(document).on("mouseleave",".wpd-comment-right",function(){e(this).find(".wpd-tools-actions").hide(),e("#comments").css({paddingBottom:"0"})}),e(document).on("click",".wpd_stick_btn",function(){var t=X($(e(this),0)),a=new FormData;a.append("action","wpdStickComment"),a.append("commentId",t),ue(v,!0,a).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd_close_btn",function(){var t=X($(e(this),0)),a=new FormData;a.append("action","wpdCloseThread"),a.append("commentId",t),ue(v,!0,a).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var t=e(this),a=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+a),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&o.append("sorting",n),o.append("lastParentId",0),o.append("offset",0),M=1,o.append("wpdType",t.hasClass("wpdf-active")?"":a),o.append("isFirstLoad",1),e(this).hasClass("wpdf-inline")?e(this).hasClass("wpdf-active")?e(".wpd-comment-info-bar").hide():e(".wpd-comment-info-bar").css("display","flex"):e(".wpd-comment-info-bar").hide(),ue(v,!1,o).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(a.data.comment_list),K(a),r=a.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),we(a)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpdf-reacted.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdMostReactedComment"),ue(v,!1,a).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e("#comment-"+a.data.commentId).length||e(".wpd-thread-list").prepend(a.data.message),we(a),te(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-I},1e3,ae))}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")})}),e(document).on("click",".wpdf-hottest.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdHottestThread"),ue(v,!1,a).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.commentId).length?e("#comment-"+a.data.commentId).parents("[id^=wpd-comm-"+a.data.commentId+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),we(a),te(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-I},1e3,ae))}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")})}),e(document).on("click",".wpd-filter-view-all",function(){e(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")}),e(document).on("click",".wpd-follow-link.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=X($(t,0)),o=new FormData;o.append("action","wpdFollowUser"),o.append("commentId",a),ue(v,!0,o).done(function(a){t.addClass("wpd_not_clicked"),"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.code],a.data.code,t),"success"),t.removeClass("wpd-follow-active"),a.data.followTip&&t.attr("wpd-tooltip",a.data.followTip),a.data.followClass&&t.addClass(a.data.followClass)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),ne(),e(document).on("keyup",".wc_email",function(){ne(e(this))}),j&&e("#wpdcom").length){if(e("#wpd-bubble-wrapper").hover(function(){e(this).addClass("wpd-bubble-hover")},function(){e(this).removeClass("wpd-bubble-hover")}),C&&!Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)&&setTimeout(function(){e("#wpd-bubble-wrapper").addClass("wpd-bubble-hover"),Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint,"1",{expires:7,path:"/"}),setTimeout(function(){e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")},1e3*k)},1e3*C),"content_left"===O)if(e(".entry-content").length){var ie=(se=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?se:25;e("#wpd-bubble-wrapper").css({left:ie+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){ie=(se=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?se:25;e("#wpd-bubble-wrapper").css({left:ie+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var se;ie=(se=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?se:25;e("#wpd-bubble-wrapper").css({left:ie+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner");else"left_corner"===O?(e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===O&&(e("#wpd-bubble-wrapper").css({right:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-right-corner"));e("#wpd-bubble-wrapper").show(),e(document).on("click","#wpd-bubble-add-message-close",function(t){t.preventDefault(),t.stopPropagation(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),e(document).on("click","#wpd-bubble",function(){te(),e("#tab-title-reviews").length&&e("#tab-title-reviews a").trigger("click"),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-(I+28)},1e3,function(){ae(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover"),wpdiscuzLoadRichEditor?e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0").focus():e("#wc-textarea-0_0").length&&e("#wc-textarea-0_0").trigger("focus")})}),e(document).on("click","#wpd-bubble-comment-close",function(t){t.preventDefault(),e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),e(document).on("click","#wpd-bubble-comment-reply-link a",function(){var t=e(this).attr("href");setTimeout(function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),Q(!0);var a=t.match(/#comment\-(\d+)/);F=F.filter(function(e){return e!=a[1]}),e("#wpd-bubble-count .wpd-new-comments-count").text(F.length),0==F.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),e(document).on("click","#wpd-bubble-count",function(){if(F.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",F.join()),ue(v,!0,t).done(function(t){"object"==typeof t&&t.success&&(t.data.message=t.data.message.filter(function(t){if(!e("#comment-"+t.comment_id).length)return t}),G(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),F=[],e(".wpd-new-loaded-comment").length&&(te(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-(I+28)},1e3,ae)),we(t)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,a){console.log(a)})}})}if((j&&x||d)&&(t||!t&&p)&&setTimeout(function t(){e.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:s,lastId:l,visibleCommentIds:Z()}}).done(function(a){if(!E)if("object"==typeof a){if(a.commentIDsToRemove.forEach(function(t){e("[id^=wpd-comm-"+t+"]").remove()}),a.ids.length){d&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",r),i.append("visibleCommentIds",Z()),ue(v,!1,i).done(function(t){E||"object"==typeof t&&t.success&&(G(t),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),r=t.data.loadLastCommentId)}).fail(function(e,t,a){console.log(a)})),a.ids=a.ids.filter(function(t){if(!e("#comment-"+t).length)return t});var o=5e3;l=parseInt(a.ids[a.ids.length-1]),F=F.concat(a.ids),y&&a.commentText&&(e("#wpd-bubble-author-avatar").html(a.avatar),e("#wpd-bubble-author-name").html(a.authorName),e("#wpd-bubble-comment-date span").html(a.commentDate),e("#wpd-bubble-comment-text").html(a.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",a.commentLink),e("#wpd-bubble-notification-message").show(),o=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=a.ids.length,e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),e("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout(function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")},o),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}a.all_comments_count=parseInt(a.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(a.all_comments_count_bubble_html),e(".wpd-thread-info").html(a.all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.all_comments_count)}else console.log(a);var i;setTimeout(t,c)}).fail(function(e,a,o){console.log(o),setTimeout(t,c)})},c),e(".wpd-inline-form-wrapper").length){var de=new FormData;de.append("action","wpdGetInlineCommentForm"),ue(v,!1,de).done(function(t){"object"==typeof t?t.success?(e(".wpd-inline-form-wrapper").append(t.data),e.each(e("[name=_wpd_inline_nonce]"),function(){var t=e(this).attr("id"),a=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+a.substring(a.lastIndexOf("-")+1))}),e(".wpd-inline-opened").addClass("wpd-active"),e(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),e(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),e(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),le()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data]),t.data,"error"):console.log(t)}).fail(function(e,t,a){console.log(a)})}function ce(t){if(e(t).hasClass("wpd-inline-shortcode"))var a=e(t).attr("id");else a=e(t).parents(".wpd-inline-shortcode").attr("id");return a.substring(a.lastIndexOf("-")+1)}function pe(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function re(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var t=e(this),a=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&a>0&&a<300&&("blink"===A?(t.addClass("wpd-blink"),setTimeout(function(){t.removeClass("wpd-blink")},3e3)):(t.parents(".wpd-inline-shortcode").addClass("wpd-active"),t.siblings(".wpd-inline-form-wrapper").show(),t.addClass("wpd-open"),le(t.siblings(".wpd-inline-form-wrapper"))))})}function le(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(a=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var a;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(a=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}}else e.each(e(".wpd-inline-form-wrapper:visible"),function(){if(e(this).offset().left<=10)e(this).css("left",Math.ceil(parseInt(e(this).css("left"))-e(this).offset().left+10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))<3&&(t=3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;");else if(e(this).offset().left+e(this).width()>document.body.clientWidth-10){var t;e(this).css("left",Math.ceil(parseInt(e(this).css("left"))+(document.body.clientWidth-(e(this).offset().left+e(this).width()))-10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))>e(this).width()-3&&(t=e(this).width()-3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;")}})}function me(t){var a,o=0;if(t.parents(".wpd_main_comm_form").length)o=parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents(".wpd_main_comm_form");else if(t.parents(".wpd-secondary-form-wrapper").length)o=parseInt(wpdiscuzAjaxObj.replyTextMaxLength),a=t.parents(".wpd-secondary-form-wrapper");else if(t.parents("#wpdiscuz-edit-form").length){var n=$(t);o=parseInt(n.substring(n.lastIndexOf("_")+1))?parseInt(wpdiscuzAjaxObj.replyTextMaxLength):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents("#wpdiscuz-edit-form")}if(o&&a){var i=t.val().length,s=e(".wpd-editor-char-counter",a),d=o-i;s.html(d),d<=10?s.addClass("error"):s.removeClass("error")}}function we(t,a,o,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,a,o,n):console.log(t.data.callbackFunctions[e]+" is not a function")})}function ue(t,a,o){a&&e("#wpdiscuz-loading-bar").show(),o.append("postId",s);var n=o.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(o=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](o,t,a))});var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:o,contentType:!1,processData:!1})}e(document).on("click","body",function(t){if(e(t.target).hasClass("wpd-inline-form-close")||e(t.target).parents(".wpd-inline-form-close").length)t.preventDefault(),e(t.target).parents(".wpd-inline-form-wrapper").hide(),e(t.target).parents(".wpd-inline-shortcode").removeClass("wpd-active"),e(t.target).parents(".wpd-inline-form-wrapper").siblings(".wpd-inline-icon").removeClass("wpd-open");else if(!e(t.target).hasClass("wpd-inline-form-wrapper")&&!e(t.target).parents(".wpd-inline-form-wrapper").length){pe();var a="";e(t.target).hasClass("wpd-inline-icon")?a=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(a=e(t.target).parents(".wpd-inline-icon")),a.length&&a.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(a.parents(".wpd-inline-shortcode").addClass("wpd-active"),a.siblings(".wpd-inline-form-wrapper").show(),a.addClass("wpd-open"),a.removeClass("wpd-ignored"),le(a.siblings(".wpd-inline-form-wrapper")))}(!e(t.target).hasClass("wpd-last-inline-comments-wrapper")&&!e(t.target).parents(".wpd-last-inline-comments-wrapper").length||e(t.target).parents(".wpd-last-inline-comments-wrapper").length&&e(t.target).hasClass("wpd-load-inline-comment"))&&e(".wpd-last-inline-comments-wrapper").remove()}),e(document).on("click",".wpd-inline-submit.wpd_not_clicked",function(t){t.preventDefault();var a=e(this),o=e(this).parents(".wpd_inline_comm_form");if(o[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",ce(o)),e.each(e("input, textarea",o),function(t,a){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(a).attr("name"),e(a).val()):n.append(e(a).attr("name"),e(a).val())}),ue(v,!0,n).done(function(t){if(a.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){o[0].reset(),pe();var n=parseInt(t.data.newCount),i=a.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),e(".wpd-thread-info").attr("data-comments-count",t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.message&&oe(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data,a),"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("keydown",".wpd-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_comm_submit").trigger("click")}),e(document).on("keydown","#wpdiscuz-edit-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_save_edited_comment").trigger("click")}),e(document).on("keydown",".wpd-inline-comment-content",function(t){t.ctrlKey&&13==t.keyCode&&e(this).parents(".wpd_inline_comm_form").find(".wpd-inline-submit.wpd_not_clicked").trigger("click")}),e(document).on("click",".wpd-inline-icon-count.wpd-has-comments",function(){var t=e(this),a=new FormData;a.append("action","wpdGetLastInlineComments"),a.append("inline_form_id",ce(t)),ue(v,!0,a).done(function(a){"object"==typeof a?a.success?e(a.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-view-all-inline-comments",function(t){t.preventDefault(),e(this).parents(".wpd-last-inline-comments-wrapper").remove(),e(".wpdf-inline").hasClass("wpdf-active")||e(".wpdf-inline").trigger("click"),te(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-I},1e3,ae)}),e(document).on("click",".wpd-feedback-content-link",function(t){t.preventDefault();var a=e(this).data("feedback-content-id");te(),e("html, body").animate({scrollTop:e("#wpd-inline-"+a).offset().top-(I+6)},1e3,function(){ae(),e("#wpd-inline-"+a).addClass("wpd-active")})}),"scroll_open"!==A&&"blink"!==A||(re(),e(window).on("scroll",re)),e(document).on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var t=new FormData,a=e(this).index();a>=0&&a<5&&(t.append("action","wpdUserRate"),t.append("rating",a+1),ue(v,!0,t).done(function(t){"object"==typeof t?t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data),"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))}),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){t.preventDefault();var a,o,i=e(this);if(i[0].checkValidity()&&(a=i,o=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).val().length?(o=!1,e(".wpdiscuz-recaptcha",a).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&e(".wpdiscuz-recaptcha",a).css("border","none"),o)){var s=new FormData;s.append("action","wpdAddSubscription"),e("*",i).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&s.append(this.name+"",e(this).val()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&s.append(this.name+"",e(this).val())}),ue(v,!0,s).done(function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):wpdiscuzAjaxObj.setCommentMessage(t,"error"),e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wpd-unsubscribe",function(t){t.preventDefault();var a=new FormData;a.append("action","wpdUnsubscribe"),a.append("sid",e(this).data("sid")),a.append("skey",e(this).data("skey")),ue(v,!0,a).done(function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=ue});var onloadCallback=function(){if(document.getElementById("wpdiscuz-recaptcha-0_0")&&"2.0"===wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.render("wpdiscuz-recaptcha-0_0",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(e){jQuery("#wpdiscuz-recaptcha-field-0_0").val("key")},"expired-callback":function(){jQuery("#wpdiscuz-recaptcha-field-0_0").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}};
|
11 |
/* Colorbox */
|
12 |
!function(t,e,i){var o,n,r,h,a,s,l,c,d,g,f,u,p,m,w,v,y,x,b,T,C,H,k,W,E,I,M,L,R,S,K,P,B,O={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return t(this).attr("href")},title:function(){return this.title},createImg:function(){var e=new Image,i=t(this).data("cbox-img-attrs");return"object"==typeof i&&t.each(i,function(t,i){e[t]=i}),e},createIframe:function(){var i=e.createElement("iframe"),o=t(this).data("cbox-iframe-attrs");return"object"==typeof o&&t.each(o,function(t,e){i[t]=e}),"frameBorder"in i&&(i.frameBorder=0),"allowTransparency"in i&&(i.allowTransparency="true"),i.name=(new Date).getTime(),i.allowFullscreen=!0,i}},_="colorbox",j="cbox",D=j+"Element",F=j+"_open",N=j+"_load",z=j+"_complete",A=j+"_cleanup",q=j+"_closed",U=j+"_purge",$=t("<a/>"),G="div",Q=0,J={};function V(i,o,n){var r=e.createElement(i);return o&&(r.id=j+o),n&&(r.style.cssText=n),t(r)}function X(){return i.innerHeight?i.innerHeight:t(i).height()}function Y(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var o;return void 0===this.cache[e]&&(void 0!==(o=t(this.el).attr("data-cbox-"+e))?this.cache[e]=o:void 0!==i[e]?this.cache[e]=i[e]:void 0!==O[e]&&(this.cache[e]=O[e])),this.cache[e]},this.get=function(t){var e=this.value(t);return"function"==typeof e?e.call(this.el,this):e}}function Z(t){var e=d.length,i=(I+t)%e;return i<0?e+i:i}function tt(t,e){return Math.round((/%/.test(t)?("x"===e?g.width():X())/100:1)*parseInt(t,10))}function et(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function it(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function ot(t){"contains"in n[0]&&!n[0].contains(t.target)&&t.target!==o[0]&&(t.stopPropagation(),n.trigger("focus"))}function nt(t){nt.str!==t&&(n.add(o).removeClass(nt.str).addClass(t),nt.str=t)}function rt(i){t(e).trigger(i),$.triggerHandler(i)}var ht=function(){var t,e,i=j+"Slideshow_",o="click."+j;function r(){clearTimeout(e)}function h(){(C.get("loop")||d[I+1])&&(r(),e=setTimeout(P.next,C.get("slideshowSpeed")))}function a(){v.html(C.get("slideshowStop")).off(o).one(o,s),$.on(z,h).on(N,r),n.removeClass(i+"off").addClass(i+"on")}function s(){r(),$.off(z,h).off(N,r),v.html(C.get("slideshowStart")).off(o).one(o,function(){P.next(),a()}),n.removeClass(i+"on").addClass(i+"off")}function l(){t=!1,v.hide(),r(),$.off(z,h).off(N,r),n.removeClass(i+"off "+i+"on")}return function(){t?C.get("slideshow")||($.off(A,l),l()):C.get("slideshow")&&d[1]&&(t=!0,$.one(A,l),C.get("slideshowAuto")?a():s(),v.show())}}();function at(r){var g,w;if(!S){if(g=t(r).data(_),C=new Y(r,g),w=C.get("rel"),I=0,w&&!1!==w&&"nofollow"!==w?(d=t("."+D).filter(function(){return new Y(this,t.data(this,_)).get("rel")===w}),-1===(I=d.index(C.el))&&(d=d.add(C.el),I=d.length-1)):d=t(C.el),!L){L=R=!0,nt(C.get("className")),n.css({visibility:"hidden",display:"block",opacity:""}),f=V(G,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),h.css({width:"",height:""}).append(f),H=a.height()+c.height()+h.outerHeight(!0)-h.height(),k=s.width()+l.width()+h.outerWidth(!0)-h.width(),W=f.outerHeight(!0),E=f.outerWidth(!0);var v=tt(C.get("initialWidth"),"x"),y=tt(C.get("initialHeight"),"y"),x=C.get("maxWidth"),B=C.get("maxHeight");C.w=Math.max((!1!==x?Math.min(v,tt(x,"x")):v)-E-k,0),C.h=Math.max((!1!==B?Math.min(y,tt(B,"y")):y)-W-H,0),f.css({width:"",height:C.h}),P.position(),rt(F),C.get("onOpen"),T.add(m).hide(),n.trigger("focus"),C.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",ot,!0),$.one(q,function(){e.removeEventListener("focus",ot,!0)})),C.get("returnFocus")&&$.one(q,function(){t(C.el).trigger("focus")})}var O=parseFloat(C.get("opacity"));o.css({opacity:O==O?O:"",cursor:C.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),C.get("closeButton")?b.html(C.get("close")).appendTo(h):b.appendTo("<div/>"),function(){var e,o,n,r=P.prep,h=++Q;R=!0,M=!1,rt(U),rt(N),C.get("onLoad"),C.h=C.get("height")?tt(C.get("height"),"y")-W-H:C.get("innerHeight")&&tt(C.get("innerHeight"),"y"),C.w=C.get("width")?tt(C.get("width"),"x")-E-k:C.get("innerWidth")&&tt(C.get("innerWidth"),"x"),C.mw=C.w,C.mh=C.h,C.get("maxWidth")&&(C.mw=tt(C.get("maxWidth"),"x")-E-k,C.mw=C.w&&C.w<C.mw?C.w:C.mw);C.get("maxHeight")&&(C.mh=tt(C.get("maxHeight"),"y")-W-H,C.mh=C.h&&C.h<C.mh?C.h:C.mh);if(e=C.get("href"),K=setTimeout(function(){p.show()},100),C.get("inline")){var a=t(e).eq(0);n=t("<div>").hide().insertBefore(a),$.one(U,function(){n.replaceWith(a)}),r(a)}else C.get("iframe")?r(" "):C.get("html")?r(C.get("html")):et(C,e)?(e=it(C,e),M=C.get("createImg"),t(M).addClass(j+"Photo").on("error."+j,function(){r(V(G,"Error").html(C.get("imgError")))}).one("load",function(){h===Q&&setTimeout(function(){var e;C.get("retinaImage")&&i.devicePixelRatio>1&&(M.height=M.height/i.devicePixelRatio,M.width=M.width/i.devicePixelRatio),C.get("scalePhotos")&&(o=function(){M.height-=M.height*e,M.width-=M.width*e},C.mw&&M.width>C.mw&&(e=(M.width-C.mw)/M.width,o()),C.mh&&M.height>C.mh&&(e=(M.height-C.mh)/M.height,o())),C.h&&(M.style.marginTop=Math.max(C.mh-M.height,0)/2+"px"),d[1]&&(C.get("loop")||d[I+1])&&(M.style.cursor="pointer",t(M).on("click."+j,function(){P.next()})),M.style.width=M.width+"px",M.style.height=M.height+"px",r(M)},1)}),M.src=e):e&&u.load(e,C.get("data"),function(e,i){h===Q&&r("error"===i?V(G,"Error").html(C.get("xhrError")):t(this).contents())})}()}}function st(){n||(B=!1,g=t(i),n=V(G).attr({id:_,class:!1===t.support.opacity?j+"IE":"",role:"dialog",tabindex:"-1"}).hide(),o=V(G,"Overlay").hide(),p=t([V(G,"LoadingOverlay")[0],V(G,"LoadingGraphic")[0]]),r=V(G,"Wrapper"),h=V(G,"Content").append(m=V(G,"Title"),w=V(G,"Current"),x=t('<button type="button"/>').attr({id:j+"Previous"}),y=t('<button type="button"/>').attr({id:j+"Next"}),v=t('<button type="button"/>').attr({id:j+"Slideshow"}),p),b=t('<button type="button"/>').attr({id:j+"Close"}),r.append(V(G).append(V(G,"TopLeft"),a=V(G,"TopCenter"),V(G,"TopRight")),V(G,!1,"clear:left").append(s=V(G,"MiddleLeft"),h,l=V(G,"MiddleRight")),V(G,!1,"clear:left").append(V(G,"BottomLeft"),c=V(G,"BottomCenter"),V(G,"BottomRight"))).find("div div").css({float:"left"}),u=V(G,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),T=y.add(x).add(w).add(v)),e.body&&!n.parent().length&&t(e.body).append(o,n.append(r,u))}function lt(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t.ctrlKey||(t.preventDefault(),at(this))}return!!n&&(B||(B=!0,y.on("click",function(){P.next()}),x.on("click",function(){P.prev()}),b.on("click",function(){P.close()}),o.on("click",function(){C.get("overlayClose")&&P.close()}),t(e).on("keydown."+j,function(t){var e=t.keyCode;L&&C.get("escKey")&&27===e&&(t.preventDefault(),P.close()),L&&C.get("arrowKey")&&d[1]&&!t.altKey&&(37===e?(t.preventDefault(),x.trigger("click")):39===e&&(t.preventDefault(),y.trigger("click")))}),"function"==typeof t.fn.on?t(e).on("click."+j,"."+D,i):t("."+D).live("click."+j,i)),!0)}t[_]||(t(st),(P=t.fn[_]=t[_]=function(e,i){var o=this;return e=e||{},"function"==typeof o&&(o=t("<a/>"),e.open=!0),o[0]?(st(),lt()&&(i&&(e.onComplete=i),o.each(function(){var i=t.data(this,_)||{};t.data(this,_,t.extend(i,e))}).addClass(D),new Y(o[0],e).get("open")&&at(o[0])),o):o}).position=function(e,i){var o,d,f,u=0,p=0,m=n.offset();function w(){a[0].style.width=c[0].style.width=h[0].style.width=parseInt(n[0].style.width,10)-k+"px",h[0].style.height=s[0].style.height=l[0].style.height=parseInt(n[0].style.height,10)-H+"px"}if(g.off("resize."+j),n.css({top:-9e4,left:-9e4}),d=g.scrollTop(),f=g.scrollLeft(),C.get("fixed")?(m.top-=d,m.left-=f,n.css({position:"fixed"})):(u=d,p=f,n.css({position:"absolute"})),!1!==C.get("right")?p+=Math.max(g.width()-C.w-E-k-tt(C.get("right"),"x"),0):!1!==C.get("left")?p+=tt(C.get("left"),"x"):p+=Math.round(Math.max(g.width()-C.w-E-k,0)/2),!1!==C.get("bottom")?u+=Math.max(X()-C.h-W-H-tt(C.get("bottom"),"y"),0):!1!==C.get("top")?u+=tt(C.get("top"),"y"):u+=Math.round(Math.max(X()-C.h-W-H,0)/2),n.css({top:m.top,left:m.left,visibility:"visible"}),r[0].style.width=r[0].style.height="9999px",o={width:C.w+E+k,height:C.h+W+H,top:u,left:p},e){var v=0;t.each(o,function(t){o[t]===J[t]||(v=e)}),e=v}J=o,e||n.css(o),n.dequeue().animate(o,{duration:e||0,complete:function(){w(),R=!1,r[0].style.width=C.w+E+k+"px",r[0].style.height=C.h+W+H+"px",C.get("reposition")&&setTimeout(function(){g.on("resize."+j,P.position)},1),"function"==typeof i&&i()},step:w})},P.resize=function(t){var e;L&&((t=t||{}).width&&(C.w=tt(t.width,"x")-E-k),t.innerWidth&&(C.w=tt(t.innerWidth,"x")),f.css({width:C.w}),t.height&&(C.h=tt(t.height,"y")-W-H),t.innerHeight&&(C.h=tt(t.innerHeight,"y")),t.innerHeight||t.height||(e=f.scrollTop(),f.css({height:"auto"}),C.h=f.height()),f.css({height:C.h}),e&&f.scrollTop(e),P.position("none"===C.get("transition")?0:C.get("speed")))},P.prep=function(i){if(L){var o,r="none"===C.get("transition")?0:C.get("speed");f.remove(),(f=V(G,"LoadedContent").append(i)).hide().appendTo(u.show()).css({width:(C.w=C.w||f.width(),C.w=C.mw&&C.mw<C.w?C.mw:C.w,C.w),overflow:C.get("scrolling")?"auto":"hidden"}).css({height:(C.h=C.h||f.height(),C.h=C.mh&&C.mh<C.h?C.mh:C.h,C.h)}).prependTo(h),u.hide(),t(M).css({float:"none"}),nt(C.get("className")),o=function(){var i,o,h=d.length;function a(){!1===t.support.opacity&&n[0].style.removeAttribute("filter")}L&&(o=function(){clearTimeout(K),p.hide(),rt(z),C.get("onComplete")},m.html(C.get("title")).show(),f.show(),h>1?("string"==typeof C.get("current")&&w.html(C.get("current").replace("{current}",I+1).replace("{total}",h)).show(),y[C.get("loop")||I<h-1?"show":"hide"]().html(C.get("next")),x[C.get("loop")||I?"show":"hide"]().html(C.get("previous")),ht(),C.get("preloading")&&t.each([Z(-1),Z(1)],function(){var i=d[this],o=new Y(i,t.data(i,_)),n=o.get("href");n&&et(o,n)&&(n=it(o,n),e.createElement("img").src=n)})):T.hide(),C.get("iframe")?(i=C.get("createIframe"),C.get("scrolling")||(i.scrolling="no"),t(i).attr({src:C.get("href"),class:j+"Iframe"}).one("load",o).appendTo(f),$.one(U,function(){i.src="//about:blank"}),C.get("fastIframe")&&t(i).trigger("load")):o(),"fade"===C.get("transition")?n.fadeTo(r,1,a):a())},"fade"===C.get("transition")?n.fadeTo(r,0,function(){P.position(0,o)}):P.position(r,o)}},P.next=function(){!R&&d[1]&&(C.get("loop")||d[I+1])&&(I=Z(1),at(d[I]))},P.prev=function(){!R&&d[1]&&(C.get("loop")||I)&&(I=Z(-1),at(d[I]))},P.close=function(){L&&!S&&(S=!0,L=!1,rt(A),C.get("onCleanup"),g.off("."+j),o.fadeTo(C.get("fadeOut")||0,0),n.stop().fadeTo(C.get("fadeOut")||0,0,function(){n.hide(),o.hide(),rt(U),f.remove(),setTimeout(function(){S=!1,rt(q),C.get("onClosed")},1)}))},P.remove=function(){n&&(n.stop(),t[_].close(),n.stop(!1,!0).remove(),o.remove(),S=!1,n=null,t("."+D).removeData(_).removeClass(D),t(e).off("click."+j).off("keydown."+j))},P.element=function(){return t(C.el)},P.settings=O)}(jQuery,document,window);
|
13 |
/* Media Uploader */
|
7 |
/* Autogrow */
|
8 |
jQuery.fn.autoGrow=function(){return this.each(function(){var createMirror=function(textarea){jQuery(textarea).after('<div class="autogrow-textarea-mirror"></div>');return jQuery(textarea).next(".autogrow-textarea-mirror")[0]};var sendContentToMirror=function(textarea){mirror.innerHTML=String(textarea.value).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\n/g,"<br />")+".<br/>.";if(jQuery(textarea).height()!=jQuery(mirror).height())jQuery(textarea).height(jQuery(mirror).height())};var growTextarea=function(){sendContentToMirror(this)};var mirror=createMirror(this);mirror.style.display="none";mirror.style.wordWrap="break-word";mirror.style.padding=jQuery(this).css("padding");mirror.style.width=jQuery(this).css("width");mirror.style.fontFamily=jQuery(this).css("font-family");mirror.style.fontSize=jQuery(this).css("font-size");mirror.style.lineHeight=jQuery(this).css("line-height");this.style.overflow="hidden";this.style.minHeight=this.rows+"em";this.onkeydown=growTextarea;sendContentToMirror(this)})};
|
9 |
/* wpDiscuz */
|
10 |
+
var wpDiscuzEditor,wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor);function wpdMessagesOnInit(e,t){wpdiscuzAjaxObj.setCommentMessage(e,t),setTimeout(function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)},3e3)}wpdiscuzLoadRichEditor&&(wpDiscuzEditor=new WpdEditor),wpdiscuzAjaxObj.setCommentMessage=function(e,t,o){var a="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?a="wpdiscuz-message-success":"warning"===t[n]&&(a="wpdiscuz-message-warning"):"success"===t?a="wpdiscuz-message-success":"warning"===t&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(o instanceof Array?o[n]:o||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===t?a="wpdiscuz-message-success":"warning"===t&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(e).prependTo("#wpdiscuz-comment-message").delay(o||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},wpdiscuzAjaxObj.applyFilterOnPhrase=function(t,o,a){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[e]]&&(t=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[e]](t,o,a))}),t},jQuery(document).ready(function(c){c("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var i=wpdiscuzAjaxObj.is_user_logged_in,p=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!i,r=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&i,l=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,s=parseInt(wpdiscuzAjaxObj.commentListLoadType),d=parseInt(wpdiscuzAjaxObj.wc_post_id),n=parseInt(wpdiscuzAjaxObj.commentListUpdateType),m=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer),e=parseInt(wpdiscuzAjaxObj.liveUpdateGuests),w=wpdiscuzAjaxObj.loadLastCommentId,u=w,f=parseInt(wpdiscuzAjaxObj.firstLoadWithAjax);Cookies.get("wpdiscuz_comments_sorting")&&Cookies.remove("wpdiscuz_comments_sorting",{path:""}),Cookies.get("wordpress_last_visit")&&Cookies.remove("wordpress_last_visit",{path:""}),Cookies.get("wpdiscuz_last_visit")&&Cookies.remove("wpdiscuz_last_visit",{path:""});var t,o,h,a=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate),b=wpdiscuzAjaxObj.storeCommenterData,_=parseInt(wpdiscuzAjaxObj.wmuEnabled),g=wpdiscuzAjaxObj.isCookiesEnabled,z=!0,j=wpdiscuzAjaxObj.cookiehash,v=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),C=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,x=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),k=parseInt(wpdiscuzAjaxObj.enableBubble),y=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),O=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),A=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,I=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),T=wpdiscuzAjaxObj.bubbleLocation,D=wpdiscuzAjaxObj.inlineFeedbackAttractionType,E=(E=parseInt(wpdiscuzAjaxObj.scrollSize))||32,F=[],M=[],L=[],R=!1,S=1,P=c("html").css("scroll-behavior"),q=c("body").css("scroll-behavior");function H(d,e,s){we(x||_,!1,e).done(function(e){var t,o,a,n;c(s).addClass("wpd_not_clicked"),"object"==typeof e?e.success?("collapsed"===wpdiscuzAjaxObj.commentFormView&&c(".wpd-form-foot",d).slideUp(C),e.data.wc_all_comments_count_new=parseInt(e.data.wc_all_comments_count_new),c(".wpd-thread-info").html(e.data.wc_all_comments_count_before_threads_html),c(".wpd-thread-info").attr("data-comments-count",e.data.wc_all_comments_count_new),c("#wpd-bubble-all-comments-count").replaceWith(e.data.wc_all_comments_count_bubble_html),t=C,e.data.is_main?de(e.data.message):(t=700+C,c("#wpd-secondary-form-wrapper-"+e.data.uniqueid).slideToggle(700),(1==e.data.is_in_same_container?c("#wpd-secondary-form-wrapper-"+e.data.uniqueid):c("#wpd-comm-"+e.data.uniqueid)).after(e.data.message)),(a=e).data.held_moderate||((o=new FormData).append("action","wpdCheckNotificationType"),o.append("comment_id",a.data.new_comment_id),o.append("email",a.data.comment_author_email),o.append("isParent",a.data.is_main),we(x,!0,o)),0<(a=e).data.redirect&&a.data.new_comment_id&&((n=new FormData).append("action","wpdRedirect"),n.append("commentId",a.data.new_comment_id),we(x,!0,n).done(function(e){"object"==typeof e&&e.success&&setTimeout(function(){location.href=e.data},2e3)}).fail(function(e,t,o){console.log(o)})),g&&z?(o=e.data,a=o.comment_author_email,n=o.comment_author,o=o.comment_author_url,null==b?(Cookies.set("comment_author_email_"+j,a),Cookies.set("comment_author_"+j,n),o.length&&Cookies.set("comment_author_url_"+j,o)):(b=parseInt(b),Cookies.set("comment_author_email_"+j,a,{expires:b,path:"/"}),Cookies.set("comment_author_"+j,n,{expires:b,path:"/"}),o.length&&Cookies.set("comment_author_url_"+j,o,{expires:b,path:"/"})),c(".wpd-cookies-checkbox").length&&c(".wpd-cookies-checkbox").prop("checked",!0)):z||c(".wpd-cookies-checkbox").prop("checked",!1),d.get(0).reset(),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+c(".wpdiscuz_unique_id",d).val()).setContents([{insert:"\n"}]):le(d.find(".wc_comment")),U(e.data),c(".wmu-preview-wrap",d).remove(),F.length&&(F.forEach(function(e){e.parents(".wpd-field-checkbox").remove()}),F=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){ae(),c("html, body").animate({scrollTop:c("#comment-"+e.data.new_comment_id).offset().top-E},1e3,ne)},t),me(e,d)):e.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[e.data],e.data,d),"error"),me(e,d)):wpdiscuzAjaxObj.setCommentMessage(e,"error"),c("#wpdiscuz-loading-bar").fadeOut(250),R=!1}).fail(function(e,t,o){console.log(o),c(s).addClass("wpd_not_clicked"),c("#wpdiscuz-loading-bar").fadeOut(250)})}function U(e){c(".wpd_comm_form .wc_name").val(e.comment_author),e.comment_author_email&&e.comment_author_email.indexOf("@example.com")<0&&c(".wpd_comm_form .wc_email").val(e.comment_author_email),e.comment_author_url&&c(".wpd_comm_form .wc_website").val(e.comment_author_url)}function W(e,t){c("#wpd-comm-"+e+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),c("#wpd-comm-"+e+" .wpdiscuz-edit-form-wrap").replaceWith(t),c("#wpd-comm-"+e+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}c(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?c(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):c(".wc_social_plugin_wrapper .the_champ_login_container").length?c(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):c(".wc_social_plugin_wrapper .social_connect_form").length?c(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):c(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&c(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&c("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",function(e){var t=c(".wpd-form").not(":hidden");if(t.length)if(wpdiscuzLoadRichEditor){for(var o=0;o<t.length;o++)if("\n"!==wpDiscuzEditor.createEditor(c(t[o]).find(".ql-container").attr("id")).getText())return e.preventDefault(),void(e.returnValue="")}else for(o=0;o<t.length;o++)if(c(t[o]).find(".wc_comment").val())return e.preventDefault(),void(e.returnValue="")}),wpdiscuzLoadRichEditor||(c(document).delegate("textarea.wc_comment","input",function(){le(c(this))}),c.each(c("textarea.wc_comment"),function(){le(c(this))})),c(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){c(".wpd-form-foot",c(this).parents(".wpd_comm_form")).slideDown(C)}),c(document).on("focus","#wpdcom textarea",function(){c(this).next(".autogrow-textarea-mirror").length||c(this).autoGrow()}),i||U({comment_author:Cookies.get("comment_author_"+j),comment_author_email:Cookies.get("comment_author_email_"+j),comment_author_url:Cookies.get("comment_author_url_"+j)}),c(".wpd-vote-down.wpd-dislike-hidden").remove(),c(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),c(document).on("click","#wpd-editor-source-code-wrapper-bg",function(){c(this).hide(),c("#wpd-editor-source-code-wrapper").hide(),c("#wpd-editor-uid").val(""),c("#wpd-editor-source-code").val("")}),wpdiscuzLoadRichEditor&&c(document).on("click","#wpd-insert-source-code",function(){var e=wpDiscuzEditor.createEditor("#"+c("#wpd-editor-uid").val());e.deleteText(0,e.getLength(),Quill.sources.USER);var t=c("#wpd-editor-source-code").val();t.length&&e.clipboard.dangerouslyPasteHTML(0,t,Quill.sources.USER),e.update(),c("#wpd-editor-source-code-wrapper-bg").hide(),c("#wpd-editor-source-code-wrapper").hide(),c("#wpd-editor-uid").val(""),c("#wpd-editor-source-code").val("")}),c(document).on("click",".wpd-reply-button",function(){var t,e,o=J(c(this),0);c(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+o).focus()},C):setTimeout(function(){c("#wc-textarea-"+o).trigger("focus")},C),c("#wpd-secondary-form-wrapper-"+o).slideToggle(C)):function(e){var t=J(e,0);c("#wpdiscuz_form_anchor-"+t).before(function(e){return c("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,e)}(t));var o=c("#wpd-secondary-form-wrapper-"+t);i||U({comment_author:Cookies.get("comment_author_"+j),comment_author_email:Cookies.get("comment_author_email_"+j),comment_author_url:Cookies.get("comment_author_url_"+j)}),wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+t).focus()},C):setTimeout(function(){c("#wc-textarea-"+t).trigger("focus")},C),o.slideToggle(C,function(){e.addClass("wpdiscuz-clonned")})}(c(this)),t=o,(p||r)&&"2.0"===l&&(e=Z(t),setTimeout(function(){if(!M[e])try{M[e]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(e){c("#wpdiscuz-recaptcha-field-"+t).val("key")},"expired-callback":function(){c("#wpdiscuz-recaptcha-field-"+t).val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3))}),c(document).on("click","#wpdcom .wpd-comment-link [data-comment-url]",function(){var e=c(this).data("comment-url"),t=c("<input/>");t.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(e),t.trigger("select"),document.execCommand("copy"),t.remove(),wpdiscuzAjaxObj.setCommentMessage(e+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)}),c(document).on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",function(e){e.preventDefault()}),c(document).on("click",".wpd-toggle.wpd_not_clicked",function(){var e=c(this);e.removeClass("wpd_not_clicked");var t,a,o,n,d=J(c(this),0),s=c(this),i=c(".fas",s);!s.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&v?(a=e,o=Z(t=d),(n=new FormData).append("action","wpdShowReplies"),n.append("commentId",o),we(x,!0,n).done(function(e){a.addClass("wpd_not_clicked"),"object"==typeof e&&e.success&&(c("#wpd-comm-"+t).replaceWith(e.data.comment_list),c("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),c("#wpd-comm-"+t+" .wpd-toggle .wpd-view-replies .wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),c("#wpd-comm-"+t+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),me(e)),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o),a.addClass("wpd_not_clicked"),c("#wpdiscuz-loading-bar").fadeOut(250)})):c("#wpd-comm-"+d+"> .wpd-reply").slideToggle(700,function(){c(this).is(":hidden")?(i.removeClass("fa-chevron-up"),i.addClass("fa-chevron-down"),s.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),s.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(i.removeClass("fa-chevron-down"),i.addClass("fa-chevron-up"),s.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),s.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),e.addClass("wpd_not_clicked")})}),c(document).on("mouseenter",".wpd-new-loaded-comment",function(){c(this).removeClass("wpd-new-loaded-comment")}),c(document).on("click",".wpd-sbs-toggle",function(){c(".wpdiscuz-subscribe-bar").slideToggle(C)}),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm)&&!i&&wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&c("#wpdiscuz-subscribe-form").length&&("2.0"===l?(setTimeout(function(){try{grecaptcha.render("wpdiscuz-recaptcha-subscribe-form",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(e){c("#wpdiscuz-recaptcha-field-subscribe-form").val("key")},"expired-callback":function(){c("#wpdiscuz-recaptcha-field-subscribe-form").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3),c(document).on("submit","#wpdiscuz-subscribe-form",function(e){c("#wpdiscuz-recaptcha-field-subscribe-form").val()?c(".wpdiscuz-recaptcha",c(this)).css("border","none"):(c(".wpdiscuz-recaptcha",c(this)).css("border","1px solid red"),e.preventDefault())})):"3.0"===l&&c(document).on("click","#wpdiscuz_subscription_button",function(e){var t=c(this).parents("#wpdiscuz-subscribe-form");e.preventDefault();try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then(function(e){console.log(5555),document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=e,t.trigger("submit")},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}})),(p||r)&&"2.0"===l&&(t=c(window).width(),1100<=(o=c("#wpdcom").width())&&(c("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),c("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"65%"}),c("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"35%"})),940<=o&&o<1100&&(c("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),c("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"60%"}),c("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"40%"})),810<=o&&o<940&&(c("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"40%"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"60%"})),730<=o&&o<810&&(c("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"45%"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"55%"})),610<=o&&o<730&&(c("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.85)","-webkit-transform":"scale(0.85)"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),c("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"43%"}),c("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"55%"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"})),650<t&&(510<=o&&o<610&&(c("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),c("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"35%"}),c("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"63%"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%",position:"relative",right:"-60px"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"}),c("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),470<=o&&o<510&&(c("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),c("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"40%"}),c("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"60%"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),c("#wpdcom .wpd_main_comm_form .wc-form-footer").css({"margin-left":"0px"}),c("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),o<470&&(c("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({margin:"0px auto","transform-origin":"center 0","-webkit-transform-origin":"center 0"}),c("#wpdcom .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),c("#wpdcom .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),c("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"}),c("#wpdcom .wpd-secondary-form-wrapper .wc_notification_checkboxes").css({"text-align":"center"}),c("#wpdcom .wpd-secondary-form-wrapper .wc-field-submit").css({"text-align":"center"})))),c(document).on("click",".wc_comm_submit.wpd_not_clicked",function(){var o,e,t,a=c(this),n=1,d=c(this).parents("form");if(d.hasClass("wpd_main_comm_form")||(t=(t=c(this).parents(".wpd-comment")).attr("class").split(" "),o="",c.each(t,function(e,t){"wpd_comment_level"===ee(t,!1)&&(o=ee(t,!0))}),n=parseInt(o)+1),oe(d,"#wpd-editor-"+c(".wpdiscuz_unique_id",d).val()),d.on("submit",function(e){e.preventDefault()}),""!==c(".wc_comment",d).val().trim()){if(d[0].checkValidity()&&(e=d,t=!0,"2.0"===l&&c("input[name=wc_captcha]",e).length&&!c("input[name=wc_captcha]",e).val().length?(t=!1,c(".wpdiscuz-recaptcha",e).css("border","1px solid red")):"2.0"===l&&c("input[name=wc_captcha]",e).length&&c(".wpdiscuz-recaptcha",e).css("border","none"),t)){R=!0,c(".wpd-agreement-checkbox",d).each(function(){c(this).hasClass("wpd_agreement_hide")&&g&&c(this).prop("checked")&&(Cookies.set(c(this).attr("name")+"_"+j,1,{expires:30,path:"/"}),c("input[name="+c(this).attr("name")+"]").each(function(){F.push(c(this))}))}),c(a).removeClass("wpd_not_clicked");var s=new FormData;if(s.append("action","wpdAddComment"),c(":input",d).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&s.append(this.name+"",c(this).val().trim()),"checkbox"!=this.type&&"radio"!=this.type||c(this).is(":checked")&&s.append(this.name+"",c(this).val())}),s.append("wpd_comment_depth",n),wpdiscuzAjaxObj.wpdiscuz_zs&&s.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),c(".wpd-cookies-checkbox",d).length?c(".wpd-cookies-checkbox",d).prop("checked")||(z=!1):i&&(z=!1),c("#wpdiscuz-loading-bar").show(),wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&"3.0"===l&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/addComment"}).then(function(e){s.append("g-recaptcha-response",e),H(d,s,a)},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error"),c("#wpdiscuz-loading-bar").fadeOut(250)}else H(d,s,a)}n=c(".wpdiscuz_unique_id",d).val(),(p||r)&&"2.0"===l&&(n=Z(n),grecaptcha.reset(M[n])),c(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wc_msg_required_fields,"wc_msg_required_fields",d),"error")}),c(document).on("click",".wpd_editable_comment",function(){h&&c(".wpdiscuz-edit-form-wrap").length&&W(J(c(".wpdiscuz-edit-form-wrap"),0),h);var o=c(this),a=J(o,0),e=Z(a),t=new FormData;t.append("action","wpdEditComment"),t.append("commentId",e),h=c("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-text").get(0),we(x,!0,t).done(function(e){var t;"object"==typeof e?e.success?(c("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(e.data.html),wpdiscuzLoadRichEditor?((t=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+a)).clipboard.dangerouslyPasteHTML(0,e.data.content),t.update(),c(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")):(c("#wc-textarea-edit_"+a).val(e.data.content),le(c("#wc-textarea-edit_"+a))),c("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),c("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[e.data],e.data,o),"error"):console.log(e),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o),c("#wpdiscuz-loading-bar").fadeOut(250)})}),c(document).on("click",".wc_save_edited_comment",function(){var e,t=c(this),o=J(t),a=Z(o),n=c("#wpd-comm-"+o+" #wpdiscuz-edit-form");oe(n,"#wpd-editor-edit_"+o),n.on("submit",function(e){e.preventDefault()}),n[0].checkValidity()&&((e=new FormData).append("action","wpdSaveEditedComment"),e.append("commentId",a),c(":input",n).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&e.append(this.name+"",c(this).val()),"checkbox"!==this.type&&"radio"!==this.type||c(this).is(":checked")&&e.append(this.name+"",c(this).val())}),we(x,!0,e).done(function(e){"object"==typeof e?(e.success?(W(o,e.data.message),e.data.lastEdited&&(c("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),c(e.data.lastEdited).insertAfter("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),e.data.twitterShareLink&&c("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",e.data.twitterShareLink),e.data.whatsappShareLink&&c("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",e.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+o)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[e.data],e.data,t),"error"),me(e,a)):console.log(e),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o),c("#wpdiscuz-loading-bar").fadeOut(250)}))}),c(document).on("click",".wc_cancel_edit",function(){var e=J(c(this));W(e,h),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+e)}),!a&&f&&(S=0,1==f?setTimeout(function(){N(!0)},500):c(document).on("click",".wpd-load-comments",function(){c(this).parent(".wpd-load-more-submit-wrap").remove(),N(!0)})),c(document).on("click",".wpd-load-more-submit",function(){var e=c(this),t="wpd-loaded";e.hasClass(t)&&N(!1,e,t,"wpd-loading")});var V,B,K=!1;function Q(){var e=c("#wpdiscuzHasMoreComments").val(),t=c(document).height(),o=c(window).height()+c(window).scrollTop();t&&o&&80<=100*o/t&&!1===K&&1==e&&N(!(K=!0),c(".wpd-load-more-submit"))}function N(t,a,n,d){a&&(a.toggleClass(n),a.toggleClass(d));var e=new FormData;e.append("action","wpdLoadMoreComments");var o=c(".wpdiscuz-sort-button-active").attr("data-sorting");o&&e.append("sorting",o),e.append("offset",S),e.append("lastParentId",c(".wpd-load-more-submit").attr("data-lastparentid")),e.append("isFirstLoad",t?1:0);o=c(".wpdf-active").attr("data-filter-type");e.append("wpdType",o||""),we(x,!t||1!=f,e).done(function(e){"object"==typeof e&&e.success&&(S++,t&&c(".wpd-comment").remove(),c(".wpdiscuz_single").remove(),c(".wpdiscuz-comment-pagination").before(e.data.comment_list),G(e,t&&2!==s),K=!1,e.data.loadLastCommentId&&(w=e.data.loadLastCommentId),me(e),t&&$(!1)),c("#wpdiscuz-loading-bar").fadeOut(250),c(".wpd-load-more-submit").blur(),a&&(a.toggleClass(n),a.toggleClass(d))}).fail(function(e,t,o){console.log(o),c("#wpdiscuz-loading-bar").fadeOut(250),c(".wpd-load-more-submit").blur(),a&&(a.toggleClass(n),a.toggleClass(d))})}function G(e,t){var o;0==e.data.is_show_load_more?(c("#wpdiscuzHasMoreComments").val(0),c(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()):(o=e.data.last_parent_id,c(".wpd-load-more-submit").attr("data-lastparentid",o),2!==s&&c(".wpdiscuz-comment-pagination").show(),c("#wpdiscuzHasMoreComments").val(1),t&&c(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show()),me(e)}function $(o){var a,e=location.href.match(/#comment\-(\d+)/);null!==e&&(a=e[1],c("#comment-"+a).length?setTimeout(function(){ae(),c("html, body").animate({scrollTop:c("#comment-"+a).parents("[id^=wpd-comm-]").offset().top-E},1e3,ne),o&&X(a)},500):((e=new FormData).append("action","wpdGetSingleComment"),e.append("commentId",a),we(x,!0,e).done(function(e){var t;"object"==typeof e&&e.success&&(t="#comment-"+a,c("#comment-"+e.data.parentCommentID).length?c("#comment-"+e.data.parentCommentID).parents("[id^=wpd-comm-"+e.data.parentCommentID+"]").replaceWith(e.data.message):c(".wpd-thread-list").prepend(e.data.message),me(e),ae(),c("html, body").animate({scrollTop:c(t).offset().top-E},1e3,ne),o&&X(a)),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o),c("#wpdiscuz-loading-bar").fadeOut(250)})))}function X(e){setTimeout(function(){c("#comment-"+e).siblings(".wpd-secondary-form-wrapper").is(":visible")||c("#comment-"+e).find(".wpd-reply-button").trigger("click")},1100)}function Y(e){if(void 0!==e.data.message)for(var t=e.data.message,o=0;o<t.length;o++)n=t[o],a=n.comment_parent,n=n.comment_html,0==a?de(n):(a=J(c("#comment-"+a),0),c("#wpdiscuz_form_anchor-"+a).after(n));var a,n}function J(e,t){var o="";return(o=(t?e.parents(".wpd-main-form-wrapper"):e.parents(".wpd-comment")).attr("id")).substring(o.lastIndexOf("-")+1)}function Z(e){return e.substring(0,e.indexOf("_"))}function ee(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function te(){var e=[];return c(".wpd-comment-right").each(function(){e.push(Z(J(c(this),0)))}),e.join(",")}function oe(e,t){var o=e.find(".wpd-required-group");wpdiscuzLoadRichEditor&&e.find(".wc_comment").val(c(t+">.ql-editor").html()),t=(t=(t=(t=(t=(e=(t=e).find(".wc_comment")).val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n")).replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),e.val(t),c.each(o,function(){c("input",this).prop("required",!1),0===c("input:checked",this).length?c("input",c(this)).prop("required",!0):c(".wpd-field-invalid",this).remove()})}function ae(){c("html, body").css("scroll-behavior","unset")}function ne(){c("html").css("scroll-behavior",P),c("body").css("scroll-behavior",q)}function de(e){c(".wpd-sticky-comment").last()[0]?c(e).insertAfter(c(".wpd-sticky-comment").last()[0]):c(".wpd-thread-list").prepend(e)}function se(e){e?e.prop("required")||(e.val()?e.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):e.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):c.each(c(".wc_email"),function(e,t){t=c(t);t.prop("required")||(t.val()?t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}function ie(e){return(e=(c(e).hasClass("wpd-inline-shortcode")?c(e):c(e).parents(".wpd-inline-shortcode")).attr("id")).substring(e.lastIndexOf("-")+1)}function ce(){c(".wpd-inline-form-wrapper").hide(),c(".wpd-inline-shortcode").removeClass("wpd-active"),c(".wpd-inline-icon").removeClass("wpd-open")}function pe(){c.each(c(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var e=c(this),t=e.offset().top-window.pageYOffset;e.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&0<t&&t<300&&("blink"===D?(e.addClass("wpd-blink"),setTimeout(function(){e.removeClass("wpd-blink")},3e3)):(e.parents(".wpd-inline-shortcode").addClass("wpd-active"),e.siblings(".wpd-inline-form-wrapper").show(),e.addClass("wpd-open"),re(e.siblings(".wpd-inline-form-wrapper"))))})}function re(e){var t;e?e.offset().left<=10?(e.css("left",Math.ceil(parseInt(e.css("left"))-e.offset().left+10)),(t=Math.ceil(e.siblings(".wpd-inline-icon.wpd-open").offset().left-e.offset().left+2))<3&&(t=3),document.styleSheets[0].addRule("#"+e.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;")):e.offset().left+e.width()>document.body.clientWidth-10&&(e.css("left",Math.ceil(parseInt(e.css("left"))+(document.body.clientWidth-(e.offset().left+e.width()))-10)),(t=Math.ceil(e.siblings(".wpd-inline-icon.wpd-open").offset().left-e.offset().left+2))>e.width()-3&&(t=e.width()-3),document.styleSheets[0].addRule("#"+e.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;")):c.each(c(".wpd-inline-form-wrapper:visible"),function(){var e;c(this).offset().left<=10?(c(this).css("left",Math.ceil(parseInt(c(this).css("left"))-c(this).offset().left+10)),(e=Math.ceil(c(this).siblings(".wpd-inline-icon.wpd-open").offset().left-c(this).offset().left+2))<3&&(e=3),document.styleSheets[0].addRule("#"+c(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+e+"px;")):c(this).offset().left+c(this).width()>document.body.clientWidth-10&&(c(this).css("left",Math.ceil(parseInt(c(this).css("left"))+(document.body.clientWidth-(c(this).offset().left+c(this).width()))-10)),(e=Math.ceil(c(this).siblings(".wpd-inline-icon.wpd-open").offset().left-c(this).offset().left+2))>c(this).width()-3&&(e=c(this).width()-3),document.styleSheets[0].addRule("#"+c(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+e+"px;"))})}function le(e){var t,o,a=0;e.parents(".wpd_main_comm_form").length?(a=parseInt(wpdiscuzAjaxObj.commentTextMaxLength),o=e.parents(".wpd_main_comm_form")):e.parents(".wpd-secondary-form-wrapper").length?(a=parseInt(wpdiscuzAjaxObj.replyTextMaxLength),o=e.parents(".wpd-secondary-form-wrapper")):e.parents("#wpdiscuz-edit-form").length&&(t=J(e),a=parseInt(t.substring(t.lastIndexOf("_")+1))?parseInt(wpdiscuzAjaxObj.replyTextMaxLength):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),o=e.parents("#wpdiscuz-edit-form")),a&&o&&(e=a-e.val().length,(o=c(".wpd-editor-char-counter",o)).html(e),e<=10?o.addClass("error"):o.removeClass("error"))}function me(t,o,a,n){t.data.callbackFunctions&&c.each(t.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,o,a,n):console.log(t.data.callbackFunctions[e]+" is not a function")})}function we(t,o,a){o&&c("#wpdiscuz-loading-bar").show(),a.append("postId",d);var n=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&c.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](a,t,o))});var e=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return c.ajax({type:"POST",url:e,data:a,contentType:!1,processData:!1})}2!==s||a||(c(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),Q(),c(window).scroll(function(){Q()})),wpdiscuzAjaxObj.setLoadMoreVisibility=G,c(document).on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",function(){var d=c(this);c(d).removeClass("wpd_not_clicked");var s=Z(J(d)),i=c(this).hasClass("wpd-vote-up")?1:-1,e=new FormData;e.append("action","wpdVoteOnComment"),e.append("commentId",s),e.append("voteType",i),we(x,!0,e).done(function(e){var t,o,a,n;c(d).addClass("wpd_not_clicked"),"object"==typeof e?(e.success?("total"===e.data.buttonsStyle?(t=c(".wpd-comment-footer .wpd-vote-result",c("#comment-"+s)),o=e.data.votes,t.text(e.data.votesHumanReadable),t.attr("title",o),t.removeClass("wpd-up wpd-down"),0<o&&t.addClass("wpd-up"),o<0&&t.addClass("wpd-down")):(a=c(".wpd-comment-footer .wpd-vote-result-like",c("#comment-"+s)),n=c(".wpd-comment-footer .wpd-vote-result-dislike",c("#comment-"+s)),a.text(e.data.likeCountHumanReadable),a.attr("title",e.data.likeCount),n.text(e.data.dislikeCountHumanReadable),n.attr("title",e.data.dislikeCount),0<parseInt(e.data.likeCount)?a.addClass("wpd-up"):a.removeClass("wpd-up"),parseInt(e.data.dislikeCount)<0?n.addClass("wpd-down"):n.removeClass("wpd-down")),a=c(".wpd-comment-footer .wpd-vote-up",c("#comment-"+s)),n=c(".wpd-comment-footer .wpd-vote-down",c("#comment-"+s)),a.removeClass("wpd-up"),n.removeClass("wpd-down"),0<e.data.curUserReaction?a.addClass("wpd-up"):e.data.curUserReaction<0&&n.addClass("wpd-down")):e.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[e.data],e.data,d),"error"),me(e,s,i)):console.log(e),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o),c(d).addClass("wpd_not_clicked"),c("#wpdiscuz-loading-bar").fadeOut(250)})}),c(document).on("click","body",function(e){var t=c(".wpdiscuz-sort-buttons");c(e.target).hasClass("wpdf-sorting")||c(e.target).parent().hasClass("wpdf-sorting")?t.css({display:t.is(":visible")?"none":"flex"}):t.hide()}),c(document).on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var e=c(this),t=c(this).attr("data-sorting");t&&(c(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),e.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting"),(e=new FormData).append("action","wpdSorting"),e.append("sorting",t),t=c(".wpdf-active").attr("data-filter-type"),e.append("wpdType",t||""),we(x,!0,e).done(function(e){"object"==typeof e&&e.success&&(c("#wpdcom .wpd-comment").remove(),c("#wpdcom .wpd-thread-list").prepend(e.data.message),G(e,!1),S=1),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o),c("#wpdiscuz-loading-bar").fadeOut(250)}))}),window.onhashchange=function(){$(!1)},1!=f&&$(!1),c(document).on("click",".wpdiscuz-readmore",function(){var t=J(c(this)),o=Z(t),e=new FormData;e.append("action","wpdReadMore"),e.append("commentId",o),we(x,!0,e).done(function(e){"object"==typeof e?(e.success?(c("#comment-"+o+" .wpd-comment-text").replaceWith(" "+e.data.message),c("#wpdiscuz-readmore-"+t).remove()):console.log(e.data),me(e)):console.log(e),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o),c("#wpdiscuz-loading-bar").fadeOut(250)})}),c(document).on("change",".wpd-required-group",function(){0!==c("input:checked",this).length?c("input",c(this)).prop("required",!1):c("input",c(this)).prop("required",!0)}),c(document).on("click",".wpdiscuz-spoiler",function(){c(this).next().slideToggle(),c(this).hasClass("wpdiscuz-spoiler-closed")?c(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"):c(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"),c(this).toggleClass("wpdiscuz-spoiler-closed")}),c(document).on("click",".wpd-tools i",function(){var e=c(this).siblings(".wpd-tools-actions");e.is(":visible")||c(this).parents(".wpd-comment-right").attr("id")!==c("[id^=comment-]","#wpdcom").last().attr("id")||c("#comments").css({paddingBottom:"160px"}),e.css({display:e.is(":visible")?"none":"flex"})}),c(document).on("mouseleave",".wpd-comment-right",function(){c(this).find(".wpd-tools-actions").hide(),c("#comments").css({paddingBottom:"0"})}),c(document).on("click",".wpd_stick_btn",function(){var e=Z(J(c(this),0)),t=new FormData;t.append("action","wpdStickComment"),t.append("commentId",e),we(x,!0,t).done(function(e){"object"==typeof e&&e.success&&location.reload(!0),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o),c("#wpdiscuz-loading-bar").fadeOut(250)})}),c(document).on("click",".wpd_close_btn",function(){var e=Z(J(c(this),0)),t=new FormData;t.append("action","wpdCloseThread"),t.append("commentId",e),we(x,!0,t).done(function(e){"object"==typeof e&&e.success&&location.reload(!0),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o),c("#wpdiscuz-loading-bar").fadeOut(250)})}),c(document).on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var t=c(this),e=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+e),t.removeClass("wpd_not_clicked"),c(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdLoadMoreComments");var a=c(".wpdiscuz-sort-button-active").attr("data-sorting");a&&o.append("sorting",a),o.append("lastParentId",0),o.append("offset",0),S=1,o.append("wpdType",t.hasClass("wpdf-active")?"":e),o.append("isFirstLoad",1),!c(this).hasClass("wpdf-inline")||c(this).hasClass("wpdf-active")?c(".wpd-comment-info-bar").hide():c(".wpd-comment-info-bar").css("display","flex"),we(x,!1,o).done(function(e){t.addClass("wpd_not_clicked"),c(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof e&&e.success&&(t.toggleClass("wpdf-active"),c(".wpd-load-comments").remove(),c(".wpd-comment").remove(),c(".wpd-thread-list").prepend(e.data.comment_list),G(e),w=e.data.loadLastCommentId,c(".wpd-load-more-submit").blur(),me(e)),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o),c("#wpdiscuz-loading-bar").fadeOut(250)})}),c(document).on("click",".wpdf-reacted.wpd_not_clicked",function(){var a=c(this);a.removeClass("wpd_not_clicked"),c(".fas",a).addClass("fa-pulse fa-spinner");var e=new FormData;e.append("action","wpdMostReactedComment"),we(x,!1,e).done(function(e){a.addClass("wpd_not_clicked"),c(".fas",a).removeClass("fa-pulse fa-spinner"),"object"==typeof e&&e.success&&(c("#comment-"+e.data.parentCommentID).length?c("#comment-"+e.data.parentCommentID).parents("[id^=wpd-comm-"+e.data.parentCommentID+"]").replaceWith(e.data.message):c("#comment-"+e.data.commentId).length||c(".wpd-thread-list").prepend(e.data.message),me(e),ae(),c("html, body").animate({scrollTop:c("#comment-"+e.data.commentId).offset().top-E},1e3,ne))}).fail(function(e,t,o){console.log(o),c(".fas",a).removeClass("fa-pulse fa-spinner")})}),c(document).on("click",".wpdf-hottest.wpd_not_clicked",function(){var a=c(this);a.removeClass("wpd_not_clicked"),c(".fas",a).addClass("fa-pulse fa-spinner");var e=new FormData;e.append("action","wpdHottestThread"),we(x,!1,e).done(function(e){a.addClass("wpd_not_clicked"),c(".fas",a).removeClass("fa-pulse fa-spinner"),"object"==typeof e&&e.success&&(c("#comment-"+e.data.commentId).length?c("#comment-"+e.data.commentId).parents("[id^=wpd-comm-"+e.data.commentId+"]").replaceWith(e.data.message):c(".wpd-thread-list").prepend(e.data.message),me(e),ae(),c("html, body").animate({scrollTop:c("#comment-"+e.data.commentId).offset().top-E},1e3,ne))}).fail(function(e,t,o){console.log(o),c(".fas",a).removeClass("fa-pulse fa-spinner")})}),c(document).on("click",".wpd-filter-view-all",function(){c(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")}),c(document).on("click",".wpd-follow-link.wpd_not_clicked",function(){var a=c(this);a.removeClass("wpd_not_clicked"),c(".fas",a).addClass("fa-pulse fa-spinner");var e=Z(J(a,0)),t=new FormData;t.append("action","wpdFollowUser"),t.append("commentId",e),we(x,!0,t).done(function(e){a.addClass("wpd_not_clicked"),"object"==typeof e?e.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[e.data.code],e.data.code,a),"success"),a.removeClass("wpd-follow-active"),e.data.followTip&&a.attr("wpd-tooltip",e.data.followTip),e.data.followClass&&a.addClass(e.data.followClass)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[e.data],e.data,a),"error"):console.log(e),c(".fas",a).removeClass("fa-pulse fa-spinner"),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o),c(".fas",a).removeClass("fa-pulse fa-spinner"),c("#wpdiscuz-loading-bar").fadeOut(250)})}),se(),c(document).on("keyup",".wc_email",function(){se(c(this))}),k&&c("#wpdcom").length&&(c("#wpd-bubble-wrapper").hover(function(){c(this).addClass("wpd-bubble-hover")},function(){c(this).removeClass("wpd-bubble-hover")}),O&&!Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)&&setTimeout(function(){c("#wpd-bubble-wrapper").addClass("wpd-bubble-hover"),Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint,"1",{expires:7,path:"/"}),setTimeout(function(){c("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")},1e3*A)},1e3*O),"content_left"===T?c(".entry-content").length?(B=25<(V=Math.min(c(".entry-content").offset().left,c("#wpdcom").offset().left)-120)?V:25,c("#wpd-bubble-wrapper").css({left:B+"px"}),c("#wpd-bubble-wrapper").addClass("wpd-left-content")):c(".post-entry").length?(B=25<(V=Math.min(c(".post-entry").offset().left,c("#wpdcom").offset().left)-120)?V:25,c("#wpd-bubble-wrapper").css({left:B+"px"}),c("#wpd-bubble-wrapper").addClass("wpd-left-content")):c(".container").length?(B=25<(V=Math.min(c(".container").offset().left,c("#wpdcom").offset().left)-120)?V:25,c("#wpd-bubble-wrapper").css({left:B+"px"}),c("#wpd-bubble-wrapper").addClass("wpd-left-content")):(c("#wpd-bubble-wrapper").css({left:"25px"}),c("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"left_corner"===T?(c("#wpd-bubble-wrapper").css({left:"25px"}),c("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===T&&(c("#wpd-bubble-wrapper").css({right:"25px"}),c("#wpd-bubble-wrapper").addClass("wpd-right-corner")),c("#wpd-bubble-wrapper").show(),c(document).on("click","#wpd-bubble-add-message-close",function(e){e.preventDefault(),e.stopPropagation(),c("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),c(document).on("click","#wpd-bubble",function(){ae(),c("#tab-title-reviews").length&&c("#tab-title-reviews a").trigger("click"),c("html, body").animate({scrollTop:c("#wpdcom").offset().top-(E+28)},1e3,function(){ne(),c("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover"),wpdiscuzLoadRichEditor?c("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0").focus():c("#wc-textarea-0_0").length&&c("#wc-textarea-0_0").trigger("focus")})}),c(document).on("click","#wpd-bubble-comment-close",function(e){e.preventDefault(),c("#wpd-bubble-notification-message").hide(),c("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),c(document).on("click","#wpd-bubble-comment-reply-link a",function(){var e=c(this).attr("href");setTimeout(function(){c("#wpd-bubble-notification-message").hide(),c("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),$(!0);var t=e.match(/#comment\-(\d+)/);L=L.filter(function(e){return e!=t[1]}),c("#wpd-bubble-count .wpd-new-comments-count").text(L.length),0==L.length&&c("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),c(document).on("click","#wpd-bubble-count",function(){var e;L.length&&((e=new FormData).append("action","wpdBubbleUpdate"),e.append("newCommentIds",L.join()),we(x,!0,e).done(function(e){"object"==typeof e&&e.success&&(e.data.message=e.data.message.filter(function(e){if(!c("#comment-"+e.comment_id).length)return e}),Y(e),c("#wpd-bubble-count").removeClass("wpd-new-comments"),c("#wpd-bubble-count .wpd-new-comments-count").text("0"),L=[],c(".wpd-new-loaded-comment").length&&(ae(),c("html, body").animate({scrollTop:c(c(".wpd-new-loaded-comment")[0]).offset().top-(E+28)},1e3,ne)),me(e)),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o)}))})),(k&&y||n)&&(i||!i&&e)&&setTimeout(function a(){c.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:d,lastId:u,visibleCommentIds:te()}}).done(function(e){var t,o;R||("object"==typeof e?(e.commentIDsToRemove.forEach(function(e){c("[id^=wpd-comm-"+e+"]").remove()}),e.ids.length&&(n&&((o=new FormData).append("action","wpdUpdateAutomatically"),o.append("loadLastCommentId",w),o.append("visibleCommentIds",te()),we(x,!1,o).done(function(e){R||"object"==typeof e&&e.success&&(Y(e),e.data.wc_all_comments_count_new=parseInt(e.data.wc_all_comments_count_new),c(".wpd-thread-info").html(e.data.wc_all_comments_count_before_threads_html),c(".wpd-thread-info").attr("data-comments-count",e.data.wc_all_comments_count_new),c("#wpd-bubble-all-comments-count").replaceWith(e.data.wc_all_comments_count_bubble_html),w=e.data.loadLastCommentId)}).fail(function(e,t,o){console.log(o)})),e.ids=e.ids.filter(function(e){if(!c("#comment-"+e).length)return e}),t=5e3,u=parseInt(e.ids[e.ids.length-1]),L=L.concat(e.ids),I&&e.commentText&&(c("#wpd-bubble-author-avatar").html(e.avatar),c("#wpd-bubble-author-name").html(e.authorName),c("#wpd-bubble-comment-date span").html(e.commentDate),c("#wpd-bubble-comment-text").html(e.commentText),c("#wpd-bubble-comment-reply-link a").attr("href",e.commentLink),c("#wpd-bubble-notification-message").show(),t=1e4),o=parseInt(c(".wpd-new-comments-count").text()),o+=e.ids.length,c("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),c("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout(function(){c("#wpd-bubble-notification-message").hide(),c("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")},t),c(".wpd-new-comments-count").text(o),c("#wpd-bubble-count").addClass("wpd-new-comments")),e.all_comments_count=parseInt(e.all_comments_count),c("#wpd-bubble-all-comments-count").replaceWith(e.all_comments_count_bubble_html),c(".wpd-thread-info").html(e.all_comments_count_before_threads_html),c(".wpd-thread-info").attr("data-comments-count",e.all_comments_count)):console.log(e)),setTimeout(a,m)}).fail(function(e,t,o){console.log(o),setTimeout(a,m)})},m),c(".wpd-inline-form-wrapper").length&&((e=new FormData).append("action","wpdGetInlineCommentForm"),we(x,!1,e).done(function(e){"object"==typeof e?e.success?(c(".wpd-inline-form-wrapper").append(e.data),c.each(c("[name=_wpd_inline_nonce]"),function(){var e=c(this).attr("id"),t=c(this).parents(".wpd-inline-shortcode").attr("id");c(this).attr("id",e+"-"+t.substring(t.lastIndexOf("-")+1))}),c(".wpd-inline-opened").addClass("wpd-active"),c(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),c(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),c(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),re()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[e.data]),e.data,"error"):console.log(e)}).fail(function(e,t,o){console.log(o)})),c(document).on("click","body",function(e){var t;c(e.target).hasClass("wpd-inline-form-close")||c(e.target).parents(".wpd-inline-form-close").length?(e.preventDefault(),c(e.target).parents(".wpd-inline-form-wrapper").hide(),c(e.target).parents(".wpd-inline-shortcode").removeClass("wpd-active"),c(e.target).parents(".wpd-inline-form-wrapper").siblings(".wpd-inline-icon").removeClass("wpd-open")):c(e.target).hasClass("wpd-inline-form-wrapper")||c(e.target).parents(".wpd-inline-form-wrapper").length||(ce(),t="",c(e.target).hasClass("wpd-inline-icon")?t=c(e.target):c(e.target).parents(".wpd-inline-icon").length&&(t=c(e.target).parents(".wpd-inline-icon")),t.length&&t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(t.parents(".wpd-inline-shortcode").addClass("wpd-active"),t.siblings(".wpd-inline-form-wrapper").show(),t.addClass("wpd-open"),t.removeClass("wpd-ignored"),re(t.siblings(".wpd-inline-form-wrapper")))),(!c(e.target).hasClass("wpd-last-inline-comments-wrapper")&&!c(e.target).parents(".wpd-last-inline-comments-wrapper").length||c(e.target).parents(".wpd-last-inline-comments-wrapper").length&&c(e.target).hasClass("wpd-load-inline-comment"))&&c(".wpd-last-inline-comments-wrapper").remove()}),c(document).on("click",".wpd-inline-submit.wpd_not_clicked",function(e){e.preventDefault();var o,a=c(this),n=c(this).parents(".wpd_inline_comm_form");n[0].checkValidity()&&(c(this).removeClass("wpd_not_clicked"),(o=new FormData).append("action","wpdAddInlineComment"),o.append("inline_form_id",ie(n)),c.each(c("input, textarea",n),function(e,t){("checkbox"!==this.type||c(this).is(":checked"))&&o.append(c(t).attr("name"),c(t).val())}),we(x,!0,o).done(function(e){var t,o;a.addClass("wpd_not_clicked"),"object"==typeof e?e.success?(n[0].reset(),ce(),t=parseInt(e.data.newCount),(o=a.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count")).text(t),t?o.addClass("wpd-has-comments"):o.removeClass("wpd-has-comments"),e.data.allCommentsCountNew=parseInt(e.data.allCommentsCountNew),c(".wpd-thread-info").html(e.data.allCommentsCountBeforeThreadsHtml),c(".wpd-thread-info").attr("data-comments-count",e.data.allCommentsCountNew),c("#wpd-bubble-all-comments-count").replaceWith(e.data.allCommentsCountBubbleHtml),e.data.message&&de(e.data.message),wpdiscuzAjaxObj.setCommentMessage(e.data.notification,"success")):e.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[e.data],e.data,a),"error"):wpdiscuzAjaxObj.setCommentMessage(e,"error"),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o),c("#wpdiscuz-loading-bar").fadeOut(250)}))}),c(document).on("keydown",".wpd-form",function(e){e.ctrlKey&&13==e.keyCode&&c(this).find(".wc_comm_submit").trigger("click")}),c(document).on("keydown","#wpdiscuz-edit-form",function(e){e.ctrlKey&&13==e.keyCode&&c(this).find(".wc_save_edited_comment").trigger("click")}),c(document).on("keydown",".wpd-inline-comment-content",function(e){e.ctrlKey&&13==e.keyCode&&c(this).parents(".wpd_inline_comm_form").find(".wpd-inline-submit.wpd_not_clicked").trigger("click")}),c(document).on("click",".wpd-inline-icon-count.wpd-has-comments",function(){var t=c(this),e=new FormData;e.append("action","wpdGetLastInlineComments"),e.append("inline_form_id",ie(t)),we(x,!0,e).done(function(e){"object"==typeof e?e.success?c(e.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[e.data],e.data,t),"error"):console.log(e),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o),c("#wpdiscuz-loading-bar").fadeOut(250)})}),c(document).on("click",".wpd-view-all-inline-comments",function(e){e.preventDefault(),c(this).parents(".wpd-last-inline-comments-wrapper").remove(),c(".wpdf-inline").hasClass("wpdf-active")||c(".wpdf-inline").trigger("click"),ae(),c("html, body").animate({scrollTop:c(".wpdf-inline").offset().top-E},1e3,ne)}),c(document).on("click",".wpd-feedback-content-link",function(e){e.preventDefault();var t=c(this).data("feedback-content-id");ae(),c("html, body").animate({scrollTop:c("#wpd-inline-"+t).offset().top-(E+6)},1e3,function(){ne(),c("#wpd-inline-"+t).addClass("wpd-active")})}),"scroll_open"!==D&&"blink"!==D||(pe(),c(window).on("scroll",pe)),c(document).on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var e=new FormData,t=c(this).index();0<=t&&t<5&&(e.append("action","wpdUserRate"),e.append("rating",t+1),we(x,!0,e).done(function(e){"object"==typeof e?e.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[e.data],e.data),"error"):console.log(e),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o),c("#wpdiscuz-loading-bar").fadeOut(250)}))}),c(document).on("submit","#wpdiscuz-subscribe-form",function(e){e.preventDefault();var t,o,a=c(this);a[0].checkValidity()&&(o=a,e=!0,"2.0"===l&&c("input[name=wpdiscuz_recaptcha_subscribe_form]",o).length&&!c("input[name=wpdiscuz_recaptcha_subscribe_form]",o).val().length?(e=!1,c(".wpdiscuz-recaptcha",o).css("border","1px solid red")):"2.0"===l&&c("input[name=wpdiscuz_recaptcha_subscribe_form]",o).length&&c(".wpdiscuz-recaptcha",o).css("border","none"),e)&&((t=new FormData).append("action","wpdAddSubscription"),c("*",a).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&t.append(this.name+"",c(this).val()),"checkbox"!=this.type&&"radio"!=this.type||c(this).is(":checked")&&t.append(this.name+"",c(this).val())}),we(x,!0,t).done(function(e){"object"==typeof e?e.success?(wpdiscuzAjaxObj.setCommentMessage(e.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(e.data,"error"):wpdiscuzAjaxObj.setCommentMessage(e,"error"),c("#wpdiscuz-loading-bar").fadeOut(250),R=!1}).fail(function(e,t,o){console.log(o),c("#wpdiscuz-loading-bar").fadeOut(250)}))}),c(document).on("click",".wpd-unsubscribe",function(e){e.preventDefault();e=new FormData;e.append("action","wpdUnsubscribe"),e.append("sid",c(this).data("sid")),e.append("skey",c(this).data("skey")),we(x,!0,e).done(function(e){"object"==typeof e?e.success?(wpdiscuzAjaxObj.setCommentMessage(e.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(e.data,"error"):console.log(e),c("#wpdiscuz-loading-bar").fadeOut(250),R=!1}).fail(function(e,t,o){console.log(o),c("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(e){c(".wpd-filter.wpdf-active"+(e?":not("+e+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=we});var onloadCallback=function(){if(document.getElementById("wpdiscuz-recaptcha-0_0")&&"2.0"===wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.render("wpdiscuz-recaptcha-0_0",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(e){jQuery("#wpdiscuz-recaptcha-field-0_0").val("key")},"expired-callback":function(){jQuery("#wpdiscuz-recaptcha-field-0_0").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}};
|
11 |
/* Colorbox */
|
12 |
!function(t,e,i){var o,n,r,h,a,s,l,c,d,g,f,u,p,m,w,v,y,x,b,T,C,H,k,W,E,I,M,L,R,S,K,P,B,O={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return t(this).attr("href")},title:function(){return this.title},createImg:function(){var e=new Image,i=t(this).data("cbox-img-attrs");return"object"==typeof i&&t.each(i,function(t,i){e[t]=i}),e},createIframe:function(){var i=e.createElement("iframe"),o=t(this).data("cbox-iframe-attrs");return"object"==typeof o&&t.each(o,function(t,e){i[t]=e}),"frameBorder"in i&&(i.frameBorder=0),"allowTransparency"in i&&(i.allowTransparency="true"),i.name=(new Date).getTime(),i.allowFullscreen=!0,i}},_="colorbox",j="cbox",D=j+"Element",F=j+"_open",N=j+"_load",z=j+"_complete",A=j+"_cleanup",q=j+"_closed",U=j+"_purge",$=t("<a/>"),G="div",Q=0,J={};function V(i,o,n){var r=e.createElement(i);return o&&(r.id=j+o),n&&(r.style.cssText=n),t(r)}function X(){return i.innerHeight?i.innerHeight:t(i).height()}function Y(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var o;return void 0===this.cache[e]&&(void 0!==(o=t(this.el).attr("data-cbox-"+e))?this.cache[e]=o:void 0!==i[e]?this.cache[e]=i[e]:void 0!==O[e]&&(this.cache[e]=O[e])),this.cache[e]},this.get=function(t){var e=this.value(t);return"function"==typeof e?e.call(this.el,this):e}}function Z(t){var e=d.length,i=(I+t)%e;return i<0?e+i:i}function tt(t,e){return Math.round((/%/.test(t)?("x"===e?g.width():X())/100:1)*parseInt(t,10))}function et(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function it(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function ot(t){"contains"in n[0]&&!n[0].contains(t.target)&&t.target!==o[0]&&(t.stopPropagation(),n.trigger("focus"))}function nt(t){nt.str!==t&&(n.add(o).removeClass(nt.str).addClass(t),nt.str=t)}function rt(i){t(e).trigger(i),$.triggerHandler(i)}var ht=function(){var t,e,i=j+"Slideshow_",o="click."+j;function r(){clearTimeout(e)}function h(){(C.get("loop")||d[I+1])&&(r(),e=setTimeout(P.next,C.get("slideshowSpeed")))}function a(){v.html(C.get("slideshowStop")).off(o).one(o,s),$.on(z,h).on(N,r),n.removeClass(i+"off").addClass(i+"on")}function s(){r(),$.off(z,h).off(N,r),v.html(C.get("slideshowStart")).off(o).one(o,function(){P.next(),a()}),n.removeClass(i+"on").addClass(i+"off")}function l(){t=!1,v.hide(),r(),$.off(z,h).off(N,r),n.removeClass(i+"off "+i+"on")}return function(){t?C.get("slideshow")||($.off(A,l),l()):C.get("slideshow")&&d[1]&&(t=!0,$.one(A,l),C.get("slideshowAuto")?a():s(),v.show())}}();function at(r){var g,w;if(!S){if(g=t(r).data(_),C=new Y(r,g),w=C.get("rel"),I=0,w&&!1!==w&&"nofollow"!==w?(d=t("."+D).filter(function(){return new Y(this,t.data(this,_)).get("rel")===w}),-1===(I=d.index(C.el))&&(d=d.add(C.el),I=d.length-1)):d=t(C.el),!L){L=R=!0,nt(C.get("className")),n.css({visibility:"hidden",display:"block",opacity:""}),f=V(G,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),h.css({width:"",height:""}).append(f),H=a.height()+c.height()+h.outerHeight(!0)-h.height(),k=s.width()+l.width()+h.outerWidth(!0)-h.width(),W=f.outerHeight(!0),E=f.outerWidth(!0);var v=tt(C.get("initialWidth"),"x"),y=tt(C.get("initialHeight"),"y"),x=C.get("maxWidth"),B=C.get("maxHeight");C.w=Math.max((!1!==x?Math.min(v,tt(x,"x")):v)-E-k,0),C.h=Math.max((!1!==B?Math.min(y,tt(B,"y")):y)-W-H,0),f.css({width:"",height:C.h}),P.position(),rt(F),C.get("onOpen"),T.add(m).hide(),n.trigger("focus"),C.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",ot,!0),$.one(q,function(){e.removeEventListener("focus",ot,!0)})),C.get("returnFocus")&&$.one(q,function(){t(C.el).trigger("focus")})}var O=parseFloat(C.get("opacity"));o.css({opacity:O==O?O:"",cursor:C.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),C.get("closeButton")?b.html(C.get("close")).appendTo(h):b.appendTo("<div/>"),function(){var e,o,n,r=P.prep,h=++Q;R=!0,M=!1,rt(U),rt(N),C.get("onLoad"),C.h=C.get("height")?tt(C.get("height"),"y")-W-H:C.get("innerHeight")&&tt(C.get("innerHeight"),"y"),C.w=C.get("width")?tt(C.get("width"),"x")-E-k:C.get("innerWidth")&&tt(C.get("innerWidth"),"x"),C.mw=C.w,C.mh=C.h,C.get("maxWidth")&&(C.mw=tt(C.get("maxWidth"),"x")-E-k,C.mw=C.w&&C.w<C.mw?C.w:C.mw);C.get("maxHeight")&&(C.mh=tt(C.get("maxHeight"),"y")-W-H,C.mh=C.h&&C.h<C.mh?C.h:C.mh);if(e=C.get("href"),K=setTimeout(function(){p.show()},100),C.get("inline")){var a=t(e).eq(0);n=t("<div>").hide().insertBefore(a),$.one(U,function(){n.replaceWith(a)}),r(a)}else C.get("iframe")?r(" "):C.get("html")?r(C.get("html")):et(C,e)?(e=it(C,e),M=C.get("createImg"),t(M).addClass(j+"Photo").on("error."+j,function(){r(V(G,"Error").html(C.get("imgError")))}).one("load",function(){h===Q&&setTimeout(function(){var e;C.get("retinaImage")&&i.devicePixelRatio>1&&(M.height=M.height/i.devicePixelRatio,M.width=M.width/i.devicePixelRatio),C.get("scalePhotos")&&(o=function(){M.height-=M.height*e,M.width-=M.width*e},C.mw&&M.width>C.mw&&(e=(M.width-C.mw)/M.width,o()),C.mh&&M.height>C.mh&&(e=(M.height-C.mh)/M.height,o())),C.h&&(M.style.marginTop=Math.max(C.mh-M.height,0)/2+"px"),d[1]&&(C.get("loop")||d[I+1])&&(M.style.cursor="pointer",t(M).on("click."+j,function(){P.next()})),M.style.width=M.width+"px",M.style.height=M.height+"px",r(M)},1)}),M.src=e):e&&u.load(e,C.get("data"),function(e,i){h===Q&&r("error"===i?V(G,"Error").html(C.get("xhrError")):t(this).contents())})}()}}function st(){n||(B=!1,g=t(i),n=V(G).attr({id:_,class:!1===t.support.opacity?j+"IE":"",role:"dialog",tabindex:"-1"}).hide(),o=V(G,"Overlay").hide(),p=t([V(G,"LoadingOverlay")[0],V(G,"LoadingGraphic")[0]]),r=V(G,"Wrapper"),h=V(G,"Content").append(m=V(G,"Title"),w=V(G,"Current"),x=t('<button type="button"/>').attr({id:j+"Previous"}),y=t('<button type="button"/>').attr({id:j+"Next"}),v=t('<button type="button"/>').attr({id:j+"Slideshow"}),p),b=t('<button type="button"/>').attr({id:j+"Close"}),r.append(V(G).append(V(G,"TopLeft"),a=V(G,"TopCenter"),V(G,"TopRight")),V(G,!1,"clear:left").append(s=V(G,"MiddleLeft"),h,l=V(G,"MiddleRight")),V(G,!1,"clear:left").append(V(G,"BottomLeft"),c=V(G,"BottomCenter"),V(G,"BottomRight"))).find("div div").css({float:"left"}),u=V(G,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),T=y.add(x).add(w).add(v)),e.body&&!n.parent().length&&t(e.body).append(o,n.append(r,u))}function lt(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t.ctrlKey||(t.preventDefault(),at(this))}return!!n&&(B||(B=!0,y.on("click",function(){P.next()}),x.on("click",function(){P.prev()}),b.on("click",function(){P.close()}),o.on("click",function(){C.get("overlayClose")&&P.close()}),t(e).on("keydown."+j,function(t){var e=t.keyCode;L&&C.get("escKey")&&27===e&&(t.preventDefault(),P.close()),L&&C.get("arrowKey")&&d[1]&&!t.altKey&&(37===e?(t.preventDefault(),x.trigger("click")):39===e&&(t.preventDefault(),y.trigger("click")))}),"function"==typeof t.fn.on?t(e).on("click."+j,"."+D,i):t("."+D).live("click."+j,i)),!0)}t[_]||(t(st),(P=t.fn[_]=t[_]=function(e,i){var o=this;return e=e||{},"function"==typeof o&&(o=t("<a/>"),e.open=!0),o[0]?(st(),lt()&&(i&&(e.onComplete=i),o.each(function(){var i=t.data(this,_)||{};t.data(this,_,t.extend(i,e))}).addClass(D),new Y(o[0],e).get("open")&&at(o[0])),o):o}).position=function(e,i){var o,d,f,u=0,p=0,m=n.offset();function w(){a[0].style.width=c[0].style.width=h[0].style.width=parseInt(n[0].style.width,10)-k+"px",h[0].style.height=s[0].style.height=l[0].style.height=parseInt(n[0].style.height,10)-H+"px"}if(g.off("resize."+j),n.css({top:-9e4,left:-9e4}),d=g.scrollTop(),f=g.scrollLeft(),C.get("fixed")?(m.top-=d,m.left-=f,n.css({position:"fixed"})):(u=d,p=f,n.css({position:"absolute"})),!1!==C.get("right")?p+=Math.max(g.width()-C.w-E-k-tt(C.get("right"),"x"),0):!1!==C.get("left")?p+=tt(C.get("left"),"x"):p+=Math.round(Math.max(g.width()-C.w-E-k,0)/2),!1!==C.get("bottom")?u+=Math.max(X()-C.h-W-H-tt(C.get("bottom"),"y"),0):!1!==C.get("top")?u+=tt(C.get("top"),"y"):u+=Math.round(Math.max(X()-C.h-W-H,0)/2),n.css({top:m.top,left:m.left,visibility:"visible"}),r[0].style.width=r[0].style.height="9999px",o={width:C.w+E+k,height:C.h+W+H,top:u,left:p},e){var v=0;t.each(o,function(t){o[t]===J[t]||(v=e)}),e=v}J=o,e||n.css(o),n.dequeue().animate(o,{duration:e||0,complete:function(){w(),R=!1,r[0].style.width=C.w+E+k+"px",r[0].style.height=C.h+W+H+"px",C.get("reposition")&&setTimeout(function(){g.on("resize."+j,P.position)},1),"function"==typeof i&&i()},step:w})},P.resize=function(t){var e;L&&((t=t||{}).width&&(C.w=tt(t.width,"x")-E-k),t.innerWidth&&(C.w=tt(t.innerWidth,"x")),f.css({width:C.w}),t.height&&(C.h=tt(t.height,"y")-W-H),t.innerHeight&&(C.h=tt(t.innerHeight,"y")),t.innerHeight||t.height||(e=f.scrollTop(),f.css({height:"auto"}),C.h=f.height()),f.css({height:C.h}),e&&f.scrollTop(e),P.position("none"===C.get("transition")?0:C.get("speed")))},P.prep=function(i){if(L){var o,r="none"===C.get("transition")?0:C.get("speed");f.remove(),(f=V(G,"LoadedContent").append(i)).hide().appendTo(u.show()).css({width:(C.w=C.w||f.width(),C.w=C.mw&&C.mw<C.w?C.mw:C.w,C.w),overflow:C.get("scrolling")?"auto":"hidden"}).css({height:(C.h=C.h||f.height(),C.h=C.mh&&C.mh<C.h?C.mh:C.h,C.h)}).prependTo(h),u.hide(),t(M).css({float:"none"}),nt(C.get("className")),o=function(){var i,o,h=d.length;function a(){!1===t.support.opacity&&n[0].style.removeAttribute("filter")}L&&(o=function(){clearTimeout(K),p.hide(),rt(z),C.get("onComplete")},m.html(C.get("title")).show(),f.show(),h>1?("string"==typeof C.get("current")&&w.html(C.get("current").replace("{current}",I+1).replace("{total}",h)).show(),y[C.get("loop")||I<h-1?"show":"hide"]().html(C.get("next")),x[C.get("loop")||I?"show":"hide"]().html(C.get("previous")),ht(),C.get("preloading")&&t.each([Z(-1),Z(1)],function(){var i=d[this],o=new Y(i,t.data(i,_)),n=o.get("href");n&&et(o,n)&&(n=it(o,n),e.createElement("img").src=n)})):T.hide(),C.get("iframe")?(i=C.get("createIframe"),C.get("scrolling")||(i.scrolling="no"),t(i).attr({src:C.get("href"),class:j+"Iframe"}).one("load",o).appendTo(f),$.one(U,function(){i.src="//about:blank"}),C.get("fastIframe")&&t(i).trigger("load")):o(),"fade"===C.get("transition")?n.fadeTo(r,1,a):a())},"fade"===C.get("transition")?n.fadeTo(r,0,function(){P.position(0,o)}):P.position(r,o)}},P.next=function(){!R&&d[1]&&(C.get("loop")||d[I+1])&&(I=Z(1),at(d[I]))},P.prev=function(){!R&&d[1]&&(C.get("loop")||I)&&(I=Z(-1),at(d[I]))},P.close=function(){L&&!S&&(S=!0,L=!1,rt(A),C.get("onCleanup"),g.off("."+j),o.fadeTo(C.get("fadeOut")||0,0),n.stop().fadeTo(C.get("fadeOut")||0,0,function(){n.hide(),o.hide(),rt(U),f.remove(),setTimeout(function(){S=!1,rt(q),C.get("onClosed")},1)}))},P.remove=function(){n&&(n.stop(),t[_].close(),n.stop(!1,!0).remove(),o.remove(),S=!1,n=null,t("."+D).removeData(_).removeClass(D),t(e).off("click."+j).off("keydown."+j))},P.element=function(){return t(C.el)},P.settings=O)}(jQuery,document,window);
|
13 |
/* Media Uploader */
|
assets/js/wpdiscuz.js
CHANGED
@@ -96,6 +96,7 @@ jQuery(document).ready(function($) {
|
|
96 |
if (Cookies.get('wpdiscuz_last_visit')) {
|
97 |
Cookies.remove('wpdiscuz_last_visit', {path: ''});
|
98 |
}
|
|
|
99 |
var storeCommenterData = wpdiscuzAjaxObj.storeCommenterData;
|
100 |
var wpdiscuzUploader = parseInt(wpdiscuzAjaxObj.wmuEnabled);
|
101 |
var isCookiesEnabled = wpdiscuzAjaxObj.isCookiesEnabled;
|
@@ -852,7 +853,7 @@ jQuery(document).ready(function($) {
|
|
852 |
|
853 |
//============================== /EDIT COMMENT FUNCTION ============================== //
|
854 |
//============================== LOAD MORE ============================== //
|
855 |
-
if (!
|
856 |
wpdiscuzLoadCount = 0;
|
857 |
if (firstLoadWithAjax == 1) {
|
858 |
setTimeout(function() {
|
@@ -876,7 +877,7 @@ jQuery(document).ready(function($) {
|
|
876 |
});
|
877 |
|
878 |
var isRun = false;
|
879 |
-
if (commentListLoadType === 2 && !
|
880 |
$('.wpd-load-more-submit').parents('.wpdiscuz-comment-pagination').hide();
|
881 |
wpdiscuzScrollEvents();
|
882 |
$(window).scroll(function() {
|
96 |
if (Cookies.get('wpdiscuz_last_visit')) {
|
97 |
Cookies.remove('wpdiscuz_last_visit', {path: ''});
|
98 |
}
|
99 |
+
var wordpressIsPaginate = parseInt(wpdiscuzAjaxObj.wordpressIsPaginate);
|
100 |
var storeCommenterData = wpdiscuzAjaxObj.storeCommenterData;
|
101 |
var wpdiscuzUploader = parseInt(wpdiscuzAjaxObj.wmuEnabled);
|
102 |
var isCookiesEnabled = wpdiscuzAjaxObj.isCookiesEnabled;
|
853 |
|
854 |
//============================== /EDIT COMMENT FUNCTION ============================== //
|
855 |
//============================== LOAD MORE ============================== //
|
856 |
+
if (!wordpressIsPaginate && firstLoadWithAjax) {
|
857 |
wpdiscuzLoadCount = 0;
|
858 |
if (firstLoadWithAjax == 1) {
|
859 |
setTimeout(function() {
|
877 |
});
|
878 |
|
879 |
var isRun = false;
|
880 |
+
if (commentListLoadType === 2 && !wordpressIsPaginate) {
|
881 |
$('.wpd-load-more-submit').parents('.wpdiscuz-comment-pagination').hide();
|
882 |
wpdiscuzScrollEvents();
|
883 |
$(window).scroll(function() {
|
assets/js/wpdiscuz.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor);if(wpdiscuzLoadRichEditor)var wpDiscuzEditor=new WpdEditor;function wpdMessagesOnInit(e,t){wpdiscuzAjaxObj.setCommentMessage(e,t),setTimeout(function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)},3e3)}wpdiscuzAjaxObj.setCommentMessage=function(e,t,a){var o="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?o="wpdiscuz-message-success":"warning"===t[n]&&(o="wpdiscuz-message-warning"):"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(a instanceof Array?a[n]:a||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e).prependTo("#wpdiscuz-comment-message").delay(a||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},wpdiscuzAjaxObj.applyFilterOnPhrase=function(e,t,a){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,function(o){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]]&&(e=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]](e,t,a))}),e},jQuery(document).ready(function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType),s=parseInt(wpdiscuzAjaxObj.wc_post_id),d=parseInt(wpdiscuzAjaxObj.commentListUpdateType),c=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer),p=parseInt(wpdiscuzAjaxObj.liveUpdateGuests),r=wpdiscuzAjaxObj.loadLastCommentId,l=r,m=parseInt(wpdiscuzAjaxObj.firstLoadWithAjax);Cookies.get("wpdiscuz_comments_sorting")&&Cookies.remove("wpdiscuz_comments_sorting",{path:""}),Cookies.get("wordpress_last_visit")&&Cookies.remove("wordpress_last_visit",{path:""}),Cookies.get("wpdiscuz_last_visit")&&Cookies.remove("wpdiscuz_last_visit",{path:""});var w,u=wpdiscuzAjaxObj.storeCommenterData,f=parseInt(wpdiscuzAjaxObj.wmuEnabled),h=wpdiscuzAjaxObj.isCookiesEnabled,b=!0,_=wpdiscuzAjaxObj.cookiehash,g=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),z=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,v=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),j=parseInt(wpdiscuzAjaxObj.enableBubble),x=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),C=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),k=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,y=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),O=wpdiscuzAjaxObj.bubbleLocation,A=wpdiscuzAjaxObj.inlineFeedbackAttractionType,I=(I=parseInt(wpdiscuzAjaxObj.scrollSize))||32,T=[],D=[],F=[],E=!1,M=1,L=e("html").css("scroll-behavior"),R=e("body").css("scroll-behavior");(e(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?e(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .the_champ_login_container").length?e(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .social_connect_form").length?e(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&e(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",function(t){var a=e(".wpd-form").not(":hidden");if(a.length)if(wpdiscuzLoadRichEditor){for(var o=0;o<a.length;o++)if("\n"!==wpDiscuzEditor.createEditor(e(a[o]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(o=0;o<a.length;o++)if(e(a[o]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")}),wpdiscuzLoadRichEditor||(e(document).delegate("textarea.wc_comment","input",function(){me(e(this))}),e.each(e("textarea.wc_comment"),function(){me(e(this))})),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(z)}),e(document).on("focus","#wpdcom textarea",function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()}),t)||H({comment_author:Cookies.get("comment_author_"+_),comment_author_email:Cookies.get("comment_author_email_"+_),comment_author_url:Cookies.get("comment_author_url_"+_)});if(e(".wpd-vote-down.wpd-dislike-hidden").remove(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),e(document).on("click","#wpd-editor-source-code-wrapper-bg",function(){e(this).hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")}),wpdiscuzLoadRichEditor&&e(document).on("click","#wpd-insert-source-code",function(){var t=wpDiscuzEditor.createEditor("#"+e("#wpd-editor-uid").val());t.deleteText(0,t.getLength(),Quill.sources.USER);var a=e("#wpd-editor-source-code").val();a.length&&t.clipboard.dangerouslyPasteHTML(0,a,Quill.sources.USER),t.update(),e("#wpd-editor-source-code-wrapper-bg").hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")}),e(document).on("click",".wpd-reply-button",function(){var i=$(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()},z):setTimeout(function(){e("#wc-textarea-"+i).trigger("focus")},z),e("#wpd-secondary-form-wrapper-"+i).slideToggle(z)):function(a){var o=$(a,0);e("#wpdiscuz_form_anchor-"+o).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(o));var n=e("#wpd-secondary-form-wrapper-"+o);if(!t){var i={comment_author:Cookies.get("comment_author_"+_),comment_author_email:Cookies.get("comment_author_email_"+_),comment_author_url:Cookies.get("comment_author_url_"+_)};H(i)}wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+o).focus()},z):setTimeout(function(){e("#wc-textarea-"+o).trigger("focus")},z);n.slideToggle(z,function(){a.addClass("wpdiscuz-clonned")})}(e(this)),function(t){if((a||o)&&"2.0"===n){var i=X(t);setTimeout(function(){if(!D[i])try{D[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){e("#wpdiscuz-recaptcha-field-"+t).val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-"+t).val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3)}}(i)}),e(document).on("click","#wpdcom .wpd-comment-link [data-comment-url]",function(){var t=e(this).data("comment-url"),a=e("<input/>");a.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),a.trigger("select"),document.execCommand("copy"),a.remove(),wpdiscuzAjaxObj.setCommentMessage(t+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)}),e(document).on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",function(e){e.preventDefault()}),e(document).on("click",".wpd-toggle.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked");var a=$(e(this),0),o=e(this),n=e(".fas",o);!o.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&g?function(t,a){var o=X(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",o),ue(v,!0,n).done(function(o){a.addClass("wpd_not_clicked"),"object"==typeof o&&o.success&&(e("#wpd-comm-"+t).replaceWith(o.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle .wpd-view-replies .wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),e("#wpd-comm-"+t+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),we(o)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,n){console.log(n),a.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}(a,t):e("#wpd-comm-"+a+"> .wpd-reply").slideToggle(700,function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),o.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),o.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),t.addClass("wpd_not_clicked")})}),e(document).on("mouseenter",".wpd-new-loaded-comment",function(){e(this).removeClass("wpd-new-loaded-comment")}),e(document).on("click",".wpd-sbs-toggle",function(){e(".wpdiscuz-subscribe-bar").slideToggle(z)}),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm)&&!t&&wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&e("#wpdiscuz-subscribe-form").length&&("2.0"===n?(setTimeout(function(){try{grecaptcha.render("wpdiscuz-recaptcha-subscribe-form",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-subscribe-form").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val()?e(".wpdiscuz-recaptcha",e(this)).css("border","none"):(e(".wpdiscuz-recaptcha",e(this)).css("border","1px solid red"),t.preventDefault())})):"3.0"===n&&e(document).on("click","#wpdiscuz_subscription_button",function(t){var a=e(this).parents("#wpdiscuz-subscribe-form");t.preventDefault();try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then(function(e){console.log(5555),document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=e,a.trigger("submit")},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}})),(a||o)&&"2.0"===n){var S=e(window).width(),P=e("#wpdcom").width();P>=1100&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"65%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"35%"})),P>=940&&P<1100&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"60%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"40%"})),P>=810&&P<940&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"40%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"60%"})),P>=730&&P<810&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"45%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"55%"})),P>=610&&P<730&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.85)","-webkit-transform":"scale(0.85)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"43%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"55%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"})),S>650&&(P>=510&&P<610&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"35%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"63%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%",position:"relative",right:"-60px"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),P>=470&&P<510&&(e("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"40%"}),e("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"60%"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd_main_comm_form .wc-form-footer").css({"margin-left":"0px"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),P<470&&(e("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({margin:"0px auto","transform-origin":"center 0","-webkit-transform-origin":"center 0"}),e("#wpdcom .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"}),e("#wpdcom .wpd-secondary-form-wrapper .wc_notification_checkboxes").css({"text-align":"center"}),e("#wpdcom .wpd-secondary-form-wrapper .wc-field-submit").css({"text-align":"center"})))}function q(t,a,o){ue(v||f,!1,a).done(function(a){if(e(o).addClass("wpd_not_clicked"),"object"==typeof a)if(a.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(z),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),e(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html);var n=z;a.data.is_main?oe(a.data.message):(n=z+700,e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).slideToggle(700),1==a.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).after(a.data.message):e("#wpd-comm-"+a.data.uniqueid).after(a.data.message)),function(e){if(!e.data.held_moderate){var t=new FormData;t.append("action","wpdCheckNotificationType"),t.append("comment_id",e.data.new_comment_id),t.append("email",e.data.comment_author_email),t.append("isParent",e.data.is_main),ue(v,!0,t)}}(a),function(e){if(e.data.redirect>0&&e.data.new_comment_id){var t=new FormData;t.append("action","wpdRedirect"),t.append("commentId",e.data.new_comment_id),ue(v,!0,t).done(function(e){"object"==typeof e&&e.success&&setTimeout(function(){location.href=e.data},2e3)}).fail(function(e,t,a){console.log(a)})}}(a),h&&b?function(t){var a=t.comment_author_email,o=t.comment_author,n=t.comment_author_url;null==u?(Cookies.set("comment_author_email_"+_,a),Cookies.set("comment_author_"+_,o),n.length&&Cookies.set("comment_author_url_"+_,n)):(u=parseInt(u),Cookies.set("comment_author_email_"+_,a,{expires:u,path:"/"}),Cookies.set("comment_author_"+_,o,{expires:u,path:"/"}),n.length&&Cookies.set("comment_author_url_"+_,n,{expires:u,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(a.data):b||e(".wpd-cookies-checkbox").prop("checked",!1),t.get(0).reset(),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]):me(t.find(".wc_comment")),H(a.data),e(".wmu-preview-wrap",t).remove(),T.length&&(T.forEach(function(e){e.parents(".wpd-field-checkbox").remove()}),T=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){te(),e("html, body").animate({scrollTop:e("#comment-"+a.data.new_comment_id).offset().top-I},1e3,ae)},n),we(a,t)}else a.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"),we(a,t));else wpdiscuzAjaxObj.setCommentMessage(a,"error");e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,a,n){console.log(n),e(o).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}function H(t){e(".wpd_comm_form .wc_name").val(t.comment_author),t.comment_author_email&&t.comment_author_email.indexOf("@example.com")<0&&e(".wpd_comm_form .wc_email").val(t.comment_author_email),t.comment_author_url&&e(".wpd_comm_form .wc_website").val(t.comment_author_url)}function U(t,a){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(a),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}e(document).on("click",".wc_comm_submit.wpd_not_clicked",function(){var i=e(this),s=1,d=e(this).parents("form");if(d.hasClass("wpd_main_comm_form")||(s=function(t){var a=t.attr("class").split(" "),o="";return e.each(a,function(e,t){"wpd_comment_level"===Y(t,!1)&&(o=Y(t,!0))}),parseInt(o)+1}(e(this).parents(".wpd-comment"))),ee(d,"#wpd-editor-"+e(".wpdiscuz_unique_id",d).val()),d.on("submit",function(e){e.preventDefault()}),""!==e(".wc_comment",d).val().trim()){if(d[0].checkValidity()&&(p=d,r=!0,"2.0"===n&&e("input[name=wc_captcha]",p).length&&!e("input[name=wc_captcha]",p).val().length?(r=!1,e(".wpdiscuz-recaptcha",p).css("border","1px solid red")):"2.0"===n&&e("input[name=wc_captcha]",p).length&&e(".wpdiscuz-recaptcha",p).css("border","none"),r)){E=!0,function(t){e(".wpd-agreement-checkbox",t).each(function(){e(this).hasClass("wpd_agreement_hide")&&h&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+_,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each(function(){T.push(e(this))}))})}(d),e(i).removeClass("wpd_not_clicked");var c=new FormData;if(c.append("action","wpdAddComment"),e(":input",d).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&c.append(this.name+"",e(this).val().trim()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&c.append(this.name+"",e(this).val())}),c.append("wpd_comment_depth",s),wpdiscuzAjaxObj.wpdiscuz_zs&&c.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),e(".wpd-cookies-checkbox",d).length?e(".wpd-cookies-checkbox",d).prop("checked")||(b=!1):t&&(b=!1),e("#wpdiscuz-loading-bar").show(),wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&"3.0"===n&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/addComment"}).then(function(e){c.append("g-recaptcha-response",e),q(d,c,i)},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error"),e("#wpdiscuz-loading-bar").fadeOut(250)}else q(d,c,i)}var p,r;!function(e){if((a||o)&&"2.0"===n){var t=X(e);grecaptcha.reset(D[t])}}(e(".wpdiscuz_unique_id",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wc_msg_required_fields,"wc_msg_required_fields",d),"error")}),e(document).on("click",".wpd_editable_comment",function(){w&&e(".wpdiscuz-edit-form-wrap").length&&U($(e(".wpdiscuz-edit-form-wrap"),0),w);var t=e(this),a=$(t,0),o=X(a),n=new FormData;n.append("action","wpdEditComment"),n.append("commentId",o),w=e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-text").get(0),ue(v,!0,n).done(function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){var n=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+a);n.clipboard.dangerouslyPasteHTML(0,o.data.content),n.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+a).val(o.data.content),me(e("#wc-textarea-edit_"+a));e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wc_save_edited_comment",function(){var t=e(this),a=$(t),o=X(a),n=e("#wpd-comm-"+a+" #wpdiscuz-edit-form");if(ee(n,"#wpd-editor-edit_"+a),n.on("submit",function(e){e.preventDefault()}),n[0].checkValidity()){var i=new FormData;i.append("action","wpdSaveEditedComment"),i.append("commentId",o),e(":input",n).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&i.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&i.append(this.name+"",e(this).val())}),ue(v,!0,i).done(function(n){"object"==typeof n?(n.success?(U(a,n.data.message),n.data.lastEdited&&(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(n.data.lastEdited).insertAfter("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),n.data.twitterShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",n.data.twitterShareLink),n.data.whatsappShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",n.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error"),we(n,o)):console.log(n),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=$(e(this));U(t,w),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!wpdiscuzAjaxObj.wordpressIsPaginate&&m&&(M=0,1==m?setTimeout(function(){B(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),B(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&B(!1,t,"wpd-loaded","wpd-loading")});var W=!1;function V(){var t=e("#wpdiscuzHasMoreComments").val(),a=e(document).height(),o=e(window).height()+e(window).scrollTop();a&&o&&(100*o/a>=80&&!1===W&&1==t&&(W=!0,B(!1,e(".wpd-load-more-submit"))))}function B(t,a,o,n){a&&(a.toggleClass(o),a.toggleClass(n));var s=new FormData;s.append("action","wpdLoadMoreComments");var d=e(".wpdiscuz-sort-button-active").attr("data-sorting");d&&s.append("sorting",d),s.append("offset",M),s.append("lastParentId",e(".wpd-load-more-submit").attr("data-lastparentid")),s.append("isFirstLoad",t?1:0);var c=e(".wpdf-active").attr("data-filter-type");s.append("wpdType",c||""),ue(v,!t||1!=m,s).done(function(s){"object"==typeof s&&s.success&&(M++,t&&e(".wpd-comment").remove(),e(".wpdiscuz_single").remove(),e(".wpdiscuz-comment-pagination").before(s.data.comment_list),K(s,t&&2!==i),W=!1,s.data.loadLastCommentId&&(r=s.data.loadLastCommentId),we(s),t&&Q(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))}).fail(function(t,i,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))})}function K(t,a){var o;0==t.data.is_show_load_more?(e("#wpdiscuzHasMoreComments").val(0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()):(o=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",o),2!==i&&e(".wpdiscuz-comment-pagination").show(),e("#wpdiscuzHasMoreComments").val(1),a&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show()),we(t)}function Q(t){var a=location.href.match(/#comment\-(\d+)/);if(null!==a){var o=a[1];if(e("#comment-"+o).length)setTimeout(function(){te(),e("html, body").animate({scrollTop:e("#comment-"+o).parents("[id^=wpd-comm-]").offset().top-I},1e3,ae),t&&N(o)},500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",o),ue(v,!0,n).done(function(a){if("object"==typeof a&&a.success){var n="#comment-"+o;e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),we(a),te(),e("html, body").animate({scrollTop:e(n).offset().top-I},1e3,ae),t&&N(o)}e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}}function N(t){setTimeout(function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")},1100)}function G(e){if(void 0!==e.data.message)for(var t,a=e.data.message,o=0;o<a.length;o++)J((t=a[o]).comment_parent,t.comment_html)}function $(e,t){var a="";return(a=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(a.lastIndexOf("-")+1)}function X(e){return e.substring(0,e.indexOf("_"))}function Y(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function J(t,a){if(0==t)oe(a);else{var o=$(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+o).after(a)}}function Z(){var t=[];return e(".wpd-comment-right").each(function(){t.push(X($(e(this),0)))}),t.join(",")}function ee(t,a){var o=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(a+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),a=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");a=(a=(a=(a=a.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),t.val(a)}(t),e.each(o,function(){e("input",this).prop("required",!1),0===e("input:checked",this).length?e("input",e(this)).prop("required",!0):e(".wpd-field-invalid",this).remove()})}function te(){e("html, body").css("scroll-behavior","unset")}function ae(){e("html").css("scroll-behavior",L),e("body").css("scroll-behavior",R)}function oe(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function ne(t){t?t.prop("required")||(t.val()?t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):e.each(e(".wc_email"),function(t,a){var o=e(a);o.prop("required")||(o.val()?o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==i||wpdiscuzAjaxObj.wordpressIsPaginate||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),V(),e(window).scroll(function(){V()})),wpdiscuzAjaxObj.setLoadMoreVisibility=K,e(document).on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",function(){var t=e(this);e(t).removeClass("wpd_not_clicked");var a,o=X($(t));a=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",o),n.append("voteType",a),ue(v,!0,n).done(function(n){if(e(t).addClass("wpd_not_clicked"),"object"==typeof n){if(n.success){if("total"===n.data.buttonsStyle){var i=e(".wpd-comment-footer .wpd-vote-result",e("#comment-"+o)),s=n.data.votes;i.text(n.data.votesHumanReadable),i.attr("title",s),i.removeClass("wpd-up wpd-down"),s>0&&i.addClass("wpd-up"),s<0&&i.addClass("wpd-down")}else{var d=e(".wpd-comment-footer .wpd-vote-result-like",e("#comment-"+o)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+o));d.text(n.data.likeCountHumanReadable),d.attr("title",n.data.likeCount),c.text(n.data.dislikeCountHumanReadable),c.attr("title",n.data.dislikeCount),parseInt(n.data.likeCount)>0?d.addClass("wpd-up"):d.removeClass("wpd-up"),parseInt(n.data.dislikeCount)<0?c.addClass("wpd-down"):c.removeClass("wpd-down")}var p=e(".wpd-comment-footer .wpd-vote-up",e("#comment-"+o)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+o));p.removeClass("wpd-up"),r.removeClass("wpd-down"),n.data.curUserReaction>0?p.addClass("wpd-up"):n.data.curUserReaction<0&&r.addClass("wpd-down")}else n.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error");we(n,o,a)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,o,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click","body",function(t){var a=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?a.css({display:a.is(":visible")?"none":"flex"}):a.hide()}),e(document).on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var t=e(this),a=e(this).attr("data-sorting");if(a){e(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),t.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var o=new FormData;o.append("action","wpdSorting"),o.append("sorting",a);var n=e(".wpdf-active").attr("data-filter-type");o.append("wpdType",n||""),ue(v,!0,o).done(function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),K(t,!1),M=1),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){Q(!1)},1!=m&&Q(!1),e(document).on("click",".wpdiscuz-readmore",function(){var t=$(e(this)),a=X(t),o=new FormData;o.append("action","wpdReadMore"),o.append("commentId",a),ue(v,!0,o).done(function(o){"object"==typeof o?(o.success?(e("#comment-"+a+" .wpd-comment-text").replaceWith(" "+o.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(o.data),we(o)):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("change",".wpd-required-group",function(){0!==e("input:checked",this).length?e("input",e(this)).prop("required",!1):e("input",e(this)).prop("required",!0)}),e(document).on("click",".wpdiscuz-spoiler",function(){e(this).next().slideToggle(),e(this).hasClass("wpdiscuz-spoiler-closed")?e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"):e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"),e(this).toggleClass("wpdiscuz-spoiler-closed")}),e(document).on("click",".wpd-tools i",function(){var t=e(this).siblings(".wpd-tools-actions");t.is(":visible")||e(this).parents(".wpd-comment-right").attr("id")!==e("[id^=comment-]","#wpdcom").last().attr("id")||e("#comments").css({paddingBottom:"160px"}),t.css({display:t.is(":visible")?"none":"flex"})}),e(document).on("mouseleave",".wpd-comment-right",function(){e(this).find(".wpd-tools-actions").hide(),e("#comments").css({paddingBottom:"0"})}),e(document).on("click",".wpd_stick_btn",function(){var t=X($(e(this),0)),a=new FormData;a.append("action","wpdStickComment"),a.append("commentId",t),ue(v,!0,a).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd_close_btn",function(){var t=X($(e(this),0)),a=new FormData;a.append("action","wpdCloseThread"),a.append("commentId",t),ue(v,!0,a).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var t=e(this),a=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+a),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&o.append("sorting",n),o.append("lastParentId",0),o.append("offset",0),M=1,o.append("wpdType",t.hasClass("wpdf-active")?"":a),o.append("isFirstLoad",1),e(this).hasClass("wpdf-inline")?e(this).hasClass("wpdf-active")?e(".wpd-comment-info-bar").hide():e(".wpd-comment-info-bar").css("display","flex"):e(".wpd-comment-info-bar").hide(),ue(v,!1,o).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(a.data.comment_list),K(a),r=a.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),we(a)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpdf-reacted.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdMostReactedComment"),ue(v,!1,a).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e("#comment-"+a.data.commentId).length||e(".wpd-thread-list").prepend(a.data.message),we(a),te(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-I},1e3,ae))}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")})}),e(document).on("click",".wpdf-hottest.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdHottestThread"),ue(v,!1,a).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.commentId).length?e("#comment-"+a.data.commentId).parents("[id^=wpd-comm-"+a.data.commentId+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),we(a),te(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-I},1e3,ae))}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")})}),e(document).on("click",".wpd-filter-view-all",function(){e(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")}),e(document).on("click",".wpd-follow-link.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=X($(t,0)),o=new FormData;o.append("action","wpdFollowUser"),o.append("commentId",a),ue(v,!0,o).done(function(a){t.addClass("wpd_not_clicked"),"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.code],a.data.code,t),"success"),t.removeClass("wpd-follow-active"),a.data.followTip&&t.attr("wpd-tooltip",a.data.followTip),a.data.followClass&&t.addClass(a.data.followClass)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),ne(),e(document).on("keyup",".wc_email",function(){ne(e(this))}),j&&e("#wpdcom").length){if(e("#wpd-bubble-wrapper").hover(function(){e(this).addClass("wpd-bubble-hover")},function(){e(this).removeClass("wpd-bubble-hover")}),C&&!Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)&&setTimeout(function(){e("#wpd-bubble-wrapper").addClass("wpd-bubble-hover"),Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint,"1",{expires:7,path:"/"}),setTimeout(function(){e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")},1e3*k)},1e3*C),"content_left"===O)if(e(".entry-content").length){var ie=(se=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?se:25;e("#wpd-bubble-wrapper").css({left:ie+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){ie=(se=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?se:25;e("#wpd-bubble-wrapper").css({left:ie+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var se;ie=(se=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?se:25;e("#wpd-bubble-wrapper").css({left:ie+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner");else"left_corner"===O?(e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===O&&(e("#wpd-bubble-wrapper").css({right:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-right-corner"));e("#wpd-bubble-wrapper").show(),e(document).on("click","#wpd-bubble-add-message-close",function(t){t.preventDefault(),t.stopPropagation(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),e(document).on("click","#wpd-bubble",function(){te(),e("#tab-title-reviews").length&&e("#tab-title-reviews a").trigger("click"),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-(I+28)},1e3,function(){ae(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover"),wpdiscuzLoadRichEditor?e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0").focus():e("#wc-textarea-0_0").length&&e("#wc-textarea-0_0").trigger("focus")})}),e(document).on("click","#wpd-bubble-comment-close",function(t){t.preventDefault(),e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),e(document).on("click","#wpd-bubble-comment-reply-link a",function(){var t=e(this).attr("href");setTimeout(function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),Q(!0);var a=t.match(/#comment\-(\d+)/);F=F.filter(function(e){return e!=a[1]}),e("#wpd-bubble-count .wpd-new-comments-count").text(F.length),0==F.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),e(document).on("click","#wpd-bubble-count",function(){if(F.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",F.join()),ue(v,!0,t).done(function(t){"object"==typeof t&&t.success&&(t.data.message=t.data.message.filter(function(t){if(!e("#comment-"+t.comment_id).length)return t}),G(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),F=[],e(".wpd-new-loaded-comment").length&&(te(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-(I+28)},1e3,ae)),we(t)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,a){console.log(a)})}})}if((j&&x||d)&&(t||!t&&p)&&setTimeout(function t(){e.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:s,lastId:l,visibleCommentIds:Z()}}).done(function(a){if(!E)if("object"==typeof a){if(a.commentIDsToRemove.forEach(function(t){e("[id^=wpd-comm-"+t+"]").remove()}),a.ids.length){d&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",r),i.append("visibleCommentIds",Z()),ue(v,!1,i).done(function(t){E||"object"==typeof t&&t.success&&(G(t),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),r=t.data.loadLastCommentId)}).fail(function(e,t,a){console.log(a)})),a.ids=a.ids.filter(function(t){if(!e("#comment-"+t).length)return t});var o=5e3;l=parseInt(a.ids[a.ids.length-1]),F=F.concat(a.ids),y&&a.commentText&&(e("#wpd-bubble-author-avatar").html(a.avatar),e("#wpd-bubble-author-name").html(a.authorName),e("#wpd-bubble-comment-date span").html(a.commentDate),e("#wpd-bubble-comment-text").html(a.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",a.commentLink),e("#wpd-bubble-notification-message").show(),o=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=a.ids.length,e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),e("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout(function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")},o),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}a.all_comments_count=parseInt(a.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(a.all_comments_count_bubble_html),e(".wpd-thread-info").html(a.all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.all_comments_count)}else console.log(a);var i;setTimeout(t,c)}).fail(function(e,a,o){console.log(o),setTimeout(t,c)})},c),e(".wpd-inline-form-wrapper").length){var de=new FormData;de.append("action","wpdGetInlineCommentForm"),ue(v,!1,de).done(function(t){"object"==typeof t?t.success?(e(".wpd-inline-form-wrapper").append(t.data),e.each(e("[name=_wpd_inline_nonce]"),function(){var t=e(this).attr("id"),a=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+a.substring(a.lastIndexOf("-")+1))}),e(".wpd-inline-opened").addClass("wpd-active"),e(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),e(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),e(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),le()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data]),t.data,"error"):console.log(t)}).fail(function(e,t,a){console.log(a)})}function ce(t){if(e(t).hasClass("wpd-inline-shortcode"))var a=e(t).attr("id");else a=e(t).parents(".wpd-inline-shortcode").attr("id");return a.substring(a.lastIndexOf("-")+1)}function pe(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function re(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var t=e(this),a=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&a>0&&a<300&&("blink"===A?(t.addClass("wpd-blink"),setTimeout(function(){t.removeClass("wpd-blink")},3e3)):(t.parents(".wpd-inline-shortcode").addClass("wpd-active"),t.siblings(".wpd-inline-form-wrapper").show(),t.addClass("wpd-open"),le(t.siblings(".wpd-inline-form-wrapper"))))})}function le(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(a=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var a;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(a=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}}else e.each(e(".wpd-inline-form-wrapper:visible"),function(){if(e(this).offset().left<=10)e(this).css("left",Math.ceil(parseInt(e(this).css("left"))-e(this).offset().left+10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))<3&&(t=3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;");else if(e(this).offset().left+e(this).width()>document.body.clientWidth-10){var t;e(this).css("left",Math.ceil(parseInt(e(this).css("left"))+(document.body.clientWidth-(e(this).offset().left+e(this).width()))-10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))>e(this).width()-3&&(t=e(this).width()-3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;")}})}function me(t){var a,o=0;if(t.parents(".wpd_main_comm_form").length)o=parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents(".wpd_main_comm_form");else if(t.parents(".wpd-secondary-form-wrapper").length)o=parseInt(wpdiscuzAjaxObj.replyTextMaxLength),a=t.parents(".wpd-secondary-form-wrapper");else if(t.parents("#wpdiscuz-edit-form").length){var n=$(t);o=parseInt(n.substring(n.lastIndexOf("_")+1))?parseInt(wpdiscuzAjaxObj.replyTextMaxLength):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents("#wpdiscuz-edit-form")}if(o&&a){var i=t.val().length,s=e(".wpd-editor-char-counter",a),d=o-i;s.html(d),d<=10?s.addClass("error"):s.removeClass("error")}}function we(t,a,o,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,a,o,n):console.log(t.data.callbackFunctions[e]+" is not a function")})}function ue(t,a,o){a&&e("#wpdiscuz-loading-bar").show(),o.append("postId",s);var n=o.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(o=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](o,t,a))});var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:o,contentType:!1,processData:!1})}e(document).on("click","body",function(t){if(e(t.target).hasClass("wpd-inline-form-close")||e(t.target).parents(".wpd-inline-form-close").length)t.preventDefault(),e(t.target).parents(".wpd-inline-form-wrapper").hide(),e(t.target).parents(".wpd-inline-shortcode").removeClass("wpd-active"),e(t.target).parents(".wpd-inline-form-wrapper").siblings(".wpd-inline-icon").removeClass("wpd-open");else if(!e(t.target).hasClass("wpd-inline-form-wrapper")&&!e(t.target).parents(".wpd-inline-form-wrapper").length){pe();var a="";e(t.target).hasClass("wpd-inline-icon")?a=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(a=e(t.target).parents(".wpd-inline-icon")),a.length&&a.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(a.parents(".wpd-inline-shortcode").addClass("wpd-active"),a.siblings(".wpd-inline-form-wrapper").show(),a.addClass("wpd-open"),a.removeClass("wpd-ignored"),le(a.siblings(".wpd-inline-form-wrapper")))}(!e(t.target).hasClass("wpd-last-inline-comments-wrapper")&&!e(t.target).parents(".wpd-last-inline-comments-wrapper").length||e(t.target).parents(".wpd-last-inline-comments-wrapper").length&&e(t.target).hasClass("wpd-load-inline-comment"))&&e(".wpd-last-inline-comments-wrapper").remove()}),e(document).on("click",".wpd-inline-submit.wpd_not_clicked",function(t){t.preventDefault();var a=e(this),o=e(this).parents(".wpd_inline_comm_form");if(o[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",ce(o)),e.each(e("input, textarea",o),function(t,a){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(a).attr("name"),e(a).val()):n.append(e(a).attr("name"),e(a).val())}),ue(v,!0,n).done(function(t){if(a.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){o[0].reset(),pe();var n=parseInt(t.data.newCount),i=a.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),e(".wpd-thread-info").attr("data-comments-count",t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.message&&oe(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data,a),"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("keydown",".wpd-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_comm_submit").trigger("click")}),e(document).on("keydown","#wpdiscuz-edit-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_save_edited_comment").trigger("click")}),e(document).on("keydown",".wpd-inline-comment-content",function(t){t.ctrlKey&&13==t.keyCode&&e(this).parents(".wpd_inline_comm_form").find(".wpd-inline-submit.wpd_not_clicked").trigger("click")}),e(document).on("click",".wpd-inline-icon-count.wpd-has-comments",function(){var t=e(this),a=new FormData;a.append("action","wpdGetLastInlineComments"),a.append("inline_form_id",ce(t)),ue(v,!0,a).done(function(a){"object"==typeof a?a.success?e(a.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-view-all-inline-comments",function(t){t.preventDefault(),e(this).parents(".wpd-last-inline-comments-wrapper").remove(),e(".wpdf-inline").hasClass("wpdf-active")||e(".wpdf-inline").trigger("click"),te(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-I},1e3,ae)}),e(document).on("click",".wpd-feedback-content-link",function(t){t.preventDefault();var a=e(this).data("feedback-content-id");te(),e("html, body").animate({scrollTop:e("#wpd-inline-"+a).offset().top-(I+6)},1e3,function(){ae(),e("#wpd-inline-"+a).addClass("wpd-active")})}),"scroll_open"!==A&&"blink"!==A||(re(),e(window).on("scroll",re)),e(document).on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var t=new FormData,a=e(this).index();a>=0&&a<5&&(t.append("action","wpdUserRate"),t.append("rating",a+1),ue(v,!0,t).done(function(t){"object"==typeof t?t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data),"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))}),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){t.preventDefault();var a,o,i=e(this);if(i[0].checkValidity()&&(a=i,o=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).val().length?(o=!1,e(".wpdiscuz-recaptcha",a).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&e(".wpdiscuz-recaptcha",a).css("border","none"),o)){var s=new FormData;s.append("action","wpdAddSubscription"),e("*",i).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&s.append(this.name+"",e(this).val()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&s.append(this.name+"",e(this).val())}),ue(v,!0,s).done(function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):wpdiscuzAjaxObj.setCommentMessage(t,"error"),e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wpd-unsubscribe",function(t){t.preventDefault();var a=new FormData;a.append("action","wpdUnsubscribe"),a.append("sid",e(this).data("sid")),a.append("skey",e(this).data("skey")),ue(v,!0,a).done(function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=ue});var onloadCallback=function(){if(document.getElementById("wpdiscuz-recaptcha-0_0")&&"2.0"===wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.render("wpdiscuz-recaptcha-0_0",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(e){jQuery("#wpdiscuz-recaptcha-field-0_0").val("key")},"expired-callback":function(){jQuery("#wpdiscuz-recaptcha-field-0_0").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}};
|
1 |
+
var wpDiscuzEditor,wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor);function wpdMessagesOnInit(e,t){wpdiscuzAjaxObj.setCommentMessage(e,t),setTimeout(function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)},3e3)}wpdiscuzLoadRichEditor&&(wpDiscuzEditor=new WpdEditor),wpdiscuzAjaxObj.setCommentMessage=function(e,t,o){var a="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?a="wpdiscuz-message-success":"warning"===t[n]&&(a="wpdiscuz-message-warning"):"success"===t?a="wpdiscuz-message-success":"warning"===t&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(o instanceof Array?o[n]:o||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===t?a="wpdiscuz-message-success":"warning"===t&&(a="wpdiscuz-message-warning"),jQuery("<div/>").addClass(a).html(e).prependTo("#wpdiscuz-comment-message").delay(o||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},wpdiscuzAjaxObj.applyFilterOnPhrase=function(t,o,a){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[e]]&&(t=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[e]](t,o,a))}),t},jQuery(document).ready(function(c){c("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var i=wpdiscuzAjaxObj.is_user_logged_in,p=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!i,r=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&i,l=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,s=parseInt(wpdiscuzAjaxObj.commentListLoadType),d=parseInt(wpdiscuzAjaxObj.wc_post_id),n=parseInt(wpdiscuzAjaxObj.commentListUpdateType),m=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer),e=parseInt(wpdiscuzAjaxObj.liveUpdateGuests),w=wpdiscuzAjaxObj.loadLastCommentId,u=w,f=parseInt(wpdiscuzAjaxObj.firstLoadWithAjax);Cookies.get("wpdiscuz_comments_sorting")&&Cookies.remove("wpdiscuz_comments_sorting",{path:""}),Cookies.get("wordpress_last_visit")&&Cookies.remove("wordpress_last_visit",{path:""}),Cookies.get("wpdiscuz_last_visit")&&Cookies.remove("wpdiscuz_last_visit",{path:""});var t,o,h,a=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate),b=wpdiscuzAjaxObj.storeCommenterData,_=parseInt(wpdiscuzAjaxObj.wmuEnabled),g=wpdiscuzAjaxObj.isCookiesEnabled,z=!0,j=wpdiscuzAjaxObj.cookiehash,v=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),C=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,x=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),k=parseInt(wpdiscuzAjaxObj.enableBubble),y=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),O=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),A=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,I=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),T=wpdiscuzAjaxObj.bubbleLocation,D=wpdiscuzAjaxObj.inlineFeedbackAttractionType,E=(E=parseInt(wpdiscuzAjaxObj.scrollSize))||32,F=[],M=[],L=[],R=!1,S=1,P=c("html").css("scroll-behavior"),q=c("body").css("scroll-behavior");function H(d,e,s){we(x||_,!1,e).done(function(e){var t,o,a,n;c(s).addClass("wpd_not_clicked"),"object"==typeof e?e.success?("collapsed"===wpdiscuzAjaxObj.commentFormView&&c(".wpd-form-foot",d).slideUp(C),e.data.wc_all_comments_count_new=parseInt(e.data.wc_all_comments_count_new),c(".wpd-thread-info").html(e.data.wc_all_comments_count_before_threads_html),c(".wpd-thread-info").attr("data-comments-count",e.data.wc_all_comments_count_new),c("#wpd-bubble-all-comments-count").replaceWith(e.data.wc_all_comments_count_bubble_html),t=C,e.data.is_main?de(e.data.message):(t=700+C,c("#wpd-secondary-form-wrapper-"+e.data.uniqueid).slideToggle(700),(1==e.data.is_in_same_container?c("#wpd-secondary-form-wrapper-"+e.data.uniqueid):c("#wpd-comm-"+e.data.uniqueid)).after(e.data.message)),(a=e).data.held_moderate||((o=new FormData).append("action","wpdCheckNotificationType"),o.append("comment_id",a.data.new_comment_id),o.append("email",a.data.comment_author_email),o.append("isParent",a.data.is_main),we(x,!0,o)),0<(a=e).data.redirect&&a.data.new_comment_id&&((n=new FormData).append("action","wpdRedirect"),n.append("commentId",a.data.new_comment_id),we(x,!0,n).done(function(e){"object"==typeof e&&e.success&&setTimeout(function(){location.href=e.data},2e3)}).fail(function(e,t,o){console.log(o)})),g&&z?(o=e.data,a=o.comment_author_email,n=o.comment_author,o=o.comment_author_url,null==b?(Cookies.set("comment_author_email_"+j,a),Cookies.set("comment_author_"+j,n),o.length&&Cookies.set("comment_author_url_"+j,o)):(b=parseInt(b),Cookies.set("comment_author_email_"+j,a,{expires:b,path:"/"}),Cookies.set("comment_author_"+j,n,{expires:b,path:"/"}),o.length&&Cookies.set("comment_author_url_"+j,o,{expires:b,path:"/"})),c(".wpd-cookies-checkbox").length&&c(".wpd-cookies-checkbox").prop("checked",!0)):z||c(".wpd-cookies-checkbox").prop("checked",!1),d.get(0).reset(),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+c(".wpdiscuz_unique_id",d).val()).setContents([{insert:"\n"}]):le(d.find(".wc_comment")),U(e.data),c(".wmu-preview-wrap",d).remove(),F.length&&(F.forEach(function(e){e.parents(".wpd-field-checkbox").remove()}),F=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){ae(),c("html, body").animate({scrollTop:c("#comment-"+e.data.new_comment_id).offset().top-E},1e3,ne)},t),me(e,d)):e.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[e.data],e.data,d),"error"),me(e,d)):wpdiscuzAjaxObj.setCommentMessage(e,"error"),c("#wpdiscuz-loading-bar").fadeOut(250),R=!1}).fail(function(e,t,o){console.log(o),c(s).addClass("wpd_not_clicked"),c("#wpdiscuz-loading-bar").fadeOut(250)})}function U(e){c(".wpd_comm_form .wc_name").val(e.comment_author),e.comment_author_email&&e.comment_author_email.indexOf("@example.com")<0&&c(".wpd_comm_form .wc_email").val(e.comment_author_email),e.comment_author_url&&c(".wpd_comm_form .wc_website").val(e.comment_author_url)}function W(e,t){c("#wpd-comm-"+e+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),c("#wpd-comm-"+e+" .wpdiscuz-edit-form-wrap").replaceWith(t),c("#wpd-comm-"+e+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}c(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?c(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):c(".wc_social_plugin_wrapper .the_champ_login_container").length?c(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):c(".wc_social_plugin_wrapper .social_connect_form").length?c(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):c(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&c(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&c("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",function(e){var t=c(".wpd-form").not(":hidden");if(t.length)if(wpdiscuzLoadRichEditor){for(var o=0;o<t.length;o++)if("\n"!==wpDiscuzEditor.createEditor(c(t[o]).find(".ql-container").attr("id")).getText())return e.preventDefault(),void(e.returnValue="")}else for(o=0;o<t.length;o++)if(c(t[o]).find(".wc_comment").val())return e.preventDefault(),void(e.returnValue="")}),wpdiscuzLoadRichEditor||(c(document).delegate("textarea.wc_comment","input",function(){le(c(this))}),c.each(c("textarea.wc_comment"),function(){le(c(this))})),c(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){c(".wpd-form-foot",c(this).parents(".wpd_comm_form")).slideDown(C)}),c(document).on("focus","#wpdcom textarea",function(){c(this).next(".autogrow-textarea-mirror").length||c(this).autoGrow()}),i||U({comment_author:Cookies.get("comment_author_"+j),comment_author_email:Cookies.get("comment_author_email_"+j),comment_author_url:Cookies.get("comment_author_url_"+j)}),c(".wpd-vote-down.wpd-dislike-hidden").remove(),c(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),c(document).on("click","#wpd-editor-source-code-wrapper-bg",function(){c(this).hide(),c("#wpd-editor-source-code-wrapper").hide(),c("#wpd-editor-uid").val(""),c("#wpd-editor-source-code").val("")}),wpdiscuzLoadRichEditor&&c(document).on("click","#wpd-insert-source-code",function(){var e=wpDiscuzEditor.createEditor("#"+c("#wpd-editor-uid").val());e.deleteText(0,e.getLength(),Quill.sources.USER);var t=c("#wpd-editor-source-code").val();t.length&&e.clipboard.dangerouslyPasteHTML(0,t,Quill.sources.USER),e.update(),c("#wpd-editor-source-code-wrapper-bg").hide(),c("#wpd-editor-source-code-wrapper").hide(),c("#wpd-editor-uid").val(""),c("#wpd-editor-source-code").val("")}),c(document).on("click",".wpd-reply-button",function(){var t,e,o=J(c(this),0);c(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+o).focus()},C):setTimeout(function(){c("#wc-textarea-"+o).trigger("focus")},C),c("#wpd-secondary-form-wrapper-"+o).slideToggle(C)):function(e){var t=J(e,0);c("#wpdiscuz_form_anchor-"+t).before(function(e){return c("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,e)}(t));var o=c("#wpd-secondary-form-wrapper-"+t);i||U({comment_author:Cookies.get("comment_author_"+j),comment_author_email:Cookies.get("comment_author_email_"+j),comment_author_url:Cookies.get("comment_author_url_"+j)}),wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+t).focus()},C):setTimeout(function(){c("#wc-textarea-"+t).trigger("focus")},C),o.slideToggle(C,function(){e.addClass("wpdiscuz-clonned")})}(c(this)),t=o,(p||r)&&"2.0"===l&&(e=Z(t),setTimeout(function(){if(!M[e])try{M[e]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(e){c("#wpdiscuz-recaptcha-field-"+t).val("key")},"expired-callback":function(){c("#wpdiscuz-recaptcha-field-"+t).val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3))}),c(document).on("click","#wpdcom .wpd-comment-link [data-comment-url]",function(){var e=c(this).data("comment-url"),t=c("<input/>");t.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(e),t.trigger("select"),document.execCommand("copy"),t.remove(),wpdiscuzAjaxObj.setCommentMessage(e+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)}),c(document).on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",function(e){e.preventDefault()}),c(document).on("click",".wpd-toggle.wpd_not_clicked",function(){var e=c(this);e.removeClass("wpd_not_clicked");var t,a,o,n,d=J(c(this),0),s=c(this),i=c(".fas",s);!s.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&v?(a=e,o=Z(t=d),(n=new FormData).append("action","wpdShowReplies"),n.append("commentId",o),we(x,!0,n).done(function(e){a.addClass("wpd_not_clicked"),"object"==typeof e&&e.success&&(c("#wpd-comm-"+t).replaceWith(e.data.comment_list),c("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),c("#wpd-comm-"+t+" .wpd-toggle .wpd-view-replies .wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),c("#wpd-comm-"+t+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),me(e)),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o),a.addClass("wpd_not_clicked"),c("#wpdiscuz-loading-bar").fadeOut(250)})):c("#wpd-comm-"+d+"> .wpd-reply").slideToggle(700,function(){c(this).is(":hidden")?(i.removeClass("fa-chevron-up"),i.addClass("fa-chevron-down"),s.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),s.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(i.removeClass("fa-chevron-down"),i.addClass("fa-chevron-up"),s.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),s.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),e.addClass("wpd_not_clicked")})}),c(document).on("mouseenter",".wpd-new-loaded-comment",function(){c(this).removeClass("wpd-new-loaded-comment")}),c(document).on("click",".wpd-sbs-toggle",function(){c(".wpdiscuz-subscribe-bar").slideToggle(C)}),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm)&&!i&&wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&c("#wpdiscuz-subscribe-form").length&&("2.0"===l?(setTimeout(function(){try{grecaptcha.render("wpdiscuz-recaptcha-subscribe-form",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(e){c("#wpdiscuz-recaptcha-field-subscribe-form").val("key")},"expired-callback":function(){c("#wpdiscuz-recaptcha-field-subscribe-form").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3),c(document).on("submit","#wpdiscuz-subscribe-form",function(e){c("#wpdiscuz-recaptcha-field-subscribe-form").val()?c(".wpdiscuz-recaptcha",c(this)).css("border","none"):(c(".wpdiscuz-recaptcha",c(this)).css("border","1px solid red"),e.preventDefault())})):"3.0"===l&&c(document).on("click","#wpdiscuz_subscription_button",function(e){var t=c(this).parents("#wpdiscuz-subscribe-form");e.preventDefault();try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then(function(e){console.log(5555),document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=e,t.trigger("submit")},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}})),(p||r)&&"2.0"===l&&(t=c(window).width(),1100<=(o=c("#wpdcom").width())&&(c("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),c("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"65%"}),c("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"35%"})),940<=o&&o<1100&&(c("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),c("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"60%"}),c("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"40%"})),810<=o&&o<940&&(c("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"40%"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"60%"})),730<=o&&o<810&&(c("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.9)","-webkit-transform":"scale(0.9)"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"45%"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"55%"})),610<=o&&o<730&&(c("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.85)","-webkit-transform":"scale(0.85)"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({transform:"scale(0.8)","-webkit-transform":"scale(0.8)"}),c("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"43%"}),c("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"55%"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"})),650<t&&(510<=o&&o<610&&(c("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),c("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"35%"}),c("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"63%"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({width:"30%",position:"relative",right:"-60px"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({width:"70%"}),c("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),470<=o&&o<510&&(c("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"center 0","-webkit-transform-origin":"center 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({"transform-origin":"right 0","-webkit-transform-origin":"right 0",transform:"scale(0.77)","-webkit-transform":"scale(0.77)"}),c("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({width:"40%"}),c("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({width:"60%"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),c("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),c("#wpdcom .wpd_main_comm_form .wc-form-footer").css({"margin-left":"0px"}),c("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"})),o<470&&(c("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({margin:"0px auto","transform-origin":"center 0","-webkit-transform-origin":"center 0"}),c("#wpdcom .wpd-form-col-left").css({float:"none",width:"100%",display:"block"}),c("#wpdcom .wpd-form-col-right").css({float:"none",width:"100%",display:"block"}),c("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left":"0px"}),c("#wpdcom .wpd-secondary-form-wrapper .wc_notification_checkboxes").css({"text-align":"center"}),c("#wpdcom .wpd-secondary-form-wrapper .wc-field-submit").css({"text-align":"center"})))),c(document).on("click",".wc_comm_submit.wpd_not_clicked",function(){var o,e,t,a=c(this),n=1,d=c(this).parents("form");if(d.hasClass("wpd_main_comm_form")||(t=(t=c(this).parents(".wpd-comment")).attr("class").split(" "),o="",c.each(t,function(e,t){"wpd_comment_level"===ee(t,!1)&&(o=ee(t,!0))}),n=parseInt(o)+1),oe(d,"#wpd-editor-"+c(".wpdiscuz_unique_id",d).val()),d.on("submit",function(e){e.preventDefault()}),""!==c(".wc_comment",d).val().trim()){if(d[0].checkValidity()&&(e=d,t=!0,"2.0"===l&&c("input[name=wc_captcha]",e).length&&!c("input[name=wc_captcha]",e).val().length?(t=!1,c(".wpdiscuz-recaptcha",e).css("border","1px solid red")):"2.0"===l&&c("input[name=wc_captcha]",e).length&&c(".wpdiscuz-recaptcha",e).css("border","none"),t)){R=!0,c(".wpd-agreement-checkbox",d).each(function(){c(this).hasClass("wpd_agreement_hide")&&g&&c(this).prop("checked")&&(Cookies.set(c(this).attr("name")+"_"+j,1,{expires:30,path:"/"}),c("input[name="+c(this).attr("name")+"]").each(function(){F.push(c(this))}))}),c(a).removeClass("wpd_not_clicked");var s=new FormData;if(s.append("action","wpdAddComment"),c(":input",d).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&s.append(this.name+"",c(this).val().trim()),"checkbox"!=this.type&&"radio"!=this.type||c(this).is(":checked")&&s.append(this.name+"",c(this).val())}),s.append("wpd_comment_depth",n),wpdiscuzAjaxObj.wpdiscuz_zs&&s.append("wpdiscuz_zs",wpdiscuzAjaxObj.wpdiscuz_zs),c(".wpd-cookies-checkbox",d).length?c(".wpd-cookies-checkbox",d).prop("checked")||(z=!1):i&&(z=!1),c("#wpdiscuz-loading-bar").show(),wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&"3.0"===l&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/addComment"}).then(function(e){s.append("g-recaptcha-response",e),H(d,s,a)},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error"),c("#wpdiscuz-loading-bar").fadeOut(250)}else H(d,s,a)}n=c(".wpdiscuz_unique_id",d).val(),(p||r)&&"2.0"===l&&(n=Z(n),grecaptcha.reset(M[n])),c(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wc_msg_required_fields,"wc_msg_required_fields",d),"error")}),c(document).on("click",".wpd_editable_comment",function(){h&&c(".wpdiscuz-edit-form-wrap").length&&W(J(c(".wpdiscuz-edit-form-wrap"),0),h);var o=c(this),a=J(o,0),e=Z(a),t=new FormData;t.append("action","wpdEditComment"),t.append("commentId",e),h=c("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-text").get(0),we(x,!0,t).done(function(e){var t;"object"==typeof e?e.success?(c("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(e.data.html),wpdiscuzLoadRichEditor?((t=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+a)).clipboard.dangerouslyPasteHTML(0,e.data.content),t.update(),c(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")):(c("#wc-textarea-edit_"+a).val(e.data.content),le(c("#wc-textarea-edit_"+a))),c("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),c("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[e.data],e.data,o),"error"):console.log(e),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o),c("#wpdiscuz-loading-bar").fadeOut(250)})}),c(document).on("click",".wc_save_edited_comment",function(){var e,t=c(this),o=J(t),a=Z(o),n=c("#wpd-comm-"+o+" #wpdiscuz-edit-form");oe(n,"#wpd-editor-edit_"+o),n.on("submit",function(e){e.preventDefault()}),n[0].checkValidity()&&((e=new FormData).append("action","wpdSaveEditedComment"),e.append("commentId",a),c(":input",n).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&e.append(this.name+"",c(this).val()),"checkbox"!==this.type&&"radio"!==this.type||c(this).is(":checked")&&e.append(this.name+"",c(this).val())}),we(x,!0,e).done(function(e){"object"==typeof e?(e.success?(W(o,e.data.message),e.data.lastEdited&&(c("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),c(e.data.lastEdited).insertAfter("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),e.data.twitterShareLink&&c("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",e.data.twitterShareLink),e.data.whatsappShareLink&&c("#wpd-comm-"+o+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",e.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+o)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[e.data],e.data,t),"error"),me(e,a)):console.log(e),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o),c("#wpdiscuz-loading-bar").fadeOut(250)}))}),c(document).on("click",".wc_cancel_edit",function(){var e=J(c(this));W(e,h),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+e)}),!a&&f&&(S=0,1==f?setTimeout(function(){N(!0)},500):c(document).on("click",".wpd-load-comments",function(){c(this).parent(".wpd-load-more-submit-wrap").remove(),N(!0)})),c(document).on("click",".wpd-load-more-submit",function(){var e=c(this),t="wpd-loaded";e.hasClass(t)&&N(!1,e,t,"wpd-loading")});var V,B,K=!1;function Q(){var e=c("#wpdiscuzHasMoreComments").val(),t=c(document).height(),o=c(window).height()+c(window).scrollTop();t&&o&&80<=100*o/t&&!1===K&&1==e&&N(!(K=!0),c(".wpd-load-more-submit"))}function N(t,a,n,d){a&&(a.toggleClass(n),a.toggleClass(d));var e=new FormData;e.append("action","wpdLoadMoreComments");var o=c(".wpdiscuz-sort-button-active").attr("data-sorting");o&&e.append("sorting",o),e.append("offset",S),e.append("lastParentId",c(".wpd-load-more-submit").attr("data-lastparentid")),e.append("isFirstLoad",t?1:0);o=c(".wpdf-active").attr("data-filter-type");e.append("wpdType",o||""),we(x,!t||1!=f,e).done(function(e){"object"==typeof e&&e.success&&(S++,t&&c(".wpd-comment").remove(),c(".wpdiscuz_single").remove(),c(".wpdiscuz-comment-pagination").before(e.data.comment_list),G(e,t&&2!==s),K=!1,e.data.loadLastCommentId&&(w=e.data.loadLastCommentId),me(e),t&&$(!1)),c("#wpdiscuz-loading-bar").fadeOut(250),c(".wpd-load-more-submit").blur(),a&&(a.toggleClass(n),a.toggleClass(d))}).fail(function(e,t,o){console.log(o),c("#wpdiscuz-loading-bar").fadeOut(250),c(".wpd-load-more-submit").blur(),a&&(a.toggleClass(n),a.toggleClass(d))})}function G(e,t){var o;0==e.data.is_show_load_more?(c("#wpdiscuzHasMoreComments").val(0),c(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()):(o=e.data.last_parent_id,c(".wpd-load-more-submit").attr("data-lastparentid",o),2!==s&&c(".wpdiscuz-comment-pagination").show(),c("#wpdiscuzHasMoreComments").val(1),t&&c(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show()),me(e)}function $(o){var a,e=location.href.match(/#comment\-(\d+)/);null!==e&&(a=e[1],c("#comment-"+a).length?setTimeout(function(){ae(),c("html, body").animate({scrollTop:c("#comment-"+a).parents("[id^=wpd-comm-]").offset().top-E},1e3,ne),o&&X(a)},500):((e=new FormData).append("action","wpdGetSingleComment"),e.append("commentId",a),we(x,!0,e).done(function(e){var t;"object"==typeof e&&e.success&&(t="#comment-"+a,c("#comment-"+e.data.parentCommentID).length?c("#comment-"+e.data.parentCommentID).parents("[id^=wpd-comm-"+e.data.parentCommentID+"]").replaceWith(e.data.message):c(".wpd-thread-list").prepend(e.data.message),me(e),ae(),c("html, body").animate({scrollTop:c(t).offset().top-E},1e3,ne),o&&X(a)),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o),c("#wpdiscuz-loading-bar").fadeOut(250)})))}function X(e){setTimeout(function(){c("#comment-"+e).siblings(".wpd-secondary-form-wrapper").is(":visible")||c("#comment-"+e).find(".wpd-reply-button").trigger("click")},1100)}function Y(e){if(void 0!==e.data.message)for(var t=e.data.message,o=0;o<t.length;o++)n=t[o],a=n.comment_parent,n=n.comment_html,0==a?de(n):(a=J(c("#comment-"+a),0),c("#wpdiscuz_form_anchor-"+a).after(n));var a,n}function J(e,t){var o="";return(o=(t?e.parents(".wpd-main-form-wrapper"):e.parents(".wpd-comment")).attr("id")).substring(o.lastIndexOf("-")+1)}function Z(e){return e.substring(0,e.indexOf("_"))}function ee(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function te(){var e=[];return c(".wpd-comment-right").each(function(){e.push(Z(J(c(this),0)))}),e.join(",")}function oe(e,t){var o=e.find(".wpd-required-group");wpdiscuzLoadRichEditor&&e.find(".wc_comment").val(c(t+">.ql-editor").html()),t=(t=(t=(t=(t=(e=(t=e).find(".wc_comment")).val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n")).replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),e.val(t),c.each(o,function(){c("input",this).prop("required",!1),0===c("input:checked",this).length?c("input",c(this)).prop("required",!0):c(".wpd-field-invalid",this).remove()})}function ae(){c("html, body").css("scroll-behavior","unset")}function ne(){c("html").css("scroll-behavior",P),c("body").css("scroll-behavior",q)}function de(e){c(".wpd-sticky-comment").last()[0]?c(e).insertAfter(c(".wpd-sticky-comment").last()[0]):c(".wpd-thread-list").prepend(e)}function se(e){e?e.prop("required")||(e.val()?e.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):e.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):c.each(c(".wc_email"),function(e,t){t=c(t);t.prop("required")||(t.val()?t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}function ie(e){return(e=(c(e).hasClass("wpd-inline-shortcode")?c(e):c(e).parents(".wpd-inline-shortcode")).attr("id")).substring(e.lastIndexOf("-")+1)}function ce(){c(".wpd-inline-form-wrapper").hide(),c(".wpd-inline-shortcode").removeClass("wpd-active"),c(".wpd-inline-icon").removeClass("wpd-open")}function pe(){c.each(c(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var e=c(this),t=e.offset().top-window.pageYOffset;e.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&0<t&&t<300&&("blink"===D?(e.addClass("wpd-blink"),setTimeout(function(){e.removeClass("wpd-blink")},3e3)):(e.parents(".wpd-inline-shortcode").addClass("wpd-active"),e.siblings(".wpd-inline-form-wrapper").show(),e.addClass("wpd-open"),re(e.siblings(".wpd-inline-form-wrapper"))))})}function re(e){var t;e?e.offset().left<=10?(e.css("left",Math.ceil(parseInt(e.css("left"))-e.offset().left+10)),(t=Math.ceil(e.siblings(".wpd-inline-icon.wpd-open").offset().left-e.offset().left+2))<3&&(t=3),document.styleSheets[0].addRule("#"+e.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;")):e.offset().left+e.width()>document.body.clientWidth-10&&(e.css("left",Math.ceil(parseInt(e.css("left"))+(document.body.clientWidth-(e.offset().left+e.width()))-10)),(t=Math.ceil(e.siblings(".wpd-inline-icon.wpd-open").offset().left-e.offset().left+2))>e.width()-3&&(t=e.width()-3),document.styleSheets[0].addRule("#"+e.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;")):c.each(c(".wpd-inline-form-wrapper:visible"),function(){var e;c(this).offset().left<=10?(c(this).css("left",Math.ceil(parseInt(c(this).css("left"))-c(this).offset().left+10)),(e=Math.ceil(c(this).siblings(".wpd-inline-icon.wpd-open").offset().left-c(this).offset().left+2))<3&&(e=3),document.styleSheets[0].addRule("#"+c(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+e+"px;")):c(this).offset().left+c(this).width()>document.body.clientWidth-10&&(c(this).css("left",Math.ceil(parseInt(c(this).css("left"))+(document.body.clientWidth-(c(this).offset().left+c(this).width()))-10)),(e=Math.ceil(c(this).siblings(".wpd-inline-icon.wpd-open").offset().left-c(this).offset().left+2))>c(this).width()-3&&(e=c(this).width()-3),document.styleSheets[0].addRule("#"+c(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+e+"px;"))})}function le(e){var t,o,a=0;e.parents(".wpd_main_comm_form").length?(a=parseInt(wpdiscuzAjaxObj.commentTextMaxLength),o=e.parents(".wpd_main_comm_form")):e.parents(".wpd-secondary-form-wrapper").length?(a=parseInt(wpdiscuzAjaxObj.replyTextMaxLength),o=e.parents(".wpd-secondary-form-wrapper")):e.parents("#wpdiscuz-edit-form").length&&(t=J(e),a=parseInt(t.substring(t.lastIndexOf("_")+1))?parseInt(wpdiscuzAjaxObj.replyTextMaxLength):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),o=e.parents("#wpdiscuz-edit-form")),a&&o&&(e=a-e.val().length,(o=c(".wpd-editor-char-counter",o)).html(e),e<=10?o.addClass("error"):o.removeClass("error"))}function me(t,o,a,n){t.data.callbackFunctions&&c.each(t.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,o,a,n):console.log(t.data.callbackFunctions[e]+" is not a function")})}function we(t,o,a){o&&c("#wpdiscuz-loading-bar").show(),a.append("postId",d);var n=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&c.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](a,t,o))});var e=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return c.ajax({type:"POST",url:e,data:a,contentType:!1,processData:!1})}2!==s||a||(c(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),Q(),c(window).scroll(function(){Q()})),wpdiscuzAjaxObj.setLoadMoreVisibility=G,c(document).on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",function(){var d=c(this);c(d).removeClass("wpd_not_clicked");var s=Z(J(d)),i=c(this).hasClass("wpd-vote-up")?1:-1,e=new FormData;e.append("action","wpdVoteOnComment"),e.append("commentId",s),e.append("voteType",i),we(x,!0,e).done(function(e){var t,o,a,n;c(d).addClass("wpd_not_clicked"),"object"==typeof e?(e.success?("total"===e.data.buttonsStyle?(t=c(".wpd-comment-footer .wpd-vote-result",c("#comment-"+s)),o=e.data.votes,t.text(e.data.votesHumanReadable),t.attr("title",o),t.removeClass("wpd-up wpd-down"),0<o&&t.addClass("wpd-up"),o<0&&t.addClass("wpd-down")):(a=c(".wpd-comment-footer .wpd-vote-result-like",c("#comment-"+s)),n=c(".wpd-comment-footer .wpd-vote-result-dislike",c("#comment-"+s)),a.text(e.data.likeCountHumanReadable),a.attr("title",e.data.likeCount),n.text(e.data.dislikeCountHumanReadable),n.attr("title",e.data.dislikeCount),0<parseInt(e.data.likeCount)?a.addClass("wpd-up"):a.removeClass("wpd-up"),parseInt(e.data.dislikeCount)<0?n.addClass("wpd-down"):n.removeClass("wpd-down")),a=c(".wpd-comment-footer .wpd-vote-up",c("#comment-"+s)),n=c(".wpd-comment-footer .wpd-vote-down",c("#comment-"+s)),a.removeClass("wpd-up"),n.removeClass("wpd-down"),0<e.data.curUserReaction?a.addClass("wpd-up"):e.data.curUserReaction<0&&n.addClass("wpd-down")):e.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[e.data],e.data,d),"error"),me(e,s,i)):console.log(e),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o),c(d).addClass("wpd_not_clicked"),c("#wpdiscuz-loading-bar").fadeOut(250)})}),c(document).on("click","body",function(e){var t=c(".wpdiscuz-sort-buttons");c(e.target).hasClass("wpdf-sorting")||c(e.target).parent().hasClass("wpdf-sorting")?t.css({display:t.is(":visible")?"none":"flex"}):t.hide()}),c(document).on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var e=c(this),t=c(this).attr("data-sorting");t&&(c(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),e.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting"),(e=new FormData).append("action","wpdSorting"),e.append("sorting",t),t=c(".wpdf-active").attr("data-filter-type"),e.append("wpdType",t||""),we(x,!0,e).done(function(e){"object"==typeof e&&e.success&&(c("#wpdcom .wpd-comment").remove(),c("#wpdcom .wpd-thread-list").prepend(e.data.message),G(e,!1),S=1),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o),c("#wpdiscuz-loading-bar").fadeOut(250)}))}),window.onhashchange=function(){$(!1)},1!=f&&$(!1),c(document).on("click",".wpdiscuz-readmore",function(){var t=J(c(this)),o=Z(t),e=new FormData;e.append("action","wpdReadMore"),e.append("commentId",o),we(x,!0,e).done(function(e){"object"==typeof e?(e.success?(c("#comment-"+o+" .wpd-comment-text").replaceWith(" "+e.data.message),c("#wpdiscuz-readmore-"+t).remove()):console.log(e.data),me(e)):console.log(e),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o),c("#wpdiscuz-loading-bar").fadeOut(250)})}),c(document).on("change",".wpd-required-group",function(){0!==c("input:checked",this).length?c("input",c(this)).prop("required",!1):c("input",c(this)).prop("required",!0)}),c(document).on("click",".wpdiscuz-spoiler",function(){c(this).next().slideToggle(),c(this).hasClass("wpdiscuz-spoiler-closed")?c(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"):c(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"),c(this).toggleClass("wpdiscuz-spoiler-closed")}),c(document).on("click",".wpd-tools i",function(){var e=c(this).siblings(".wpd-tools-actions");e.is(":visible")||c(this).parents(".wpd-comment-right").attr("id")!==c("[id^=comment-]","#wpdcom").last().attr("id")||c("#comments").css({paddingBottom:"160px"}),e.css({display:e.is(":visible")?"none":"flex"})}),c(document).on("mouseleave",".wpd-comment-right",function(){c(this).find(".wpd-tools-actions").hide(),c("#comments").css({paddingBottom:"0"})}),c(document).on("click",".wpd_stick_btn",function(){var e=Z(J(c(this),0)),t=new FormData;t.append("action","wpdStickComment"),t.append("commentId",e),we(x,!0,t).done(function(e){"object"==typeof e&&e.success&&location.reload(!0),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o),c("#wpdiscuz-loading-bar").fadeOut(250)})}),c(document).on("click",".wpd_close_btn",function(){var e=Z(J(c(this),0)),t=new FormData;t.append("action","wpdCloseThread"),t.append("commentId",e),we(x,!0,t).done(function(e){"object"==typeof e&&e.success&&location.reload(!0),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o),c("#wpdiscuz-loading-bar").fadeOut(250)})}),c(document).on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var t=c(this),e=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+e),t.removeClass("wpd_not_clicked"),c(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdLoadMoreComments");var a=c(".wpdiscuz-sort-button-active").attr("data-sorting");a&&o.append("sorting",a),o.append("lastParentId",0),o.append("offset",0),S=1,o.append("wpdType",t.hasClass("wpdf-active")?"":e),o.append("isFirstLoad",1),!c(this).hasClass("wpdf-inline")||c(this).hasClass("wpdf-active")?c(".wpd-comment-info-bar").hide():c(".wpd-comment-info-bar").css("display","flex"),we(x,!1,o).done(function(e){t.addClass("wpd_not_clicked"),c(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof e&&e.success&&(t.toggleClass("wpdf-active"),c(".wpd-load-comments").remove(),c(".wpd-comment").remove(),c(".wpd-thread-list").prepend(e.data.comment_list),G(e),w=e.data.loadLastCommentId,c(".wpd-load-more-submit").blur(),me(e)),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o),c("#wpdiscuz-loading-bar").fadeOut(250)})}),c(document).on("click",".wpdf-reacted.wpd_not_clicked",function(){var a=c(this);a.removeClass("wpd_not_clicked"),c(".fas",a).addClass("fa-pulse fa-spinner");var e=new FormData;e.append("action","wpdMostReactedComment"),we(x,!1,e).done(function(e){a.addClass("wpd_not_clicked"),c(".fas",a).removeClass("fa-pulse fa-spinner"),"object"==typeof e&&e.success&&(c("#comment-"+e.data.parentCommentID).length?c("#comment-"+e.data.parentCommentID).parents("[id^=wpd-comm-"+e.data.parentCommentID+"]").replaceWith(e.data.message):c("#comment-"+e.data.commentId).length||c(".wpd-thread-list").prepend(e.data.message),me(e),ae(),c("html, body").animate({scrollTop:c("#comment-"+e.data.commentId).offset().top-E},1e3,ne))}).fail(function(e,t,o){console.log(o),c(".fas",a).removeClass("fa-pulse fa-spinner")})}),c(document).on("click",".wpdf-hottest.wpd_not_clicked",function(){var a=c(this);a.removeClass("wpd_not_clicked"),c(".fas",a).addClass("fa-pulse fa-spinner");var e=new FormData;e.append("action","wpdHottestThread"),we(x,!1,e).done(function(e){a.addClass("wpd_not_clicked"),c(".fas",a).removeClass("fa-pulse fa-spinner"),"object"==typeof e&&e.success&&(c("#comment-"+e.data.commentId).length?c("#comment-"+e.data.commentId).parents("[id^=wpd-comm-"+e.data.commentId+"]").replaceWith(e.data.message):c(".wpd-thread-list").prepend(e.data.message),me(e),ae(),c("html, body").animate({scrollTop:c("#comment-"+e.data.commentId).offset().top-E},1e3,ne))}).fail(function(e,t,o){console.log(o),c(".fas",a).removeClass("fa-pulse fa-spinner")})}),c(document).on("click",".wpd-filter-view-all",function(){c(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")}),c(document).on("click",".wpd-follow-link.wpd_not_clicked",function(){var a=c(this);a.removeClass("wpd_not_clicked"),c(".fas",a).addClass("fa-pulse fa-spinner");var e=Z(J(a,0)),t=new FormData;t.append("action","wpdFollowUser"),t.append("commentId",e),we(x,!0,t).done(function(e){a.addClass("wpd_not_clicked"),"object"==typeof e?e.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[e.data.code],e.data.code,a),"success"),a.removeClass("wpd-follow-active"),e.data.followTip&&a.attr("wpd-tooltip",e.data.followTip),e.data.followClass&&a.addClass(e.data.followClass)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[e.data],e.data,a),"error"):console.log(e),c(".fas",a).removeClass("fa-pulse fa-spinner"),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o),c(".fas",a).removeClass("fa-pulse fa-spinner"),c("#wpdiscuz-loading-bar").fadeOut(250)})}),se(),c(document).on("keyup",".wc_email",function(){se(c(this))}),k&&c("#wpdcom").length&&(c("#wpd-bubble-wrapper").hover(function(){c(this).addClass("wpd-bubble-hover")},function(){c(this).removeClass("wpd-bubble-hover")}),O&&!Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)&&setTimeout(function(){c("#wpd-bubble-wrapper").addClass("wpd-bubble-hover"),Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint,"1",{expires:7,path:"/"}),setTimeout(function(){c("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")},1e3*A)},1e3*O),"content_left"===T?c(".entry-content").length?(B=25<(V=Math.min(c(".entry-content").offset().left,c("#wpdcom").offset().left)-120)?V:25,c("#wpd-bubble-wrapper").css({left:B+"px"}),c("#wpd-bubble-wrapper").addClass("wpd-left-content")):c(".post-entry").length?(B=25<(V=Math.min(c(".post-entry").offset().left,c("#wpdcom").offset().left)-120)?V:25,c("#wpd-bubble-wrapper").css({left:B+"px"}),c("#wpd-bubble-wrapper").addClass("wpd-left-content")):c(".container").length?(B=25<(V=Math.min(c(".container").offset().left,c("#wpdcom").offset().left)-120)?V:25,c("#wpd-bubble-wrapper").css({left:B+"px"}),c("#wpd-bubble-wrapper").addClass("wpd-left-content")):(c("#wpd-bubble-wrapper").css({left:"25px"}),c("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"left_corner"===T?(c("#wpd-bubble-wrapper").css({left:"25px"}),c("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===T&&(c("#wpd-bubble-wrapper").css({right:"25px"}),c("#wpd-bubble-wrapper").addClass("wpd-right-corner")),c("#wpd-bubble-wrapper").show(),c(document).on("click","#wpd-bubble-add-message-close",function(e){e.preventDefault(),e.stopPropagation(),c("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover")}),c(document).on("click","#wpd-bubble",function(){ae(),c("#tab-title-reviews").length&&c("#tab-title-reviews a").trigger("click"),c("html, body").animate({scrollTop:c("#wpdcom").offset().top-(E+28)},1e3,function(){ne(),c("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover"),wpdiscuzLoadRichEditor?c("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0").focus():c("#wc-textarea-0_0").length&&c("#wc-textarea-0_0").trigger("focus")})}),c(document).on("click","#wpd-bubble-comment-close",function(e){e.preventDefault(),c("#wpd-bubble-notification-message").hide(),c("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),c(document).on("click","#wpd-bubble-comment-reply-link a",function(){var e=c(this).attr("href");setTimeout(function(){c("#wpd-bubble-notification-message").hide(),c("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),$(!0);var t=e.match(/#comment\-(\d+)/);L=L.filter(function(e){return e!=t[1]}),c("#wpd-bubble-count .wpd-new-comments-count").text(L.length),0==L.length&&c("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),c(document).on("click","#wpd-bubble-count",function(){var e;L.length&&((e=new FormData).append("action","wpdBubbleUpdate"),e.append("newCommentIds",L.join()),we(x,!0,e).done(function(e){"object"==typeof e&&e.success&&(e.data.message=e.data.message.filter(function(e){if(!c("#comment-"+e.comment_id).length)return e}),Y(e),c("#wpd-bubble-count").removeClass("wpd-new-comments"),c("#wpd-bubble-count .wpd-new-comments-count").text("0"),L=[],c(".wpd-new-loaded-comment").length&&(ae(),c("html, body").animate({scrollTop:c(c(".wpd-new-loaded-comment")[0]).offset().top-(E+28)},1e3,ne)),me(e)),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o)}))})),(k&&y||n)&&(i||!i&&e)&&setTimeout(function a(){c.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:d,lastId:u,visibleCommentIds:te()}}).done(function(e){var t,o;R||("object"==typeof e?(e.commentIDsToRemove.forEach(function(e){c("[id^=wpd-comm-"+e+"]").remove()}),e.ids.length&&(n&&((o=new FormData).append("action","wpdUpdateAutomatically"),o.append("loadLastCommentId",w),o.append("visibleCommentIds",te()),we(x,!1,o).done(function(e){R||"object"==typeof e&&e.success&&(Y(e),e.data.wc_all_comments_count_new=parseInt(e.data.wc_all_comments_count_new),c(".wpd-thread-info").html(e.data.wc_all_comments_count_before_threads_html),c(".wpd-thread-info").attr("data-comments-count",e.data.wc_all_comments_count_new),c("#wpd-bubble-all-comments-count").replaceWith(e.data.wc_all_comments_count_bubble_html),w=e.data.loadLastCommentId)}).fail(function(e,t,o){console.log(o)})),e.ids=e.ids.filter(function(e){if(!c("#comment-"+e).length)return e}),t=5e3,u=parseInt(e.ids[e.ids.length-1]),L=L.concat(e.ids),I&&e.commentText&&(c("#wpd-bubble-author-avatar").html(e.avatar),c("#wpd-bubble-author-name").html(e.authorName),c("#wpd-bubble-comment-date span").html(e.commentDate),c("#wpd-bubble-comment-text").html(e.commentText),c("#wpd-bubble-comment-reply-link a").attr("href",e.commentLink),c("#wpd-bubble-notification-message").show(),t=1e4),o=parseInt(c(".wpd-new-comments-count").text()),o+=e.ids.length,c("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),c("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout(function(){c("#wpd-bubble-notification-message").hide(),c("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")},t),c(".wpd-new-comments-count").text(o),c("#wpd-bubble-count").addClass("wpd-new-comments")),e.all_comments_count=parseInt(e.all_comments_count),c("#wpd-bubble-all-comments-count").replaceWith(e.all_comments_count_bubble_html),c(".wpd-thread-info").html(e.all_comments_count_before_threads_html),c(".wpd-thread-info").attr("data-comments-count",e.all_comments_count)):console.log(e)),setTimeout(a,m)}).fail(function(e,t,o){console.log(o),setTimeout(a,m)})},m),c(".wpd-inline-form-wrapper").length&&((e=new FormData).append("action","wpdGetInlineCommentForm"),we(x,!1,e).done(function(e){"object"==typeof e?e.success?(c(".wpd-inline-form-wrapper").append(e.data),c.each(c("[name=_wpd_inline_nonce]"),function(){var e=c(this).attr("id"),t=c(this).parents(".wpd-inline-shortcode").attr("id");c(this).attr("id",e+"-"+t.substring(t.lastIndexOf("-")+1))}),c(".wpd-inline-opened").addClass("wpd-active"),c(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),c(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),c(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),re()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[e.data]),e.data,"error"):console.log(e)}).fail(function(e,t,o){console.log(o)})),c(document).on("click","body",function(e){var t;c(e.target).hasClass("wpd-inline-form-close")||c(e.target).parents(".wpd-inline-form-close").length?(e.preventDefault(),c(e.target).parents(".wpd-inline-form-wrapper").hide(),c(e.target).parents(".wpd-inline-shortcode").removeClass("wpd-active"),c(e.target).parents(".wpd-inline-form-wrapper").siblings(".wpd-inline-icon").removeClass("wpd-open")):c(e.target).hasClass("wpd-inline-form-wrapper")||c(e.target).parents(".wpd-inline-form-wrapper").length||(ce(),t="",c(e.target).hasClass("wpd-inline-icon")?t=c(e.target):c(e.target).parents(".wpd-inline-icon").length&&(t=c(e.target).parents(".wpd-inline-icon")),t.length&&t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(t.parents(".wpd-inline-shortcode").addClass("wpd-active"),t.siblings(".wpd-inline-form-wrapper").show(),t.addClass("wpd-open"),t.removeClass("wpd-ignored"),re(t.siblings(".wpd-inline-form-wrapper")))),(!c(e.target).hasClass("wpd-last-inline-comments-wrapper")&&!c(e.target).parents(".wpd-last-inline-comments-wrapper").length||c(e.target).parents(".wpd-last-inline-comments-wrapper").length&&c(e.target).hasClass("wpd-load-inline-comment"))&&c(".wpd-last-inline-comments-wrapper").remove()}),c(document).on("click",".wpd-inline-submit.wpd_not_clicked",function(e){e.preventDefault();var o,a=c(this),n=c(this).parents(".wpd_inline_comm_form");n[0].checkValidity()&&(c(this).removeClass("wpd_not_clicked"),(o=new FormData).append("action","wpdAddInlineComment"),o.append("inline_form_id",ie(n)),c.each(c("input, textarea",n),function(e,t){("checkbox"!==this.type||c(this).is(":checked"))&&o.append(c(t).attr("name"),c(t).val())}),we(x,!0,o).done(function(e){var t,o;a.addClass("wpd_not_clicked"),"object"==typeof e?e.success?(n[0].reset(),ce(),t=parseInt(e.data.newCount),(o=a.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count")).text(t),t?o.addClass("wpd-has-comments"):o.removeClass("wpd-has-comments"),e.data.allCommentsCountNew=parseInt(e.data.allCommentsCountNew),c(".wpd-thread-info").html(e.data.allCommentsCountBeforeThreadsHtml),c(".wpd-thread-info").attr("data-comments-count",e.data.allCommentsCountNew),c("#wpd-bubble-all-comments-count").replaceWith(e.data.allCommentsCountBubbleHtml),e.data.message&&de(e.data.message),wpdiscuzAjaxObj.setCommentMessage(e.data.notification,"success")):e.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[e.data],e.data,a),"error"):wpdiscuzAjaxObj.setCommentMessage(e,"error"),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o),c("#wpdiscuz-loading-bar").fadeOut(250)}))}),c(document).on("keydown",".wpd-form",function(e){e.ctrlKey&&13==e.keyCode&&c(this).find(".wc_comm_submit").trigger("click")}),c(document).on("keydown","#wpdiscuz-edit-form",function(e){e.ctrlKey&&13==e.keyCode&&c(this).find(".wc_save_edited_comment").trigger("click")}),c(document).on("keydown",".wpd-inline-comment-content",function(e){e.ctrlKey&&13==e.keyCode&&c(this).parents(".wpd_inline_comm_form").find(".wpd-inline-submit.wpd_not_clicked").trigger("click")}),c(document).on("click",".wpd-inline-icon-count.wpd-has-comments",function(){var t=c(this),e=new FormData;e.append("action","wpdGetLastInlineComments"),e.append("inline_form_id",ie(t)),we(x,!0,e).done(function(e){"object"==typeof e?e.success?c(e.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[e.data],e.data,t),"error"):console.log(e),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o),c("#wpdiscuz-loading-bar").fadeOut(250)})}),c(document).on("click",".wpd-view-all-inline-comments",function(e){e.preventDefault(),c(this).parents(".wpd-last-inline-comments-wrapper").remove(),c(".wpdf-inline").hasClass("wpdf-active")||c(".wpdf-inline").trigger("click"),ae(),c("html, body").animate({scrollTop:c(".wpdf-inline").offset().top-E},1e3,ne)}),c(document).on("click",".wpd-feedback-content-link",function(e){e.preventDefault();var t=c(this).data("feedback-content-id");ae(),c("html, body").animate({scrollTop:c("#wpd-inline-"+t).offset().top-(E+6)},1e3,function(){ne(),c("#wpd-inline-"+t).addClass("wpd-active")})}),"scroll_open"!==D&&"blink"!==D||(pe(),c(window).on("scroll",pe)),c(document).on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var e=new FormData,t=c(this).index();0<=t&&t<5&&(e.append("action","wpdUserRate"),e.append("rating",t+1),we(x,!0,e).done(function(e){"object"==typeof e?e.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[e.data],e.data),"error"):console.log(e),c("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o),c("#wpdiscuz-loading-bar").fadeOut(250)}))}),c(document).on("submit","#wpdiscuz-subscribe-form",function(e){e.preventDefault();var t,o,a=c(this);a[0].checkValidity()&&(o=a,e=!0,"2.0"===l&&c("input[name=wpdiscuz_recaptcha_subscribe_form]",o).length&&!c("input[name=wpdiscuz_recaptcha_subscribe_form]",o).val().length?(e=!1,c(".wpdiscuz-recaptcha",o).css("border","1px solid red")):"2.0"===l&&c("input[name=wpdiscuz_recaptcha_subscribe_form]",o).length&&c(".wpdiscuz-recaptcha",o).css("border","none"),e)&&((t=new FormData).append("action","wpdAddSubscription"),c("*",a).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&t.append(this.name+"",c(this).val()),"checkbox"!=this.type&&"radio"!=this.type||c(this).is(":checked")&&t.append(this.name+"",c(this).val())}),we(x,!0,t).done(function(e){"object"==typeof e?e.success?(wpdiscuzAjaxObj.setCommentMessage(e.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(e.data,"error"):wpdiscuzAjaxObj.setCommentMessage(e,"error"),c("#wpdiscuz-loading-bar").fadeOut(250),R=!1}).fail(function(e,t,o){console.log(o),c("#wpdiscuz-loading-bar").fadeOut(250)}))}),c(document).on("click",".wpd-unsubscribe",function(e){e.preventDefault();e=new FormData;e.append("action","wpdUnsubscribe"),e.append("sid",c(this).data("sid")),e.append("skey",c(this).data("skey")),we(x,!0,e).done(function(e){"object"==typeof e?e.success?(wpdiscuzAjaxObj.setCommentMessage(e.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(e.data,"error"):console.log(e),c("#wpdiscuz-loading-bar").fadeOut(250),R=!1}).fail(function(e,t,o){console.log(o),c("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(e){c(".wpd-filter.wpdf-active"+(e?":not("+e+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=we});var onloadCallback=function(){if(document.getElementById("wpdiscuz-recaptcha-0_0")&&"2.0"===wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.render("wpdiscuz-recaptcha-0_0",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(e){jQuery("#wpdiscuz-recaptcha-field-0_0").val("key")},"expired-callback":function(){jQuery("#wpdiscuz-recaptcha-field-0_0").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}};
|
class.WpdiscuzCore.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
* Plugin Name: wpDiscuz
|
4 |
* Description: #1 WordPress Comment Plugin. Innovative, modern and feature-rich comment system to supercharge your website comment section.
|
5 |
-
* Version: 7.3.
|
6 |
* Author: gVectors Team
|
7 |
* Author URI: https://gvectors.com/
|
8 |
* Plugin URI: https://wpdiscuz.com/
|
@@ -471,7 +471,6 @@ class WpdiscuzCore implements WpDiscuzConstants {
|
|
471 |
$response["callbackFunctions"] = [];
|
472 |
$response = apply_filters("wpdiscuz_comment_post", $response);
|
473 |
do_action("wpdiscuz_clean_post_cache", $postId, "comment_posted");
|
474 |
-
do_action("wpdiscuz_reset_comments_cache", $postId);
|
475 |
wp_send_json_success($response);
|
476 |
} else {
|
477 |
wp_send_json_error("wc_invalid_field");
|
@@ -678,7 +677,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
|
|
678 |
$this->form = $this->wpdiscuzForm->getForm($postId);
|
679 |
if ($this->form->isUserCanSeeComments(WpdiscuzHelper::getCurrentUser(), $postId)) {
|
680 |
$this->isWpdiscuzLoaded = true;
|
681 |
-
$isFirstLoad = WpdiscuzHelper::sanitize(INPUT_POST, "isFirstLoad", FILTER_SANITIZE_NUMBER_INT,
|
682 |
// max value of php int for limit
|
683 |
$limit = ($isFirstLoad && $this->options->thread_display["commentListLoadType"] == 3) || (!$isFirstLoad && $this->options->thread_display["commentListLoadType"] == 1) ? PHP_INT_MAX - 1 : $this->options->wp["commentPerPage"];
|
684 |
$args = ["number" => $limit];
|
@@ -697,7 +696,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
|
|
697 |
$args["orderby"] = "by_vote";
|
698 |
$args["order"] = $this->options->wp["commentOrder"];
|
699 |
}
|
700 |
-
if (isset($args["orderby"]) && $args["orderby"] === "by_vote" && ($offset = WpdiscuzHelper::sanitize(INPUT_POST, "offset", FILTER_SANITIZE_NUMBER_INT,
|
701 |
$args["offset"] = $offset * ($isFirstLoad && $this->options->thread_display["commentListLoadType"] == 3 ? 0 : $this->options->wp["commentPerPage"]);
|
702 |
}
|
703 |
$args["last_parent_id"] = $lastParentId;
|
2 |
/*
|
3 |
* Plugin Name: wpDiscuz
|
4 |
* Description: #1 WordPress Comment Plugin. Innovative, modern and feature-rich comment system to supercharge your website comment section.
|
5 |
+
* Version: 7.3.3
|
6 |
* Author: gVectors Team
|
7 |
* Author URI: https://gvectors.com/
|
8 |
* Plugin URI: https://wpdiscuz.com/
|
471 |
$response["callbackFunctions"] = [];
|
472 |
$response = apply_filters("wpdiscuz_comment_post", $response);
|
473 |
do_action("wpdiscuz_clean_post_cache", $postId, "comment_posted");
|
|
|
474 |
wp_send_json_success($response);
|
475 |
} else {
|
476 |
wp_send_json_error("wc_invalid_field");
|
677 |
$this->form = $this->wpdiscuzForm->getForm($postId);
|
678 |
if ($this->form->isUserCanSeeComments(WpdiscuzHelper::getCurrentUser(), $postId)) {
|
679 |
$this->isWpdiscuzLoaded = true;
|
680 |
+
$isFirstLoad = WpdiscuzHelper::sanitize(INPUT_POST, "isFirstLoad", FILTER_SANITIZE_NUMBER_INT, 1);
|
681 |
// max value of php int for limit
|
682 |
$limit = ($isFirstLoad && $this->options->thread_display["commentListLoadType"] == 3) || (!$isFirstLoad && $this->options->thread_display["commentListLoadType"] == 1) ? PHP_INT_MAX - 1 : $this->options->wp["commentPerPage"];
|
683 |
$args = ["number" => $limit];
|
696 |
$args["orderby"] = "by_vote";
|
697 |
$args["order"] = $this->options->wp["commentOrder"];
|
698 |
}
|
699 |
+
if (isset($args["orderby"]) && $args["orderby"] === "by_vote" && ($offset = WpdiscuzHelper::sanitize(INPUT_POST, "offset", FILTER_SANITIZE_NUMBER_INT, 0))) {
|
700 |
$args["offset"] = $offset * ($isFirstLoad && $this->options->thread_display["commentListLoadType"] == 3 ? 0 : $this->options->wp["commentPerPage"]);
|
701 |
}
|
702 |
$args["last_parent_id"] = $lastParentId;
|
forms/wpdFormAttr/Login/SocialLogin.php
CHANGED
@@ -777,7 +777,7 @@ class SocialLogin {
|
|
777 |
$vkGetUserDataAttr = ["user_ids" => $userID,
|
778 |
"access_token" => $vkAccesTokenData["access_token"],
|
779 |
"fields" => "first_name,last_name,screen_name,photo_100",
|
780 |
-
"v" => "5.
|
781 |
$getVkUserResponse = wp_remote_post($vkGetUserDataURL, ["body" => $vkGetUserDataAttr]);
|
782 |
if (is_wp_error($getVkUserResponse)) {
|
783 |
$this->redirect($postID, $getVkUserResponse->get_error_message());
|
777 |
$vkGetUserDataAttr = ["user_ids" => $userID,
|
778 |
"access_token" => $vkAccesTokenData["access_token"],
|
779 |
"fields" => "first_name,last_name,screen_name,photo_100",
|
780 |
+
"v" => "5.89"];
|
781 |
$getVkUserResponse = wp_remote_post($vkGetUserDataURL, ["body" => $vkGetUserDataAttr]);
|
782 |
if (is_wp_error($getVkUserResponse)) {
|
783 |
$this->redirect($postID, $getVkUserResponse->get_error_message());
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: gVectors Team
|
|
3 |
Tags: comment, comments, ajax comments, comment form, comment fields
|
4 |
Requires at least: 5.0
|
5 |
Tested up to: 5.8
|
6 |
-
Stable tag: 7.3.
|
7 |
Requires PHP: 5.6 and higher
|
8 |
License: GPLv3
|
9 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
@@ -73,6 +73,7 @@ wpDiscuz version 7 is a revolutionary perspective on the commenting world! This
|
|
73 |
* Sticky Comments
|
74 |
* Closed Comments Threads (disable replies)
|
75 |
* Subscribe to User / User Follow
|
|
|
76 |
|
77 |
|
78 |
= Add-ons =
|
@@ -92,16 +93,17 @@ wpDiscuz version 7 is a revolutionary perspective on the commenting world! This
|
|
92 |
* | [wpDiscuz - Ads Manager](https://gvectors.com/product/wpdiscuz-ads-manager/)
|
93 |
* | [wpDiscuz - User & Comment Mentioning](https://gvectors.com/product/wpdiscuz-user-comment-mentioning/)
|
94 |
* | [wpDiscuz - Advanced Likers](https://gvectors.com/product/wpdiscuz-advanced-likers/)
|
95 |
-
* | [wpDiscuz - Comments Censure](https://gvectors.com/product/comments-censure-pro/)
|
96 |
* | [wpDiscuz - Online Users](https://gvectors.com/product/wpdiscuz-online-users/)
|
97 |
* | [wpDiscuz - Private Comments](https://gvectors.com/product/wpdiscuz-private-comments/)
|
98 |
* | [wpDiscuz - Syntax Highlighter](https://gvectors.com/product/wpdiscuz-syntax-highlighter/)
|
99 |
-
* | [
|
100 |
|
101 |
= Integration Add-ons =
|
102 |
|
103 |
* | [wpDiscuz - BuddyPress Integration](https://gvectors.com/product/wpdiscuz-buddypress-integration/)
|
104 |
* | [wpDiscuz - Tenor GIFs Integration](https://gvectors.com/product/wpdiscuz-tenor-integration/)
|
|
|
|
|
105 |
|
106 |
|
107 |
== Installation ==
|
@@ -183,6 +185,17 @@ Nothing will be lost! **Comments - wpDiscuz** will show all old comments.
|
|
183 |
|
184 |
== Changelog ==
|
185 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
= Comments - wpDiscuz v7.3.2 =
|
187 |
|
188 |
* Added: Better UI for option search in wpDiscuz settings page
|
@@ -191,10 +204,6 @@ Nothing will be lost! **Comments - wpDiscuz** will show all old comments.
|
|
191 |
* Fixed: Fatal Error - Uncaught Error, cannot use string offset as an array
|
192 |
* Fixed: Fatal Error - Too few arguments to function cleanCommentRelatedRows()
|
193 |
|
194 |
-
**IMPORTANT!**
|
195 |
-
|
196 |
-
* Please don't forget delete all caches and purge CDN after the update.
|
197 |
-
|
198 |
|
199 |
= Comments - wpDiscuz v7.3.1 =
|
200 |
|
3 |
Tags: comment, comments, ajax comments, comment form, comment fields
|
4 |
Requires at least: 5.0
|
5 |
Tested up to: 5.8
|
6 |
+
Stable tag: 7.3.3
|
7 |
Requires PHP: 5.6 and higher
|
8 |
License: GPLv3
|
9 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
73 |
* Sticky Comments
|
74 |
* Closed Comments Threads (disable replies)
|
75 |
* Subscribe to User / User Follow
|
76 |
+
* Built-in comment and comment author caching system
|
77 |
|
78 |
|
79 |
= Add-ons =
|
93 |
* | [wpDiscuz - Ads Manager](https://gvectors.com/product/wpdiscuz-ads-manager/)
|
94 |
* | [wpDiscuz - User & Comment Mentioning](https://gvectors.com/product/wpdiscuz-user-comment-mentioning/)
|
95 |
* | [wpDiscuz - Advanced Likers](https://gvectors.com/product/wpdiscuz-advanced-likers/)
|
|
|
96 |
* | [wpDiscuz - Online Users](https://gvectors.com/product/wpdiscuz-online-users/)
|
97 |
* | [wpDiscuz - Private Comments](https://gvectors.com/product/wpdiscuz-private-comments/)
|
98 |
* | [wpDiscuz - Syntax Highlighter](https://gvectors.com/product/wpdiscuz-syntax-highlighter/)
|
99 |
+
* | [Comments Censure PRO](https://gvectors.com/product/comments-censure-pro/)
|
100 |
|
101 |
= Integration Add-ons =
|
102 |
|
103 |
* | [wpDiscuz - BuddyPress Integration](https://gvectors.com/product/wpdiscuz-buddypress-integration/)
|
104 |
* | [wpDiscuz - Tenor GIFs Integration](https://gvectors.com/product/wpdiscuz-tenor-integration/)
|
105 |
+
* | [wpDiscuz - GIPHY Integration](https://gvectors.com/product/wpdiscuz-giphy-integration/)
|
106 |
+
* | [wpDiscuz - Voice Commenting](https://gvectors.com/product/wpdiscuz-voice-commenting/)
|
107 |
|
108 |
|
109 |
== Installation ==
|
185 |
|
186 |
== Changelog ==
|
187 |
|
188 |
+
= Comments - wpDiscuz v7.3.3 =
|
189 |
+
|
190 |
+
* Fixed: Replies made from dashboard are invisible
|
191 |
+
* Fixed: Most voted comments are not loading
|
192 |
+
* Fixed: VK social login issue
|
193 |
+
|
194 |
+
**IMPORTANT!**
|
195 |
+
|
196 |
+
* Please don't forget delete all caches and purge CDN after the update.
|
197 |
+
|
198 |
+
|
199 |
= Comments - wpDiscuz v7.3.2 =
|
200 |
|
201 |
* Added: Better UI for option search in wpDiscuz settings page
|
204 |
* Fixed: Fatal Error - Uncaught Error, cannot use string offset as an array
|
205 |
* Fixed: Fatal Error - Too few arguments to function cleanCommentRelatedRows()
|
206 |
|
|
|
|
|
|
|
|
|
207 |
|
208 |
= Comments - wpDiscuz v7.3.1 =
|
209 |
|
utils/class.WpdiscuzCache.php
CHANGED
@@ -19,6 +19,7 @@ class WpdiscuzCache implements WpDiscuzConstants {
|
|
19 |
add_action("wpdiscuz_reset_users_cache", [&$this, "resetUsersCache"]);
|
20 |
add_action("wpdiscuz_reset_comments_cache", [&$this, "resetCommentsCache"]);
|
21 |
add_action("wpdiscuz_reset_comments_extra_cache", [&$this, "resetExtraCache"]);
|
|
|
22 |
}
|
23 |
|
24 |
public function purgeAllCaches() {
|
@@ -198,5 +199,11 @@ class WpdiscuzCache implements WpDiscuzConstants {
|
|
198 |
"extra" => self::EXTRA_CACHE_DIR,
|
199 |
];
|
200 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
|
202 |
}
|
19 |
add_action("wpdiscuz_reset_users_cache", [&$this, "resetUsersCache"]);
|
20 |
add_action("wpdiscuz_reset_comments_cache", [&$this, "resetCommentsCache"]);
|
21 |
add_action("wpdiscuz_reset_comments_extra_cache", [&$this, "resetExtraCache"]);
|
22 |
+
add_action("comment_post",[&$this, "commentPost"],248,3);
|
23 |
}
|
24 |
|
25 |
public function purgeAllCaches() {
|
199 |
"extra" => self::EXTRA_CACHE_DIR,
|
200 |
];
|
201 |
}
|
202 |
+
|
203 |
+
public function commentPost($comment_ID, $approved, $commentdata){
|
204 |
+
if(!empty($commentdata['comment_post_ID'])){
|
205 |
+
$this->resetCommentsCache($commentdata['comment_post_ID']);
|
206 |
+
}
|
207 |
+
}
|
208 |
|
209 |
}
|