Version Description
Download this release
Release Info
Developer | taron96 |
Plugin | Comments – wpDiscuz |
Version | 7.1.4 |
Comparing to | |
See all releases |
Code changes from version 7.1.3 to 7.1.4
- assets/js/wpdiscuz-combo-no_quill.min.js +1 -1
- assets/js/wpdiscuz-combo.min.js +1 -1
- assets/js/wpdiscuz-options.js +3 -0
- assets/js/wpdiscuz-shortcode-tinymce.js +1 -1
- assets/js/wpdiscuz.js +3 -1
- assets/js/wpdiscuz.min.js +1 -1
- assets/third-party/quicktags/wpdiscuz-quictags.js +1 -1
- class.WpdiscuzCore.php +92 -11
- forms/wpDiscuzForm.php +1 -0
- forms/wpdFormAttr/Form.php +20 -18
- forms/wpdFormAttr/FormConst/wpdFormConst.php +2 -1
- forms/wpdFormAttr/Row.php +4 -0
- includes/class.WpdiscuzDBManager.php +27 -4
- includes/interface.WpDiscuzConstants.php +3 -0
- options/class.WpdiscuzOptions.php +12 -0
- readme.txt +17 -2
- themes/default/class.WpdiscuzWalker.php +3 -3
- themes/default/comment-form.php +3 -3
- utils/class.WpdiscuzHelper.php +55 -51
- utils/class.WpdiscuzHelperAjax.php +6 -0
- utils/class.WpdiscuzHelperOptimization.php +2 -0
assets/js/wpdiscuz-combo-no_quill.min.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/* Autogrow */
|
4 |
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)})};
|
5 |
/* wpDiscuz */
|
6 |
-
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,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()})},jQuery(document).ready(function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,a=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),v=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,z=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),j=parseInt(wpdiscuzAjaxObj.enableBubble),C=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),x=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,y=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),O=wpdiscuzAjaxObj.bubbleLocation,A=wpdiscuzAjaxObj.inlineFeedbackAttractionType,I=[],T=[],D=[],E=!1,M=1,F=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 o=e(".wpd-form").not(":hidden");if(o.length)if(wpdiscuzLoadRichEditor){for(var a=0;a<o.length;a++)if("\n"!==wpDiscuzEditor.createEditor(e(o[a]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(a=0;a<o.length;a++)if(e(o[a]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")}),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(v)}),e(document).on("focus","#wpdcom textarea",function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()}),t)||q({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 o=e("#wpd-editor-source-code").val();o.length&&t.clipboard.dangerouslyPasteHTML(0,o,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=G(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()},v):setTimeout(function(){e("#wc-textarea-"+i).trigger("focus")},v),e("#wpd-secondary-form-wrapper-"+i).slideToggle(v)):function(o){var a=G(o,0);e("#wpdiscuz_form_anchor-"+a).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(a));var n=e("#wpd-secondary-form-wrapper-"+a);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_"+_)};q(i)}wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},v):setTimeout(function(){e("#wc-textarea-"+a).trigger("focus")},v);n.slideToggle(v,function(){o.addClass("wpdiscuz-clonned")})}(e(this)),function(t){if((o||a)&&"2.0"===n){var i=$(t);setTimeout(function(){if(!T[i])try{T[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(o){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"),o=e("<input/>");o.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),o.trigger("select"),document.execCommand("copy"),o.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 o=G(e(this),0),a=e(this),n=e(".fas",a);!a.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&g?function(t,o){var a=$(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",a),me(z,!0,n).done(function(a){o.addClass("wpd_not_clicked"),"object"==typeof a&&a.success&&(e("#wpd-comm-"+t).replaceWith(a.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),e("#wpd-comm-"+t+" .wpd-toggle .wpd-view-replies").remove(),le(a)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,n){console.log(n),o.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}(o,t):e("#wpd-comm-"+o+"> .wpd-reply").slideToggle(700,function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),a.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(v)}),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 o=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,o.trigger("submit")},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}})),(o||a)&&"2.0"===n){var L=e(window).width(),S=e("#wpdcom").width();S>=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%"})),S>=940&&S<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%"})),S>=810&&S<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%"})),S>=730&&S<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%"})),S>=610&&S<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%"})),L>650&&(S>=510&&S<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"})),S>=470&&S<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"})),S<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 H(t,o,a){me(z||f,!1,o).done(function(o){if(e(a).addClass("wpd_not_clicked"),"object"==typeof o)if(o.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(v),e(".wpd-thread-info").html(o.data.wc_all_comments_count_before_threads_html),o.data.wc_all_comments_count_new=parseInt(o.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(o.data.wc_all_comments_count_bubble_html),o.data.wc_all_comments_count_new?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide();var n=v;o.data.is_main?oe(o.data.message):(n=v+700,e("#wpd-secondary-form-wrapper-"+o.data.uniqueid).slideToggle(700),1==o.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+o.data.uniqueid).after(o.data.message):e("#wpd-comm-"+o.data.uniqueid).after(o.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),me(z,!0,t)}}(o),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),me(z,!0,t).done(function(e){"object"==typeof e&&e.success&&setTimeout(function(){location.href=e.data},2e3)}).fail(function(e,t,o){console.log(o)})}}(o),h&&b?function(t){var o=t.comment_author_email,a=t.comment_author,n=t.comment_author_url;null==u?(Cookies.set("comment_author_email_"+_,o),Cookies.set("comment_author_"+_,a),n.length&&Cookies.set("comment_author_url_"+_,n)):(u=parseInt(u),Cookies.set("comment_author_email_"+_,o,{expires:u,path:"/"}),Cookies.set("comment_author_"+_,a,{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)}(o.data):b||e(".wpd-cookies-checkbox").prop("checked",!1),wpdiscuzLoadRichEditor&&wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]),t.get(0).reset(),q(o.data),e(".wmu-preview-wrap",t).remove(),I.length&&(I.forEach(function(e){e.parents(".wpd-field-checkbox").remove()}),I=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.new_comment_id).offset().top-32},1e3,te)},n),le(o,t)}else o.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"),le(o,t));else wpdiscuzAjaxObj.setCommentMessage(o,"error");e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,o,n){console.log(n),e(a).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}function q(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,o){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(o),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 o=t.attr("class").split(" "),a="";return e.each(o,function(e,t){"wpd_comment_level"===X(t,!1)&&(a=X(t,!0))}),parseInt(a)+1}(e(this).parents(".wpd-comment"))),Z(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(){I.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),H(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 H(d,c,i)}var p,r;!function(e){if((o||a)&&"2.0"===n){var t=$(e);grecaptcha.reset(T[t])}}(e(".wpdiscuz_unique_id",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.wc_msg_required_fields,"error")}),e(document).on("click",".wpd_editable_comment",function(){w&&e(".wpdiscuz-edit-form-wrap").length&&U(G(e(".wpdiscuz-edit-form-wrap"),0),w);var t=G(e(this),0),o=$(t),a=new FormData;a.append("action","wpdEditComment"),a.append("commentId",o),w=e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-text").get(0),me(z,!0,a).done(function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){var a=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+t);a.clipboard.dangerouslyPasteHTML(0,o.data.content),a.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+t).val(o.data.content);e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wc_save_edited_comment",function(){var t=G(e(this)),o=$(t),a=e("#wpd-comm-"+t+" #wpdiscuz-edit-form");if(Z(a,"#wpd-editor-edit_"+t),a.submit(function(e){e.preventDefault()}),a[0].checkValidity()){var n=new FormData;n.append("action","wpdSaveEditedComment"),n.append("commentId",o),e(":input",a).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&n.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&n.append(this.name+"",e(this).val())}),me(z,!0,n).done(function(a){"object"==typeof a?(a.success?(U(t,a.data.message),a.data.lastEdited&&(e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(a.data.lastEdited).insertAfter("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),a.data.twitterShareLink&&e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",a.data.twitterShareLink),a.data.whatsappShareLink&&e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",a.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[a.data],"error"),le(a,o)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=G(e(this));U(t,w),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!wpdiscuzAjaxObj.wordpressIsPaginate&&m&&(M=0,1==m?setTimeout(function(){V(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),V(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&V(!1,t,"wpd-loaded","wpd-loading")});var W=!1;function P(){var t=e("#wpdiscuzHasMoreComments").val(),o=e(document).height(),a=e(window).height()+e(window).scrollTop();o&&a&&(100*a/o>=80&&!1===W&&1==t&&(W=!0,V(!1,e(".wpd-load-more-submit"))))}function V(t,o,a,n){o&&(o.toggleClass(a),o.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||""),me(z,!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),B(s,t&&2!==i),W=!1,r=s.data.loadLastCommentId,le(s),t&&K(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))}).fail(function(t,i,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))})}function B(t,o){var a;0==t.data.is_show_load_more?(e("#wpdiscuzHasMoreComments").val(0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()):(a=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",a),2!==i&&e(".wpdiscuz-comment-pagination").show(),e("#wpdiscuzHasMoreComments").val(1),o&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show()),le(t)}function K(t){var o=location.href.match(/#comment\-(\d+)/);if(null!==o){var a=o[1];if(e("#comment-"+a).length)setTimeout(function(){ee(),e("html, body").animate({scrollTop:e("#comment-"+a).parents("[id^=wpd-comm-]").offset().top-32},1e3,te),t&&N(a)},500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",a),me(z,!0,n).done(function(o){if("object"==typeof o&&o.success){var n="#comment-"+a;e("#comment-"+o.data.parentCommentID).length?e("#comment-"+o.data.parentCommentID).parents("[id^=wpd-comm-"+o.data.parentCommentID+"]").replaceWith(o.data.message):e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e(n).offset().top-32},1e3,te),t&&N(a)}e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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 Q(e){if(void 0!==e.data.message)for(var t,o=e.data.message,a=0;a<o.length;a++)Y((t=o[a]).comment_parent,t.comment_html)}function G(e,t){var o="";return(o=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(o.lastIndexOf("-")+1)}function $(e){return e.substring(0,e.indexOf("_"))}function X(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function Y(t,o){if(0==t)oe(o);else{var a=G(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+a).after(o)}}function J(){var t=[];return e(".wpd-comment-right").each(function(){t.push($(G(e(this),0)))}),t.join(",")}function Z(t,o){var a=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(o+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),o=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");o=(o=(o=(o=o.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(o)}(t),e.each(a,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 ee(){e("html, body").css("scroll-behavior","unset")}function te(){e("html").css("scroll-behavior",F),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 ae(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,o){var a=e(o);a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.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(),P(),e(window).scroll(function(){P()})),wpdiscuzAjaxObj.setLoadMoreVisibility=B,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 o,a=$(G(t));o=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",a),n.append("voteType",o),me(z,!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-"+a)),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-"+a)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+a));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-"+a)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+a));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[n.data],"error");le(n,a,o)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(o,a,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click","body",function(t){var o=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?o.css({display:o.is(":visible")?"none":"flex"}):o.hide()}),e(document).on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var t=e(this),o=e(this).attr("data-sorting");if(o){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 a=new FormData;a.append("action","wpdSorting"),a.append("sorting",o);var n=e(".wpdf-active").attr("data-filter-type");a.append("wpdType",n||""),me(z,!0,a).done(function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),B(t,!1),M=1),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){K(!1)},1!=m&&K(!1),e(document).on("click",".wpdiscuz-readmore",function(){var t=G(e(this)),o=$(t),a=new FormData;a.append("action","wpdReadMore"),a.append("commentId",o),me(z,!0,a).done(function(a){"object"==typeof a?(a.success?(e("#comment-"+o+" .wpd-comment-text").replaceWith(" "+a.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(a.data),le(a)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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=$(G(e(this),0)),o=new FormData;o.append("action","wpdStickComment"),o.append("commentId",t),me(z,!0,o).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd_close_btn",function(){var t=$(G(e(this),0)),o=new FormData;o.append("action","wpdCloseThread"),o.append("commentId",t),me(z,!0,o).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var t=e(this),o=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+o),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&a.append("sorting",n),a.append("lastParentId",0),a.append("offset",0),M=1,a.append("wpdType",t.hasClass("wpdf-active")?"":o),a.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(),me(z,!1,a).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(o.data.comment_list),B(o),r=o.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),le(o)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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 o=new FormData;o.append("action","wpdMostReactedComment"),me(z,!1,o).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(e("#comment-"+o.data.parentCommentID).length?e("#comment-"+o.data.parentCommentID).parents("[id^=wpd-comm-"+o.data.parentCommentID+"]").replaceWith(o.data.message):e("#comment-"+o.data.commentId).length||e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.commentId).offset().top-32},1e3,te))}).fail(function(o,a,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 o=new FormData;o.append("action","wpdHottestThread"),me(z,!1,o).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(e("#comment-"+o.data.commentId).length?e("#comment-"+o.data.commentId).parents("[id^=wpd-comm-"+o.data.commentId+"]").replaceWith(o.data.message):e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.commentId).offset().top-32},1e3,te))}).fail(function(o,a,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 o=$(G(t,0)),a=new FormData;a.append("action","wpdFollowUser"),a.append("commentId",o),me(z,!0,a).done(function(o){t.addClass("wpd_not_clicked"),"object"==typeof o?o.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data.code],"success"),t.removeClass("wpd-follow-active"),o.data.followTip&&t.attr("wpd-tooltip",o.data.followTip),o.data.followClass&&t.addClass(o.data.followClass)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"):console.log(o),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),ae(),e(document).on("keyup",".wc_email",function(){ae(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")}),k&&!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*x)},1e3*k),"content_left"===O)if(e(".entry-content").length){var ne=(ie=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){ne=(ie=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var ie;ne=(ie=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"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(){ee(),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-60},1e3,function(){te(),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"),K(!0);var o=t.match(/#comment\-(\d+)/);D=D.filter(function(e){return e!=o[1]}),e("#wpd-bubble-count .wpd-new-comments-count").text(D.length),0==D.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),e(document).on("click","#wpd-bubble-count",function(){if(D.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",D.join()),me(z,!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}),Q(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),D=[],e(".wpd-new-loaded-comment").length&&(ee(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-60},1e3,te)),le(t)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o)})}})}if((j&&C||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:J()}}).done(function(o){if(!E)if("object"==typeof o){if(o.commentIDsToRemove.forEach(function(t){e("[id^=wpd-comm-"+t+"]").remove()}),o.ids.length){d&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",r),i.append("visibleCommentIds",J()),me(z,!1,i).done(function(t){E||"object"==typeof t&&t.success&&(Q(t),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),t.data.wc_all_comments_count_new?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),r=t.data.loadLastCommentId)}).fail(function(e,t,o){console.log(o)})),o.ids=o.ids.filter(function(t){if(!e("#comment-"+t).length)return t});var a=5e3;l=parseInt(o.ids[o.ids.length-1]),D=D.concat(o.ids),y&&o.commentText&&(e("#wpd-bubble-author-avatar").html(o.avatar),e("#wpd-bubble-author-name").html(o.authorName),e("#wpd-bubble-comment-date span").html(o.commentDate),e("#wpd-bubble-comment-text").html(o.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",o.commentLink),e("#wpd-bubble-notification-message").show(),a=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=o.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")},a),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}o.all_comments_count=parseInt(o.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(o.all_comments_count_bubble_html),o.all_comments_count?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),e(".wpd-thread-info").html(o.all_comments_count_before_threads_html)}else console.log(o);var i;setTimeout(t,c)}).fail(function(e,o,a){console.log(a),setTimeout(t,c)})},c),e(".wpd-inline-form-wrapper").length){var se=new FormData;se.append("action","wpdGetInlineCommentForm"),me(z,!1,se).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"),o=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+o.substring(o.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"),re()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error"):console.log(t)}).fail(function(e,t,o){console.log(o)})}function de(t){if(e(t).hasClass("wpd-inline-shortcode"))var o=e(t).attr("id");else o=e(t).parents(".wpd-inline-shortcode").attr("id");return o.substring(o.lastIndexOf("-")+1)}function ce(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function pe(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var t=e(this),o=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&o>0&&o<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"),re(t.siblings(".wpd-inline-form-wrapper"))))})}function re(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(o=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var o;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(o=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"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 le(t,o,a,n){t.data.callbackFunctions&&e.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 me(t,o,a){o&&e("#wpdiscuz-loading-bar").show(),a.append("postId",s);var n=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](a,t,o))});var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:a,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){ce();var o="";e(t.target).hasClass("wpd-inline-icon")?o=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(o=e(t.target).parents(".wpd-inline-icon")),o.length&&o.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(o.parents(".wpd-inline-shortcode").addClass("wpd-active"),o.siblings(".wpd-inline-form-wrapper").show(),o.addClass("wpd-open"),o.removeClass("wpd-ignored"),re(o.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 o=e(this),a=e(this).parents(".wpd_inline_comm_form");if(a[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",de(a)),e.each(e("input, textarea",a),function(t,o){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(o).attr("name"),e(o).val()):n.append(e(o).attr("name"),e(o).val())}),me(z,!0,n).done(function(t){if(o.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){a[0].reset(),ce();var n=parseInt(t.data.newCount),i=o.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.allCommentsCountNew?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),t.data.message&&oe(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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),o=new FormData;o.append("action","wpdGetLastInlineComments"),o.append("inline_form_id",de(t)),me(z,!0,o).done(function(o){"object"==typeof o?o.success?e(o.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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"),ee(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-32},1e3,te)}),e(document).on("click",".wpd-feedback-content-link",function(t){t.preventDefault();var o=e(this).data("feedback-content-id");ee(),e("html, body").animate({scrollTop:e("#wpd-inline-"+o).offset().top-38},1e3,function(){te(),e("#wpd-inline-"+o).addClass("wpd-active")})}),"scroll_open"!==A&&"blink"!==A||(pe(),e(window).on("scroll",pe)),e(document).on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var t=new FormData,o=e(this).index();o>=0&&o<5&&(t.append("action","wpdUserRate"),t.append("rating",o+1),me(z,!0,t).done(function(t){"object"==typeof t?t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){t.preventDefault();var o,a,i=e(this);if(i[0].checkValidity()&&(o=i,a=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).val().length?(a=!1,e(".wpdiscuz-recaptcha",o).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).length&&e(".wpdiscuz-recaptcha",o).css("border","none"),a)){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())}),me(z,!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,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wpd-unsubscribe",function(t){t.preventDefault();var o=new FormData;o.append("action","wpdUnsubscribe"),o.append("sid",e(this).data("sid")),o.append("skey",e(this).data("skey")),me(z,!0,o).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,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=me});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")}};
|
7 |
/* Colorbox */
|
8 |
!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);
|
9 |
/* Media Uploader */
|
3 |
/* Autogrow */
|
4 |
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)})};
|
5 |
/* wpDiscuz */
|
6 |
+
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,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()})},jQuery(document).ready(function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,a=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),v=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,z=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),j=parseInt(wpdiscuzAjaxObj.enableBubble),C=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),x=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,y=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),O=wpdiscuzAjaxObj.bubbleLocation,A=wpdiscuzAjaxObj.inlineFeedbackAttractionType,I=[],T=[],D=[],E=!1,M=1,F=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 o=e(".wpd-form").not(":hidden");if(o.length)if(wpdiscuzLoadRichEditor){for(var a=0;a<o.length;a++)if("\n"!==wpDiscuzEditor.createEditor(e(o[a]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(a=0;a<o.length;a++)if(e(o[a]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")}),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(v)}),e(document).on("focus","#wpdcom textarea",function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()}),t)||q({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 o=e("#wpd-editor-source-code").val();o.length&&t.clipboard.dangerouslyPasteHTML(0,o,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=G(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()},v):setTimeout(function(){e("#wc-textarea-"+i).trigger("focus")},v),e("#wpd-secondary-form-wrapper-"+i).slideToggle(v)):function(o){var a=G(o,0);e("#wpdiscuz_form_anchor-"+a).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(a));var n=e("#wpd-secondary-form-wrapper-"+a);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_"+_)};q(i)}wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},v):setTimeout(function(){e("#wc-textarea-"+a).trigger("focus")},v);n.slideToggle(v,function(){o.addClass("wpdiscuz-clonned")})}(e(this)),function(t){if((o||a)&&"2.0"===n){var i=$(t);setTimeout(function(){if(!T[i])try{T[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(o){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"),o=e("<input/>");o.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),o.trigger("select"),document.execCommand("copy"),o.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 o=G(e(this),0),a=e(this),n=e(".fas",a);!a.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&g?function(t,o){var a=$(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",a),me(z,!0,n).done(function(a){o.addClass("wpd_not_clicked"),"object"==typeof a&&a.success&&(e("#wpd-comm-"+t).replaceWith(a.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),le(a)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,n){console.log(n),o.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}(o,t):e("#wpd-comm-"+o+"> .wpd-reply").slideToggle(700,function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),a.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),a.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),a.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(v)}),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 o=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,o.trigger("submit")},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}})),(o||a)&&"2.0"===n){var L=e(window).width(),S=e("#wpdcom").width();S>=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%"})),S>=940&&S<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%"})),S>=810&&S<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%"})),S>=730&&S<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%"})),S>=610&&S<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%"})),L>650&&(S>=510&&S<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"})),S>=470&&S<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"})),S<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 H(t,o,a){me(z||f,!1,o).done(function(o){if(e(a).addClass("wpd_not_clicked"),"object"==typeof o)if(o.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(v),e(".wpd-thread-info").html(o.data.wc_all_comments_count_before_threads_html),o.data.wc_all_comments_count_new=parseInt(o.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(o.data.wc_all_comments_count_bubble_html),o.data.wc_all_comments_count_new?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide();var n=v;o.data.is_main?oe(o.data.message):(n=v+700,e("#wpd-secondary-form-wrapper-"+o.data.uniqueid).slideToggle(700),1==o.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+o.data.uniqueid).after(o.data.message):e("#wpd-comm-"+o.data.uniqueid).after(o.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),me(z,!0,t)}}(o),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),me(z,!0,t).done(function(e){"object"==typeof e&&e.success&&setTimeout(function(){location.href=e.data},2e3)}).fail(function(e,t,o){console.log(o)})}}(o),h&&b?function(t){var o=t.comment_author_email,a=t.comment_author,n=t.comment_author_url;null==u?(Cookies.set("comment_author_email_"+_,o),Cookies.set("comment_author_"+_,a),n.length&&Cookies.set("comment_author_url_"+_,n)):(u=parseInt(u),Cookies.set("comment_author_email_"+_,o,{expires:u,path:"/"}),Cookies.set("comment_author_"+_,a,{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)}(o.data):b||e(".wpd-cookies-checkbox").prop("checked",!1),wpdiscuzLoadRichEditor&&wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]),t.get(0).reset(),q(o.data),e(".wmu-preview-wrap",t).remove(),I.length&&(I.forEach(function(e){e.parents(".wpd-field-checkbox").remove()}),I=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.new_comment_id).offset().top-32},1e3,te)},n),le(o,t)}else o.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"),le(o,t));else wpdiscuzAjaxObj.setCommentMessage(o,"error");e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,o,n){console.log(n),e(a).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}function q(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,o){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(o),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 o=t.attr("class").split(" "),a="";return e.each(o,function(e,t){"wpd_comment_level"===X(t,!1)&&(a=X(t,!0))}),parseInt(a)+1}(e(this).parents(".wpd-comment"))),Z(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(){I.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),H(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 H(d,c,i)}var p,r;!function(e){if((o||a)&&"2.0"===n){var t=$(e);grecaptcha.reset(T[t])}}(e(".wpdiscuz_unique_id",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.wc_msg_required_fields,"error")}),e(document).on("click",".wpd_editable_comment",function(){w&&e(".wpdiscuz-edit-form-wrap").length&&U(G(e(".wpdiscuz-edit-form-wrap"),0),w);var t=G(e(this),0),o=$(t),a=new FormData;a.append("action","wpdEditComment"),a.append("commentId",o),w=e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-text").get(0),me(z,!0,a).done(function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){var a=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+t);a.clipboard.dangerouslyPasteHTML(0,o.data.content),a.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+t).val(o.data.content);e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wc_save_edited_comment",function(){var t=G(e(this)),o=$(t),a=e("#wpd-comm-"+t+" #wpdiscuz-edit-form");if(Z(a,"#wpd-editor-edit_"+t),a.submit(function(e){e.preventDefault()}),a[0].checkValidity()){var n=new FormData;n.append("action","wpdSaveEditedComment"),n.append("commentId",o),e(":input",a).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&n.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&n.append(this.name+"",e(this).val())}),me(z,!0,n).done(function(a){"object"==typeof a?(a.success?(U(t,a.data.message),a.data.lastEdited&&(e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(a.data.lastEdited).insertAfter("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),a.data.twitterShareLink&&e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",a.data.twitterShareLink),a.data.whatsappShareLink&&e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",a.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[a.data],"error"),le(a,o)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=G(e(this));U(t,w),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!wpdiscuzAjaxObj.wordpressIsPaginate&&m&&(M=0,1==m?setTimeout(function(){V(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),V(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&V(!1,t,"wpd-loaded","wpd-loading")});var W=!1;function P(){var t=e("#wpdiscuzHasMoreComments").val(),o=e(document).height(),a=e(window).height()+e(window).scrollTop();o&&a&&(100*a/o>=80&&!1===W&&1==t&&(W=!0,V(!1,e(".wpd-load-more-submit"))))}function V(t,o,a,n){o&&(o.toggleClass(a),o.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||""),me(z,!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),B(s,t&&2!==i),W=!1,r=s.data.loadLastCommentId,le(s),t&&K(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))}).fail(function(t,i,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))})}function B(t,o){var a;0==t.data.is_show_load_more?(e("#wpdiscuzHasMoreComments").val(0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()):(a=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",a),2!==i&&e(".wpdiscuz-comment-pagination").show(),e("#wpdiscuzHasMoreComments").val(1),o&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show()),le(t)}function K(t){var o=location.href.match(/#comment\-(\d+)/);if(null!==o){var a=o[1];if(e("#comment-"+a).length)setTimeout(function(){ee(),e("html, body").animate({scrollTop:e("#comment-"+a).parents("[id^=wpd-comm-]").offset().top-32},1e3,te),t&&N(a)},500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",a),me(z,!0,n).done(function(o){if("object"==typeof o&&o.success){var n="#comment-"+a;e("#comment-"+o.data.parentCommentID).length?e("#comment-"+o.data.parentCommentID).parents("[id^=wpd-comm-"+o.data.parentCommentID+"]").replaceWith(o.data.message):e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e(n).offset().top-32},1e3,te),t&&N(a)}e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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 Q(e){if(void 0!==e.data.message)for(var t,o=e.data.message,a=0;a<o.length;a++)Y((t=o[a]).comment_parent,t.comment_html)}function G(e,t){var o="";return(o=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(o.lastIndexOf("-")+1)}function $(e){return e.substring(0,e.indexOf("_"))}function X(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function Y(t,o){if(0==t)oe(o);else{var a=G(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+a).after(o)}}function J(){var t=[];return e(".wpd-comment-right").each(function(){t.push($(G(e(this),0)))}),t.join(",")}function Z(t,o){var a=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(o+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),o=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");o=(o=(o=(o=o.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(o)}(t),e.each(a,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 ee(){e("html, body").css("scroll-behavior","unset")}function te(){e("html").css("scroll-behavior",F),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 ae(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,o){var a=e(o);a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.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(),P(),e(window).scroll(function(){P()})),wpdiscuzAjaxObj.setLoadMoreVisibility=B,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 o,a=$(G(t));o=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",a),n.append("voteType",o),me(z,!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-"+a)),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-"+a)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+a));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-"+a)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+a));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[n.data],"error");le(n,a,o)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(o,a,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click","body",function(t){var o=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?o.css({display:o.is(":visible")?"none":"flex"}):o.hide()}),e(document).on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var t=e(this),o=e(this).attr("data-sorting");if(o){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 a=new FormData;a.append("action","wpdSorting"),a.append("sorting",o);var n=e(".wpdf-active").attr("data-filter-type");a.append("wpdType",n||""),me(z,!0,a).done(function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),B(t,!1),M=1),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){K(!1)},1!=m&&K(!1),e(document).on("click",".wpdiscuz-readmore",function(){var t=G(e(this)),o=$(t),a=new FormData;a.append("action","wpdReadMore"),a.append("commentId",o),me(z,!0,a).done(function(a){"object"==typeof a?(a.success?(e("#comment-"+o+" .wpd-comment-text").replaceWith(" "+a.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(a.data),le(a)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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=$(G(e(this),0)),o=new FormData;o.append("action","wpdStickComment"),o.append("commentId",t),me(z,!0,o).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd_close_btn",function(){var t=$(G(e(this),0)),o=new FormData;o.append("action","wpdCloseThread"),o.append("commentId",t),me(z,!0,o).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var t=e(this),o=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+o),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&a.append("sorting",n),a.append("lastParentId",0),a.append("offset",0),M=1,a.append("wpdType",t.hasClass("wpdf-active")?"":o),a.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(),me(z,!1,a).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(o.data.comment_list),B(o),r=o.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),le(o)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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 o=new FormData;o.append("action","wpdMostReactedComment"),me(z,!1,o).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(e("#comment-"+o.data.parentCommentID).length?e("#comment-"+o.data.parentCommentID).parents("[id^=wpd-comm-"+o.data.parentCommentID+"]").replaceWith(o.data.message):e("#comment-"+o.data.commentId).length||e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.commentId).offset().top-32},1e3,te))}).fail(function(o,a,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 o=new FormData;o.append("action","wpdHottestThread"),me(z,!1,o).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(e("#comment-"+o.data.commentId).length?e("#comment-"+o.data.commentId).parents("[id^=wpd-comm-"+o.data.commentId+"]").replaceWith(o.data.message):e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.commentId).offset().top-32},1e3,te))}).fail(function(o,a,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 o=$(G(t,0)),a=new FormData;a.append("action","wpdFollowUser"),a.append("commentId",o),me(z,!0,a).done(function(o){t.addClass("wpd_not_clicked"),"object"==typeof o?o.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data.code],"success"),t.removeClass("wpd-follow-active"),o.data.followTip&&t.attr("wpd-tooltip",o.data.followTip),o.data.followClass&&t.addClass(o.data.followClass)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"):console.log(o),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),ae(),e(document).on("keyup",".wc_email",function(){ae(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")}),k&&!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*x)},1e3*k),"content_left"===O)if(e(".entry-content").length){var ne=(ie=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){ne=(ie=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var ie;ne=(ie=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"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(){ee(),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-60},1e3,function(){te(),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"),K(!0);var o=t.match(/#comment\-(\d+)/);D=D.filter(function(e){return e!=o[1]}),e("#wpd-bubble-count .wpd-new-comments-count").text(D.length),0==D.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),e(document).on("click","#wpd-bubble-count",function(){if(D.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",D.join()),me(z,!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}),Q(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),D=[],e(".wpd-new-loaded-comment").length&&(ee(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-60},1e3,te)),le(t)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o)})}})}if((j&&C||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:J()}}).done(function(o){if(!E)if("object"==typeof o){if(o.commentIDsToRemove.forEach(function(t){e("[id^=wpd-comm-"+t+"]").remove()}),o.ids.length){d&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",r),i.append("visibleCommentIds",J()),me(z,!1,i).done(function(t){E||"object"==typeof t&&t.success&&(Q(t),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),t.data.wc_all_comments_count_new?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),r=t.data.loadLastCommentId)}).fail(function(e,t,o){console.log(o)})),o.ids=o.ids.filter(function(t){if(!e("#comment-"+t).length)return t});var a=5e3;l=parseInt(o.ids[o.ids.length-1]),D=D.concat(o.ids),y&&o.commentText&&(e("#wpd-bubble-author-avatar").html(o.avatar),e("#wpd-bubble-author-name").html(o.authorName),e("#wpd-bubble-comment-date span").html(o.commentDate),e("#wpd-bubble-comment-text").html(o.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",o.commentLink),e("#wpd-bubble-notification-message").show(),a=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=o.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")},a),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}o.all_comments_count=parseInt(o.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(o.all_comments_count_bubble_html),o.all_comments_count?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),e(".wpd-thread-info").html(o.all_comments_count_before_threads_html)}else console.log(o);var i;setTimeout(t,c)}).fail(function(e,o,a){console.log(a),setTimeout(t,c)})},c),e(".wpd-inline-form-wrapper").length){var se=new FormData;se.append("action","wpdGetInlineCommentForm"),me(z,!1,se).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"),o=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+o.substring(o.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"),re()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error"):console.log(t)}).fail(function(e,t,o){console.log(o)})}function de(t){if(e(t).hasClass("wpd-inline-shortcode"))var o=e(t).attr("id");else o=e(t).parents(".wpd-inline-shortcode").attr("id");return o.substring(o.lastIndexOf("-")+1)}function ce(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function pe(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var t=e(this),o=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&o>0&&o<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"),re(t.siblings(".wpd-inline-form-wrapper"))))})}function re(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(o=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var o;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(o=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"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 le(t,o,a,n){t.data.callbackFunctions&&e.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 me(t,o,a){o&&e("#wpdiscuz-loading-bar").show(),a.append("postId",s);var n=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](a,t,o))});var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:a,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){ce();var o="";e(t.target).hasClass("wpd-inline-icon")?o=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(o=e(t.target).parents(".wpd-inline-icon")),o.length&&o.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(o.parents(".wpd-inline-shortcode").addClass("wpd-active"),o.siblings(".wpd-inline-form-wrapper").show(),o.addClass("wpd-open"),o.removeClass("wpd-ignored"),re(o.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 o=e(this),a=e(this).parents(".wpd_inline_comm_form");if(a[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",de(a)),e.each(e("input, textarea",a),function(t,o){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(o).attr("name"),e(o).val()):n.append(e(o).attr("name"),e(o).val())}),me(z,!0,n).done(function(t){if(o.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){a[0].reset(),ce();var n=parseInt(t.data.newCount),i=o.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.allCommentsCountNew?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),t.data.message&&oe(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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),o=new FormData;o.append("action","wpdGetLastInlineComments"),o.append("inline_form_id",de(t)),me(z,!0,o).done(function(o){"object"==typeof o?o.success?e(o.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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"),ee(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-32},1e3,te)}),e(document).on("click",".wpd-feedback-content-link",function(t){t.preventDefault();var o=e(this).data("feedback-content-id");ee(),e("html, body").animate({scrollTop:e("#wpd-inline-"+o).offset().top-38},1e3,function(){te(),e("#wpd-inline-"+o).addClass("wpd-active")})}),"scroll_open"!==A&&"blink"!==A||(pe(),e(window).on("scroll",pe)),e(document).on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var t=new FormData,o=e(this).index();o>=0&&o<5&&(t.append("action","wpdUserRate"),t.append("rating",o+1),me(z,!0,t).done(function(t){"object"==typeof t?t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){t.preventDefault();var o,a,i=e(this);if(i[0].checkValidity()&&(o=i,a=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).val().length?(a=!1,e(".wpdiscuz-recaptcha",o).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).length&&e(".wpdiscuz-recaptcha",o).css("border","none"),a)){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())}),me(z,!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,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wpd-unsubscribe",function(t){t.preventDefault();var o=new FormData;o.append("action","wpdUnsubscribe"),o.append("sid",e(this).data("sid")),o.append("skey",e(this).data("skey")),me(z,!0,o).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,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=me});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")}};
|
7 |
/* Colorbox */
|
8 |
!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);
|
9 |
/* Media Uploader */
|
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,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()})},jQuery(document).ready(function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,a=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),v=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,z=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),j=parseInt(wpdiscuzAjaxObj.enableBubble),C=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),x=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,y=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),O=wpdiscuzAjaxObj.bubbleLocation,A=wpdiscuzAjaxObj.inlineFeedbackAttractionType,I=[],T=[],D=[],E=!1,M=1,F=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 o=e(".wpd-form").not(":hidden");if(o.length)if(wpdiscuzLoadRichEditor){for(var a=0;a<o.length;a++)if("\n"!==wpDiscuzEditor.createEditor(e(o[a]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(a=0;a<o.length;a++)if(e(o[a]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")}),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(v)}),e(document).on("focus","#wpdcom textarea",function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()}),t)||q({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 o=e("#wpd-editor-source-code").val();o.length&&t.clipboard.dangerouslyPasteHTML(0,o,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=G(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()},v):setTimeout(function(){e("#wc-textarea-"+i).trigger("focus")},v),e("#wpd-secondary-form-wrapper-"+i).slideToggle(v)):function(o){var a=G(o,0);e("#wpdiscuz_form_anchor-"+a).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(a));var n=e("#wpd-secondary-form-wrapper-"+a);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_"+_)};q(i)}wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},v):setTimeout(function(){e("#wc-textarea-"+a).trigger("focus")},v);n.slideToggle(v,function(){o.addClass("wpdiscuz-clonned")})}(e(this)),function(t){if((o||a)&&"2.0"===n){var i=$(t);setTimeout(function(){if(!T[i])try{T[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(o){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"),o=e("<input/>");o.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),o.trigger("select"),document.execCommand("copy"),o.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 o=G(e(this),0),a=e(this),n=e(".fas",a);!a.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&g?function(t,o){var a=$(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",a),me(z,!0,n).done(function(a){o.addClass("wpd_not_clicked"),"object"==typeof a&&a.success&&(e("#wpd-comm-"+t).replaceWith(a.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),e("#wpd-comm-"+t+" .wpd-toggle .wpd-view-replies").remove(),le(a)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,n){console.log(n),o.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}(o,t):e("#wpd-comm-"+o+"> .wpd-reply").slideToggle(700,function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),a.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(v)}),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 o=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,o.trigger("submit")},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}})),(o||a)&&"2.0"===n){var L=e(window).width(),S=e("#wpdcom").width();S>=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%"})),S>=940&&S<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%"})),S>=810&&S<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%"})),S>=730&&S<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%"})),S>=610&&S<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%"})),L>650&&(S>=510&&S<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"})),S>=470&&S<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"})),S<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 H(t,o,a){me(z||f,!1,o).done(function(o){if(e(a).addClass("wpd_not_clicked"),"object"==typeof o)if(o.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(v),e(".wpd-thread-info").html(o.data.wc_all_comments_count_before_threads_html),o.data.wc_all_comments_count_new=parseInt(o.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(o.data.wc_all_comments_count_bubble_html),o.data.wc_all_comments_count_new?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide();var n=v;o.data.is_main?oe(o.data.message):(n=v+700,e("#wpd-secondary-form-wrapper-"+o.data.uniqueid).slideToggle(700),1==o.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+o.data.uniqueid).after(o.data.message):e("#wpd-comm-"+o.data.uniqueid).after(o.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),me(z,!0,t)}}(o),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),me(z,!0,t).done(function(e){"object"==typeof e&&e.success&&setTimeout(function(){location.href=e.data},2e3)}).fail(function(e,t,o){console.log(o)})}}(o),h&&b?function(t){var o=t.comment_author_email,a=t.comment_author,n=t.comment_author_url;null==u?(Cookies.set("comment_author_email_"+_,o),Cookies.set("comment_author_"+_,a),n.length&&Cookies.set("comment_author_url_"+_,n)):(u=parseInt(u),Cookies.set("comment_author_email_"+_,o,{expires:u,path:"/"}),Cookies.set("comment_author_"+_,a,{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)}(o.data):b||e(".wpd-cookies-checkbox").prop("checked",!1),wpdiscuzLoadRichEditor&&wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]),t.get(0).reset(),q(o.data),e(".wmu-preview-wrap",t).remove(),I.length&&(I.forEach(function(e){e.parents(".wpd-field-checkbox").remove()}),I=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.new_comment_id).offset().top-32},1e3,te)},n),le(o,t)}else o.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"),le(o,t));else wpdiscuzAjaxObj.setCommentMessage(o,"error");e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,o,n){console.log(n),e(a).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}function q(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,o){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(o),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 o=t.attr("class").split(" "),a="";return e.each(o,function(e,t){"wpd_comment_level"===X(t,!1)&&(a=X(t,!0))}),parseInt(a)+1}(e(this).parents(".wpd-comment"))),Z(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(){I.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),H(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 H(d,c,i)}var p,r;!function(e){if((o||a)&&"2.0"===n){var t=$(e);grecaptcha.reset(T[t])}}(e(".wpdiscuz_unique_id",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.wc_msg_required_fields,"error")}),e(document).on("click",".wpd_editable_comment",function(){w&&e(".wpdiscuz-edit-form-wrap").length&&U(G(e(".wpdiscuz-edit-form-wrap"),0),w);var t=G(e(this),0),o=$(t),a=new FormData;a.append("action","wpdEditComment"),a.append("commentId",o),w=e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-text").get(0),me(z,!0,a).done(function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){var a=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+t);a.clipboard.dangerouslyPasteHTML(0,o.data.content),a.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+t).val(o.data.content);e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wc_save_edited_comment",function(){var t=G(e(this)),o=$(t),a=e("#wpd-comm-"+t+" #wpdiscuz-edit-form");if(Z(a,"#wpd-editor-edit_"+t),a.submit(function(e){e.preventDefault()}),a[0].checkValidity()){var n=new FormData;n.append("action","wpdSaveEditedComment"),n.append("commentId",o),e(":input",a).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&n.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&n.append(this.name+"",e(this).val())}),me(z,!0,n).done(function(a){"object"==typeof a?(a.success?(U(t,a.data.message),a.data.lastEdited&&(e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(a.data.lastEdited).insertAfter("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),a.data.twitterShareLink&&e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",a.data.twitterShareLink),a.data.whatsappShareLink&&e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",a.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[a.data],"error"),le(a,o)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=G(e(this));U(t,w),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!wpdiscuzAjaxObj.wordpressIsPaginate&&m&&(M=0,1==m?setTimeout(function(){V(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),V(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&V(!1,t,"wpd-loaded","wpd-loading")});var W=!1;function P(){var t=e("#wpdiscuzHasMoreComments").val(),o=e(document).height(),a=e(window).height()+e(window).scrollTop();o&&a&&(100*a/o>=80&&!1===W&&1==t&&(W=!0,V(!1,e(".wpd-load-more-submit"))))}function V(t,o,a,n){o&&(o.toggleClass(a),o.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||""),me(z,!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),B(s,t&&2!==i),W=!1,r=s.data.loadLastCommentId,le(s),t&&K(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))}).fail(function(t,i,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))})}function B(t,o){var a;0==t.data.is_show_load_more?(e("#wpdiscuzHasMoreComments").val(0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()):(a=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",a),2!==i&&e(".wpdiscuz-comment-pagination").show(),e("#wpdiscuzHasMoreComments").val(1),o&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show()),le(t)}function K(t){var o=location.href.match(/#comment\-(\d+)/);if(null!==o){var a=o[1];if(e("#comment-"+a).length)setTimeout(function(){ee(),e("html, body").animate({scrollTop:e("#comment-"+a).parents("[id^=wpd-comm-]").offset().top-32},1e3,te),t&&N(a)},500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",a),me(z,!0,n).done(function(o){if("object"==typeof o&&o.success){var n="#comment-"+a;e("#comment-"+o.data.parentCommentID).length?e("#comment-"+o.data.parentCommentID).parents("[id^=wpd-comm-"+o.data.parentCommentID+"]").replaceWith(o.data.message):e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e(n).offset().top-32},1e3,te),t&&N(a)}e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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 Q(e){if(void 0!==e.data.message)for(var t,o=e.data.message,a=0;a<o.length;a++)Y((t=o[a]).comment_parent,t.comment_html)}function G(e,t){var o="";return(o=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(o.lastIndexOf("-")+1)}function $(e){return e.substring(0,e.indexOf("_"))}function X(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function Y(t,o){if(0==t)oe(o);else{var a=G(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+a).after(o)}}function J(){var t=[];return e(".wpd-comment-right").each(function(){t.push($(G(e(this),0)))}),t.join(",")}function Z(t,o){var a=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(o+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),o=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");o=(o=(o=(o=o.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(o)}(t),e.each(a,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 ee(){e("html, body").css("scroll-behavior","unset")}function te(){e("html").css("scroll-behavior",F),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 ae(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,o){var a=e(o);a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.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(),P(),e(window).scroll(function(){P()})),wpdiscuzAjaxObj.setLoadMoreVisibility=B,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 o,a=$(G(t));o=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",a),n.append("voteType",o),me(z,!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-"+a)),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-"+a)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+a));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-"+a)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+a));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[n.data],"error");le(n,a,o)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(o,a,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click","body",function(t){var o=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?o.css({display:o.is(":visible")?"none":"flex"}):o.hide()}),e(document).on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var t=e(this),o=e(this).attr("data-sorting");if(o){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 a=new FormData;a.append("action","wpdSorting"),a.append("sorting",o);var n=e(".wpdf-active").attr("data-filter-type");a.append("wpdType",n||""),me(z,!0,a).done(function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),B(t,!1),M=1),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){K(!1)},1!=m&&K(!1),e(document).on("click",".wpdiscuz-readmore",function(){var t=G(e(this)),o=$(t),a=new FormData;a.append("action","wpdReadMore"),a.append("commentId",o),me(z,!0,a).done(function(a){"object"==typeof a?(a.success?(e("#comment-"+o+" .wpd-comment-text").replaceWith(" "+a.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(a.data),le(a)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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=$(G(e(this),0)),o=new FormData;o.append("action","wpdStickComment"),o.append("commentId",t),me(z,!0,o).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd_close_btn",function(){var t=$(G(e(this),0)),o=new FormData;o.append("action","wpdCloseThread"),o.append("commentId",t),me(z,!0,o).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var t=e(this),o=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+o),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&a.append("sorting",n),a.append("lastParentId",0),a.append("offset",0),M=1,a.append("wpdType",t.hasClass("wpdf-active")?"":o),a.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(),me(z,!1,a).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(o.data.comment_list),B(o),r=o.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),le(o)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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 o=new FormData;o.append("action","wpdMostReactedComment"),me(z,!1,o).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(e("#comment-"+o.data.parentCommentID).length?e("#comment-"+o.data.parentCommentID).parents("[id^=wpd-comm-"+o.data.parentCommentID+"]").replaceWith(o.data.message):e("#comment-"+o.data.commentId).length||e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.commentId).offset().top-32},1e3,te))}).fail(function(o,a,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 o=new FormData;o.append("action","wpdHottestThread"),me(z,!1,o).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(e("#comment-"+o.data.commentId).length?e("#comment-"+o.data.commentId).parents("[id^=wpd-comm-"+o.data.commentId+"]").replaceWith(o.data.message):e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.commentId).offset().top-32},1e3,te))}).fail(function(o,a,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 o=$(G(t,0)),a=new FormData;a.append("action","wpdFollowUser"),a.append("commentId",o),me(z,!0,a).done(function(o){t.addClass("wpd_not_clicked"),"object"==typeof o?o.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data.code],"success"),t.removeClass("wpd-follow-active"),o.data.followTip&&t.attr("wpd-tooltip",o.data.followTip),o.data.followClass&&t.addClass(o.data.followClass)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"):console.log(o),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),ae(),e(document).on("keyup",".wc_email",function(){ae(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")}),k&&!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*x)},1e3*k),"content_left"===O)if(e(".entry-content").length){var ne=(ie=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){ne=(ie=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var ie;ne=(ie=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"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(){ee(),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-60},1e3,function(){te(),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"),K(!0);var o=t.match(/#comment\-(\d+)/);D=D.filter(function(e){return e!=o[1]}),e("#wpd-bubble-count .wpd-new-comments-count").text(D.length),0==D.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),e(document).on("click","#wpd-bubble-count",function(){if(D.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",D.join()),me(z,!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}),Q(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),D=[],e(".wpd-new-loaded-comment").length&&(ee(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-60},1e3,te)),le(t)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o)})}})}if((j&&C||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:J()}}).done(function(o){if(!E)if("object"==typeof o){if(o.commentIDsToRemove.forEach(function(t){e("[id^=wpd-comm-"+t+"]").remove()}),o.ids.length){d&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",r),i.append("visibleCommentIds",J()),me(z,!1,i).done(function(t){E||"object"==typeof t&&t.success&&(Q(t),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),t.data.wc_all_comments_count_new?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),r=t.data.loadLastCommentId)}).fail(function(e,t,o){console.log(o)})),o.ids=o.ids.filter(function(t){if(!e("#comment-"+t).length)return t});var a=5e3;l=parseInt(o.ids[o.ids.length-1]),D=D.concat(o.ids),y&&o.commentText&&(e("#wpd-bubble-author-avatar").html(o.avatar),e("#wpd-bubble-author-name").html(o.authorName),e("#wpd-bubble-comment-date span").html(o.commentDate),e("#wpd-bubble-comment-text").html(o.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",o.commentLink),e("#wpd-bubble-notification-message").show(),a=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=o.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")},a),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}o.all_comments_count=parseInt(o.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(o.all_comments_count_bubble_html),o.all_comments_count?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),e(".wpd-thread-info").html(o.all_comments_count_before_threads_html)}else console.log(o);var i;setTimeout(t,c)}).fail(function(e,o,a){console.log(a),setTimeout(t,c)})},c),e(".wpd-inline-form-wrapper").length){var se=new FormData;se.append("action","wpdGetInlineCommentForm"),me(z,!1,se).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"),o=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+o.substring(o.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"),re()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error"):console.log(t)}).fail(function(e,t,o){console.log(o)})}function de(t){if(e(t).hasClass("wpd-inline-shortcode"))var o=e(t).attr("id");else o=e(t).parents(".wpd-inline-shortcode").attr("id");return o.substring(o.lastIndexOf("-")+1)}function ce(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function pe(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var t=e(this),o=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&o>0&&o<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"),re(t.siblings(".wpd-inline-form-wrapper"))))})}function re(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(o=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var o;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(o=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"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 le(t,o,a,n){t.data.callbackFunctions&&e.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 me(t,o,a){o&&e("#wpdiscuz-loading-bar").show(),a.append("postId",s);var n=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](a,t,o))});var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:a,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){ce();var o="";e(t.target).hasClass("wpd-inline-icon")?o=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(o=e(t.target).parents(".wpd-inline-icon")),o.length&&o.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(o.parents(".wpd-inline-shortcode").addClass("wpd-active"),o.siblings(".wpd-inline-form-wrapper").show(),o.addClass("wpd-open"),o.removeClass("wpd-ignored"),re(o.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 o=e(this),a=e(this).parents(".wpd_inline_comm_form");if(a[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",de(a)),e.each(e("input, textarea",a),function(t,o){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(o).attr("name"),e(o).val()):n.append(e(o).attr("name"),e(o).val())}),me(z,!0,n).done(function(t){if(o.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){a[0].reset(),ce();var n=parseInt(t.data.newCount),i=o.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.allCommentsCountNew?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),t.data.message&&oe(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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),o=new FormData;o.append("action","wpdGetLastInlineComments"),o.append("inline_form_id",de(t)),me(z,!0,o).done(function(o){"object"==typeof o?o.success?e(o.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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"),ee(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-32},1e3,te)}),e(document).on("click",".wpd-feedback-content-link",function(t){t.preventDefault();var o=e(this).data("feedback-content-id");ee(),e("html, body").animate({scrollTop:e("#wpd-inline-"+o).offset().top-38},1e3,function(){te(),e("#wpd-inline-"+o).addClass("wpd-active")})}),"scroll_open"!==A&&"blink"!==A||(pe(),e(window).on("scroll",pe)),e(document).on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var t=new FormData,o=e(this).index();o>=0&&o<5&&(t.append("action","wpdUserRate"),t.append("rating",o+1),me(z,!0,t).done(function(t){"object"==typeof t?t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){t.preventDefault();var o,a,i=e(this);if(i[0].checkValidity()&&(o=i,a=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).val().length?(a=!1,e(".wpdiscuz-recaptcha",o).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).length&&e(".wpdiscuz-recaptcha",o).css("border","none"),a)){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())}),me(z,!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,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wpd-unsubscribe",function(t){t.preventDefault();var o=new FormData;o.append("action","wpdUnsubscribe"),o.append("sid",e(this).data("sid")),o.append("skey",e(this).data("skey")),me(z,!0,o).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,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=me});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 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,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()})},jQuery(document).ready(function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,a=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),v=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,z=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),j=parseInt(wpdiscuzAjaxObj.enableBubble),C=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),x=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,y=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),O=wpdiscuzAjaxObj.bubbleLocation,A=wpdiscuzAjaxObj.inlineFeedbackAttractionType,I=[],T=[],D=[],E=!1,M=1,F=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 o=e(".wpd-form").not(":hidden");if(o.length)if(wpdiscuzLoadRichEditor){for(var a=0;a<o.length;a++)if("\n"!==wpDiscuzEditor.createEditor(e(o[a]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(a=0;a<o.length;a++)if(e(o[a]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")}),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(v)}),e(document).on("focus","#wpdcom textarea",function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()}),t)||q({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 o=e("#wpd-editor-source-code").val();o.length&&t.clipboard.dangerouslyPasteHTML(0,o,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=G(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()},v):setTimeout(function(){e("#wc-textarea-"+i).trigger("focus")},v),e("#wpd-secondary-form-wrapper-"+i).slideToggle(v)):function(o){var a=G(o,0);e("#wpdiscuz_form_anchor-"+a).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(a));var n=e("#wpd-secondary-form-wrapper-"+a);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_"+_)};q(i)}wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},v):setTimeout(function(){e("#wc-textarea-"+a).trigger("focus")},v);n.slideToggle(v,function(){o.addClass("wpdiscuz-clonned")})}(e(this)),function(t){if((o||a)&&"2.0"===n){var i=$(t);setTimeout(function(){if(!T[i])try{T[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(o){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"),o=e("<input/>");o.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),o.trigger("select"),document.execCommand("copy"),o.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 o=G(e(this),0),a=e(this),n=e(".fas",a);!a.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&g?function(t,o){var a=$(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",a),me(z,!0,n).done(function(a){o.addClass("wpd_not_clicked"),"object"==typeof a&&a.success&&(e("#wpd-comm-"+t).replaceWith(a.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),le(a)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,n){console.log(n),o.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}(o,t):e("#wpd-comm-"+o+"> .wpd-reply").slideToggle(700,function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),a.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),a.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),a.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(v)}),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 o=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,o.trigger("submit")},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}})),(o||a)&&"2.0"===n){var L=e(window).width(),S=e("#wpdcom").width();S>=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%"})),S>=940&&S<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%"})),S>=810&&S<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%"})),S>=730&&S<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%"})),S>=610&&S<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%"})),L>650&&(S>=510&&S<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"})),S>=470&&S<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"})),S<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 H(t,o,a){me(z||f,!1,o).done(function(o){if(e(a).addClass("wpd_not_clicked"),"object"==typeof o)if(o.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(v),e(".wpd-thread-info").html(o.data.wc_all_comments_count_before_threads_html),o.data.wc_all_comments_count_new=parseInt(o.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(o.data.wc_all_comments_count_bubble_html),o.data.wc_all_comments_count_new?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide();var n=v;o.data.is_main?oe(o.data.message):(n=v+700,e("#wpd-secondary-form-wrapper-"+o.data.uniqueid).slideToggle(700),1==o.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+o.data.uniqueid).after(o.data.message):e("#wpd-comm-"+o.data.uniqueid).after(o.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),me(z,!0,t)}}(o),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),me(z,!0,t).done(function(e){"object"==typeof e&&e.success&&setTimeout(function(){location.href=e.data},2e3)}).fail(function(e,t,o){console.log(o)})}}(o),h&&b?function(t){var o=t.comment_author_email,a=t.comment_author,n=t.comment_author_url;null==u?(Cookies.set("comment_author_email_"+_,o),Cookies.set("comment_author_"+_,a),n.length&&Cookies.set("comment_author_url_"+_,n)):(u=parseInt(u),Cookies.set("comment_author_email_"+_,o,{expires:u,path:"/"}),Cookies.set("comment_author_"+_,a,{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)}(o.data):b||e(".wpd-cookies-checkbox").prop("checked",!1),wpdiscuzLoadRichEditor&&wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]),t.get(0).reset(),q(o.data),e(".wmu-preview-wrap",t).remove(),I.length&&(I.forEach(function(e){e.parents(".wpd-field-checkbox").remove()}),I=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.new_comment_id).offset().top-32},1e3,te)},n),le(o,t)}else o.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"),le(o,t));else wpdiscuzAjaxObj.setCommentMessage(o,"error");e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,o,n){console.log(n),e(a).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}function q(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,o){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(o),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 o=t.attr("class").split(" "),a="";return e.each(o,function(e,t){"wpd_comment_level"===X(t,!1)&&(a=X(t,!0))}),parseInt(a)+1}(e(this).parents(".wpd-comment"))),Z(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(){I.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),H(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 H(d,c,i)}var p,r;!function(e){if((o||a)&&"2.0"===n){var t=$(e);grecaptcha.reset(T[t])}}(e(".wpdiscuz_unique_id",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.wc_msg_required_fields,"error")}),e(document).on("click",".wpd_editable_comment",function(){w&&e(".wpdiscuz-edit-form-wrap").length&&U(G(e(".wpdiscuz-edit-form-wrap"),0),w);var t=G(e(this),0),o=$(t),a=new FormData;a.append("action","wpdEditComment"),a.append("commentId",o),w=e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-text").get(0),me(z,!0,a).done(function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){var a=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+t);a.clipboard.dangerouslyPasteHTML(0,o.data.content),a.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+t).val(o.data.content);e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wc_save_edited_comment",function(){var t=G(e(this)),o=$(t),a=e("#wpd-comm-"+t+" #wpdiscuz-edit-form");if(Z(a,"#wpd-editor-edit_"+t),a.submit(function(e){e.preventDefault()}),a[0].checkValidity()){var n=new FormData;n.append("action","wpdSaveEditedComment"),n.append("commentId",o),e(":input",a).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&n.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&n.append(this.name+"",e(this).val())}),me(z,!0,n).done(function(a){"object"==typeof a?(a.success?(U(t,a.data.message),a.data.lastEdited&&(e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(a.data.lastEdited).insertAfter("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),a.data.twitterShareLink&&e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",a.data.twitterShareLink),a.data.whatsappShareLink&&e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",a.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[a.data],"error"),le(a,o)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=G(e(this));U(t,w),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!wpdiscuzAjaxObj.wordpressIsPaginate&&m&&(M=0,1==m?setTimeout(function(){V(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),V(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&V(!1,t,"wpd-loaded","wpd-loading")});var W=!1;function P(){var t=e("#wpdiscuzHasMoreComments").val(),o=e(document).height(),a=e(window).height()+e(window).scrollTop();o&&a&&(100*a/o>=80&&!1===W&&1==t&&(W=!0,V(!1,e(".wpd-load-more-submit"))))}function V(t,o,a,n){o&&(o.toggleClass(a),o.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||""),me(z,!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),B(s,t&&2!==i),W=!1,r=s.data.loadLastCommentId,le(s),t&&K(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))}).fail(function(t,i,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))})}function B(t,o){var a;0==t.data.is_show_load_more?(e("#wpdiscuzHasMoreComments").val(0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()):(a=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",a),2!==i&&e(".wpdiscuz-comment-pagination").show(),e("#wpdiscuzHasMoreComments").val(1),o&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show()),le(t)}function K(t){var o=location.href.match(/#comment\-(\d+)/);if(null!==o){var a=o[1];if(e("#comment-"+a).length)setTimeout(function(){ee(),e("html, body").animate({scrollTop:e("#comment-"+a).parents("[id^=wpd-comm-]").offset().top-32},1e3,te),t&&N(a)},500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",a),me(z,!0,n).done(function(o){if("object"==typeof o&&o.success){var n="#comment-"+a;e("#comment-"+o.data.parentCommentID).length?e("#comment-"+o.data.parentCommentID).parents("[id^=wpd-comm-"+o.data.parentCommentID+"]").replaceWith(o.data.message):e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e(n).offset().top-32},1e3,te),t&&N(a)}e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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 Q(e){if(void 0!==e.data.message)for(var t,o=e.data.message,a=0;a<o.length;a++)Y((t=o[a]).comment_parent,t.comment_html)}function G(e,t){var o="";return(o=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(o.lastIndexOf("-")+1)}function $(e){return e.substring(0,e.indexOf("_"))}function X(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function Y(t,o){if(0==t)oe(o);else{var a=G(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+a).after(o)}}function J(){var t=[];return e(".wpd-comment-right").each(function(){t.push($(G(e(this),0)))}),t.join(",")}function Z(t,o){var a=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(o+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),o=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");o=(o=(o=(o=o.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(o)}(t),e.each(a,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 ee(){e("html, body").css("scroll-behavior","unset")}function te(){e("html").css("scroll-behavior",F),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 ae(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,o){var a=e(o);a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.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(),P(),e(window).scroll(function(){P()})),wpdiscuzAjaxObj.setLoadMoreVisibility=B,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 o,a=$(G(t));o=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",a),n.append("voteType",o),me(z,!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-"+a)),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-"+a)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+a));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-"+a)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+a));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[n.data],"error");le(n,a,o)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(o,a,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click","body",function(t){var o=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?o.css({display:o.is(":visible")?"none":"flex"}):o.hide()}),e(document).on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var t=e(this),o=e(this).attr("data-sorting");if(o){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 a=new FormData;a.append("action","wpdSorting"),a.append("sorting",o);var n=e(".wpdf-active").attr("data-filter-type");a.append("wpdType",n||""),me(z,!0,a).done(function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),B(t,!1),M=1),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){K(!1)},1!=m&&K(!1),e(document).on("click",".wpdiscuz-readmore",function(){var t=G(e(this)),o=$(t),a=new FormData;a.append("action","wpdReadMore"),a.append("commentId",o),me(z,!0,a).done(function(a){"object"==typeof a?(a.success?(e("#comment-"+o+" .wpd-comment-text").replaceWith(" "+a.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(a.data),le(a)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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=$(G(e(this),0)),o=new FormData;o.append("action","wpdStickComment"),o.append("commentId",t),me(z,!0,o).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd_close_btn",function(){var t=$(G(e(this),0)),o=new FormData;o.append("action","wpdCloseThread"),o.append("commentId",t),me(z,!0,o).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var t=e(this),o=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+o),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&a.append("sorting",n),a.append("lastParentId",0),a.append("offset",0),M=1,a.append("wpdType",t.hasClass("wpdf-active")?"":o),a.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(),me(z,!1,a).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(o.data.comment_list),B(o),r=o.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),le(o)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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 o=new FormData;o.append("action","wpdMostReactedComment"),me(z,!1,o).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(e("#comment-"+o.data.parentCommentID).length?e("#comment-"+o.data.parentCommentID).parents("[id^=wpd-comm-"+o.data.parentCommentID+"]").replaceWith(o.data.message):e("#comment-"+o.data.commentId).length||e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.commentId).offset().top-32},1e3,te))}).fail(function(o,a,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 o=new FormData;o.append("action","wpdHottestThread"),me(z,!1,o).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(e("#comment-"+o.data.commentId).length?e("#comment-"+o.data.commentId).parents("[id^=wpd-comm-"+o.data.commentId+"]").replaceWith(o.data.message):e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.commentId).offset().top-32},1e3,te))}).fail(function(o,a,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 o=$(G(t,0)),a=new FormData;a.append("action","wpdFollowUser"),a.append("commentId",o),me(z,!0,a).done(function(o){t.addClass("wpd_not_clicked"),"object"==typeof o?o.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data.code],"success"),t.removeClass("wpd-follow-active"),o.data.followTip&&t.attr("wpd-tooltip",o.data.followTip),o.data.followClass&&t.addClass(o.data.followClass)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"):console.log(o),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),ae(),e(document).on("keyup",".wc_email",function(){ae(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")}),k&&!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*x)},1e3*k),"content_left"===O)if(e(".entry-content").length){var ne=(ie=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){ne=(ie=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var ie;ne=(ie=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"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(){ee(),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-60},1e3,function(){te(),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"),K(!0);var o=t.match(/#comment\-(\d+)/);D=D.filter(function(e){return e!=o[1]}),e("#wpd-bubble-count .wpd-new-comments-count").text(D.length),0==D.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),e(document).on("click","#wpd-bubble-count",function(){if(D.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",D.join()),me(z,!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}),Q(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),D=[],e(".wpd-new-loaded-comment").length&&(ee(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-60},1e3,te)),le(t)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o)})}})}if((j&&C||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:J()}}).done(function(o){if(!E)if("object"==typeof o){if(o.commentIDsToRemove.forEach(function(t){e("[id^=wpd-comm-"+t+"]").remove()}),o.ids.length){d&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",r),i.append("visibleCommentIds",J()),me(z,!1,i).done(function(t){E||"object"==typeof t&&t.success&&(Q(t),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),t.data.wc_all_comments_count_new?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),r=t.data.loadLastCommentId)}).fail(function(e,t,o){console.log(o)})),o.ids=o.ids.filter(function(t){if(!e("#comment-"+t).length)return t});var a=5e3;l=parseInt(o.ids[o.ids.length-1]),D=D.concat(o.ids),y&&o.commentText&&(e("#wpd-bubble-author-avatar").html(o.avatar),e("#wpd-bubble-author-name").html(o.authorName),e("#wpd-bubble-comment-date span").html(o.commentDate),e("#wpd-bubble-comment-text").html(o.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",o.commentLink),e("#wpd-bubble-notification-message").show(),a=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=o.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")},a),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}o.all_comments_count=parseInt(o.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(o.all_comments_count_bubble_html),o.all_comments_count?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),e(".wpd-thread-info").html(o.all_comments_count_before_threads_html)}else console.log(o);var i;setTimeout(t,c)}).fail(function(e,o,a){console.log(a),setTimeout(t,c)})},c),e(".wpd-inline-form-wrapper").length){var se=new FormData;se.append("action","wpdGetInlineCommentForm"),me(z,!1,se).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"),o=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+o.substring(o.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"),re()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error"):console.log(t)}).fail(function(e,t,o){console.log(o)})}function de(t){if(e(t).hasClass("wpd-inline-shortcode"))var o=e(t).attr("id");else o=e(t).parents(".wpd-inline-shortcode").attr("id");return o.substring(o.lastIndexOf("-")+1)}function ce(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function pe(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var t=e(this),o=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&o>0&&o<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"),re(t.siblings(".wpd-inline-form-wrapper"))))})}function re(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(o=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var o;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(o=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"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 le(t,o,a,n){t.data.callbackFunctions&&e.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 me(t,o,a){o&&e("#wpdiscuz-loading-bar").show(),a.append("postId",s);var n=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](a,t,o))});var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:a,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){ce();var o="";e(t.target).hasClass("wpd-inline-icon")?o=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(o=e(t.target).parents(".wpd-inline-icon")),o.length&&o.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(o.parents(".wpd-inline-shortcode").addClass("wpd-active"),o.siblings(".wpd-inline-form-wrapper").show(),o.addClass("wpd-open"),o.removeClass("wpd-ignored"),re(o.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 o=e(this),a=e(this).parents(".wpd_inline_comm_form");if(a[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",de(a)),e.each(e("input, textarea",a),function(t,o){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(o).attr("name"),e(o).val()):n.append(e(o).attr("name"),e(o).val())}),me(z,!0,n).done(function(t){if(o.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){a[0].reset(),ce();var n=parseInt(t.data.newCount),i=o.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.allCommentsCountNew?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),t.data.message&&oe(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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),o=new FormData;o.append("action","wpdGetLastInlineComments"),o.append("inline_form_id",de(t)),me(z,!0,o).done(function(o){"object"==typeof o?o.success?e(o.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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"),ee(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-32},1e3,te)}),e(document).on("click",".wpd-feedback-content-link",function(t){t.preventDefault();var o=e(this).data("feedback-content-id");ee(),e("html, body").animate({scrollTop:e("#wpd-inline-"+o).offset().top-38},1e3,function(){te(),e("#wpd-inline-"+o).addClass("wpd-active")})}),"scroll_open"!==A&&"blink"!==A||(pe(),e(window).on("scroll",pe)),e(document).on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var t=new FormData,o=e(this).index();o>=0&&o<5&&(t.append("action","wpdUserRate"),t.append("rating",o+1),me(z,!0,t).done(function(t){"object"==typeof t?t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){t.preventDefault();var o,a,i=e(this);if(i[0].checkValidity()&&(o=i,a=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).val().length?(a=!1,e(".wpdiscuz-recaptcha",o).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).length&&e(".wpdiscuz-recaptcha",o).css("border","none"),a)){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())}),me(z,!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,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wpd-unsubscribe",function(t){t.preventDefault();var o=new FormData;o.append("action","wpdUnsubscribe"),o.append("sid",e(this).data("sid")),o.append("skey",e(this).data("skey")),me(z,!0,o).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,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=me});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-options.js
CHANGED
@@ -444,6 +444,9 @@ jQuery(document).ready(function ($) {
|
|
444 |
$('.rebuild-ratings-step').val(0);
|
445 |
$('.rebuild-ratings-start-id').val(0);
|
446 |
doingAjax = false;
|
|
|
|
|
|
|
447 |
}
|
448 |
}
|
449 |
} catch (e) {
|
444 |
$('.rebuild-ratings-step').val(0);
|
445 |
$('.rebuild-ratings-start-id').val(0);
|
446 |
doingAjax = false;
|
447 |
+
setTimeout(function () {
|
448 |
+
location.reload(true);
|
449 |
+
}, 2000);
|
450 |
}
|
451 |
}
|
452 |
} catch (e) {
|
assets/js/wpdiscuz-shortcode-tinymce.js
CHANGED
@@ -19,7 +19,7 @@
|
|
19 |
}
|
20 |
});
|
21 |
|
22 |
-
$(document).
|
23 |
var question = $('#wpd-inline-question').val();
|
24 |
var shortcode = '[' + wpdObject.shortcode + ' id="' + Math.random().toString(36).substr(2, 10) + '" question="' + (question ? $('<div>' + question + '</div>').text() : wpdObject.leave_feebdack) + '" opened="' + $('[name=wpd-inline-type]:checked').val() + '"]';
|
25 |
shortcode += tinymce.activeEditor.selection.getContent();
|
19 |
}
|
20 |
});
|
21 |
|
22 |
+
$(document).on('mousedown', '#wpd-put-shortcode', function () {
|
23 |
var question = $('#wpd-inline-question').val();
|
24 |
var shortcode = '[' + wpdObject.shortcode + ' id="' + Math.random().toString(36).substr(2, 10) + '" question="' + (question ? $('<div>' + question + '</div>').text() : wpdObject.leave_feebdack) + '" opened="' + $('[name=wpd-inline-type]:checked').val() + '"]';
|
25 |
shortcode += tinymce.activeEditor.selection.getContent();
|
assets/js/wpdiscuz.js
CHANGED
@@ -227,10 +227,12 @@ jQuery(document).ready(function($) {
|
|
227 |
if ($(this).is(':hidden')) {
|
228 |
icon.removeClass('fa-chevron-up');
|
229 |
icon.addClass('fa-chevron-down');
|
|
|
230 |
toggle.attr('wpd-tooltip', wpdiscuzAjaxObj.wc_show_replies_text);
|
231 |
} else {
|
232 |
icon.removeClass('fa-chevron-down');
|
233 |
icon.addClass('fa-chevron-up');
|
|
|
234 |
toggle.attr('wpd-tooltip', wpdiscuzAjaxObj.wc_hide_replies_text);
|
235 |
}
|
236 |
btn.addClass('wpd_not_clicked');
|
@@ -1369,8 +1371,8 @@ jQuery(document).ready(function($) {
|
|
1369 |
if (r.success) {
|
1370 |
$('#wpd-comm-' + uniqueId).replaceWith(r.data.comment_list);
|
1371 |
$('#wpd-comm-' + uniqueId + ' .wpd-toggle .fas').removeClass('fa-chevron-down').addClass('fa-chevron-up');
|
|
|
1372 |
$('#wpd-comm-' + uniqueId + ' .wpd-toggle').attr('wpd-tooltip', wpdiscuzAjaxObj.wc_hide_replies_text);
|
1373 |
-
$('#wpd-comm-' + uniqueId + ' .wpd-toggle .wpd-view-replies').remove();
|
1374 |
|
1375 |
runCallbacks(r);
|
1376 |
}
|
227 |
if ($(this).is(':hidden')) {
|
228 |
icon.removeClass('fa-chevron-up');
|
229 |
icon.addClass('fa-chevron-down');
|
230 |
+
toggle.find('.wpd-view-replies-text').text(wpdiscuzAjaxObj.wc_show_replies_text);
|
231 |
toggle.attr('wpd-tooltip', wpdiscuzAjaxObj.wc_show_replies_text);
|
232 |
} else {
|
233 |
icon.removeClass('fa-chevron-down');
|
234 |
icon.addClass('fa-chevron-up');
|
235 |
+
toggle.find('.wpd-view-replies-text').text(wpdiscuzAjaxObj.wc_hide_replies_text);
|
236 |
toggle.attr('wpd-tooltip', wpdiscuzAjaxObj.wc_hide_replies_text);
|
237 |
}
|
238 |
btn.addClass('wpd_not_clicked');
|
1371 |
if (r.success) {
|
1372 |
$('#wpd-comm-' + uniqueId).replaceWith(r.data.comment_list);
|
1373 |
$('#wpd-comm-' + uniqueId + ' .wpd-toggle .fas').removeClass('fa-chevron-down').addClass('fa-chevron-up');
|
1374 |
+
$('#wpd-comm-' + uniqueId + ' .wpd-toggle .wpd-view-replies .wpd-view-replies-text').text(wpdiscuzAjaxObj.wc_hide_replies_text);
|
1375 |
$('#wpd-comm-' + uniqueId + ' .wpd-toggle').attr('wpd-tooltip', wpdiscuzAjaxObj.wc_hide_replies_text);
|
|
|
1376 |
|
1377 |
runCallbacks(r);
|
1378 |
}
|
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,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()})},jQuery(document).ready(function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,a=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),v=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,z=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),j=parseInt(wpdiscuzAjaxObj.enableBubble),C=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),x=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,y=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),O=wpdiscuzAjaxObj.bubbleLocation,A=wpdiscuzAjaxObj.inlineFeedbackAttractionType,I=[],T=[],D=[],E=!1,M=1,F=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 o=e(".wpd-form").not(":hidden");if(o.length)if(wpdiscuzLoadRichEditor){for(var a=0;a<o.length;a++)if("\n"!==wpDiscuzEditor.createEditor(e(o[a]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(a=0;a<o.length;a++)if(e(o[a]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")}),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(v)}),e(document).on("focus","#wpdcom textarea",function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()}),t)||q({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 o=e("#wpd-editor-source-code").val();o.length&&t.clipboard.dangerouslyPasteHTML(0,o,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=G(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()},v):setTimeout(function(){e("#wc-textarea-"+i).trigger("focus")},v),e("#wpd-secondary-form-wrapper-"+i).slideToggle(v)):function(o){var a=G(o,0);e("#wpdiscuz_form_anchor-"+a).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(a));var n=e("#wpd-secondary-form-wrapper-"+a);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_"+_)};q(i)}wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},v):setTimeout(function(){e("#wc-textarea-"+a).trigger("focus")},v);n.slideToggle(v,function(){o.addClass("wpdiscuz-clonned")})}(e(this)),function(t){if((o||a)&&"2.0"===n){var i=$(t);setTimeout(function(){if(!T[i])try{T[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(o){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"),o=e("<input/>");o.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),o.trigger("select"),document.execCommand("copy"),o.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 o=G(e(this),0),a=e(this),n=e(".fas",a);!a.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&g?function(t,o){var a=$(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",a),me(z,!0,n).done(function(a){o.addClass("wpd_not_clicked"),"object"==typeof a&&a.success&&(e("#wpd-comm-"+t).replaceWith(a.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),e("#wpd-comm-"+t+" .wpd-toggle .wpd-view-replies").remove(),le(a)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,n){console.log(n),o.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}(o,t):e("#wpd-comm-"+o+"> .wpd-reply").slideToggle(700,function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),a.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(v)}),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 o=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,o.trigger("submit")},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}})),(o||a)&&"2.0"===n){var L=e(window).width(),S=e("#wpdcom").width();S>=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%"})),S>=940&&S<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%"})),S>=810&&S<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%"})),S>=730&&S<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%"})),S>=610&&S<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%"})),L>650&&(S>=510&&S<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"})),S>=470&&S<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"})),S<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 H(t,o,a){me(z||f,!1,o).done(function(o){if(e(a).addClass("wpd_not_clicked"),"object"==typeof o)if(o.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(v),e(".wpd-thread-info").html(o.data.wc_all_comments_count_before_threads_html),o.data.wc_all_comments_count_new=parseInt(o.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(o.data.wc_all_comments_count_bubble_html),o.data.wc_all_comments_count_new?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide();var n=v;o.data.is_main?oe(o.data.message):(n=v+700,e("#wpd-secondary-form-wrapper-"+o.data.uniqueid).slideToggle(700),1==o.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+o.data.uniqueid).after(o.data.message):e("#wpd-comm-"+o.data.uniqueid).after(o.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),me(z,!0,t)}}(o),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),me(z,!0,t).done(function(e){"object"==typeof e&&e.success&&setTimeout(function(){location.href=e.data},2e3)}).fail(function(e,t,o){console.log(o)})}}(o),h&&b?function(t){var o=t.comment_author_email,a=t.comment_author,n=t.comment_author_url;null==u?(Cookies.set("comment_author_email_"+_,o),Cookies.set("comment_author_"+_,a),n.length&&Cookies.set("comment_author_url_"+_,n)):(u=parseInt(u),Cookies.set("comment_author_email_"+_,o,{expires:u,path:"/"}),Cookies.set("comment_author_"+_,a,{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)}(o.data):b||e(".wpd-cookies-checkbox").prop("checked",!1),wpdiscuzLoadRichEditor&&wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]),t.get(0).reset(),q(o.data),e(".wmu-preview-wrap",t).remove(),I.length&&(I.forEach(function(e){e.parents(".wpd-field-checkbox").remove()}),I=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.new_comment_id).offset().top-32},1e3,te)},n),le(o,t)}else o.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"),le(o,t));else wpdiscuzAjaxObj.setCommentMessage(o,"error");e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,o,n){console.log(n),e(a).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}function q(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,o){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(o),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 o=t.attr("class").split(" "),a="";return e.each(o,function(e,t){"wpd_comment_level"===X(t,!1)&&(a=X(t,!0))}),parseInt(a)+1}(e(this).parents(".wpd-comment"))),Z(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(){I.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),H(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 H(d,c,i)}var p,r;!function(e){if((o||a)&&"2.0"===n){var t=$(e);grecaptcha.reset(T[t])}}(e(".wpdiscuz_unique_id",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.wc_msg_required_fields,"error")}),e(document).on("click",".wpd_editable_comment",function(){w&&e(".wpdiscuz-edit-form-wrap").length&&U(G(e(".wpdiscuz-edit-form-wrap"),0),w);var t=G(e(this),0),o=$(t),a=new FormData;a.append("action","wpdEditComment"),a.append("commentId",o),w=e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-text").get(0),me(z,!0,a).done(function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){var a=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+t);a.clipboard.dangerouslyPasteHTML(0,o.data.content),a.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+t).val(o.data.content);e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wc_save_edited_comment",function(){var t=G(e(this)),o=$(t),a=e("#wpd-comm-"+t+" #wpdiscuz-edit-form");if(Z(a,"#wpd-editor-edit_"+t),a.submit(function(e){e.preventDefault()}),a[0].checkValidity()){var n=new FormData;n.append("action","wpdSaveEditedComment"),n.append("commentId",o),e(":input",a).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&n.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&n.append(this.name+"",e(this).val())}),me(z,!0,n).done(function(a){"object"==typeof a?(a.success?(U(t,a.data.message),a.data.lastEdited&&(e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(a.data.lastEdited).insertAfter("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),a.data.twitterShareLink&&e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",a.data.twitterShareLink),a.data.whatsappShareLink&&e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",a.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[a.data],"error"),le(a,o)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=G(e(this));U(t,w),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!wpdiscuzAjaxObj.wordpressIsPaginate&&m&&(M=0,1==m?setTimeout(function(){V(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),V(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&V(!1,t,"wpd-loaded","wpd-loading")});var W=!1;function P(){var t=e("#wpdiscuzHasMoreComments").val(),o=e(document).height(),a=e(window).height()+e(window).scrollTop();o&&a&&(100*a/o>=80&&!1===W&&1==t&&(W=!0,V(!1,e(".wpd-load-more-submit"))))}function V(t,o,a,n){o&&(o.toggleClass(a),o.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||""),me(z,!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),B(s,t&&2!==i),W=!1,r=s.data.loadLastCommentId,le(s),t&&K(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))}).fail(function(t,i,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))})}function B(t,o){var a;0==t.data.is_show_load_more?(e("#wpdiscuzHasMoreComments").val(0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()):(a=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",a),2!==i&&e(".wpdiscuz-comment-pagination").show(),e("#wpdiscuzHasMoreComments").val(1),o&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show()),le(t)}function K(t){var o=location.href.match(/#comment\-(\d+)/);if(null!==o){var a=o[1];if(e("#comment-"+a).length)setTimeout(function(){ee(),e("html, body").animate({scrollTop:e("#comment-"+a).parents("[id^=wpd-comm-]").offset().top-32},1e3,te),t&&N(a)},500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",a),me(z,!0,n).done(function(o){if("object"==typeof o&&o.success){var n="#comment-"+a;e("#comment-"+o.data.parentCommentID).length?e("#comment-"+o.data.parentCommentID).parents("[id^=wpd-comm-"+o.data.parentCommentID+"]").replaceWith(o.data.message):e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e(n).offset().top-32},1e3,te),t&&N(a)}e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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 Q(e){if(void 0!==e.data.message)for(var t,o=e.data.message,a=0;a<o.length;a++)Y((t=o[a]).comment_parent,t.comment_html)}function G(e,t){var o="";return(o=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(o.lastIndexOf("-")+1)}function $(e){return e.substring(0,e.indexOf("_"))}function X(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function Y(t,o){if(0==t)oe(o);else{var a=G(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+a).after(o)}}function J(){var t=[];return e(".wpd-comment-right").each(function(){t.push($(G(e(this),0)))}),t.join(",")}function Z(t,o){var a=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(o+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),o=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");o=(o=(o=(o=o.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(o)}(t),e.each(a,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 ee(){e("html, body").css("scroll-behavior","unset")}function te(){e("html").css("scroll-behavior",F),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 ae(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,o){var a=e(o);a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.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(),P(),e(window).scroll(function(){P()})),wpdiscuzAjaxObj.setLoadMoreVisibility=B,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 o,a=$(G(t));o=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",a),n.append("voteType",o),me(z,!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-"+a)),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-"+a)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+a));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-"+a)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+a));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[n.data],"error");le(n,a,o)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(o,a,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click","body",function(t){var o=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?o.css({display:o.is(":visible")?"none":"flex"}):o.hide()}),e(document).on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var t=e(this),o=e(this).attr("data-sorting");if(o){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 a=new FormData;a.append("action","wpdSorting"),a.append("sorting",o);var n=e(".wpdf-active").attr("data-filter-type");a.append("wpdType",n||""),me(z,!0,a).done(function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),B(t,!1),M=1),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){K(!1)},1!=m&&K(!1),e(document).on("click",".wpdiscuz-readmore",function(){var t=G(e(this)),o=$(t),a=new FormData;a.append("action","wpdReadMore"),a.append("commentId",o),me(z,!0,a).done(function(a){"object"==typeof a?(a.success?(e("#comment-"+o+" .wpd-comment-text").replaceWith(" "+a.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(a.data),le(a)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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=$(G(e(this),0)),o=new FormData;o.append("action","wpdStickComment"),o.append("commentId",t),me(z,!0,o).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd_close_btn",function(){var t=$(G(e(this),0)),o=new FormData;o.append("action","wpdCloseThread"),o.append("commentId",t),me(z,!0,o).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var t=e(this),o=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+o),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&a.append("sorting",n),a.append("lastParentId",0),a.append("offset",0),M=1,a.append("wpdType",t.hasClass("wpdf-active")?"":o),a.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(),me(z,!1,a).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(o.data.comment_list),B(o),r=o.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),le(o)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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 o=new FormData;o.append("action","wpdMostReactedComment"),me(z,!1,o).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(e("#comment-"+o.data.parentCommentID).length?e("#comment-"+o.data.parentCommentID).parents("[id^=wpd-comm-"+o.data.parentCommentID+"]").replaceWith(o.data.message):e("#comment-"+o.data.commentId).length||e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.commentId).offset().top-32},1e3,te))}).fail(function(o,a,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 o=new FormData;o.append("action","wpdHottestThread"),me(z,!1,o).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(e("#comment-"+o.data.commentId).length?e("#comment-"+o.data.commentId).parents("[id^=wpd-comm-"+o.data.commentId+"]").replaceWith(o.data.message):e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.commentId).offset().top-32},1e3,te))}).fail(function(o,a,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 o=$(G(t,0)),a=new FormData;a.append("action","wpdFollowUser"),a.append("commentId",o),me(z,!0,a).done(function(o){t.addClass("wpd_not_clicked"),"object"==typeof o?o.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data.code],"success"),t.removeClass("wpd-follow-active"),o.data.followTip&&t.attr("wpd-tooltip",o.data.followTip),o.data.followClass&&t.addClass(o.data.followClass)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"):console.log(o),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),ae(),e(document).on("keyup",".wc_email",function(){ae(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")}),k&&!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*x)},1e3*k),"content_left"===O)if(e(".entry-content").length){var ne=(ie=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){ne=(ie=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var ie;ne=(ie=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"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(){ee(),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-60},1e3,function(){te(),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"),K(!0);var o=t.match(/#comment\-(\d+)/);D=D.filter(function(e){return e!=o[1]}),e("#wpd-bubble-count .wpd-new-comments-count").text(D.length),0==D.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),e(document).on("click","#wpd-bubble-count",function(){if(D.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",D.join()),me(z,!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}),Q(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),D=[],e(".wpd-new-loaded-comment").length&&(ee(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-60},1e3,te)),le(t)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o)})}})}if((j&&C||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:J()}}).done(function(o){if(!E)if("object"==typeof o){if(o.commentIDsToRemove.forEach(function(t){e("[id^=wpd-comm-"+t+"]").remove()}),o.ids.length){d&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",r),i.append("visibleCommentIds",J()),me(z,!1,i).done(function(t){E||"object"==typeof t&&t.success&&(Q(t),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),t.data.wc_all_comments_count_new?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),r=t.data.loadLastCommentId)}).fail(function(e,t,o){console.log(o)})),o.ids=o.ids.filter(function(t){if(!e("#comment-"+t).length)return t});var a=5e3;l=parseInt(o.ids[o.ids.length-1]),D=D.concat(o.ids),y&&o.commentText&&(e("#wpd-bubble-author-avatar").html(o.avatar),e("#wpd-bubble-author-name").html(o.authorName),e("#wpd-bubble-comment-date span").html(o.commentDate),e("#wpd-bubble-comment-text").html(o.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",o.commentLink),e("#wpd-bubble-notification-message").show(),a=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=o.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")},a),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}o.all_comments_count=parseInt(o.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(o.all_comments_count_bubble_html),o.all_comments_count?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),e(".wpd-thread-info").html(o.all_comments_count_before_threads_html)}else console.log(o);var i;setTimeout(t,c)}).fail(function(e,o,a){console.log(a),setTimeout(t,c)})},c),e(".wpd-inline-form-wrapper").length){var se=new FormData;se.append("action","wpdGetInlineCommentForm"),me(z,!1,se).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"),o=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+o.substring(o.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"),re()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error"):console.log(t)}).fail(function(e,t,o){console.log(o)})}function de(t){if(e(t).hasClass("wpd-inline-shortcode"))var o=e(t).attr("id");else o=e(t).parents(".wpd-inline-shortcode").attr("id");return o.substring(o.lastIndexOf("-")+1)}function ce(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function pe(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var t=e(this),o=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&o>0&&o<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"),re(t.siblings(".wpd-inline-form-wrapper"))))})}function re(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(o=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var o;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(o=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"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 le(t,o,a,n){t.data.callbackFunctions&&e.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 me(t,o,a){o&&e("#wpdiscuz-loading-bar").show(),a.append("postId",s);var n=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](a,t,o))});var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:a,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){ce();var o="";e(t.target).hasClass("wpd-inline-icon")?o=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(o=e(t.target).parents(".wpd-inline-icon")),o.length&&o.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(o.parents(".wpd-inline-shortcode").addClass("wpd-active"),o.siblings(".wpd-inline-form-wrapper").show(),o.addClass("wpd-open"),o.removeClass("wpd-ignored"),re(o.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 o=e(this),a=e(this).parents(".wpd_inline_comm_form");if(a[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",de(a)),e.each(e("input, textarea",a),function(t,o){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(o).attr("name"),e(o).val()):n.append(e(o).attr("name"),e(o).val())}),me(z,!0,n).done(function(t){if(o.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){a[0].reset(),ce();var n=parseInt(t.data.newCount),i=o.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.allCommentsCountNew?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),t.data.message&&oe(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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),o=new FormData;o.append("action","wpdGetLastInlineComments"),o.append("inline_form_id",de(t)),me(z,!0,o).done(function(o){"object"==typeof o?o.success?e(o.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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"),ee(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-32},1e3,te)}),e(document).on("click",".wpd-feedback-content-link",function(t){t.preventDefault();var o=e(this).data("feedback-content-id");ee(),e("html, body").animate({scrollTop:e("#wpd-inline-"+o).offset().top-38},1e3,function(){te(),e("#wpd-inline-"+o).addClass("wpd-active")})}),"scroll_open"!==A&&"blink"!==A||(pe(),e(window).on("scroll",pe)),e(document).on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var t=new FormData,o=e(this).index();o>=0&&o<5&&(t.append("action","wpdUserRate"),t.append("rating",o+1),me(z,!0,t).done(function(t){"object"==typeof t?t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){t.preventDefault();var o,a,i=e(this);if(i[0].checkValidity()&&(o=i,a=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).val().length?(a=!1,e(".wpdiscuz-recaptcha",o).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).length&&e(".wpdiscuz-recaptcha",o).css("border","none"),a)){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())}),me(z,!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,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wpd-unsubscribe",function(t){t.preventDefault();var o=new FormData;o.append("action","wpdUnsubscribe"),o.append("sid",e(this).data("sid")),o.append("skey",e(this).data("skey")),me(z,!0,o).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,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=me});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 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,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()})},jQuery(document).ready(function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,a=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),v=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,z=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),j=parseInt(wpdiscuzAjaxObj.enableBubble),C=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),x=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,y=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),O=wpdiscuzAjaxObj.bubbleLocation,A=wpdiscuzAjaxObj.inlineFeedbackAttractionType,I=[],T=[],D=[],E=!1,M=1,F=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 o=e(".wpd-form").not(":hidden");if(o.length)if(wpdiscuzLoadRichEditor){for(var a=0;a<o.length;a++)if("\n"!==wpDiscuzEditor.createEditor(e(o[a]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(a=0;a<o.length;a++)if(e(o[a]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")}),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(v)}),e(document).on("focus","#wpdcom textarea",function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()}),t)||q({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 o=e("#wpd-editor-source-code").val();o.length&&t.clipboard.dangerouslyPasteHTML(0,o,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=G(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()},v):setTimeout(function(){e("#wc-textarea-"+i).trigger("focus")},v),e("#wpd-secondary-form-wrapper-"+i).slideToggle(v)):function(o){var a=G(o,0);e("#wpdiscuz_form_anchor-"+a).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(a));var n=e("#wpd-secondary-form-wrapper-"+a);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_"+_)};q(i)}wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+a).focus()},v):setTimeout(function(){e("#wc-textarea-"+a).trigger("focus")},v);n.slideToggle(v,function(){o.addClass("wpdiscuz-clonned")})}(e(this)),function(t){if((o||a)&&"2.0"===n){var i=$(t);setTimeout(function(){if(!T[i])try{T[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(o){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"),o=e("<input/>");o.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),o.trigger("select"),document.execCommand("copy"),o.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 o=G(e(this),0),a=e(this),n=e(".fas",a);!a.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&g?function(t,o){var a=$(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",a),me(z,!0,n).done(function(a){o.addClass("wpd_not_clicked"),"object"==typeof a&&a.success&&(e("#wpd-comm-"+t).replaceWith(a.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),le(a)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,n){console.log(n),o.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}(o,t):e("#wpd-comm-"+o+"> .wpd-reply").slideToggle(700,function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),a.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),a.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),a.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),a.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(v)}),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 o=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,o.trigger("submit")},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}})),(o||a)&&"2.0"===n){var L=e(window).width(),S=e("#wpdcom").width();S>=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%"})),S>=940&&S<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%"})),S>=810&&S<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%"})),S>=730&&S<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%"})),S>=610&&S<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%"})),L>650&&(S>=510&&S<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"})),S>=470&&S<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"})),S<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 H(t,o,a){me(z||f,!1,o).done(function(o){if(e(a).addClass("wpd_not_clicked"),"object"==typeof o)if(o.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(v),e(".wpd-thread-info").html(o.data.wc_all_comments_count_before_threads_html),o.data.wc_all_comments_count_new=parseInt(o.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(o.data.wc_all_comments_count_bubble_html),o.data.wc_all_comments_count_new?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide();var n=v;o.data.is_main?oe(o.data.message):(n=v+700,e("#wpd-secondary-form-wrapper-"+o.data.uniqueid).slideToggle(700),1==o.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+o.data.uniqueid).after(o.data.message):e("#wpd-comm-"+o.data.uniqueid).after(o.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),me(z,!0,t)}}(o),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),me(z,!0,t).done(function(e){"object"==typeof e&&e.success&&setTimeout(function(){location.href=e.data},2e3)}).fail(function(e,t,o){console.log(o)})}}(o),h&&b?function(t){var o=t.comment_author_email,a=t.comment_author,n=t.comment_author_url;null==u?(Cookies.set("comment_author_email_"+_,o),Cookies.set("comment_author_"+_,a),n.length&&Cookies.set("comment_author_url_"+_,n)):(u=parseInt(u),Cookies.set("comment_author_email_"+_,o,{expires:u,path:"/"}),Cookies.set("comment_author_"+_,a,{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)}(o.data):b||e(".wpd-cookies-checkbox").prop("checked",!1),wpdiscuzLoadRichEditor&&wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]),t.get(0).reset(),q(o.data),e(".wmu-preview-wrap",t).remove(),I.length&&(I.forEach(function(e){e.parents(".wpd-field-checkbox").remove()}),I=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.new_comment_id).offset().top-32},1e3,te)},n),le(o,t)}else o.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"),le(o,t));else wpdiscuzAjaxObj.setCommentMessage(o,"error");e("#wpdiscuz-loading-bar").fadeOut(250),E=!1}).fail(function(t,o,n){console.log(n),e(a).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}function q(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,o){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(o),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 o=t.attr("class").split(" "),a="";return e.each(o,function(e,t){"wpd_comment_level"===X(t,!1)&&(a=X(t,!0))}),parseInt(a)+1}(e(this).parents(".wpd-comment"))),Z(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(){I.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),H(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 H(d,c,i)}var p,r;!function(e){if((o||a)&&"2.0"===n){var t=$(e);grecaptcha.reset(T[t])}}(e(".wpdiscuz_unique_id",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.wc_msg_required_fields,"error")}),e(document).on("click",".wpd_editable_comment",function(){w&&e(".wpdiscuz-edit-form-wrap").length&&U(G(e(".wpdiscuz-edit-form-wrap"),0),w);var t=G(e(this),0),o=$(t),a=new FormData;a.append("action","wpdEditComment"),a.append("commentId",o),w=e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-text").get(0),me(z,!0,a).done(function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){var a=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+t);a.clipboard.dangerouslyPasteHTML(0,o.data.content),a.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+t).val(o.data.content);e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wc_save_edited_comment",function(){var t=G(e(this)),o=$(t),a=e("#wpd-comm-"+t+" #wpdiscuz-edit-form");if(Z(a,"#wpd-editor-edit_"+t),a.submit(function(e){e.preventDefault()}),a[0].checkValidity()){var n=new FormData;n.append("action","wpdSaveEditedComment"),n.append("commentId",o),e(":input",a).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&n.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&n.append(this.name+"",e(this).val())}),me(z,!0,n).done(function(a){"object"==typeof a?(a.success?(U(t,a.data.message),a.data.lastEdited&&(e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(a.data.lastEdited).insertAfter("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),a.data.twitterShareLink&&e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",a.data.twitterShareLink),a.data.whatsappShareLink&&e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",a.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[a.data],"error"),le(a,o)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=G(e(this));U(t,w),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!wpdiscuzAjaxObj.wordpressIsPaginate&&m&&(M=0,1==m?setTimeout(function(){V(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),V(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&V(!1,t,"wpd-loaded","wpd-loading")});var W=!1;function P(){var t=e("#wpdiscuzHasMoreComments").val(),o=e(document).height(),a=e(window).height()+e(window).scrollTop();o&&a&&(100*a/o>=80&&!1===W&&1==t&&(W=!0,V(!1,e(".wpd-load-more-submit"))))}function V(t,o,a,n){o&&(o.toggleClass(a),o.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||""),me(z,!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),B(s,t&&2!==i),W=!1,r=s.data.loadLastCommentId,le(s),t&&K(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))}).fail(function(t,i,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),o&&(o.toggleClass(a),o.toggleClass(n))})}function B(t,o){var a;0==t.data.is_show_load_more?(e("#wpdiscuzHasMoreComments").val(0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()):(a=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",a),2!==i&&e(".wpdiscuz-comment-pagination").show(),e("#wpdiscuzHasMoreComments").val(1),o&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show()),le(t)}function K(t){var o=location.href.match(/#comment\-(\d+)/);if(null!==o){var a=o[1];if(e("#comment-"+a).length)setTimeout(function(){ee(),e("html, body").animate({scrollTop:e("#comment-"+a).parents("[id^=wpd-comm-]").offset().top-32},1e3,te),t&&N(a)},500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",a),me(z,!0,n).done(function(o){if("object"==typeof o&&o.success){var n="#comment-"+a;e("#comment-"+o.data.parentCommentID).length?e("#comment-"+o.data.parentCommentID).parents("[id^=wpd-comm-"+o.data.parentCommentID+"]").replaceWith(o.data.message):e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e(n).offset().top-32},1e3,te),t&&N(a)}e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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 Q(e){if(void 0!==e.data.message)for(var t,o=e.data.message,a=0;a<o.length;a++)Y((t=o[a]).comment_parent,t.comment_html)}function G(e,t){var o="";return(o=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(o.lastIndexOf("-")+1)}function $(e){return e.substring(0,e.indexOf("_"))}function X(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function Y(t,o){if(0==t)oe(o);else{var a=G(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+a).after(o)}}function J(){var t=[];return e(".wpd-comment-right").each(function(){t.push($(G(e(this),0)))}),t.join(",")}function Z(t,o){var a=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(o+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),o=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");o=(o=(o=(o=o.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(o)}(t),e.each(a,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 ee(){e("html, body").css("scroll-behavior","unset")}function te(){e("html").css("scroll-behavior",F),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 ae(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,o){var a=e(o);a.prop("required")||(a.val()?a.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):a.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(),P(),e(window).scroll(function(){P()})),wpdiscuzAjaxObj.setLoadMoreVisibility=B,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 o,a=$(G(t));o=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",a),n.append("voteType",o),me(z,!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-"+a)),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-"+a)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+a));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-"+a)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+a));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[n.data],"error");le(n,a,o)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(o,a,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click","body",function(t){var o=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?o.css({display:o.is(":visible")?"none":"flex"}):o.hide()}),e(document).on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var t=e(this),o=e(this).attr("data-sorting");if(o){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 a=new FormData;a.append("action","wpdSorting"),a.append("sorting",o);var n=e(".wpdf-active").attr("data-filter-type");a.append("wpdType",n||""),me(z,!0,a).done(function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),B(t,!1),M=1),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){K(!1)},1!=m&&K(!1),e(document).on("click",".wpdiscuz-readmore",function(){var t=G(e(this)),o=$(t),a=new FormData;a.append("action","wpdReadMore"),a.append("commentId",o),me(z,!0,a).done(function(a){"object"==typeof a?(a.success?(e("#comment-"+o+" .wpd-comment-text").replaceWith(" "+a.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(a.data),le(a)):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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=$(G(e(this),0)),o=new FormData;o.append("action","wpdStickComment"),o.append("commentId",t),me(z,!0,o).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd_close_btn",function(){var t=$(G(e(this),0)),o=new FormData;o.append("action","wpdCloseThread"),o.append("commentId",t),me(z,!0,o).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var t=e(this),o=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+o),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&a.append("sorting",n),a.append("lastParentId",0),a.append("offset",0),M=1,a.append("wpdType",t.hasClass("wpdf-active")?"":o),a.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(),me(z,!1,a).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(o.data.comment_list),B(o),r=o.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),le(o)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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 o=new FormData;o.append("action","wpdMostReactedComment"),me(z,!1,o).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(e("#comment-"+o.data.parentCommentID).length?e("#comment-"+o.data.parentCommentID).parents("[id^=wpd-comm-"+o.data.parentCommentID+"]").replaceWith(o.data.message):e("#comment-"+o.data.commentId).length||e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.commentId).offset().top-32},1e3,te))}).fail(function(o,a,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 o=new FormData;o.append("action","wpdHottestThread"),me(z,!1,o).done(function(o){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof o&&o.success&&(e("#comment-"+o.data.commentId).length?e("#comment-"+o.data.commentId).parents("[id^=wpd-comm-"+o.data.commentId+"]").replaceWith(o.data.message):e(".wpd-thread-list").prepend(o.data.message),le(o),ee(),e("html, body").animate({scrollTop:e("#comment-"+o.data.commentId).offset().top-32},1e3,te))}).fail(function(o,a,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 o=$(G(t,0)),a=new FormData;a.append("action","wpdFollowUser"),a.append("commentId",o),me(z,!0,a).done(function(o){t.addClass("wpd_not_clicked"),"object"==typeof o?o.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data.code],"success"),t.removeClass("wpd-follow-active"),o.data.followTip&&t.attr("wpd-tooltip",o.data.followTip),o.data.followClass&&t.addClass(o.data.followClass)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"):console.log(o),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(o,a,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),ae(),e(document).on("keyup",".wc_email",function(){ae(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")}),k&&!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*x)},1e3*k),"content_left"===O)if(e(".entry-content").length){var ne=(ie=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){ne=(ie=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var ie;ne=(ie=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?ie:25;e("#wpd-bubble-wrapper").css({left:ne+"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(){ee(),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-60},1e3,function(){te(),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"),K(!0);var o=t.match(/#comment\-(\d+)/);D=D.filter(function(e){return e!=o[1]}),e("#wpd-bubble-count .wpd-new-comments-count").text(D.length),0==D.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),e(document).on("click","#wpd-bubble-count",function(){if(D.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",D.join()),me(z,!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}),Q(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),D=[],e(".wpd-new-loaded-comment").length&&(ee(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-60},1e3,te)),le(t)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,o){console.log(o)})}})}if((j&&C||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:J()}}).done(function(o){if(!E)if("object"==typeof o){if(o.commentIDsToRemove.forEach(function(t){e("[id^=wpd-comm-"+t+"]").remove()}),o.ids.length){d&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",r),i.append("visibleCommentIds",J()),me(z,!1,i).done(function(t){E||"object"==typeof t&&t.success&&(Q(t),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),t.data.wc_all_comments_count_new?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),r=t.data.loadLastCommentId)}).fail(function(e,t,o){console.log(o)})),o.ids=o.ids.filter(function(t){if(!e("#comment-"+t).length)return t});var a=5e3;l=parseInt(o.ids[o.ids.length-1]),D=D.concat(o.ids),y&&o.commentText&&(e("#wpd-bubble-author-avatar").html(o.avatar),e("#wpd-bubble-author-name").html(o.authorName),e("#wpd-bubble-comment-date span").html(o.commentDate),e("#wpd-bubble-comment-text").html(o.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",o.commentLink),e("#wpd-bubble-notification-message").show(),a=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=o.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")},a),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}o.all_comments_count=parseInt(o.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(o.all_comments_count_bubble_html),o.all_comments_count?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),e(".wpd-thread-info").html(o.all_comments_count_before_threads_html)}else console.log(o);var i;setTimeout(t,c)}).fail(function(e,o,a){console.log(a),setTimeout(t,c)})},c),e(".wpd-inline-form-wrapper").length){var se=new FormData;se.append("action","wpdGetInlineCommentForm"),me(z,!1,se).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"),o=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+o.substring(o.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"),re()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error"):console.log(t)}).fail(function(e,t,o){console.log(o)})}function de(t){if(e(t).hasClass("wpd-inline-shortcode"))var o=e(t).attr("id");else o=e(t).parents(".wpd-inline-shortcode").attr("id");return o.substring(o.lastIndexOf("-")+1)}function ce(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function pe(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var t=e(this),o=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&o>0&&o<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"),re(t.siblings(".wpd-inline-form-wrapper"))))})}function re(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(o=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var o;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(o=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(o=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+o+"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 le(t,o,a,n){t.data.callbackFunctions&&e.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 me(t,o,a){o&&e("#wpdiscuz-loading-bar").show(),a.append("postId",s);var n=a.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(a=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](a,t,o))});var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:a,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){ce();var o="";e(t.target).hasClass("wpd-inline-icon")?o=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(o=e(t.target).parents(".wpd-inline-icon")),o.length&&o.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(o.parents(".wpd-inline-shortcode").addClass("wpd-active"),o.siblings(".wpd-inline-form-wrapper").show(),o.addClass("wpd-open"),o.removeClass("wpd-ignored"),re(o.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 o=e(this),a=e(this).parents(".wpd_inline_comm_form");if(a[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",de(a)),e.each(e("input, textarea",a),function(t,o){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(o).attr("name"),e(o).val()):n.append(e(o).attr("name"),e(o).val())}),me(z,!0,n).done(function(t){if(o.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){a[0].reset(),ce();var n=parseInt(t.data.newCount),i=o.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.allCommentsCountNew?e("#wpd-bubble-all-comments-count").show():e("#wpd-bubble-all-comments-count").hide(),t.data.message&&oe(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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),o=new FormData;o.append("action","wpdGetLastInlineComments"),o.append("inline_form_id",de(t)),me(z,!0,o).done(function(o){"object"==typeof o?o.success?e(o.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[o.data],"error"):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),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"),ee(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-32},1e3,te)}),e(document).on("click",".wpd-feedback-content-link",function(t){t.preventDefault();var o=e(this).data("feedback-content-id");ee(),e("html, body").animate({scrollTop:e("#wpd-inline-"+o).offset().top-38},1e3,function(){te(),e("#wpd-inline-"+o).addClass("wpd-active")})}),"scroll_open"!==A&&"blink"!==A||(pe(),e(window).on("scroll",pe)),e(document).on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var t=new FormData,o=e(this).index();o>=0&&o<5&&(t.append("action","wpdUserRate"),t.append("rating",o+1),me(z,!0,t).done(function(t){"object"==typeof t?t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj[t.data],"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}))}),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){t.preventDefault();var o,a,i=e(this);if(i[0].checkValidity()&&(o=i,a=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).val().length?(a=!1,e(".wpdiscuz-recaptcha",o).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",o).length&&e(".wpdiscuz-recaptcha",o).css("border","none"),a)){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())}),me(z,!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,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wpd-unsubscribe",function(t){t.preventDefault();var o=new FormData;o.append("action","wpdUnsubscribe"),o.append("sid",e(this).data("sid")),o.append("skey",e(this).data("skey")),me(z,!0,o).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,o,a){console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=me});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")}};
|
assets/third-party/quicktags/wpdiscuz-quictags.js
CHANGED
@@ -10,7 +10,7 @@ jQuery(document).ready(function ($) {
|
|
10 |
QTags.addButton('wpdiscuz_spoiler', 'spoiler', '[spoiler title=" "]', '[/spoiler]', '', 'Spoiler', 115);
|
11 |
quicktags(settings);
|
12 |
|
13 |
-
$(document).
|
14 |
var uniqueId = 'wc-textarea-' + wpdiscuzGetUniqueId($(this));
|
15 |
if (uniqueId) {
|
16 |
var settings = {
|
10 |
QTags.addButton('wpdiscuz_spoiler', 'spoiler', '[spoiler title=" "]', '[/spoiler]', '', 'Spoiler', 115);
|
11 |
quicktags(settings);
|
12 |
|
13 |
+
$(document).on('click', '.wpd-reply-button', function () {
|
14 |
var uniqueId = 'wc-textarea-' + wpdiscuzGetUniqueId($(this));
|
15 |
if (uniqueId) {
|
16 |
var settings = {
|
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.1.
|
6 |
* Author: gVectors Team
|
7 |
* Author URI: https://gvectors.com/
|
8 |
* Plugin URI: https://wpdiscuz.com/
|
@@ -148,6 +148,8 @@ class WpdiscuzCore implements WpDiscuzConstants {
|
|
148 |
add_filter("auto_update_plugin", [&$this, "shouldUpdate"], 10, 2);
|
149 |
|
150 |
add_filter("preprocess_comment", [&$this, "validateRecaptcha"], 10, 2);
|
|
|
|
|
151 |
}
|
152 |
|
153 |
public static function getInstance() {
|
@@ -1057,15 +1059,24 @@ class WpdiscuzCore implements WpDiscuzConstants {
|
|
1057 |
wp_register_script("wpdiscuz-contenthover", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/contenthover/jquery.contenthover.min.js"), ["jquery"], $this->version, true);
|
1058 |
wp_enqueue_script("wpdiscuz-contenthover");
|
1059 |
|
1060 |
-
if (isset($_GET["page"])
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
1067 |
-
|
1068 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1069 |
}
|
1070 |
} else if ($pagenow === "comment.php") {
|
1071 |
wp_register_style("wpdiscuz-options-css", plugins_url(WPDISCUZ_DIR_NAME . "/assets/css/wpdiscuz-options.css"), null, $this->version);
|
@@ -1308,6 +1319,10 @@ class WpdiscuzCore implements WpDiscuzConstants {
|
|
1308 |
if (version_compare($this->version, "7.0.3", "<") && version_compare($this->version, "1.0.0", "!=")) {
|
1309 |
$this->dbManager->alterSubscriptionTable();
|
1310 |
}
|
|
|
|
|
|
|
|
|
1311 |
do_action("wpdiscuz_clean_all_caches", $pluginData["Version"], $this->version);
|
1312 |
}
|
1313 |
do_action("wpdiscuz_check_version");
|
@@ -1577,7 +1592,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
|
|
1577 |
"is_share_enabled" => $this->options->isShareEnabled(),
|
1578 |
"post_permalink" => $post_permalink,
|
1579 |
"can_user_reply" => comments_open($post->ID) && $this->options->wp["threadComments"] && (($this->form ? $this->form->isUserCanComment($currentUser, $postId) : true) || $high_level_user) && !(class_exists("WooCommerce") && get_post_type($post) === "product" && !$replyForWoo),
|
1580 |
-
"can_user_follow" => $this->options->subscription["isFollowActive"] && $isUserLoggedIn && !empty($currentUserEmail),
|
1581 |
"can_user_vote" => $currentUser->ID || $this->options->thread_layouts["isGuestCanVote"],
|
1582 |
"wpd_stick_btn" => $this->options->moderation["enableStickButton"] && ($high_level_user || $can_stick_or_close) ? "<span class='wpd_stick_btn wpd-cta-button'>%s</span>" : "",
|
1583 |
"wpd_close_btn" => $this->options->moderation["enableCloseButton"] && ($high_level_user || $can_stick_or_close) ? "<span class='wpd_close_btn wpd-cta-button'>%s</span>" : "",
|
@@ -2234,6 +2249,72 @@ class WpdiscuzCore implements WpDiscuzConstants {
|
|
2234 |
return $commentdata;
|
2235 |
}
|
2236 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2237 |
}
|
2238 |
|
2239 |
$wpdiscuz = wpDiscuz();
|
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.1.4
|
6 |
* Author: gVectors Team
|
7 |
* Author URI: https://gvectors.com/
|
8 |
* Plugin URI: https://wpdiscuz.com/
|
148 |
add_filter("auto_update_plugin", [&$this, "shouldUpdate"], 10, 2);
|
149 |
|
150 |
add_filter("preprocess_comment", [&$this, "validateRecaptcha"], 10, 2);
|
151 |
+
|
152 |
+
add_action("admin_bar_menu", [&$this, "addToolbarItems"], 300);
|
153 |
}
|
154 |
|
155 |
public static function getInstance() {
|
1059 |
wp_register_script("wpdiscuz-contenthover", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/contenthover/jquery.contenthover.min.js"), ["jquery"], $this->version, true);
|
1060 |
wp_enqueue_script("wpdiscuz-contenthover");
|
1061 |
|
1062 |
+
if (isset($_GET["page"])) {
|
1063 |
+
if ($_GET["page"] === self::PAGE_WPDISCUZ) {
|
1064 |
+
wp_register_style("wpdiscuz-easy-responsive-tabs-css", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/easy-responsive-tabs/css/easy-responsive-tabs.min.css"), null, $this->version);
|
1065 |
+
wp_enqueue_style("wpdiscuz-easy-responsive-tabs-css");
|
1066 |
+
wp_register_script("wpdiscuz-easy-responsive-tabs-js", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/easy-responsive-tabs/js/easy-responsive-tabs.js"), ["jquery"], $this->version, true);
|
1067 |
+
wp_enqueue_script("wpdiscuz-easy-responsive-tabs-js");
|
1068 |
+
wp_register_script("wpdiscuz-jquery-cookie", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/wpdccjs/wpdcc.js"), ["jquery"], $this->version, true);
|
1069 |
+
wp_enqueue_script("wpdiscuz-jquery-cookie");
|
1070 |
+
wp_register_script("wpdiscuz-chart-js", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/chart/chart.min.js"), [], $this->version, true);
|
1071 |
+
wp_enqueue_script("wpdiscuz-chart-js");
|
1072 |
+
} else if ($_GET["page"] === self::PAGE_PHRASES) {
|
1073 |
+
wp_register_style("wpdiscuz-easy-responsive-tabs-css", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/easy-responsive-tabs/css/easy-responsive-tabs.min.css"), null, $this->version);
|
1074 |
+
wp_enqueue_style("wpdiscuz-easy-responsive-tabs-css");
|
1075 |
+
wp_register_script("wpdiscuz-easy-responsive-tabs-js", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/easy-responsive-tabs/js/easy-responsive-tabs.js"), ["jquery"], $this->version, true);
|
1076 |
+
wp_enqueue_script("wpdiscuz-easy-responsive-tabs-js");
|
1077 |
+
wp_register_script("wpdiscuz-jquery-cookie", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/wpdccjs/wpdcc.js"), ["jquery"], $this->version, true);
|
1078 |
+
wp_enqueue_script("wpdiscuz-jquery-cookie");
|
1079 |
+
}
|
1080 |
}
|
1081 |
} else if ($pagenow === "comment.php") {
|
1082 |
wp_register_style("wpdiscuz-options-css", plugins_url(WPDISCUZ_DIR_NAME . "/assets/css/wpdiscuz-options.css"), null, $this->version);
|
1319 |
if (version_compare($this->version, "7.0.3", "<") && version_compare($this->version, "1.0.0", "!=")) {
|
1320 |
$this->dbManager->alterSubscriptionTable();
|
1321 |
}
|
1322 |
+
if (version_compare($this->version, "7.1.4", "<") && version_compare($this->version, "1.0.0", "!=")) {
|
1323 |
+
$showRatingRebuildMsg = intval($this->dbManager->showRatingRebuildMsg());
|
1324 |
+
add_option(self::OPTION_SLUG_SHOW_RATING_REBUIL_MSG, ($showRatingRebuildMsg ? "1" : "0"), "", "no");
|
1325 |
+
}
|
1326 |
do_action("wpdiscuz_clean_all_caches", $pluginData["Version"], $this->version);
|
1327 |
}
|
1328 |
do_action("wpdiscuz_check_version");
|
1592 |
"is_share_enabled" => $this->options->isShareEnabled(),
|
1593 |
"post_permalink" => $post_permalink,
|
1594 |
"can_user_reply" => comments_open($post->ID) && $this->options->wp["threadComments"] && (($this->form ? $this->form->isUserCanComment($currentUser, $postId) : true) || $high_level_user) && !(class_exists("WooCommerce") && get_post_type($post) === "product" && !$replyForWoo),
|
1595 |
+
"can_user_follow" => $this->options->subscription["isFollowActive"] && $isUserLoggedIn && !empty($currentUserEmail) && $this->helper->isUserCanFollowOrSubscribe($currentUserEmail),
|
1596 |
"can_user_vote" => $currentUser->ID || $this->options->thread_layouts["isGuestCanVote"],
|
1597 |
"wpd_stick_btn" => $this->options->moderation["enableStickButton"] && ($high_level_user || $can_stick_or_close) ? "<span class='wpd_stick_btn wpd-cta-button'>%s</span>" : "",
|
1598 |
"wpd_close_btn" => $this->options->moderation["enableCloseButton"] && ($high_level_user || $can_stick_or_close) ? "<span class='wpd_close_btn wpd-cta-button'>%s</span>" : "",
|
2249 |
return $commentdata;
|
2250 |
}
|
2251 |
|
2252 |
+
public function addToolbarItems($admin_bar){
|
2253 |
+
if ($this->isWpdiscuzLoaded && current_user_can("manage_options")) {
|
2254 |
+
$admin_bar->add_menu([
|
2255 |
+
"id" => self::PAGE_WPDISCUZ,
|
2256 |
+
"title" => "wpDiscuz",
|
2257 |
+
"href" => esc_url_raw(admin_url("admin.php?page=" . WpdiscuzCore::PAGE_WPDISCUZ)),
|
2258 |
+
"meta" => [
|
2259 |
+
"title" => "wpDiscuz",
|
2260 |
+
"target" => "_blank",
|
2261 |
+
],
|
2262 |
+
]);
|
2263 |
+
$admin_bar->add_menu([
|
2264 |
+
"id" => self::PAGE_WPDISCUZ . "-child",
|
2265 |
+
"parent" => self::PAGE_WPDISCUZ,
|
2266 |
+
"title" => esc_html__("Dashboard", "wpdiscuz"),
|
2267 |
+
"href" => esc_url_raw(admin_url("admin.php?page=" . WpdiscuzCore::PAGE_WPDISCUZ)),
|
2268 |
+
"meta" => [
|
2269 |
+
"title" => esc_html__("Dashboard", "wpdiscuz"),
|
2270 |
+
"target" => "_blank",
|
2271 |
+
],
|
2272 |
+
]);
|
2273 |
+
$admin_bar->add_menu([
|
2274 |
+
"id" => self::PAGE_SETTINGS,
|
2275 |
+
"parent" => self::PAGE_WPDISCUZ,
|
2276 |
+
"title" => esc_html__("Settings", "wpdiscuz"),
|
2277 |
+
"href" => esc_url_raw(admin_url("admin.php?page=" . WpdiscuzCore::PAGE_SETTINGS)),
|
2278 |
+
"meta" => [
|
2279 |
+
"title" => esc_html__("Settings", "wpdiscuz"),
|
2280 |
+
"target" => "_blank",
|
2281 |
+
],
|
2282 |
+
]);
|
2283 |
+
if (!$this->options->general["isUsePoMo"]) {
|
2284 |
+
$admin_bar->add_menu([
|
2285 |
+
"id" => self::PAGE_PHRASES,
|
2286 |
+
"parent" => self::PAGE_WPDISCUZ,
|
2287 |
+
"title" => esc_html__("Phrases", "wpdiscuz"),
|
2288 |
+
"href" => esc_url_raw(admin_url("admin.php?page=" . WpdiscuzCore::PAGE_PHRASES)),
|
2289 |
+
"meta" => [
|
2290 |
+
"title" => esc_html__("Phrases", "wpdiscuz"),
|
2291 |
+
"target" => "_blank",
|
2292 |
+
],
|
2293 |
+
]);
|
2294 |
+
}
|
2295 |
+
$admin_bar->add_menu([
|
2296 |
+
"id" => self::PAGE_TOOLS,
|
2297 |
+
"parent" => self::PAGE_WPDISCUZ,
|
2298 |
+
"title" => esc_html__("Tools", "wpdiscuz"),
|
2299 |
+
"href" => esc_url_raw(admin_url("admin.php?page=" . WpdiscuzCore::PAGE_TOOLS)),
|
2300 |
+
"meta" => [
|
2301 |
+
"title" => esc_html__("Tools", "wpdiscuz"),
|
2302 |
+
"target" => "_blank",
|
2303 |
+
],
|
2304 |
+
]);
|
2305 |
+
$admin_bar->add_menu([
|
2306 |
+
"id" => self::PAGE_ADDONS,
|
2307 |
+
"parent" => self::PAGE_WPDISCUZ,
|
2308 |
+
"title" => esc_html__("Addons", "wpdiscuz"),
|
2309 |
+
"href" => esc_url_raw(admin_url("admin.php?page=" . WpdiscuzCore::PAGE_ADDONS)),
|
2310 |
+
"meta" => [
|
2311 |
+
"title" => esc_html__("Addons", "wpdiscuz"),
|
2312 |
+
"target" => "_blank",
|
2313 |
+
],
|
2314 |
+
]);
|
2315 |
+
}
|
2316 |
+
}
|
2317 |
+
|
2318 |
}
|
2319 |
|
2320 |
$wpdiscuz = wpDiscuz();
|
forms/wpDiscuzForm.php
CHANGED
@@ -543,6 +543,7 @@ class wpDiscuzForm implements wpdFormConst {
|
|
543 |
}
|
544 |
}
|
545 |
update_post_meta($comment->comment_post_ID, self::WPDISCUZ_RATING_COUNT, $postRatings);
|
|
|
546 |
}
|
547 |
|
548 |
private function chagePostSingleRating($metaKey, $commentID, $difference, $postRatings) {
|
543 |
}
|
544 |
}
|
545 |
update_post_meta($comment->comment_post_ID, self::WPDISCUZ_RATING_COUNT, $postRatings);
|
546 |
+
$form->updateSeparateRatingMeta($postRatings, $comment->comment_post_ID);
|
547 |
}
|
548 |
|
549 |
private function chagePostSingleRating($metaKey, $commentID, $difference, $postRatings) {
|
forms/wpdFormAttr/Form.php
CHANGED
@@ -271,6 +271,7 @@ class Form {
|
|
271 |
unset($postRatingMeta[$mettaKey][$oldCommentRating]);
|
272 |
}
|
273 |
update_post_meta($postID, wpdFormConst::WPDISCUZ_RATING_COUNT, $postRatingMeta);
|
|
|
274 |
}
|
275 |
$this->ratings[] = ["metakey" => $mettaKey, "value" => $data];
|
276 |
}
|
@@ -332,6 +333,7 @@ class Form {
|
|
332 |
}
|
333 |
}
|
334 |
update_post_meta($postID, wpdFormConst::WPDISCUZ_RATING_COUNT, $wpdiscuzRatingCount);
|
|
|
335 |
}
|
336 |
}
|
337 |
|
@@ -487,23 +489,12 @@ class Form {
|
|
487 |
$post = get_post($atts["postid"]);
|
488 |
$this->initFormFields();
|
489 |
if ($this->ratingsExists && (($this->wpdOptions->rating["ratingCssOnNoneSingular"] && !is_singular()) || is_singular())) {
|
490 |
-
$wpdiscuzRatingCountMeta = get_post_meta($post->ID, wpdFormConst::WPDISCUZ_RATING_COUNT, true);
|
491 |
-
$wpdiscuzRatingCount = $wpdiscuzRatingCountMeta && is_array($wpdiscuzRatingCountMeta) ? $wpdiscuzRatingCountMeta : [];
|
492 |
$ratingList = [];
|
493 |
-
foreach ($
|
494 |
-
$
|
495 |
-
$
|
496 |
-
|
497 |
-
|
498 |
-
$tempRatingCount += $count;
|
499 |
-
}
|
500 |
-
if ($tempRatingCount <= 0) {
|
501 |
-
$ratingList[$metaKey]["average"] = 0;
|
502 |
-
$ratingList[$metaKey]["count"] = 0;
|
503 |
-
} else {
|
504 |
-
$ratingList[$metaKey]["average"] = round($tempRating / $tempRatingCount, 1);
|
505 |
-
$ratingList[$metaKey]["count"] = $tempRatingCount;
|
506 |
-
}
|
507 |
}
|
508 |
if ($ratingList) {
|
509 |
$atts["show-label"] = filter_var($atts['show-label'], FILTER_VALIDATE_BOOLEAN);
|
@@ -512,8 +503,6 @@ class Form {
|
|
512 |
}
|
513 |
$html .= "<div class='wpdiscuz-post-rating-wrap wpd-custom-field'>";
|
514 |
if (!isset($atts["metakey"]) || $atts["metakey"] === "" || $atts["metakey"] === "all") {
|
515 |
-
$avg = 0;
|
516 |
-
$q = 0;
|
517 |
foreach ($ratingList as $key => $value) {
|
518 |
$html .= $this->getSingleRatingHtml($key, $value, $atts);
|
519 |
}
|
@@ -1532,4 +1521,17 @@ class Form {
|
|
1532 |
return $this->row->allowedFieldsType();
|
1533 |
}
|
1534 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1535 |
}
|
271 |
unset($postRatingMeta[$mettaKey][$oldCommentRating]);
|
272 |
}
|
273 |
update_post_meta($postID, wpdFormConst::WPDISCUZ_RATING_COUNT, $postRatingMeta);
|
274 |
+
$this->updateSeparateRatingMeta($postRatingMeta, $postID);
|
275 |
}
|
276 |
$this->ratings[] = ["metakey" => $mettaKey, "value" => $data];
|
277 |
}
|
333 |
}
|
334 |
}
|
335 |
update_post_meta($postID, wpdFormConst::WPDISCUZ_RATING_COUNT, $wpdiscuzRatingCount);
|
336 |
+
$this->updateSeparateRatingMeta($wpdiscuzRatingCount, $postID);
|
337 |
}
|
338 |
}
|
339 |
|
489 |
$post = get_post($atts["postid"]);
|
490 |
$this->initFormFields();
|
491 |
if ($this->ratingsExists && (($this->wpdOptions->rating["ratingCssOnNoneSingular"] && !is_singular()) || is_singular())) {
|
|
|
|
|
492 |
$ratingList = [];
|
493 |
+
foreach (array_unique($this->ratingsFieldsKey) as $key => $field) {
|
494 |
+
$avg = get_post_meta($post->ID, wpdFormConst::WPDISCUZ_RATING_SEPARATE_AVG . $field, true);
|
495 |
+
$c = get_post_meta($post->ID, wpdFormConst::WPDISCUZ_RATING_SEPARATE_COUNT . $field, true);
|
496 |
+
$ratingList[$field]["average"] = $avg ? $avg : 0;
|
497 |
+
$ratingList[$field]["count"] = $c ? $c : 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
498 |
}
|
499 |
if ($ratingList) {
|
500 |
$atts["show-label"] = filter_var($atts['show-label'], FILTER_VALIDATE_BOOLEAN);
|
503 |
}
|
504 |
$html .= "<div class='wpdiscuz-post-rating-wrap wpd-custom-field'>";
|
505 |
if (!isset($atts["metakey"]) || $atts["metakey"] === "" || $atts["metakey"] === "all") {
|
|
|
|
|
506 |
foreach ($ratingList as $key => $value) {
|
507 |
$html .= $this->getSingleRatingHtml($key, $value, $atts);
|
508 |
}
|
1521 |
return $this->row->allowedFieldsType();
|
1522 |
}
|
1523 |
|
1524 |
+
public function updateSeparateRatingMeta($ratings, $post_id) {
|
1525 |
+
foreach ($ratings as $key => $values) {
|
1526 |
+
$avg = 0;
|
1527 |
+
$c = 0;
|
1528 |
+
foreach ($values as $rating => $count) {
|
1529 |
+
$avg += $rating * $count;
|
1530 |
+
$c += $count;
|
1531 |
+
}
|
1532 |
+
update_post_meta($post_id, wpdFormConst::WPDISCUZ_RATING_SEPARATE_AVG . $key, round($avg / $c, 1));
|
1533 |
+
update_post_meta($post_id, wpdFormConst::WPDISCUZ_RATING_SEPARATE_COUNT . $key, $c);
|
1534 |
+
}
|
1535 |
+
}
|
1536 |
+
|
1537 |
}
|
forms/wpdFormAttr/FormConst/wpdFormConst.php
CHANGED
@@ -15,7 +15,8 @@ interface wpdFormConst {
|
|
15 |
const WPDISCUZ_META_FORMS_FIELDS = "wpdiscuz_form_fields";
|
16 |
const WPDISCUZ_META_FORMS_CSS = "wpd_form_custom_css";
|
17 |
const WPDISCUZ_RATING_COUNT = "wpdiscuz_rating_count";
|
18 |
-
|
|
|
19 |
/* === DEFAULT FIELDS NAMES ===*/
|
20 |
const WPDISCUZ_FORMS_NAME_FIELD = "wc_name";
|
21 |
const WPDISCUZ_FORMS_EMAIL_FIELD = "wc_email";
|
15 |
const WPDISCUZ_META_FORMS_FIELDS = "wpdiscuz_form_fields";
|
16 |
const WPDISCUZ_META_FORMS_CSS = "wpd_form_custom_css";
|
17 |
const WPDISCUZ_RATING_COUNT = "wpdiscuz_rating_count";
|
18 |
+
const WPDISCUZ_RATING_SEPARATE_AVG = "wpdiscuz_post_rating_";
|
19 |
+
const WPDISCUZ_RATING_SEPARATE_COUNT = "wpdiscuz_post_rating_count_";
|
20 |
/* === DEFAULT FIELDS NAMES ===*/
|
21 |
const WPDISCUZ_FORMS_NAME_FIELD = "wc_name";
|
22 |
const WPDISCUZ_FORMS_EMAIL_FIELD = "wc_email";
|
forms/wpdFormAttr/Row.php
CHANGED
@@ -189,6 +189,10 @@ class Row {
|
|
189 |
if (isset($fieldData["meta_key_replace"]) && $fieldData["meta_key_replace"]) {
|
190 |
$sql = $wpdb->prepare("UPDATE `{$wpdb->commentmeta}` SET `meta_key` = %s WHERE `meta_key` = %s", $newKey, $oldKey);
|
191 |
$wpdb->query($sql);
|
|
|
|
|
|
|
|
|
192 |
}
|
193 |
}
|
194 |
|
189 |
if (isset($fieldData["meta_key_replace"]) && $fieldData["meta_key_replace"]) {
|
190 |
$sql = $wpdb->prepare("UPDATE `{$wpdb->commentmeta}` SET `meta_key` = %s WHERE `meta_key` = %s", $newKey, $oldKey);
|
191 |
$wpdb->query($sql);
|
192 |
+
$sql = $wpdb->prepare("UPDATE `{$wpdb->postmeta}` SET `meta_key` = %s WHERE `meta_key` = %s", wpdFormConst::WPDISCUZ_RATING_SEPARATE_AVG . $newKey, wpdFormConst::WPDISCUZ_RATING_SEPARATE_AVG . $oldKey);
|
193 |
+
$wpdb->query($sql);
|
194 |
+
$sql = $wpdb->prepare("UPDATE `{$wpdb->postmeta}` SET `meta_key` = %s WHERE `meta_key` = %s", wpdFormConst::WPDISCUZ_RATING_SEPARATE_COUNT . $newKey, wpdFormConst::WPDISCUZ_RATING_SEPARATE_COUNT . $oldKey);
|
195 |
+
$wpdb->query($sql);
|
196 |
}
|
197 |
}
|
198 |
|
includes/class.WpdiscuzDBManager.php
CHANGED
@@ -220,7 +220,7 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
|
|
220 |
}
|
221 |
|
222 |
public function addEmailNotification($subsriptionId, $postId, $email, $subscriptionType, $confirm = 0) {
|
223 |
-
if (
|
224 |
return false;
|
225 |
}
|
226 |
if ($subscriptionType !== self::SUBSCRIPTION_COMMENT) {
|
@@ -391,6 +391,11 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
|
|
391 |
}
|
392 |
}
|
393 |
|
|
|
|
|
|
|
|
|
|
|
394 |
public function deleteVotes($commnetId) {
|
395 |
if ($cId = intval($commnetId)) {
|
396 |
$sql = $this->db->prepare("DELETE FROM `{$this->usersVoted}` WHERE `comment_id` = %d;", $cId);
|
@@ -787,11 +792,16 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
|
|
787 |
* remove user related follows
|
788 |
* @param type $email the user email who other users following
|
789 |
*/
|
790 |
-
public function
|
791 |
$sql = $this->db->prepare("DELETE FROM `{$this->followUsers}` WHERE `user_email` = %s;", trim($email));
|
792 |
$this->db->query($sql);
|
793 |
}
|
794 |
|
|
|
|
|
|
|
|
|
|
|
795 |
/* === MODAL === */
|
796 |
|
797 |
/* === FOLLOW USER === */
|
@@ -834,7 +844,7 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
|
|
834 |
$followerName = isset($args["follower_name"]) ? trim($args["follower_name"]) : "";
|
835 |
$confirm = isset($args["confirm"]) ? intval($args["confirm"]) : 0;
|
836 |
|
837 |
-
if (
|
838 |
return false;
|
839 |
}
|
840 |
|
@@ -1001,6 +1011,13 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
|
|
1001 |
/* === /Synchronize Commenter Data === */
|
1002 |
/* === Rebuild Ratings === */
|
1003 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1004 |
public function getRebuildRatingsCount() {
|
1005 |
$sql = $this->db->prepare("SELECT COUNT(*) FROM `{$this->db->postmeta}` WHERE `meta_key` = %s", self::POSTMETA_RATING_COUNT);
|
1006 |
return intval($this->db->get_var($sql));
|
@@ -1017,11 +1034,17 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
|
|
1017 |
if ($val) {
|
1018 |
$newValues = [];
|
1019 |
foreach ($val as $k => $v) {
|
1020 |
-
$sql = $this->db->prepare("SELECT COUNT(`cm`.`meta_id`) AS `count`, `cm`.`meta_value` FROM `{$this->db->commentmeta}` AS `cm` INNER JOIN `{$this->db->comments}` AS `c` ON `cm`.`comment_id` = `c`.`comment_ID` WHERE `c`.`comment_post_ID` = %d AND `cm`.`meta_key` = '%s' AND `cm`.`meta_value` IS NOT NULL AND `cm`.`meta_value` != 0 GROUP BY `cm`.`meta_value`", $value["post_id"], $k);
|
1021 |
$values = $this->db->get_results($sql, ARRAY_A);
|
|
|
|
|
1022 |
foreach ($values as $newData) {
|
1023 |
$newValues[$k][$newData["meta_value"]] = $newData["count"];
|
|
|
|
|
1024 |
}
|
|
|
|
|
1025 |
}
|
1026 |
update_post_meta($value["post_id"], self::POSTMETA_RATING_COUNT, $newValues, $val);
|
1027 |
}
|
220 |
}
|
221 |
|
222 |
public function addEmailNotification($subsriptionId, $postId, $email, $subscriptionType, $confirm = 0) {
|
223 |
+
if (!WpdiscuzHelper::isUserCanFollowOrSubscribe($email)) {
|
224 |
return false;
|
225 |
}
|
226 |
if ($subscriptionType !== self::SUBSCRIPTION_COMMENT) {
|
391 |
}
|
392 |
}
|
393 |
|
394 |
+
public function deleteSubscriptionsByEmail($email) {
|
395 |
+
$sql = $this->db->prepare("DELETE FROM `{$this->emailNotification}` WHERE `email` = %s;", trim($email));
|
396 |
+
$this->db->query($sql);
|
397 |
+
}
|
398 |
+
|
399 |
public function deleteVotes($commnetId) {
|
400 |
if ($cId = intval($commnetId)) {
|
401 |
$sql = $this->db->prepare("DELETE FROM `{$this->usersVoted}` WHERE `comment_id` = %d;", $cId);
|
792 |
* remove user related follows
|
793 |
* @param type $email the user email who other users following
|
794 |
*/
|
795 |
+
public function deleteFollowersByEmail($email) {
|
796 |
$sql = $this->db->prepare("DELETE FROM `{$this->followUsers}` WHERE `user_email` = %s;", trim($email));
|
797 |
$this->db->query($sql);
|
798 |
}
|
799 |
|
800 |
+
public function deleteFollowsByEmail($email) {
|
801 |
+
$sql = $this->db->prepare("DELETE FROM `{$this->followUsers}` WHERE `follower_email` = %s;", trim($email));
|
802 |
+
$this->db->query($sql);
|
803 |
+
}
|
804 |
+
|
805 |
/* === MODAL === */
|
806 |
|
807 |
/* === FOLLOW USER === */
|
844 |
$followerName = isset($args["follower_name"]) ? trim($args["follower_name"]) : "";
|
845 |
$confirm = isset($args["confirm"]) ? intval($args["confirm"]) : 0;
|
846 |
|
847 |
+
if (!WpdiscuzHelper::isUserCanFollowOrSubscribe($followerEmail)) {
|
848 |
return false;
|
849 |
}
|
850 |
|
1011 |
/* === /Synchronize Commenter Data === */
|
1012 |
/* === Rebuild Ratings === */
|
1013 |
|
1014 |
+
public function showRatingRebuildMsg() {
|
1015 |
+
$sql = $this->db->prepare("SELECT COUNT(*) FROM `{$this->db->postmeta}` WHERE `meta_key` = %s", self::POSTMETA_RATING_COUNT);
|
1016 |
+
$ratingCount = intval($this->db->get_var($sql));
|
1017 |
+
$separateCount = intval($this->db->get_var("SELECT COUNT(*) FROM `{$this->db->postmeta}` WHERE `meta_key` LIKE '" . self::POSTMETA_RATING_SEPARATE_AVG . "%'"));
|
1018 |
+
return $ratingCount > 0 && $separateCount === 0;
|
1019 |
+
}
|
1020 |
+
|
1021 |
public function getRebuildRatingsCount() {
|
1022 |
$sql = $this->db->prepare("SELECT COUNT(*) FROM `{$this->db->postmeta}` WHERE `meta_key` = %s", self::POSTMETA_RATING_COUNT);
|
1023 |
return intval($this->db->get_var($sql));
|
1034 |
if ($val) {
|
1035 |
$newValues = [];
|
1036 |
foreach ($val as $k => $v) {
|
1037 |
+
$sql = $this->db->prepare("SELECT COUNT(`cm`.`meta_id`) AS `count`, `cm`.`meta_value` FROM `{$this->db->commentmeta}` AS `cm` INNER JOIN `{$this->db->comments}` AS `c` ON `cm`.`comment_id` = `c`.`comment_ID` WHERE `c`.`comment_post_ID` = %d AND `c`.`comment_approved` = '1' AND `cm`.`meta_key` = '%s' AND `cm`.`meta_value` IS NOT NULL AND `cm`.`meta_value` != 0 GROUP BY `cm`.`meta_value`", $value["post_id"], $k);
|
1038 |
$values = $this->db->get_results($sql, ARRAY_A);
|
1039 |
+
$avg = 0;
|
1040 |
+
$c = 0;
|
1041 |
foreach ($values as $newData) {
|
1042 |
$newValues[$k][$newData["meta_value"]] = $newData["count"];
|
1043 |
+
$avg += $newData["meta_value"] * $newData["count"];
|
1044 |
+
$c += $newData["count"];
|
1045 |
}
|
1046 |
+
update_post_meta($value["post_id"], self::POSTMETA_RATING_SEPARATE_AVG . $k, round($avg / $c, 1));
|
1047 |
+
update_post_meta($value["post_id"], self::POSTMETA_RATING_SEPARATE_COUNT . $k, $c);
|
1048 |
}
|
1049 |
update_post_meta($value["post_id"], self::POSTMETA_RATING_COUNT, $newValues, $val);
|
1050 |
}
|
includes/interface.WpDiscuzConstants.php
CHANGED
@@ -18,6 +18,7 @@ interface WpDiscuzConstants {
|
|
18 |
const OPTION_SLUG_WIZARD_COMPLETED = "wpdiscuz_wizard_completed";
|
19 |
const OPTION_SLUG_WIZARD_AFTER_UPDATE = "wpdiscuz_wizard_after_update";
|
20 |
const OPTION_SLUG_WIZARD_SHOW_ADDONS_MSG = "wpdiscuz_wizard_show_addons_msg";
|
|
|
21 |
/* === OPTIONS SLUGS === */
|
22 |
const PAGE_WPDISCUZ = "wpdiscuz";
|
23 |
const PAGE_SETTINGS = "wpdiscuz_options_page";
|
@@ -76,6 +77,8 @@ interface WpDiscuzConstants {
|
|
76 |
const POSTMETA_STATISTICS = "_wpdiscuz_statistics";
|
77 |
const POSTMETA_REACTED = "reacted";
|
78 |
const POSTMETA_RATING_COUNT = "wpdiscuz_rating_count";
|
|
|
|
|
79 |
/* === USER CONTENT === */
|
80 |
const TRS_USER_HASH = "wpdiscuz_user_hash_";
|
81 |
/* === SOCIAL LOGIN */
|
18 |
const OPTION_SLUG_WIZARD_COMPLETED = "wpdiscuz_wizard_completed";
|
19 |
const OPTION_SLUG_WIZARD_AFTER_UPDATE = "wpdiscuz_wizard_after_update";
|
20 |
const OPTION_SLUG_WIZARD_SHOW_ADDONS_MSG = "wpdiscuz_wizard_show_addons_msg";
|
21 |
+
const OPTION_SLUG_SHOW_RATING_REBUIL_MSG = "wpdiscuz_show_rating_rebuild_message";
|
22 |
/* === OPTIONS SLUGS === */
|
23 |
const PAGE_WPDISCUZ = "wpdiscuz";
|
24 |
const PAGE_SETTINGS = "wpdiscuz_options_page";
|
77 |
const POSTMETA_STATISTICS = "_wpdiscuz_statistics";
|
78 |
const POSTMETA_REACTED = "reacted";
|
79 |
const POSTMETA_RATING_COUNT = "wpdiscuz_rating_count";
|
80 |
+
const POSTMETA_RATING_SEPARATE_AVG = "wpdiscuz_post_rating_";
|
81 |
+
const POSTMETA_RATING_SEPARATE_COUNT = "wpdiscuz_post_rating_count_";
|
82 |
/* === USER CONTENT === */
|
83 |
const TRS_USER_HASH = "wpdiscuz_user_hash_";
|
84 |
/* === SOCIAL LOGIN */
|
options/class.WpdiscuzOptions.php
CHANGED
@@ -2276,6 +2276,18 @@ class WpdiscuzOptions implements WpDiscuzConstants {
|
|
2276 |
</div>
|
2277 |
<?php
|
2278 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2279 |
}
|
2280 |
|
2281 |
public function getDefaultFileTypes() {
|
2276 |
</div>
|
2277 |
<?php
|
2278 |
}
|
2279 |
+
if ($wizardCompleted && intval(get_option(self::OPTION_SLUG_SHOW_RATING_REBUIL_MSG))) {
|
2280 |
+
?>
|
2281 |
+
<div class='notice notice-warning'>
|
2282 |
+
<p>
|
2283 |
+
<?php esc_html_e("Please rebuild ratings for the best performance and fastest experience", "wpdiscuz"); ?>
|
2284 |
+
|
2285 |
+
<a href="<?php echo esc_url_raw(admin_url("admin.php?page=" . self::PAGE_TOOLS . "#wpdtool-ratings")); ?>"
|
2286 |
+
class="button button-primary"><?php esc_html_e("Rebuild Ratings", "wpdiscuz"); ?></a>
|
2287 |
+
</p>
|
2288 |
+
</div>
|
2289 |
+
<?php
|
2290 |
+
}
|
2291 |
}
|
2292 |
|
2293 |
public function getDefaultFileTypes() {
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: gVectors Team
|
3 |
Tags: comment, comments, ajax comments, comment form, comment fields
|
4 |
Requires at least: 5.0
|
5 |
-
Tested up to: 5.
|
6 |
-
Stable tag: 7.1.
|
7 |
Requires PHP: 5.4 and higher
|
8 |
License: GPLv3
|
9 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
@@ -179,6 +179,21 @@ Nothing will be lost! **Comments - wpDiscuz** will show all old comments.
|
|
179 |
|
180 |
== Changelog ==
|
181 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
182 |
= Comments - wpDiscuz v7.1.3 =
|
183 |
|
184 |
* Updated: Better protection of AJAX requests
|
2 |
Contributors: gVectors Team
|
3 |
Tags: comment, comments, ajax comments, comment form, comment fields
|
4 |
Requires at least: 5.0
|
5 |
+
Tested up to: 5.7
|
6 |
+
Stable tag: 7.1.4
|
7 |
Requires PHP: 5.4 and higher
|
8 |
License: GPLv3
|
9 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
179 |
|
180 |
== Changelog ==
|
181 |
|
182 |
+
= Comments - wpDiscuz v7.1.4 =
|
183 |
+
|
184 |
+
* Added: WordPress 5.7 compatibility
|
185 |
+
* Added: Keep showing "hide/show replies" button on expending replies
|
186 |
+
* Added: wpDiscuz dashboard and settings menu on the top admin menu
|
187 |
+
* Added: Removes user subscription and follow data when user is deleted
|
188 |
+
* Added: Store post average rating information in _postmeta table
|
189 |
+
* Fixed Bug: wpDiscuz inline commenting and Block editor conflict
|
190 |
+
|
191 |
+
|
192 |
+
**IMPORTANT!**
|
193 |
+
1. Please don't forget delete all caches and purge CDN after the update.
|
194 |
+
2. If you're updating from 5.x.x versions please read this topic: [https://wordpress.org/support/topic/before-updating-to-wpdiscuz-7-version/](https://wordpress.org/support/topic/before-updating-to-wpdiscuz-7-version/)
|
195 |
+
|
196 |
+
|
197 |
= Comments - wpDiscuz v7.1.3 =
|
198 |
|
199 |
* Updated: Better protection of AJAX requests
|
themes/default/class.WpdiscuzWalker.php
CHANGED
@@ -240,7 +240,7 @@ class WpdiscuzWalker extends Walker_Comment implements WpDiscuzConstants {
|
|
240 |
$replace[] = "<i class='far fa-comments'></i>";
|
241 |
$replace[] = esc_html($this->options->phrases["wc_reply_to"]) . " ";
|
242 |
$replace[] = esc_url_raw($parentCommentLink);
|
243 |
-
$replace[] = esc_html($parentCommentUserName);
|
244 |
$showReplyTo = true;
|
245 |
}
|
246 |
|
@@ -334,7 +334,7 @@ class WpdiscuzWalker extends Walker_Comment implements WpDiscuzConstants {
|
|
334 |
$search[] = "{FOLLOW_ICON}";
|
335 |
$replace[] = "wpd-follow-link wpd_not_clicked " . $followClass;
|
336 |
$replace[] = esc_attr($followTip);
|
337 |
-
$replace[] = $args["layout"] == 1 ? (
|
338 |
$replace[] = "<i class='fas fa-rss' aria-hidden='true'></i>";
|
339 |
}
|
340 |
|
@@ -452,7 +452,7 @@ class WpdiscuzWalker extends Walker_Comment implements WpDiscuzConstants {
|
|
452 |
$search[] = "{TOGGLE_ICON}";
|
453 |
$replace[] = "wpd-toggle wpd-hidden wpd_not_clicked";
|
454 |
$replace[] = esc_html($this->options->phrases["wc_show_replies_text"]);
|
455 |
-
$replace[] = "<span class='wpd-view-replies'>" . esc_html($this->options->phrases["wc_show_replies_text"]) . " ($countChildren)</span><i class='fas fa-chevron-down'></i>";
|
456 |
$showToggle = true;
|
457 |
}
|
458 |
} else if ($comment->get_children(["post_id" => $args["post_id"]])) {
|
240 |
$replace[] = "<i class='far fa-comments'></i>";
|
241 |
$replace[] = esc_html($this->options->phrases["wc_reply_to"]) . " ";
|
242 |
$replace[] = esc_url_raw($parentCommentLink);
|
243 |
+
$replace[] = esc_html(apply_filters("wpdiscuz_comment_author", $parentCommentUserName, $parentComment));
|
244 |
$showReplyTo = true;
|
245 |
}
|
246 |
|
334 |
$search[] = "{FOLLOW_ICON}";
|
335 |
$replace[] = "wpd-follow-link wpd_not_clicked " . $followClass;
|
336 |
$replace[] = esc_attr($followTip);
|
337 |
+
$replace[] = $args["layout"] == 1 ? (!is_rtl() ? (wp_is_mobile() ? 'left' : 'right') : (wp_is_mobile() ? 'right' : 'left')) : "top";
|
338 |
$replace[] = "<i class='fas fa-rss' aria-hidden='true'></i>";
|
339 |
}
|
340 |
|
452 |
$search[] = "{TOGGLE_ICON}";
|
453 |
$replace[] = "wpd-toggle wpd-hidden wpd_not_clicked";
|
454 |
$replace[] = esc_html($this->options->phrases["wc_show_replies_text"]);
|
455 |
+
$replace[] = "<span class='wpd-view-replies'><span class='wpd-view-replies-text'>" . esc_html($this->options->phrases["wc_show_replies_text"]) . "</span> ($countChildren)</span><i class='fas fa-chevron-down'></i>";
|
456 |
$showToggle = true;
|
457 |
}
|
458 |
} else if ($comment->get_children(["post_id" => $args["post_id"]])) {
|
themes/default/comment-form.php
CHANGED
@@ -146,9 +146,6 @@ if (!post_password_required($post->ID)) {
|
|
146 |
|
147 |
$wpCommClasses = implode(" ", $wpCommClasses);
|
148 |
|
149 |
-
$isShowSubscribeBar = $form->isShowSubscriptionBar();
|
150 |
-
$isPostmaticActive = !class_exists("Prompt_Comment_Form_Handling") || (class_exists("Prompt_Comment_Form_Handling") && !$wpdiscuz->options->subscription["usePostmaticForCommentNotification"]);
|
151 |
-
|
152 |
$currentUserId = 0;
|
153 |
$currentUserEmail = isset($_COOKIE["comment_author_email_" . COOKIEHASH]) ? $_COOKIE["comment_author_email_" . COOKIEHASH] : "";
|
154 |
if ($currentUser && $currentUser->ID) {
|
@@ -156,6 +153,9 @@ if (!post_password_required($post->ID)) {
|
|
156 |
$currentUserEmail = $currentUser->user_email;
|
157 |
}
|
158 |
|
|
|
|
|
|
|
159 |
$wpdiscuz->helper->superSocializerFix();
|
160 |
if ($commentsOpen) {
|
161 |
if ($formCustomCss = $form->getCustomCSS()) {
|
146 |
|
147 |
$wpCommClasses = implode(" ", $wpCommClasses);
|
148 |
|
|
|
|
|
|
|
149 |
$currentUserId = 0;
|
150 |
$currentUserEmail = isset($_COOKIE["comment_author_email_" . COOKIEHASH]) ? $_COOKIE["comment_author_email_" . COOKIEHASH] : "";
|
151 |
if ($currentUser && $currentUser->ID) {
|
153 |
$currentUserEmail = $currentUser->user_email;
|
154 |
}
|
155 |
|
156 |
+
$isShowSubscribeBar = $form->isShowSubscriptionBar() && WpdiscuzHelper::isUserCanFollowOrSubscribe($currentUserEmail);
|
157 |
+
$isPostmaticActive = !class_exists("Prompt_Comment_Form_Handling") || (class_exists("Prompt_Comment_Form_Handling") && !$wpdiscuz->options->subscription["usePostmaticForCommentNotification"]);
|
158 |
+
|
159 |
$wpdiscuz->helper->superSocializerFix();
|
160 |
if ($commentsOpen) {
|
161 |
if ($formCustomCss = $form->getCustomCSS()) {
|
utils/class.WpdiscuzHelper.php
CHANGED
@@ -7,7 +7,7 @@ class WpdiscuzHelper implements WpDiscuzConstants {
|
|
7 |
|
8 |
private static $spoilerPattern = '@\[(\[?)(spoiler)(?![\w-])([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]*+(?:\[(?!\/\2\])[^\[]*+)*+)\[\/\2\])?)(\]?)@isu';
|
9 |
private static $inlineFormPattern = '@\[(\[?)(wpdiscuz\-feedback)(?![\w-])([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]*+(?:\[(?!\/\2\])[^\[]*+)*+)\[\/\2\])?)(\]?)@isu';
|
10 |
-
private static $inlineFormAttsPattern = '@([\w-]+)\s*=\s*\
|
11 |
private $options;
|
12 |
private $dbManager;
|
13 |
private $wpdiscuzForm;
|
@@ -833,60 +833,60 @@ class WpdiscuzHelper implements WpDiscuzConstants {
|
|
833 |
return $users;
|
834 |
}
|
835 |
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
if ($atts["question"] !== $inlineFormsBefore[$atts["id"]]["question"] || $atts["opened"] !== $inlineFormsBefore[$atts["id"]]["opened"] || $atts["content"] !== $inlineFormsBefore[$atts["id"]]["content"]) {
|
871 |
$this->dbManager->updateFeedbackForm($post_ID, $atts["id"], $atts["question"], $atts["opened"], $atts["content"]);
|
872 |
}
|
873 |
-
|
874 |
$this->dbManager->addFeedbackForm($post_ID, $atts["id"], $atts["question"], $atts["opened"], $atts["content"]);
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
|
891 |
public function getCommentFormPath($theme) {
|
892 |
if (file_exists(get_stylesheet_directory() . "/wpdiscuz/comment-form.php")) {
|
@@ -995,6 +995,10 @@ class WpdiscuzHelper implements WpDiscuzConstants {
|
|
995 |
return $content;
|
996 |
}
|
997 |
|
|
|
|
|
|
|
|
|
998 |
public function addRatingResetButton($postType, $post) {
|
999 |
$form = $this->wpdiscuzForm->getForm($post->ID);
|
1000 |
if ($form->getFormID() && ($form->getEnableRateOnPost() || $form->getRatingsExists())) {
|
7 |
|
8 |
private static $spoilerPattern = '@\[(\[?)(spoiler)(?![\w-])([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]*+(?:\[(?!\/\2\])[^\[]*+)*+)\[\/\2\])?)(\]?)@isu';
|
9 |
private static $inlineFormPattern = '@\[(\[?)(wpdiscuz\-feedback)(?![\w-])([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]*+(?:\[(?!\/\2\])[^\[]*+)*+)\[\/\2\])?)(\]?)@isu';
|
10 |
+
private static $inlineFormAttsPattern = '@([\w-]+)\s*=\s*\'([^\']*)\'(?:\s|$)|([\w-]+)\s*=\s*\'([^\']*)\'(?:\s|$)|([\w-]+)\s*=\s*([^\s\']+)(?:\s|$)|\'([^\']*)\'(?:\s|$)|\'([^\']*)\'(?:\s|$)|(\S+)(?:\s|$)@isu';
|
11 |
private $options;
|
12 |
private $dbManager;
|
13 |
private $wpdiscuzForm;
|
833 |
return $users;
|
834 |
}
|
835 |
|
836 |
+
public function checkFeedbackShortcodes($post_ID, $post_after, $post_before) {
|
837 |
+
if (comments_open($post_ID) && ($form = $this->wpdiscuzForm->getForm($post_ID)) && $form->getFormID()) {
|
838 |
+
preg_match_all(self::$inlineFormPattern, $post_before->post_content, $matchesBefore, PREG_SET_ORDER);
|
839 |
+
preg_match_all(self::$inlineFormPattern, $post_after->post_content, $matchesAfter, PREG_SET_ORDER);
|
840 |
+
if ($matchesAfter || $matchesBefore) {
|
841 |
+
$inlineFormsBefore = [];
|
842 |
+
$defaultAtts = ["id" => "", "question" => "", "opened" => 0, "content" => ""];
|
843 |
+
foreach ($matchesBefore as $k => $matchBefore) {
|
844 |
+
if (isset($matchBefore[3]) && preg_match_all(self::$inlineFormAttsPattern, $matchBefore[3], $attsBefore, PREG_SET_ORDER)) {
|
845 |
+
$atts = [];
|
846 |
+
foreach ($attsBefore as $k1 => $attrBefore) {
|
847 |
+
$atts[$attrBefore[1]] = $attrBefore[2];
|
848 |
+
}
|
849 |
+
$atts = array_merge($defaultAtts, $atts);
|
850 |
+
if (($atts["id"] = trim($atts["id"])) && ($atts["question"] = strip_tags($atts["question"]))) {
|
851 |
+
$inlineFormsBefore[$atts["id"]] = ["question" => $atts["question"], "opened" => $atts["opened"], "content" => $matchBefore[5]];
|
852 |
+
}
|
853 |
+
}
|
854 |
+
}
|
855 |
+
foreach ($matchesAfter as $k => $matchAfter) {
|
856 |
+
if (isset($matchAfter[3])) {
|
857 |
+
if (function_exists("use_block_editor_for_post") && use_block_editor_for_post($post_ID)) {
|
858 |
+
$matchAfter[3] = json_decode('"' . str_replace('\"', "'", addslashes($matchAfter[3])) . '"');
|
859 |
+
}
|
860 |
+
if (preg_match_all(self::$inlineFormAttsPattern, $matchAfter[3], $attsAfter, PREG_SET_ORDER)) {
|
861 |
+
$atts = [];
|
862 |
+
foreach ($attsAfter as $k1 => $attrAfter) {
|
863 |
+
$atts[$attrAfter[1]] = $attrAfter[2];
|
864 |
+
}
|
865 |
+
$atts["content"] = $matchAfter[5];
|
866 |
+
$atts = array_merge($defaultAtts, $atts);
|
867 |
+
if (($atts["id"] = trim($atts["id"])) && ($atts["question"] = strip_tags($atts["question"]))) {
|
868 |
+
if (isset($inlineFormsBefore[$atts["id"]])) {
|
869 |
+
if ($this->dbManager->getFeedbackFormByUid($post_ID, $atts["id"])) {
|
870 |
if ($atts["question"] !== $inlineFormsBefore[$atts["id"]]["question"] || $atts["opened"] !== $inlineFormsBefore[$atts["id"]]["opened"] || $atts["content"] !== $inlineFormsBefore[$atts["id"]]["content"]) {
|
871 |
$this->dbManager->updateFeedbackForm($post_ID, $atts["id"], $atts["question"], $atts["opened"], $atts["content"]);
|
872 |
}
|
873 |
+
} else {
|
874 |
$this->dbManager->addFeedbackForm($post_ID, $atts["id"], $atts["question"], $atts["opened"], $atts["content"]);
|
875 |
+
}
|
876 |
+
unset($inlineFormsBefore[$atts["id"]]);
|
877 |
+
} else {
|
878 |
+
$this->dbManager->addFeedbackForm($post_ID, $atts["id"], $atts["question"], $atts["opened"], $atts["content"]);
|
879 |
+
}
|
880 |
+
}
|
881 |
+
}
|
882 |
+
}
|
883 |
+
}
|
884 |
+
foreach ($inlineFormsBefore as $uid => $inlineFormBefore) {
|
885 |
+
$this->dbManager->deleteFeedbackForm($post_ID, $uid);
|
886 |
+
}
|
887 |
+
}
|
888 |
+
}
|
889 |
+
}
|
890 |
|
891 |
public function getCommentFormPath($theme) {
|
892 |
if (file_exists(get_stylesheet_directory() . "/wpdiscuz/comment-form.php")) {
|
995 |
return $content;
|
996 |
}
|
997 |
|
998 |
+
public static function isUserCanFollowOrSubscribe($email) {
|
999 |
+
return !in_array(strstr($email, "@"), ["@facebook.com", "@twitter.com", "@ok.ru", "@wechat.com", "@qq.com", "@weibo.com", "@baidu.com", "@example.com",]);
|
1000 |
+
}
|
1001 |
+
|
1002 |
public function addRatingResetButton($postType, $post) {
|
1003 |
$form = $this->wpdiscuzForm->getForm($post->ID);
|
1004 |
if ($form->getFormID() && ($form->getEnableRateOnPost() || $form->getRatingsExists())) {
|
utils/class.WpdiscuzHelperAjax.php
CHANGED
@@ -574,9 +574,13 @@ class WpdiscuzHelperAjax implements WpDiscuzConstants {
|
|
574 |
$progress = $step * $limit * 100 / $rebuildRatingsCount;
|
575 |
$response["progress"] = ($p = intval($progress)) > 100 ? 100 : $p;
|
576 |
$response["startId"] = $rebuildRatingsData[count($rebuildRatingsData) - 1]["meta_id"];
|
|
|
|
|
|
|
577 |
} else {
|
578 |
$response["progress"] = 100;
|
579 |
$response["startId"] = 0;
|
|
|
580 |
}
|
581 |
$response["step"] = $step;
|
582 |
}
|
@@ -1066,6 +1070,8 @@ class WpdiscuzHelperAjax implements WpDiscuzConstants {
|
|
1066 |
if ($postMeta) {
|
1067 |
foreach ($postMeta as $key => $value) {
|
1068 |
$this->dbManager->deleteCommentMeta($key);
|
|
|
|
|
1069 |
}
|
1070 |
update_post_meta($postId, self::POSTMETA_RATING_COUNT, []);
|
1071 |
}
|
574 |
$progress = $step * $limit * 100 / $rebuildRatingsCount;
|
575 |
$response["progress"] = ($p = intval($progress)) > 100 ? 100 : $p;
|
576 |
$response["startId"] = $rebuildRatingsData[count($rebuildRatingsData) - 1]["meta_id"];
|
577 |
+
if ($response["progress"] == 100) {
|
578 |
+
update_option(self::OPTION_SLUG_SHOW_RATING_REBUIL_MSG, "0");
|
579 |
+
}
|
580 |
} else {
|
581 |
$response["progress"] = 100;
|
582 |
$response["startId"] = 0;
|
583 |
+
update_option(self::OPTION_SLUG_SHOW_RATING_REBUIL_MSG, "0");
|
584 |
}
|
585 |
$response["step"] = $step;
|
586 |
}
|
1070 |
if ($postMeta) {
|
1071 |
foreach ($postMeta as $key => $value) {
|
1072 |
$this->dbManager->deleteCommentMeta($key);
|
1073 |
+
update_post_meta($postId, self::POSTMETA_RATING_SEPARATE_AVG . $key, 0);
|
1074 |
+
update_post_meta($postId, self::POSTMETA_RATING_SEPARATE_COUNT . $key, 0);
|
1075 |
}
|
1076 |
update_post_meta($postId, self::POSTMETA_RATING_COUNT, []);
|
1077 |
}
|
utils/class.WpdiscuzHelperOptimization.php
CHANGED
@@ -156,6 +156,8 @@ class WpdiscuzHelperOptimization implements WpDiscuzConstants {
|
|
156 |
public function deleteUserRelatedData($id, $reassign) {
|
157 |
$user = get_user_by("id", $id);
|
158 |
if ($user && $user->user_email) {
|
|
|
|
|
159 |
$this->dbManager->deleteFollowsByEmail($user->user_email);
|
160 |
}
|
161 |
$this->dbManager->deleteUserVotes($id);
|
156 |
public function deleteUserRelatedData($id, $reassign) {
|
157 |
$user = get_user_by("id", $id);
|
158 |
if ($user && $user->user_email) {
|
159 |
+
$this->dbManager->deleteSubscriptionsByEmail($user->user_email);
|
160 |
+
$this->dbManager->deleteFollowersByEmail($user->user_email);
|
161 |
$this->dbManager->deleteFollowsByEmail($user->user_email);
|
162 |
}
|
163 |
$this->dbManager->deleteUserVotes($id);
|