Comments – wpDiscuz - Version 7.3.5

Version Description

Download this release

Release Info

Developer AdvancedCoding
Plugin Icon 128x128 Comments – wpDiscuz
Version 7.3.5
Comparing to
See all releases

Code changes from version 7.3.4 to 7.3.5

assets/js/wpdiscuz-combo-no_quill.min.js CHANGED
@@ -3,11 +3,11 @@
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,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;").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,a){var o="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?o="wpdiscuz-message-success":"warning"===t[n]&&(o="wpdiscuz-message-warning"):"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(a instanceof Array?a[n]:a||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e).prependTo("#wpdiscuz-comment-message").delay(a||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},wpdiscuzAjaxObj.applyFilterOnPhrase=function(e,t,a){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,function(o){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]]&&(e=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]](e,t,a))}),e},jQuery(document).ready(function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType),s=parseInt(wpdiscuzAjaxObj.wc_post_id),d=wpdiscuzAjaxObj.wpdiscuz_nonce,c=parseInt(wpdiscuzAjaxObj.commentListUpdateType),p=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer),r=parseInt(wpdiscuzAjaxObj.liveUpdateGuests),l=wpdiscuzAjaxObj.loadLastCommentId,m=l,w=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 u,f=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate),h=wpdiscuzAjaxObj.storeCommenterData,b=parseInt(wpdiscuzAjaxObj.wmuEnabled),_=wpdiscuzAjaxObj.isCookiesEnabled,g=!0,z=wpdiscuzAjaxObj.cookiehash,v=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),j=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,x=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),C=parseInt(wpdiscuzAjaxObj.enableBubble),k=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),y=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),O=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,A=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),I=wpdiscuzAjaxObj.bubbleLocation,T=wpdiscuzAjaxObj.inlineFeedbackAttractionType,D=(D=parseInt(wpdiscuzAjaxObj.scrollSize))||32,F=[],E=[],M=[],L=!1,R=1,S=e("html").css("scroll-behavior"),P=e("body").css("scroll-behavior");(e(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?e(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .the_champ_login_container").length?e(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .social_connect_form").length?e(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&e(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",function(t){var a=e(".wpd-form").not(":hidden");if(a.length)if(wpdiscuzLoadRichEditor){for(var o=0;o<a.length;o++)if("\n"!==wpDiscuzEditor.createEditor(e(a[o]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(o=0;o<a.length;o++)if(e(a[o]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")}),wpdiscuzLoadRichEditor||(e(document).delegate("textarea.wc_comment","input",function(){ue(e(this))}),e.each(e("textarea.wc_comment"),function(){ue(e(this))})),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(j)}),e(document).on("focus","#wpdcom textarea",function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()}),t)||W({comment_author:Cookies.get("comment_author_"+z),comment_author_email:Cookies.get("comment_author_email_"+z),comment_author_url:Cookies.get("comment_author_url_"+z)});if(e(".wpd-vote-down.wpd-dislike-hidden").remove(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),e(document).on("click","#wpd-editor-source-code-wrapper-bg",function(){e(this).hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")}),wpdiscuzLoadRichEditor&&e(document).on("click","#wpd-insert-source-code",function(){var t=wpDiscuzEditor.createEditor("#"+e("#wpd-editor-uid").val());t.deleteText(0,t.getLength(),Quill.sources.USER);var a=e("#wpd-editor-source-code").val();a.length&&t.clipboard.dangerouslyPasteHTML(0,a,Quill.sources.USER),t.update(),e("#wpd-editor-source-code-wrapper-bg").hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")}),e(document).on("click",".wpd-reply-button",function(){var i=Y(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()},j):setTimeout(function(){e("#wc-textarea-"+i).trigger("focus")},j),e("#wpd-secondary-form-wrapper-"+i).slideToggle(j)):function(a){var o=Y(a,0);e("#wpdiscuz_form_anchor-"+o).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(o));var n=e("#wpd-secondary-form-wrapper-"+o);if(!t){var i={comment_author:Cookies.get("comment_author_"+z),comment_author_email:Cookies.get("comment_author_email_"+z),comment_author_url:Cookies.get("comment_author_url_"+z)};W(i)}wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+o).focus()},j):setTimeout(function(){e("#wc-textarea-"+o).trigger("focus")},j);n.slideToggle(j,function(){a.addClass("wpdiscuz-clonned")})}(e(this)),function(t){if((a||o)&&"2.0"===n){var i=J(t);setTimeout(function(){if(!E[i])try{E[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){e("#wpdiscuz-recaptcha-field-"+t).val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-"+t).val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3)}}(i)}),e(document).on("click","#wpdcom .wpd-comment-link [data-comment-url]",function(){var t=e(this).data("comment-url"),a=e("<input/>");a.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),a.trigger("select"),document.execCommand("copy"),a.remove(),wpdiscuzAjaxObj.setCommentMessage(t+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)}),e(document).on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",function(e){e.preventDefault()}),e(document).on("click",".wpd-toggle.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked");var a=Y(e(this),0),o=e(this),n=e(".fas",o);!o.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&v?function(t,a){var o=J(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",o),he(x,!0,n).done(function(o){a.addClass("wpd_not_clicked"),"object"==typeof o&&o.success&&(e("#wpd-comm-"+t).replaceWith(o.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle .wpd-view-replies .wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),e("#wpd-comm-"+t+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),fe(o)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,n){console.log(n),a.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}(a,t):e("#wpd-comm-"+a+"> .wpd-reply").slideToggle(700,function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),o.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),o.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),t.addClass("wpd_not_clicked")})}),e(document).on("mouseenter",".wpd-new-loaded-comment",function(){e(this).removeClass("wpd-new-loaded-comment")}),e(document).on("click",".wpd-sbs-toggle",function(){e(".wpdiscuz-subscribe-bar").slideToggle(j)}),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm)&&!t&&wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&e("#wpdiscuz-subscribe-form").length&&("2.0"===n?(setTimeout(function(){try{grecaptcha.render("wpdiscuz-recaptcha-subscribe-form",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-subscribe-form").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val()?e(".wpdiscuz-recaptcha",e(this)).css("border","none"):(e(".wpdiscuz-recaptcha",e(this)).css("border","1px solid red"),t.preventDefault())})):"3.0"===n&&e(document).on("click","#wpdiscuz_subscription_button",function(t){var a=e(this).parents("#wpdiscuz-subscribe-form");t.preventDefault();try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then(function(e){console.log(5555),document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=e,a.trigger("submit")},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}})),(a||o)&&"2.0"===n){var q=e(window).width(),H=e("#wpdcom").width();H>=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%"})),H>=940&&H<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%"})),H>=810&&H<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%"})),H>=730&&H<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%"})),H>=610&&H<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%"})),q>650&&(H>=510&&H<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"})),H>=470&&H<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"})),H<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 U(t,a,o){he(x||b,!1,a).done(function(a){if(e(o).addClass("wpd_not_clicked"),"object"==typeof a)if(a.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(j),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),e(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html);var n=j;a.data.is_main?ie(a.data.message):(n=j+700,e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).slideToggle(700),1==a.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).after(a.data.message):e("#wpd-comm-"+a.data.uniqueid).after(a.data.message)),function(e){if(!e.data.held_moderate){var t=new FormData;t.append("action","wpdCheckNotificationType"),t.append("comment_id",e.data.new_comment_id),t.append("email",e.data.comment_author_email),t.append("isParent",e.data.is_main),he(x,!0,t)}}(a),function(e){if(e.data.redirect>0&&e.data.new_comment_id){var t=new FormData;t.append("action","wpdRedirect"),t.append("commentId",e.data.new_comment_id),he(x,!0,t).done(function(e){"object"==typeof e&&e.success&&setTimeout(function(){location.href=e.data},2e3)}).fail(function(e,t,a){console.log(a)})}}(a),_&&g?function(t){var a=t.comment_author_email,o=t.comment_author,n=t.comment_author_url;null==h?(Cookies.set("comment_author_email_"+z,a),Cookies.set("comment_author_"+z,o),n.length&&Cookies.set("comment_author_url_"+z,n)):(h=parseInt(h),Cookies.set("comment_author_email_"+z,a,{expires:h,path:"/"}),Cookies.set("comment_author_"+z,o,{expires:h,path:"/"}),n.length&&Cookies.set("comment_author_url_"+z,n,{expires:h,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(a.data):g||e(".wpd-cookies-checkbox").prop("checked",!1),t.get(0).reset(),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]):ue(t.find(".wc_comment")),W(a.data),e(".wmu-preview-wrap",t).remove(),F.length&&(F.forEach(function(e){e.parents(".wpd-field-checkbox").remove()}),F=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){oe(),e("html, body").animate({scrollTop:e("#comment-"+a.data.new_comment_id).offset().top-D},1e3,ne)},n),fe(a,t)}else a.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"),fe(a,t));else wpdiscuzAjaxObj.setCommentMessage(a,"error");e("#wpdiscuz-loading-bar").fadeOut(250),L=!1}).fail(function(t,a,n){console.log(n),e(o).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}function W(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 V(t,a){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(a),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}e(document).on("click",".wc_comm_submit.wpd_not_clicked",function(){var i=e(this),s=1,d=e(this).parents("form");if(d.hasClass("wpd_main_comm_form")||(s=function(t){var a=t.attr("class").split(" "),o="";return e.each(a,function(e,t){"wpd_comment_level"===Z(t,!1)&&(o=Z(t,!0))}),parseInt(o)+1}(e(this).parents(".wpd-comment"))),ae(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)){L=!0,function(t){e(".wpd-agreement-checkbox",t).each(function(){e(this).hasClass("wpd_agreement_hide")&&_&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+z,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each(function(){F.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")||(g=!1):t&&(g=!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),U(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 U(d,c,i)}var p,r;!function(e){if((a||o)&&"2.0"===n){var t=J(e);grecaptcha.reset(E[t])}}(e(".wpdiscuz_unique_id",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wc_msg_required_fields,"wc_msg_required_fields",d),"error")}),e(document).on("click",".wpd_editable_comment",function(){u&&e(".wpdiscuz-edit-form-wrap").length&&V(Y(e(".wpdiscuz-edit-form-wrap"),0),u);var t=e(this),a=Y(t,0),o=J(a),n=new FormData;n.append("action","wpdEditComment"),n.append("commentId",o),u=e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-text").get(0),he(x,!0,n).done(function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){var n=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+a);n.clipboard.dangerouslyPasteHTML(0,o.data.content),n.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+a).val(o.data.content),ue(e("#wc-textarea-edit_"+a));e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wc_save_edited_comment",function(){var t=e(this),a=Y(t),o=J(a),n=e("#wpd-comm-"+a+" #wpdiscuz-edit-form");if(ae(n,"#wpd-editor-edit_"+a),n.on("submit",function(e){e.preventDefault()}),n[0].checkValidity()){var i=new FormData;i.append("action","wpdSaveEditedComment"),i.append("commentId",o),e(":input",n).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&i.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&i.append(this.name+"",e(this).val())}),he(x,!0,i).done(function(n){"object"==typeof n?(n.success?(V(a,n.data.message),n.data.lastEdited&&(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(n.data.lastEdited).insertAfter("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),n.data.twitterShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",n.data.twitterShareLink),n.data.whatsappShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",n.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error"),fe(n,o)):console.log(n),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=Y(e(this));V(t,u),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!f&&w&&(R=0,1==w?setTimeout(function(){Q(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),Q(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&Q(!1,t,"wpd-loaded","wpd-loading")});var B=!1;function K(){var t=e("#wpdiscuzHasMoreComments").val(),a=e(document).height(),o=e(window).height()+e(window).scrollTop();a&&o&&(100*o/a>=80&&!1===B&&1==t&&(B=!0,Q(!1,e(".wpd-load-more-submit"))))}function Q(t,a,o,n){a&&(a.toggleClass(o),a.toggleClass(n));var s=new FormData;s.append("action","wpdLoadMoreComments");var d=e(".wpdiscuz-sort-button-active").attr("data-sorting");d&&s.append("sorting",d),s.append("offset",R),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||""),he(x,!t||1!=w,s).done(function(s){"object"==typeof s&&s.success&&(R++,t&&e(".wpd-comment").remove(),e(".wpdiscuz_single").remove(),e(".wpdiscuz-comment-pagination").before(s.data.comment_list),N(s,t&&2!==i),B=!1,s.data.loadLastCommentId&&(l=s.data.loadLastCommentId),fe(s),t&&G(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))}).fail(function(t,i,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))})}function N(t,a){var o;0==t.data.is_show_load_more?(e("#wpdiscuzHasMoreComments").val(0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()):(o=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",o),2!==i&&e(".wpdiscuz-comment-pagination").show(),e("#wpdiscuzHasMoreComments").val(1),a&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show()),fe(t)}function G(t){var a=location.href.match(/#comment\-(\d+)/);if(null!==a){var o=a[1];if(e("#comment-"+o).length)setTimeout(function(){oe(),e("html, body").animate({scrollTop:e("#comment-"+o).parents("[id^=wpd-comm-]").offset().top-D},1e3,ne),t&&$(o)},500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",o),he(x,!0,n).done(function(a){if("object"==typeof a&&a.success){var n="#comment-"+o;e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),fe(a),oe(),e("html, body").animate({scrollTop:e(n).offset().top-D},1e3,ne),t&&$(o)}e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}}function $(t){setTimeout(function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")},1100)}function X(e){if(void 0!==e.data.message)for(var t,a=e.data.message,o=0;o<a.length;o++)ee((t=a[o]).comment_parent,t.comment_html)}function Y(e,t){var a="";return(a=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(a.lastIndexOf("-")+1)}function J(e){return e.substring(0,e.indexOf("_"))}function Z(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function ee(t,a){if(0==t)ie(a);else{var o=Y(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+o).after(a)}}function te(){var t=[];return e(".wpd-comment-right").each(function(){t.push(J(Y(e(this),0)))}),t.join(",")}function ae(t,a){var o=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(a+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),a=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");a=(a=(a=(a=a.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),t.val(a)}(t),e.each(o,function(){e("input",this).prop("required",!1),0===e("input:checked",this).length?e("input",e(this)).prop("required",!0):e(".wpd-field-invalid",this).remove()})}function oe(){e("html, body").css("scroll-behavior","unset")}function ne(){e("html").css("scroll-behavior",S),e("body").css("scroll-behavior",P)}function ie(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function se(t){t?t.prop("required")||(t.val()?t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):e.each(e(".wc_email"),function(t,a){var o=e(a);o.prop("required")||(o.val()?o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==i||f||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),K(),e(window).scroll(function(){K()})),wpdiscuzAjaxObj.setLoadMoreVisibility=N,e(document).on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",function(){var t=e(this);e(t).removeClass("wpd_not_clicked");var a,o=J(Y(t));a=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",o),n.append("voteType",a),he(x,!0,n).done(function(n){if(e(t).addClass("wpd_not_clicked"),"object"==typeof n){if(n.success){if("total"===n.data.buttonsStyle){var i=e(".wpd-comment-footer .wpd-vote-result",e("#comment-"+o)),s=n.data.votes;i.text(n.data.votesHumanReadable),i.attr("title",s),i.removeClass("wpd-up wpd-down"),s>0&&i.addClass("wpd-up"),s<0&&i.addClass("wpd-down")}else{var d=e(".wpd-comment-footer .wpd-vote-result-like",e("#comment-"+o)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+o));d.text(n.data.likeCountHumanReadable),d.attr("title",n.data.likeCount),c.text(n.data.dislikeCountHumanReadable),c.attr("title",n.data.dislikeCount),parseInt(n.data.likeCount)>0?d.addClass("wpd-up"):d.removeClass("wpd-up"),parseInt(n.data.dislikeCount)<0?c.addClass("wpd-down"):c.removeClass("wpd-down")}var p=e(".wpd-comment-footer .wpd-vote-up",e("#comment-"+o)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+o));p.removeClass("wpd-up"),r.removeClass("wpd-down"),n.data.curUserReaction>0?p.addClass("wpd-up"):n.data.curUserReaction<0&&r.addClass("wpd-down")}else n.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error");fe(n,o,a)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,o,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click","body",function(t){var a=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?a.css({display:a.is(":visible")?"none":"flex"}):a.hide()}),e(document).on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var t=e(this),a=e(this).attr("data-sorting");if(a){e(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),t.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var o=new FormData;o.append("action","wpdSorting"),o.append("sorting",a);var n=e(".wpdf-active").attr("data-filter-type");o.append("wpdType",n||""),he(x,!0,o).done(function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),N(t,!1),R=1),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){G(!1)},1!=w&&G(!1),e(document).on("click",".wpdiscuz-readmore",function(){var t=Y(e(this)),a=J(t),o=new FormData;o.append("action","wpdReadMore"),o.append("commentId",a),he(x,!0,o).done(function(o){"object"==typeof o?(o.success?(e("#comment-"+a+" .wpd-comment-text").replaceWith(" "+o.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(o.data),fe(o)):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("change",".wpd-required-group",function(){0!==e("input:checked",this).length?e("input",e(this)).prop("required",!1):e("input",e(this)).prop("required",!0)}),e(document).on("click",".wpdiscuz-spoiler",function(){e(this).next().slideToggle(),e(this).hasClass("wpdiscuz-spoiler-closed")?e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"):e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"),e(this).toggleClass("wpdiscuz-spoiler-closed")}),e(document).on("click",".wpd-tools i",function(){var t=e(this).siblings(".wpd-tools-actions");t.is(":visible")||e(this).parents(".wpd-comment-right").attr("id")!==e("[id^=comment-]","#wpdcom").last().attr("id")||e("#comments").css({paddingBottom:"160px"}),t.css({display:t.is(":visible")?"none":"flex"})}),e(document).on("mouseleave",".wpd-comment-right",function(){e(this).find(".wpd-tools-actions").hide(),e("#comments").css({paddingBottom:"0"})}),e(document).on("click",".wpd_stick_btn",function(){var t=J(Y(e(this),0)),a=new FormData;a.append("action","wpdStickComment"),a.append("commentId",t),he(x,!0,a).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd_close_btn",function(){var t=J(Y(e(this),0)),a=new FormData;a.append("action","wpdCloseThread"),a.append("commentId",t),he(x,!0,a).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var t=e(this),a=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+a),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&o.append("sorting",n),o.append("lastParentId",0),o.append("offset",0),R=1,o.append("wpdType",t.hasClass("wpdf-active")?"":a),o.append("isFirstLoad",1),e(this).hasClass("wpdf-inline")?e(this).hasClass("wpdf-active")?e(".wpd-comment-info-bar").hide():e(".wpd-comment-info-bar").css("display","flex"):e(".wpd-comment-info-bar").hide(),he(x,!1,o).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(a.data.comment_list),N(a),l=a.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),fe(a)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpdf-reacted.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdMostReactedComment"),he(x,!1,a).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e("#comment-"+a.data.commentId).length||e(".wpd-thread-list").prepend(a.data.message),fe(a),oe(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-D},1e3,ne))}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")})}),e(document).on("click",".wpdf-hottest.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdHottestThread"),he(x,!1,a).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.commentId).length?e("#comment-"+a.data.commentId).parents("[id^=wpd-comm-"+a.data.commentId+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),fe(a),oe(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-D},1e3,ne))}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")})}),e(document).on("click",".wpd-filter-view-all",function(){e(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")}),e(document).on("click",".wpd-follow-link.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=J(Y(t,0)),o=new FormData;o.append("action","wpdFollowUser"),o.append("commentId",a),he(x,!0,o).done(function(a){t.addClass("wpd_not_clicked"),"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.code],a.data.code,t),"success"),t.removeClass("wpd-follow-active"),a.data.followTip&&t.attr("wpd-tooltip",a.data.followTip),a.data.followClass&&t.addClass(a.data.followClass)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),se(),e(document).on("keyup",".wc_email",function(){se(e(this))}),C&&e("#wpdcom").length){if(e("#wpd-bubble-wrapper").hover(function(){e(this).addClass("wpd-bubble-hover")},function(){e(this).removeClass("wpd-bubble-hover")}),y&&!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*O)},1e3*y),"content_left"===I)if(e(".entry-content").length){var de=(ce=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?ce:25;e("#wpd-bubble-wrapper").css({left:de+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){de=(ce=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?ce:25;e("#wpd-bubble-wrapper").css({left:de+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var ce;de=(ce=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?ce:25;e("#wpd-bubble-wrapper").css({left:de+"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"===I?(e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===I&&(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(){oe(),e("#tab-title-reviews").length&&e("#tab-title-reviews a").trigger("click"),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-(D+28)},1e3,function(){ne(),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"),G(!0);var a=t.match(/#comment\-(\d+)/);M=M.filter(function(e){return e!=a[1]}),e("#wpd-bubble-count .wpd-new-comments-count").text(M.length),0==M.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),e(document).on("click","#wpd-bubble-count",function(){if(M.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",M.join()),he(x,!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}),X(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),M=[],e(".wpd-new-loaded-comment").length&&(oe(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-(D+28)},1e3,ne)),fe(t)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,a){console.log(a)})}})}if((C&&k||c)&&(t||!t&&r)&&setTimeout(function t(){e.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:s,lastId:m,visibleCommentIds:te()}}).done(function(a){if(!L)if("object"==typeof a){if(a.commentIDsToRemove.forEach(function(t){e("[id^=wpd-comm-"+t+"]").remove()}),a.ids.length){c&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",l),i.append("visibleCommentIds",te()),he(x,!1,i).done(function(t){L||"object"==typeof t&&t.success&&(X(t),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),l=t.data.loadLastCommentId)}).fail(function(e,t,a){console.log(a)})),a.ids=a.ids.filter(function(t){if(!e("#comment-"+t).length)return t});var o=5e3;m=parseInt(a.ids[a.ids.length-1]),M=M.concat(a.ids),A&&a.commentText&&(e("#wpd-bubble-author-avatar").html(a.avatar),e("#wpd-bubble-author-name").html(a.authorName),e("#wpd-bubble-comment-date span").html(a.commentDate),e("#wpd-bubble-comment-text").html(a.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",a.commentLink),e("#wpd-bubble-notification-message").show(),o=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=a.ids.length,e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),e("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout(function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")},o),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}a.all_comments_count=parseInt(a.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(a.all_comments_count_bubble_html),e(".wpd-thread-info").html(a.all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.all_comments_count)}else console.log(a);var i;setTimeout(t,p)}).fail(function(e,a,o){console.log(o),setTimeout(t,p)})},p),e(".wpd-inline-form-wrapper").length){var pe=new FormData;pe.append("action","wpdGetInlineCommentForm"),he(x,!1,pe).done(function(t){"object"==typeof t?t.success?(e(".wpd-inline-form-wrapper").append(t.data),e.each(e("[name=_wpd_inline_nonce]"),function(){var t=e(this).attr("id"),a=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+a.substring(a.lastIndexOf("-")+1))}),e(".wpd-inline-opened").addClass("wpd-active"),e(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),e(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),e(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),we()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data]),t.data,"error"):console.log(t)}).fail(function(e,t,a){console.log(a)})}function re(t){if(e(t).hasClass("wpd-inline-shortcode"))var a=e(t).attr("id");else a=e(t).parents(".wpd-inline-shortcode").attr("id");return a.substring(a.lastIndexOf("-")+1)}function le(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function me(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var t=e(this),a=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&a>0&&a<300&&("blink"===T?(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"),we(t.siblings(".wpd-inline-form-wrapper"))))})}function we(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(a=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var a;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(a=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}}else e.each(e(".wpd-inline-form-wrapper:visible"),function(){if(e(this).offset().left<=10)e(this).css("left",Math.ceil(parseInt(e(this).css("left"))-e(this).offset().left+10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))<3&&(t=3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;");else if(e(this).offset().left+e(this).width()>document.body.clientWidth-10){var t;e(this).css("left",Math.ceil(parseInt(e(this).css("left"))+(document.body.clientWidth-(e(this).offset().left+e(this).width()))-10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))>e(this).width()-3&&(t=e(this).width()-3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;")}})}function ue(t){var a,o=0;if(t.parents(".wpd_main_comm_form").length)o=parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents(".wpd_main_comm_form");else if(t.parents(".wpd-secondary-form-wrapper").length)o=parseInt(wpdiscuzAjaxObj.replyTextMaxLength),a=t.parents(".wpd-secondary-form-wrapper");else if(t.parents("#wpdiscuz-edit-form").length){var n=Y(t);o=parseInt(n.substring(n.lastIndexOf("_")+1))?parseInt(wpdiscuzAjaxObj.replyTextMaxLength):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents("#wpdiscuz-edit-form")}if(o&&a){var i=t.val().length,s=e(".wpd-editor-char-counter",a),d=o-i;s.html(d),d<=10?s.addClass("error"):s.removeClass("error")}}function fe(t,a,o,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,a,o,n):console.log(t.data.callbackFunctions[e]+" is not a function")})}function he(t,a,o){a&&e("#wpdiscuz-loading-bar").show(),o.append("postId",s),o.append("wpdiscuz_nonce",d);var n=o.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(o=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](o,t,a))});var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:o,contentType:!1,processData:!1})}e(document).on("click","body",function(t){if(e(t.target).hasClass("wpd-inline-form-close")||e(t.target).parents(".wpd-inline-form-close").length)t.preventDefault(),e(t.target).parents(".wpd-inline-form-wrapper").hide(),e(t.target).parents(".wpd-inline-shortcode").removeClass("wpd-active"),e(t.target).parents(".wpd-inline-form-wrapper").siblings(".wpd-inline-icon").removeClass("wpd-open");else if(!e(t.target).hasClass("wpd-inline-form-wrapper")&&!e(t.target).parents(".wpd-inline-form-wrapper").length){le();var a="";e(t.target).hasClass("wpd-inline-icon")?a=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(a=e(t.target).parents(".wpd-inline-icon")),a.length&&a.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(a.parents(".wpd-inline-shortcode").addClass("wpd-active"),a.siblings(".wpd-inline-form-wrapper").show(),a.addClass("wpd-open"),a.removeClass("wpd-ignored"),we(a.siblings(".wpd-inline-form-wrapper")))}(!e(t.target).hasClass("wpd-last-inline-comments-wrapper")&&!e(t.target).parents(".wpd-last-inline-comments-wrapper").length||e(t.target).parents(".wpd-last-inline-comments-wrapper").length&&e(t.target).hasClass("wpd-load-inline-comment"))&&e(".wpd-last-inline-comments-wrapper").remove()}),e(document).on("click",".wpd-inline-submit.wpd_not_clicked",function(t){t.preventDefault();var a=e(this),o=e(this).parents(".wpd_inline_comm_form");if(o[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",re(o)),e.each(e("input, textarea",o),function(t,a){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(a).attr("name"),e(a).val()):n.append(e(a).attr("name"),e(a).val())}),he(x,!0,n).done(function(t){if(a.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){o[0].reset(),le();var n=parseInt(t.data.newCount),i=a.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),e(".wpd-thread-info").attr("data-comments-count",t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.message&&ie(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data,a),"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("keydown",".wpd-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_comm_submit").trigger("click")}),e(document).on("keydown","#wpdiscuz-edit-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_save_edited_comment").trigger("click")}),e(document).on("keydown",".wpd-inline-comment-content",function(t){t.ctrlKey&&13==t.keyCode&&e(this).parents(".wpd_inline_comm_form").find(".wpd-inline-submit.wpd_not_clicked").trigger("click")}),e(document).on("click",".wpd-inline-icon-count.wpd-has-comments",function(){var t=e(this),a=new FormData;a.append("action","wpdGetLastInlineComments"),a.append("inline_form_id",re(t)),he(x,!0,a).done(function(a){"object"==typeof a?a.success?e(a.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-view-all-inline-comments",function(t){t.preventDefault(),e(this).parents(".wpd-last-inline-comments-wrapper").remove(),e(".wpdf-inline").hasClass("wpdf-active")||e(".wpdf-inline").trigger("click"),oe(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-D},1e3,ne)}),e(document).on("click",".wpd-feedback-content-link",function(t){t.preventDefault();var a=e(this).data("feedback-content-id");oe(),e("html, body").animate({scrollTop:e("#wpd-inline-"+a).offset().top-(D+6)},1e3,function(){ne(),e("#wpd-inline-"+a).addClass("wpd-active")})}),"scroll_open"!==T&&"blink"!==T||(me(),e(window).on("scroll",me)),e(document).on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var t=new FormData,a=e(this).index();a>=0&&a<5&&(t.append("action","wpdUserRate"),t.append("rating",a+1),he(x,!0,t).done(function(t){"object"==typeof t?t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data),"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))}),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){t.preventDefault();var a,o,i=e(this);if(i[0].checkValidity()&&(a=i,o=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).val().length?(o=!1,e(".wpdiscuz-recaptcha",a).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&e(".wpdiscuz-recaptcha",a).css("border","none"),o)){var s=new FormData;s.append("action","wpdAddSubscription"),e("*",i).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&s.append(this.name+"",e(this).val()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&s.append(this.name+"",e(this).val())}),he(x,!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),L=!1}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wpd-unsubscribe",function(t){t.preventDefault();var a=new FormData;a.append("action","wpdUnsubscribe"),a.append("sid",e(this).data("sid")),a.append("skey",e(this).data("skey")),he(x,!0,a).done(function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250),L=!1}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=he});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 */
10
- jQuery(document).ready(function(e){if(e(document).on("click","#wpdcom .wmu-upload-wrap",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0)}),e(document).on("change",".wmu-add-files",function(){var a=e(this),t=a.parents(".wpd_comm_form"),d=a[0].files?a[0].files:[];d.length&&function(a,t,d){var o=new FormData;o.append("action","wmuUploadFiles"),o.append("wmu_nonce",wpdiscuzAjaxObj.wmuSecurity),o.append("wmuAttachmentsData",e(".wmu-attachments-data",t).val()),o.append("uniqueId",t.find(".wpdiscuz_unique_id").val());var i=0;e.each(d,function(e,a){i+=a.size,o.append(wpdiscuzAjaxObj.wmuInput+"["+e+"]",a)}),i>parseInt(wpdiscuzAjaxObj.wmuMaxFileSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseMaxFileSize,"wmuPhraseMaxFileSize",a),"error",3e3):i>parseInt(wpdiscuzAjaxObj.wmuPostMaxSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhrasePostMaxSize,"wmuPhrasePostMaxSize",a),"error",3e3):wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(a){a.success?(e(".wmu-attached-data-info",t).remove(),e(".wmu-add-files",t).after(a.data.attachmentsHtml),a.data.tooltip&&e(".wmu-upload-wrap",t).attr("wpd-tooltip",a.data.tooltip),function(a,t){e.each(t.data.previewsData,function(t,d){e(".wmu-action-wrap .wmu-"+t+"-tab",a).html(""),e.each(d,function(d,o){var i=o.id,r="",s=o.fullname,u=o.shortname;t==wpdiscuzAjaxObj.wmuKeyImages?(r=o.url,u=""):t==wpdiscuzAjaxObj.wmuKeyVideos?r=wpdiscuzAjaxObj.wmuIconVideo:t==wpdiscuzAjaxObj.wmuKeyFiles&&(r=wpdiscuzAjaxObj.wmuIconFile);var n='<div class="wmu-preview [PREVIEW_TYPE_CLASS]" title="[PREVIEW_TITLE]" data-wmu-type="[PREVIEW_TYPE]" data-wmu-attachment="[PREVIEW_ID]"><div class="wmu-preview-remove"><img class="wmu-preview-img" src="[PREVIEW_ICON]"><div class="wmu-file-name">[PREVIEW_FILENAME]</div><div class="wmu-delete">&nbsp;</div></div></div>';n=(n=(n=(n=(n=(n=n.replace("[PREVIEW_TYPE_CLASS]","wmu-preview-"+t)).replace("[PREVIEW_TITLE]",s)).replace("[PREVIEW_TYPE]",t)).replace("[PREVIEW_ID]",i)).replace("[PREVIEW_ICON]",r)).replace("[PREVIEW_FILENAME]",u),e(".wmu-action-wrap .wmu-"+t+"-tab",a).removeClass("wmu-hide").append(n)})})}(t,a),a.data.errors&&(wpdiscuzAjaxObj.setCommentMessage(a.data.errors,"error",3e3),console.log(a.data.errors))):a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.errorCode],a.data.errorCode,t),"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250)})}(a,t,d)}),e(document).on("click",".wmu-attachment-delete",function(a){if(confirm(wpdiscuzAjaxObj.wmuPhraseConfirmDelete)){var t=e(this).data("wmu-attachment"),d=new FormData;d.append("action","wmuDeleteAttachment"),d.append("wmu_nonce",wpdiscuzAjaxObj.wmuSecurity),d.append("attachmentId",t),wpdiscuzAjaxObj.getAjaxObj(!0,!0,d).done(function(a){if(a.success){var d=e(".wmu-attachment-"+t).parents(".wmu-comment-attachments");e(".wmu-attachment-"+t).remove(),e(".wmu-attached-images *",d).length||e(".wmu-attached-images",d).remove(),e(".wmu-attached-videos *",d).length||e(".wmu-attached-videos",d).remove(),e(".wmu-attached-files *",d).length||e(".wmu-attached-files",d).remove()}else a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.errorCode],a.data.errorCode,d),"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250)})}else console.log("canceled")}),e(document).on("click",".wmu-preview",function(){var a=e(this),t=a.parents(".wpd_comm_form"),d=(a.data("wmu-type"),a.data("wmu-attachment")),o=new FormData;o.append("action","wmuRemoveAttachmentPreview"),o.append("attachmentId",d),o.append("wmu_nonce",wpdiscuzAjaxObj.wmuSecurity),o.append("wmuAttachmentsData",e(".wmu-attachments-data",t).val()),o.append("uniqueId",t.find(".wpdiscuz_unique_id").val()),wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(d){if(d.success){a.remove();var o=e(".wmu-tabs",t);e.each(o,function(a,t){e(".wmu-preview",t).length?e(t).removeClass("wmu-hide"):e(t).addClass("wmu-hide")}),e(".wmu-attached-data-info",t).remove(),e(".wmu-add-files",t).after(d.data.attachmentsHtml),d.data.tooltip&&e(".wmu-upload-wrap",t).attr("wpd-tooltip",d.data.tooltip)}else d.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[d.data.errorCode],d.data.errorCode,t),"error",3e3):d.data.error&&wpdiscuzAjaxObj.setCommentMessage(d.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250)})}),parseInt(wpdiscuzAjaxObj.wmuIsLightbox)){function a(){e(".wmu-lightbox").colorbox({maxHeight:"95%",maxWidth:"95%",rel:"wmu-lightbox",fixed:!0})}a(),wpdiscuzAjaxObj.wmuAddLightBox=a}wpdiscuzAjaxObj.wmuHideAll=function(a,t){"object"==typeof a?a.success?(e(".wmu-tabs",t).addClass("wmu-hide"),e(".wmu-preview",t).remove(),e(".wmu-attached-data-info",t).remove()):console.log(a.data):console.log(a)}});
11
  /* Lity */
12
  !function(e,t){"function"==typeof define&&define.amd?define(["jquery"],function(n){return t(e,n)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(e,require("jquery")):e.lity=t(e,e.jQuery||e.Zepto)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=e.document,i=t(e),r=t.Deferred,o=t("html"),a=[],l="aria-hidden",s="lity-"+l,d='a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),iframe,object,embed,[contenteditable],[tabindex]:not([tabindex^="-"])',c={esc:!0,handler:null,handlers:{image:C,inline:function(e,n){var i,r,o;try{i=t(e)}catch(e){return!1}if(!i.length)return!1;return r=t('<i style="display:none !important"/>'),o=i.hasClass("lity-hide"),n.element().one("lity:remove",function(){r.before(i).remove(),o&&!i.closest(".lity-content").length&&i.addClass("lity-hide")}),i.removeClass("lity-hide").after(r)},youtube:function(e){var n=f.exec(e);if(!n)return!1;return k(x(e,w("https://www.youtube"+(n[2]||"")+".com/embed/"+n[4],t.extend({autoplay:1},b(n[5]||"")))))},vimeo:function(e){var n=y.exec(e);if(!n)return!1;return k(x(e,w("https://player.vimeo.com/video/"+n[3],t.extend({autoplay:1},b(n[4]||"")))))},googlemaps:function(e){var t=v.exec(e);if(!t)return!1;return k(x(e,w("https://www.google."+t[3]+"/maps?"+t[6],{output:t[6].indexOf("layer=c")>0?"svembed":"embed"})))},facebookvideo:function(e){var n=p.exec(e);if(!n)return!1;0!==e.indexOf("http")&&(e="https:"+e);return k(x(e,w("https://www.facebook.com/plugins/video.php?href="+e,t.extend({autoplay:1},b(n[4]||"")))))},iframe:k},template:'<div class="lity" role="dialog" aria-label="Dialog Window (Press escape to close)" tabindex="-1"><div class="lity-wrap" data-lity-close role="document"><div class="lity-loader" aria-hidden="true">Loading...</div><div class="lity-container"><div class="lity-content"></div><button class="lity-close" type="button" aria-label="Close (Press escape to close)" data-lity-close>&times;</button></div></div></div>'},u=/(^data:image\/)|(\.(png|jpe?g|gif|svg|webp|bmp|ico|tiff?)(\?\S*)?$)/i,f=/(youtube(-nocookie)?\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11})(.*)?/i,y=/(vimeo(pro)?.com)\/(?:[^\d]+)?(\d+)\??(.*)?$/,v=/((maps|www)\.)?google\.([^\/\?]+)\/?((maps\/?)?\?)(.*)/i,p=/(facebook\.com)\/([a-z0-9_-]*)\/videos\/([0-9]*)(.*)?$/i,m=function(){var e=n.createElement("div"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in t)if(void 0!==e.style[i])return t[i];return!1}();function h(e){var t=r();return m&&e.length?(e.one(m,t.resolve),setTimeout(t.resolve,500)):t.resolve(),t.promise()}function g(e,n,i){if(1===arguments.length)return t.extend({},e);if("string"==typeof n){if(void 0===i)return void 0===e[n]?null:e[n];e[n]=i}else t.extend(e,n);return this}function b(e){for(var t,n=decodeURI(e.split("#")[0]).split("&"),i={},r=0,o=n.length;r<o;r++)n[r]&&(i[(t=n[r].split("="))[0]]=t[1]);return i}function w(e,n){return e+(e.indexOf("?")>-1?"&":"?")+t.param(n)}function x(e,t){var n=e.indexOf("#");return-1===n?t:(n>0&&(e=e.substr(n)),t+e)}function C(e,n){var i=n.opener()&&n.opener().data("lity-desc")||"Image with no description",o=t('<img src="'+e+'" alt="'+i+'"/>'),a=r(),l=function(){var e;a.reject((e="Failed loading image",t('<span class="lity-error"/>').append(e)))};return o.on("load",function(){if(0===this.naturalWidth)return l();a.resolve(o)}).on("error",l),a.promise()}function k(e){return'<div class="lity-iframe-container"><iframe frameborder="0" allowfullscreen src="'+e+'"/></div>'}function E(){return n.documentElement.clientHeight?.9*n.documentElement.clientHeight:Math.round(.9*i.height())}function j(e){var t,i,r,o=z();o&&(27===e.keyCode&&o.options("esc")&&o.close(),9===e.keyCode&&(t=e,i=o.element().find(d),r=i.index(n.activeElement),t.shiftKey&&r<=0?(i.get(i.length-1).focus(),t.preventDefault()):t.shiftKey||r!==i.length-1||(i.get(0).focus(),t.preventDefault())))}function D(){t.each(a,function(e,t){t.resize()})}function z(){return 0===a.length?null:a[0]}function T(e,d,u,f){var y,v,p,m,b,w,x,C,k,z,T,O=this,q=!1,W=!1;d=t.extend({},c,d),v=t(d.template),O.element=function(){return v},O.opener=function(){return u},O.options=t.proxy(g,O,d),O.handlers=t.proxy(g,O,d.handlers),O.resize=function(){q&&!W&&p.css("max-height",E()+"px").trigger("lity:resize",[O])},O.close=function(){if(q&&!W){var e;W=!0,(e=O).element().attr(l,"true"),1===a.length&&(o.removeClass("lity-active"),i.off({resize:D,keydown:j})),((a=t.grep(a,function(t){return e!==t})).length?a[0].element():t(".lity-hidden")).removeClass("lity-hidden").each(function(){var e=t(this),n=e.data(s);n?e.attr(l,n):e.removeAttr(l),e.removeData(s)});var d=r();if(f&&(n.activeElement===v[0]||t.contains(v[0],n.activeElement)))try{f.focus()}catch(e){}return p.trigger("lity:close",[O]),v.removeClass("lity-opened").addClass("lity-closed"),h(p.add(v)).always(function(){p.trigger("lity:remove",[O]),v.remove(),v=void 0,d.resolve()}),d.promise()}},m=e,b=O,w=d.handlers,x=d.handler,k="inline",z=t.extend({},w),x&&z[x]?(C=z[x](m,b),k=x):(t.each(["inline","iframe"],function(e,t){delete z[t],z[t]=w[t]}),t.each(z,function(e,t){return!t||!(!t.test||t.test(m,b))||(!1!==(C=t(m,b))?(k=e,!1):void 0)})),y={handler:k,content:C||""},v.attr(l,"false").addClass("lity-loading lity-opened lity-"+y.handler).appendTo("body").focus().on("click","[data-lity-close]",function(e){t(e.target).is("[data-lity-close]")&&O.close()}).trigger("lity:open",[O]),T=O,1===a.unshift(T)&&(o.addClass("lity-active"),i.on({resize:D,keydown:j})),t("body > *").not(T.element()).addClass("lity-hidden").each(function(){var e=t(this);void 0===e.data(s)&&e.data(s,e.attr(l)||null)}).attr(l,"true"),t.when(y.content).always(function(e){p=t(e).css("max-height",E()+"px"),v.find(".lity-loader").each(function(){var e=t(this);h(e).always(function(){e.remove()})}),v.removeClass("lity-loading").find(".lity-content").empty().append(p),q=!0,p.trigger("lity:ready",[O])})}function O(e,i,r){e.preventDefault?(e.preventDefault(),e=(r=t(this)).data("lity-target")||r.attr("rel")||r.attr("src")):r=t(r);var o=new T(e,t.extend({},r.data("lity-options")||r.data("lity"),i),r,n.activeElement);if(!e.preventDefault)return o}return C.test=function(e){return u.test(e)},O.version="2.2.2",O.options=t.proxy(g,O,c),O.handlers=t.proxy(g,O,c.handlers),O.current=z,t(n).on("click.lity","[data-wpd-lity]",O),O});
13
  /* My Content and Settings */
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,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;").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,a){var o="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?o="wpdiscuz-message-success":"warning"===t[n]&&(o="wpdiscuz-message-warning"):"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(a instanceof Array?a[n]:a||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e).prependTo("#wpdiscuz-comment-message").delay(a||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},wpdiscuzAjaxObj.applyFilterOnPhrase=function(e,t,a){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,function(o){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]]&&(e=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]](e,t,a))}),e},jQuery(document).ready(function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType),s=parseInt(wpdiscuzAjaxObj.wc_post_id);wpdiscuzAjaxObj.wpdiscuz_nonce="";var 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=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate),f=wpdiscuzAjaxObj.storeCommenterData,h=parseInt(wpdiscuzAjaxObj.wmuEnabled),b=wpdiscuzAjaxObj.isCookiesEnabled,_=!0,g=wpdiscuzAjaxObj.cookiehash,z=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),j=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,v=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),x=parseInt(wpdiscuzAjaxObj.enableBubble),C=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),y=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,O=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),A=wpdiscuzAjaxObj.bubbleLocation,I=wpdiscuzAjaxObj.inlineFeedbackAttractionType,T=(T=parseInt(wpdiscuzAjaxObj.scrollSize))||32,D=[],F=[],E=[],M=!1,L=1,R=e("html").css("scroll-behavior"),S=e("body").css("scroll-behavior");(e(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?e(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .the_champ_login_container").length?e(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .social_connect_form").length?e(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&e(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",function(t){var a=e(".wpd-form").not(":hidden");if(a.length)if(wpdiscuzLoadRichEditor){for(var o=0;o<a.length;o++)if("\n"!==wpDiscuzEditor.createEditor(e(a[o]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(o=0;o<a.length;o++)if(e(a[o]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")}),wpdiscuzLoadRichEditor||(e(document).delegate("textarea.wc_comment","input",function(){we(e(this))}),e.each(e("textarea.wc_comment"),function(){we(e(this))})),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(j)}),e(document).on("focus","#wpdcom textarea",function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()}),t)||U({comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)});if(e(".wpd-vote-down.wpd-dislike-hidden").remove(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),e(document).on("click","#wpd-editor-source-code-wrapper-bg",function(){e(this).hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")}),wpdiscuzLoadRichEditor&&e(document).on("click","#wpd-insert-source-code",function(){var t=wpDiscuzEditor.createEditor("#"+e("#wpd-editor-uid").val());t.deleteText(0,t.getLength(),Quill.sources.USER);var a=e("#wpd-editor-source-code").val();a.length&&t.clipboard.dangerouslyPasteHTML(0,a,Quill.sources.USER),t.update(),e("#wpd-editor-source-code-wrapper-bg").hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")}),e(document).on("click",".wpd-reply-button",function(){var i=X(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()},j):setTimeout(function(){e("#wc-textarea-"+i).trigger("focus")},j),e("#wpd-secondary-form-wrapper-"+i).slideToggle(j)):function(a){var o=X(a,0);e("#wpdiscuz_form_anchor-"+o).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(o));var n=e("#wpd-secondary-form-wrapper-"+o);if(!t){var i={comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)};U(i)}wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+o).focus()},j):setTimeout(function(){e("#wc-textarea-"+o).trigger("focus")},j);n.slideToggle(j,function(){a.addClass("wpdiscuz-clonned")})}(e(this)),function(t){if((a||o)&&"2.0"===n){var i=Y(t);setTimeout(function(){if(!F[i])try{F[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){e("#wpdiscuz-recaptcha-field-"+t).val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-"+t).val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3)}}(i)}),e(document).on("click","#wpdcom .wpd-comment-link [data-comment-url]",function(){var t=e(this).data("comment-url"),a=e("<input/>");a.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),a.trigger("select"),document.execCommand("copy"),a.remove(),wpdiscuzAjaxObj.setCommentMessage(t+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)}),e(document).on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",function(e){e.preventDefault()}),e(document).on("click",".wpd-toggle.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked");var a=X(e(this),0),o=e(this),n=e(".fas",o);!o.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&z?function(t,a){var o=Y(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",o),fe(v,!0,n).done(function(o){a.addClass("wpd_not_clicked"),"object"==typeof o&&o.success&&(e("#wpd-comm-"+t).replaceWith(o.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle .wpd-view-replies .wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),e("#wpd-comm-"+t+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),ue(o)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,n){console.log(n),a.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}(a,t):e("#wpd-comm-"+a+"> .wpd-reply").slideToggle(700,function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),o.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),o.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),t.addClass("wpd_not_clicked")})}),e(document).on("mouseenter",".wpd-new-loaded-comment",function(){e(this).removeClass("wpd-new-loaded-comment")}),e(document).on("click",".wpd-sbs-toggle",function(){e(".wpdiscuz-subscribe-bar").slideToggle(j)}),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm)&&!t&&wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&e("#wpdiscuz-subscribe-form").length&&("2.0"===n?(setTimeout(function(){try{grecaptcha.render("wpdiscuz-recaptcha-subscribe-form",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-subscribe-form").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val()?e(".wpdiscuz-recaptcha",e(this)).css("border","none"):(e(".wpdiscuz-recaptcha",e(this)).css("border","1px solid red"),t.preventDefault())})):"3.0"===n&&e(document).on("click","#wpdiscuz_subscription_button",function(t){var a=e(this).parents("#wpdiscuz-subscribe-form");t.preventDefault();try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then(function(e){console.log(5555),document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=e,a.trigger("submit")},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}})),(a||o)&&"2.0"===n){var P=e(window).width(),q=e("#wpdcom").width();q>=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%"})),q>=940&&q<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%"})),q>=810&&q<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%"})),q>=730&&q<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%"})),q>=610&&q<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%"})),P>650&&(q>=510&&q<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"})),q>=470&&q<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"})),q<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,a,o){fe(v||h,!1,a).done(function(a){if(e(o).addClass("wpd_not_clicked"),"object"==typeof a)if(a.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(j),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),e(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html);var n=j;a.data.is_main?ne(a.data.message):(n=j+700,e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).slideToggle(700),1==a.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).after(a.data.message):e("#wpd-comm-"+a.data.uniqueid).after(a.data.message)),function(e){if(!e.data.held_moderate){var t=new FormData;t.append("action","wpdCheckNotificationType"),t.append("comment_id",e.data.new_comment_id),t.append("email",e.data.comment_author_email),t.append("isParent",e.data.is_main),fe(v,!0,t)}}(a),function(e){if(e.data.redirect>0&&e.data.new_comment_id){var t=new FormData;t.append("action","wpdRedirect"),t.append("commentId",e.data.new_comment_id),fe(v,!0,t).done(function(e){"object"==typeof e&&e.success&&setTimeout(function(){location.href=e.data},2e3)}).fail(function(e,t,a){console.log(a)})}}(a),b&&_?function(t){var a=t.comment_author_email,o=t.comment_author,n=t.comment_author_url;null==f?(Cookies.set("comment_author_email_"+g,a),Cookies.set("comment_author_"+g,o),n.length&&Cookies.set("comment_author_url_"+g,n)):(f=parseInt(f),Cookies.set("comment_author_email_"+g,a,{expires:f,path:"/"}),Cookies.set("comment_author_"+g,o,{expires:f,path:"/"}),n.length&&Cookies.set("comment_author_url_"+g,n,{expires:f,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(a.data):_||e(".wpd-cookies-checkbox").prop("checked",!1),t.get(0).reset(),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]):we(t.find(".wc_comment")),U(a.data),e(".wmu-preview-wrap",t).remove(),D.length&&(D.forEach(function(e){e.parents(".wpd-field-checkbox").remove()}),D=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.new_comment_id).offset().top-T},1e3,oe)},n),ue(a,t)}else a.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"),ue(a,t));else wpdiscuzAjaxObj.setCommentMessage(a,"error");e("#wpdiscuz-loading-bar").fadeOut(250),M=!1}).fail(function(t,a,n){console.log(n),e(o).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}function U(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 W(t,a){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(a),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}e(document).on("click",".wc_comm_submit.wpd_not_clicked",function(){var i=e(this),s=1,d=e(this).parents("form");if(d.hasClass("wpd_main_comm_form")||(s=function(t){var a=t.attr("class").split(" "),o="";return e.each(a,function(e,t){"wpd_comment_level"===J(t,!1)&&(o=J(t,!0))}),parseInt(o)+1}(e(this).parents(".wpd-comment"))),te(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)){M=!0,function(t){e(".wpd-agreement-checkbox",t).each(function(){e(this).hasClass("wpd_agreement_hide")&&b&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+g,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each(function(){D.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")||(_=!1):t&&(_=!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((a||o)&&"2.0"===n){var t=Y(e);grecaptcha.reset(F[t])}}(e(".wpdiscuz_unique_id",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wc_msg_required_fields,"wc_msg_required_fields",d),"error")}),e(document).on("click",".wpd_editable_comment",function(){w&&e(".wpdiscuz-edit-form-wrap").length&&W(X(e(".wpdiscuz-edit-form-wrap"),0),w);var t=e(this),a=X(t,0),o=Y(a),n=new FormData;n.append("action","wpdEditComment"),n.append("commentId",o),w=e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-text").get(0),fe(v,!0,n).done(function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){var n=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+a);n.clipboard.dangerouslyPasteHTML(0,o.data.content),n.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+a).val(o.data.content),we(e("#wc-textarea-edit_"+a));e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wc_save_edited_comment",function(){var t=e(this),a=X(t),o=Y(a),n=e("#wpd-comm-"+a+" #wpdiscuz-edit-form");if(te(n,"#wpd-editor-edit_"+a),n.on("submit",function(e){e.preventDefault()}),n[0].checkValidity()){var i=new FormData;i.append("action","wpdSaveEditedComment"),i.append("commentId",o),e(":input",n).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&i.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&i.append(this.name+"",e(this).val())}),fe(v,!0,i).done(function(n){"object"==typeof n?(n.success?(W(a,n.data.message),n.data.lastEdited&&(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(n.data.lastEdited).insertAfter("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),n.data.twitterShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",n.data.twitterShareLink),n.data.whatsappShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",n.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error"),ue(n,o)):console.log(n),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=X(e(this));W(t,w),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!u&&m&&(L=0,1==m?setTimeout(function(){B(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),B(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&B(!1,t,"wpd-loaded","wpd-loading")});var N=!1;function V(){var t=e("#wpdiscuzHasMoreComments").val(),a=e(document).height(),o=e(window).height()+e(window).scrollTop();a&&o&&(100*o/a>=80&&!1===N&&1==t&&(N=!0,B(!1,e(".wpd-load-more-submit"))))}function B(t,a,o,n){a&&(a.toggleClass(o),a.toggleClass(n));var s=new FormData;s.append("action","wpdLoadMoreComments");var d=e(".wpdiscuz-sort-button-active").attr("data-sorting");d&&s.append("sorting",d),s.append("offset",L),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||""),fe(v,!t||1!=m,s).done(function(s){"object"==typeof s&&s.success&&(L++,t&&e(".wpd-comment").remove(),e(".wpdiscuz_single").remove(),e(".wpdiscuz-comment-pagination").before(s.data.comment_list),K(s,t&&2!==i),N=!1,s.data.loadLastCommentId&&(r=s.data.loadLastCommentId),ue(s),t&&Q(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))}).fail(function(t,i,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))})}function K(t,a){var o;0==t.data.is_show_load_more?(e("#wpdiscuzHasMoreComments").val(0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()):(o=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",o),2!==i&&e(".wpdiscuz-comment-pagination").show(),e("#wpdiscuzHasMoreComments").val(1),a&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show()),ue(t)}function Q(t){var a=location.href.match(/#comment\-(\d+)/);if(null!==a){var o=a[1];if(e("#comment-"+o).length)setTimeout(function(){ae(),e("html, body").animate({scrollTop:e("#comment-"+o).parents("[id^=wpd-comm-]").offset().top-T},1e3,oe),t&&G(o)},500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",o),fe(v,!0,n).done(function(a){if("object"==typeof a&&a.success){var n="#comment-"+o;e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e(n).offset().top-T},1e3,oe),t&&G(o)}e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}}function G(t){setTimeout(function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")},1100)}function $(e){if(void 0!==e.data.message)for(var t,a=e.data.message,o=0;o<a.length;o++)Z((t=a[o]).comment_parent,t.comment_html)}function X(e,t){var a="";return(a=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(a.lastIndexOf("-")+1)}function Y(e){return e.substring(0,e.indexOf("_"))}function J(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function Z(t,a){if(0==t)ne(a);else{var o=X(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+o).after(a)}}function ee(){var t=[];return e(".wpd-comment-right").each(function(){t.push(Y(X(e(this),0)))}),t.join(",")}function te(t,a){var o=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(a+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),a=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");a=(a=(a=(a=a.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),t.val(a)}(t),e.each(o,function(){e("input",this).prop("required",!1),0===e("input:checked",this).length?e("input",e(this)).prop("required",!0):e(".wpd-field-invalid",this).remove()})}function ae(){e("html, body").css("scroll-behavior","unset")}function oe(){e("html").css("scroll-behavior",R),e("body").css("scroll-behavior",S)}function ne(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function ie(t){t?t.prop("required")||(t.val()?t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):e.each(e(".wc_email"),function(t,a){var o=e(a);o.prop("required")||(o.val()?o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==i||u||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),V(),e(window).scroll(function(){V()})),wpdiscuzAjaxObj.setLoadMoreVisibility=K,e(document).on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",function(){var t=e(this);e(t).removeClass("wpd_not_clicked");var a,o=Y(X(t));a=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",o),n.append("voteType",a),fe(v,!0,n).done(function(n){if(e(t).addClass("wpd_not_clicked"),"object"==typeof n){if(n.success){if("total"===n.data.buttonsStyle){var i=e(".wpd-comment-footer .wpd-vote-result",e("#comment-"+o)),s=n.data.votes;i.text(n.data.votesHumanReadable),i.attr("title",s),i.removeClass("wpd-up wpd-down"),s>0&&i.addClass("wpd-up"),s<0&&i.addClass("wpd-down")}else{var d=e(".wpd-comment-footer .wpd-vote-result-like",e("#comment-"+o)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+o));d.text(n.data.likeCountHumanReadable),d.attr("title",n.data.likeCount),c.text(n.data.dislikeCountHumanReadable),c.attr("title",n.data.dislikeCount),parseInt(n.data.likeCount)>0?d.addClass("wpd-up"):d.removeClass("wpd-up"),parseInt(n.data.dislikeCount)<0?c.addClass("wpd-down"):c.removeClass("wpd-down")}var p=e(".wpd-comment-footer .wpd-vote-up",e("#comment-"+o)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+o));p.removeClass("wpd-up"),r.removeClass("wpd-down"),n.data.curUserReaction>0?p.addClass("wpd-up"):n.data.curUserReaction<0&&r.addClass("wpd-down")}else n.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error");ue(n,o,a)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,o,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click","body",function(t){var a=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?a.css({display:a.is(":visible")?"none":"flex"}):a.hide()}),e(document).on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var t=e(this),a=e(this).attr("data-sorting");if(a){e(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),t.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var o=new FormData;o.append("action","wpdSorting"),o.append("sorting",a);var n=e(".wpdf-active").attr("data-filter-type");o.append("wpdType",n||""),fe(v,!0,o).done(function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),K(t,!1),L=1),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){Q(!1)},1!=m&&Q(!1),e(document).on("click",".wpdiscuz-readmore",function(){var t=X(e(this)),a=Y(t),o=new FormData;o.append("action","wpdReadMore"),o.append("commentId",a),fe(v,!0,o).done(function(o){"object"==typeof o?(o.success?(e("#comment-"+a+" .wpd-comment-text").replaceWith(" "+o.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(o.data),ue(o)):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("change",".wpd-required-group",function(){0!==e("input:checked",this).length?e("input",e(this)).prop("required",!1):e("input",e(this)).prop("required",!0)}),e(document).on("click",".wpdiscuz-spoiler",function(){e(this).next().slideToggle(),e(this).hasClass("wpdiscuz-spoiler-closed")?e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"):e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"),e(this).toggleClass("wpdiscuz-spoiler-closed")}),e(document).on("click",".wpd-tools i",function(){var t=e(this).siblings(".wpd-tools-actions");t.is(":visible")||e(this).parents(".wpd-comment-right").attr("id")!==e("[id^=comment-]","#wpdcom").last().attr("id")||e("#comments").css({paddingBottom:"160px"}),t.css({display:t.is(":visible")?"none":"flex"})}),e(document).on("mouseleave",".wpd-comment-right",function(){e(this).find(".wpd-tools-actions").hide(),e("#comments").css({paddingBottom:"0"})}),e(document).on("click",".wpd_stick_btn",function(){var t=Y(X(e(this),0)),a=new FormData;a.append("action","wpdStickComment"),a.append("commentId",t),fe(v,!0,a).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd_close_btn",function(){var t=Y(X(e(this),0)),a=new FormData;a.append("action","wpdCloseThread"),a.append("commentId",t),fe(v,!0,a).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var t=e(this),a=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+a),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&o.append("sorting",n),o.append("lastParentId",0),o.append("offset",0),L=1,o.append("wpdType",t.hasClass("wpdf-active")?"":a),o.append("isFirstLoad",1),e(this).hasClass("wpdf-inline")?e(this).hasClass("wpdf-active")?e(".wpd-comment-info-bar").hide():e(".wpd-comment-info-bar").css("display","flex"):e(".wpd-comment-info-bar").hide(),fe(v,!1,o).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(a.data.comment_list),K(a),r=a.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),ue(a)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpdf-reacted.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdMostReactedComment"),fe(v,!1,a).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e("#comment-"+a.data.commentId).length||e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-T},1e3,oe))}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")})}),e(document).on("click",".wpdf-hottest.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdHottestThread"),fe(v,!1,a).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.commentId).length?e("#comment-"+a.data.commentId).parents("[id^=wpd-comm-"+a.data.commentId+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-T},1e3,oe))}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")})}),e(document).on("click",".wpd-filter-view-all",function(){e(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")}),e(document).on("click",".wpd-follow-link.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=Y(X(t,0)),o=new FormData;o.append("action","wpdFollowUser"),o.append("commentId",a),fe(v,!0,o).done(function(a){t.addClass("wpd_not_clicked"),"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.code],a.data.code,t),"success"),t.removeClass("wpd-follow-active"),a.data.followTip&&t.attr("wpd-tooltip",a.data.followTip),a.data.followClass&&t.addClass(a.data.followClass),ue(a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),ie(),e(document).on("keyup",".wc_email",function(){ie(e(this))}),x&&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*y)},1e3*k),"content_left"===A)if(e(".entry-content").length){var se=(de=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){se=(de=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var de;se=(de=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"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"===A?(e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===A&&(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(){ae(),e("#tab-title-reviews").length&&e("#tab-title-reviews a").trigger("click"),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-(T+28)},1e3,function(){oe(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover"),wpdiscuzLoadRichEditor?e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0").focus():e("#wc-textarea-0_0").length&&e("#wc-textarea-0_0").trigger("focus")})}),e(document).on("click","#wpd-bubble-comment-close",function(t){t.preventDefault(),e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),e(document).on("click","#wpd-bubble-comment-reply-link a",function(){var t=e(this).attr("href");setTimeout(function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),Q(!0);var a=t.match(/#comment\-(\d+)/);E=E.filter(function(e){return e!=a[1]}),e("#wpd-bubble-count .wpd-new-comments-count").text(E.length),0==E.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),e(document).on("click","#wpd-bubble-count",function(){if(E.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",E.join()),fe(v,!0,t).done(function(t){"object"==typeof t&&t.success&&(t.data.message=t.data.message.filter(function(t){if(!e("#comment-"+t.comment_id).length)return t}),$(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),E=[],e(".wpd-new-loaded-comment").length&&(ae(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-(T+28)},1e3,oe)),ue(t)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,a){console.log(a)})}})}if((x&&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:ee()}}).done(function(a){if(!M)if("object"==typeof a){if(a.commentIDsToRemove.forEach(function(t){e("[id^=wpd-comm-"+t+"]").remove()}),a.ids.length){d&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",r),i.append("visibleCommentIds",ee()),fe(v,!1,i).done(function(t){M||"object"==typeof t&&t.success&&($(t),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),r=t.data.loadLastCommentId)}).fail(function(e,t,a){console.log(a)})),a.ids=a.ids.filter(function(t){if(!e("#comment-"+t).length)return t});var o=5e3;l=parseInt(a.ids[a.ids.length-1]),E=E.concat(a.ids),O&&a.commentText&&(e("#wpd-bubble-author-avatar").html(a.avatar),e("#wpd-bubble-author-name").html(a.authorName),e("#wpd-bubble-comment-date span").html(a.commentDate),e("#wpd-bubble-comment-text").html(a.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",a.commentLink),e("#wpd-bubble-notification-message").show(),o=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=a.ids.length,e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),e("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout(function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")},o),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}a.all_comments_count=parseInt(a.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(a.all_comments_count_bubble_html),e(".wpd-thread-info").html(a.all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.all_comments_count)}else console.log(a);var i;setTimeout(t,c)}).fail(function(e,a,o){console.log(o),setTimeout(t,c)})},c),e(".wpd-inline-form-wrapper").length){var ce=new FormData;ce.append("action","wpdGetInlineCommentForm"),fe(v,!1,ce).done(function(t){"object"==typeof t?t.success?(e(".wpd-inline-form-wrapper").append(t.data),e.each(e("[name=_wpd_inline_nonce]"),function(){var t=e(this).attr("id"),a=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+a.substring(a.lastIndexOf("-")+1))}),e(".wpd-inline-opened").addClass("wpd-active"),e(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),e(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),e(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),me()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data]),t.data,"error"):console.log(t)}).fail(function(e,t,a){console.log(a)})}function pe(t){if(e(t).hasClass("wpd-inline-shortcode"))var a=e(t).attr("id");else a=e(t).parents(".wpd-inline-shortcode").attr("id");return a.substring(a.lastIndexOf("-")+1)}function re(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function le(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var t=e(this),a=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&a>0&&a<300&&("blink"===I?(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"),me(t.siblings(".wpd-inline-form-wrapper"))))})}function me(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(a=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var a;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(a=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}}else e.each(e(".wpd-inline-form-wrapper:visible"),function(){if(e(this).offset().left<=10)e(this).css("left",Math.ceil(parseInt(e(this).css("left"))-e(this).offset().left+10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))<3&&(t=3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;");else if(e(this).offset().left+e(this).width()>document.body.clientWidth-10){var t;e(this).css("left",Math.ceil(parseInt(e(this).css("left"))+(document.body.clientWidth-(e(this).offset().left+e(this).width()))-10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))>e(this).width()-3&&(t=e(this).width()-3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;")}})}function we(t){var a,o=0;if(t.parents(".wpd_main_comm_form").length)o=parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents(".wpd_main_comm_form");else if(t.parents(".wpd-secondary-form-wrapper").length)o=parseInt(wpdiscuzAjaxObj.replyTextMaxLength),a=t.parents(".wpd-secondary-form-wrapper");else if(t.parents("#wpdiscuz-edit-form").length){var n=X(t);o=parseInt(n.substring(n.lastIndexOf("_")+1))?parseInt(wpdiscuzAjaxObj.replyTextMaxLength):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents("#wpdiscuz-edit-form")}if(o&&a){var i=t.val().length,s=e(".wpd-editor-char-counter",a),d=o-i;s.html(d),d<=10?s.addClass("error"):s.removeClass("error")}}function ue(t,a,o,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,a,o,n):"function"==typeof window[t.data.callbackFunctions[e]]?window[t.data.callbackFunctions[e]](t,a,o,n):console.log(t.data.callbackFunctions[e]+" is not a function")})}function fe(t,a,o){a&&e("#wpdiscuz-loading-bar").show(),o.append("postId",s),o.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce);var n=o.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(o=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](o,t,a))});var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:o,contentType:!1,processData:!1})}function he(){var e=new FormData;e.append("action","wpdGetNonce"),e.append("key",wpdiscuzAjaxObj.wpdiscuz_nonce_key),fe(v,!1,e).done(function(e){"object"==typeof e?e.success?wpdiscuzAjaxObj.wpdiscuz_nonce=e.data:wpdiscuzAjaxObj.setCommentMessage(e.data,"error"):console.log(e)}).fail(function(e,t,a){console.log(a)})}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){re();var a="";e(t.target).hasClass("wpd-inline-icon")?a=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(a=e(t.target).parents(".wpd-inline-icon")),a.length&&a.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(a.parents(".wpd-inline-shortcode").addClass("wpd-active"),a.siblings(".wpd-inline-form-wrapper").show(),a.addClass("wpd-open"),a.removeClass("wpd-ignored"),me(a.siblings(".wpd-inline-form-wrapper")))}(!e(t.target).hasClass("wpd-last-inline-comments-wrapper")&&!e(t.target).parents(".wpd-last-inline-comments-wrapper").length||e(t.target).parents(".wpd-last-inline-comments-wrapper").length&&e(t.target).hasClass("wpd-load-inline-comment"))&&e(".wpd-last-inline-comments-wrapper").remove()}),e(document).on("click",".wpd-inline-submit.wpd_not_clicked",function(t){t.preventDefault();var a=e(this),o=e(this).parents(".wpd_inline_comm_form");if(o[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",pe(o)),e.each(e("input, textarea",o),function(t,a){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(a).attr("name"),e(a).val()):n.append(e(a).attr("name"),e(a).val())}),fe(v,!0,n).done(function(t){if(a.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){o[0].reset(),re();var n=parseInt(t.data.newCount),i=a.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),e(".wpd-thread-info").attr("data-comments-count",t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.message&&ne(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data,a),"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("keydown",".wpd-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_comm_submit").trigger("click")}),e(document).on("keydown","#wpdiscuz-edit-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_save_edited_comment").trigger("click")}),e(document).on("keydown",".wpd-inline-comment-content",function(t){t.ctrlKey&&13==t.keyCode&&e(this).parents(".wpd_inline_comm_form").find(".wpd-inline-submit.wpd_not_clicked").trigger("click")}),e(document).on("click",".wpd-inline-icon-count.wpd-has-comments",function(){var t=e(this),a=new FormData;a.append("action","wpdGetLastInlineComments"),a.append("inline_form_id",pe(t)),fe(v,!0,a).done(function(a){"object"==typeof a?a.success?e(a.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-view-all-inline-comments",function(t){t.preventDefault(),e(this).parents(".wpd-last-inline-comments-wrapper").remove(),e(".wpdf-inline").hasClass("wpdf-active")||e(".wpdf-inline").trigger("click"),ae(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-T},1e3,oe)}),e(document).on("click",".wpd-feedback-content-link",function(t){t.preventDefault();var a=e(this).data("feedback-content-id");ae(),e("html, body").animate({scrollTop:e("#wpd-inline-"+a).offset().top-(T+6)},1e3,function(){oe(),e("#wpd-inline-"+a).addClass("wpd-active")})}),"scroll_open"!==I&&"blink"!==I||(le(),e(window).on("scroll",le)),e(document).on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var t=new FormData,a=e(this).index();a>=0&&a<5&&(t.append("action","wpdUserRate"),t.append("rating",a+1),fe(v,!0,t).done(function(t){"object"==typeof t?(t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data),"error"),ue(t)):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))}),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){t.preventDefault();var a,o,i=e(this);if(i[0].checkValidity()&&(a=i,o=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).val().length?(o=!1,e(".wpdiscuz-recaptcha",a).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&e(".wpdiscuz-recaptcha",a).css("border","none"),o)){var s=new FormData;s.append("action","wpdAddSubscription"),e("*",i).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&s.append(this.name+"",e(this).val()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&s.append(this.name+"",e(this).val())}),fe(v,!0,s).done(function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):wpdiscuzAjaxObj.setCommentMessage(t,"error"),e("#wpdiscuz-loading-bar").fadeOut(250),M=!1}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wpd-unsubscribe",function(t){t.preventDefault();var a=new FormData;a.append("action","wpdUnsubscribe"),a.append("sid",e(this).data("sid")),a.append("skey",e(this).data("skey")),fe(v,!0,a).done(function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250),M=!1}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=fe,wpdiscuzAjaxObj.initNonce=he,he()});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 */
10
+ jQuery(document).ready(function(e){if(e(document).on("click","#wpdcom .wmu-upload-wrap",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0)}),e(document).on("change",".wmu-add-files",function(){var a=e(this),t=a.parents(".wpd_comm_form"),d=a[0].files?a[0].files:[];d.length&&function(a,t,d){var o=new FormData;o.append("action","wmuUploadFiles"),o.append("wmuAttachmentsData",e(".wmu-attachments-data",t).val()),o.append("uniqueId",t.find(".wpdiscuz_unique_id").val());var i=0;e.each(d,function(e,a){i+=a.size,o.append(wpdiscuzAjaxObj.wmuInput+"["+e+"]",a)}),i>parseInt(wpdiscuzAjaxObj.wmuMaxFileSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseMaxFileSize,"wmuPhraseMaxFileSize",a),"error",3e3):i>parseInt(wpdiscuzAjaxObj.wmuPostMaxSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhrasePostMaxSize,"wmuPhrasePostMaxSize",a),"error",3e3):wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(a){a.success?(e(".wmu-attached-data-info",t).remove(),e(".wmu-add-files",t).after(a.data.attachmentsHtml),a.data.tooltip&&e(".wmu-upload-wrap",t).attr("wpd-tooltip",a.data.tooltip),function(a,t){e.each(t.data.previewsData,function(t,d){e(".wmu-action-wrap .wmu-"+t+"-tab",a).html(""),e.each(d,function(d,o){var i=o.id,r="",s=o.fullname,u=o.shortname;t==wpdiscuzAjaxObj.wmuKeyImages?(r=o.url,u=""):t==wpdiscuzAjaxObj.wmuKeyVideos?r=wpdiscuzAjaxObj.wmuIconVideo:t==wpdiscuzAjaxObj.wmuKeyFiles&&(r=wpdiscuzAjaxObj.wmuIconFile);var m='<div class="wmu-preview [PREVIEW_TYPE_CLASS]" title="[PREVIEW_TITLE]" data-wmu-type="[PREVIEW_TYPE]" data-wmu-attachment="[PREVIEW_ID]"><div class="wmu-preview-remove"><img class="wmu-preview-img" src="[PREVIEW_ICON]"><div class="wmu-file-name">[PREVIEW_FILENAME]</div><div class="wmu-delete">&nbsp;</div></div></div>';m=(m=(m=(m=(m=(m=m.replace("[PREVIEW_TYPE_CLASS]","wmu-preview-"+t)).replace("[PREVIEW_TITLE]",s)).replace("[PREVIEW_TYPE]",t)).replace("[PREVIEW_ID]",i)).replace("[PREVIEW_ICON]",r)).replace("[PREVIEW_FILENAME]",u),e(".wmu-action-wrap .wmu-"+t+"-tab",a).removeClass("wmu-hide").append(m)})})}(t,a),a.data.errors&&(wpdiscuzAjaxObj.setCommentMessage(a.data.errors,"error",3e3),console.log(a.data.errors))):a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.errorCode],a.data.errorCode,t),"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250)})}(a,t,d)}),e(document).on("click",".wmu-attachment-delete",function(a){if(confirm(wpdiscuzAjaxObj.wmuPhraseConfirmDelete)){var t=e(this).data("wmu-attachment"),d=new FormData;d.append("action","wmuDeleteAttachment"),d.append("attachmentId",t),wpdiscuzAjaxObj.getAjaxObj(!0,!0,d).done(function(a){if(a.success){var d=e(".wmu-attachment-"+t).parents(".wmu-comment-attachments");e(".wmu-attachment-"+t).remove(),e(".wmu-attached-images *",d).length||e(".wmu-attached-images",d).remove(),e(".wmu-attached-videos *",d).length||e(".wmu-attached-videos",d).remove(),e(".wmu-attached-files *",d).length||e(".wmu-attached-files",d).remove()}else a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.errorCode],a.data.errorCode,d),"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250)})}else console.log("canceled")}),e(document).on("click",".wmu-preview",function(){var a=e(this),t=a.parents(".wpd_comm_form"),d=(a.data("wmu-type"),a.data("wmu-attachment")),o=new FormData;o.append("action","wmuRemoveAttachmentPreview"),o.append("attachmentId",d),o.append("wmuAttachmentsData",e(".wmu-attachments-data",t).val()),o.append("uniqueId",t.find(".wpdiscuz_unique_id").val()),wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(d){if(d.success){a.remove();var o=e(".wmu-tabs",t);e.each(o,function(a,t){e(".wmu-preview",t).length?e(t).removeClass("wmu-hide"):e(t).addClass("wmu-hide")}),e(".wmu-attached-data-info",t).remove(),e(".wmu-add-files",t).after(d.data.attachmentsHtml),d.data.tooltip&&e(".wmu-upload-wrap",t).attr("wpd-tooltip",d.data.tooltip)}else d.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[d.data.errorCode],d.data.errorCode,t),"error",3e3):d.data.error&&wpdiscuzAjaxObj.setCommentMessage(d.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250)})}),parseInt(wpdiscuzAjaxObj.wmuIsLightbox)){function a(){e(".wmu-lightbox").colorbox({maxHeight:"95%",maxWidth:"95%",rel:"wmu-lightbox",fixed:!0})}a(),wpdiscuzAjaxObj.wmuAddLightBox=a}wpdiscuzAjaxObj.wmuHideAll=function(a,t){"object"==typeof a?a.success?(e(".wmu-tabs",t).addClass("wmu-hide"),e(".wmu-preview",t).remove(),e(".wmu-attached-data-info",t).remove()):console.log(a.data):console.log(a)}});
11
  /* Lity */
12
  !function(e,t){"function"==typeof define&&define.amd?define(["jquery"],function(n){return t(e,n)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(e,require("jquery")):e.lity=t(e,e.jQuery||e.Zepto)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=e.document,i=t(e),r=t.Deferred,o=t("html"),a=[],l="aria-hidden",s="lity-"+l,d='a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),iframe,object,embed,[contenteditable],[tabindex]:not([tabindex^="-"])',c={esc:!0,handler:null,handlers:{image:C,inline:function(e,n){var i,r,o;try{i=t(e)}catch(e){return!1}if(!i.length)return!1;return r=t('<i style="display:none !important"/>'),o=i.hasClass("lity-hide"),n.element().one("lity:remove",function(){r.before(i).remove(),o&&!i.closest(".lity-content").length&&i.addClass("lity-hide")}),i.removeClass("lity-hide").after(r)},youtube:function(e){var n=f.exec(e);if(!n)return!1;return k(x(e,w("https://www.youtube"+(n[2]||"")+".com/embed/"+n[4],t.extend({autoplay:1},b(n[5]||"")))))},vimeo:function(e){var n=y.exec(e);if(!n)return!1;return k(x(e,w("https://player.vimeo.com/video/"+n[3],t.extend({autoplay:1},b(n[4]||"")))))},googlemaps:function(e){var t=v.exec(e);if(!t)return!1;return k(x(e,w("https://www.google."+t[3]+"/maps?"+t[6],{output:t[6].indexOf("layer=c")>0?"svembed":"embed"})))},facebookvideo:function(e){var n=p.exec(e);if(!n)return!1;0!==e.indexOf("http")&&(e="https:"+e);return k(x(e,w("https://www.facebook.com/plugins/video.php?href="+e,t.extend({autoplay:1},b(n[4]||"")))))},iframe:k},template:'<div class="lity" role="dialog" aria-label="Dialog Window (Press escape to close)" tabindex="-1"><div class="lity-wrap" data-lity-close role="document"><div class="lity-loader" aria-hidden="true">Loading...</div><div class="lity-container"><div class="lity-content"></div><button class="lity-close" type="button" aria-label="Close (Press escape to close)" data-lity-close>&times;</button></div></div></div>'},u=/(^data:image\/)|(\.(png|jpe?g|gif|svg|webp|bmp|ico|tiff?)(\?\S*)?$)/i,f=/(youtube(-nocookie)?\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11})(.*)?/i,y=/(vimeo(pro)?.com)\/(?:[^\d]+)?(\d+)\??(.*)?$/,v=/((maps|www)\.)?google\.([^\/\?]+)\/?((maps\/?)?\?)(.*)/i,p=/(facebook\.com)\/([a-z0-9_-]*)\/videos\/([0-9]*)(.*)?$/i,m=function(){var e=n.createElement("div"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in t)if(void 0!==e.style[i])return t[i];return!1}();function h(e){var t=r();return m&&e.length?(e.one(m,t.resolve),setTimeout(t.resolve,500)):t.resolve(),t.promise()}function g(e,n,i){if(1===arguments.length)return t.extend({},e);if("string"==typeof n){if(void 0===i)return void 0===e[n]?null:e[n];e[n]=i}else t.extend(e,n);return this}function b(e){for(var t,n=decodeURI(e.split("#")[0]).split("&"),i={},r=0,o=n.length;r<o;r++)n[r]&&(i[(t=n[r].split("="))[0]]=t[1]);return i}function w(e,n){return e+(e.indexOf("?")>-1?"&":"?")+t.param(n)}function x(e,t){var n=e.indexOf("#");return-1===n?t:(n>0&&(e=e.substr(n)),t+e)}function C(e,n){var i=n.opener()&&n.opener().data("lity-desc")||"Image with no description",o=t('<img src="'+e+'" alt="'+i+'"/>'),a=r(),l=function(){var e;a.reject((e="Failed loading image",t('<span class="lity-error"/>').append(e)))};return o.on("load",function(){if(0===this.naturalWidth)return l();a.resolve(o)}).on("error",l),a.promise()}function k(e){return'<div class="lity-iframe-container"><iframe frameborder="0" allowfullscreen src="'+e+'"/></div>'}function E(){return n.documentElement.clientHeight?.9*n.documentElement.clientHeight:Math.round(.9*i.height())}function j(e){var t,i,r,o=z();o&&(27===e.keyCode&&o.options("esc")&&o.close(),9===e.keyCode&&(t=e,i=o.element().find(d),r=i.index(n.activeElement),t.shiftKey&&r<=0?(i.get(i.length-1).focus(),t.preventDefault()):t.shiftKey||r!==i.length-1||(i.get(0).focus(),t.preventDefault())))}function D(){t.each(a,function(e,t){t.resize()})}function z(){return 0===a.length?null:a[0]}function T(e,d,u,f){var y,v,p,m,b,w,x,C,k,z,T,O=this,q=!1,W=!1;d=t.extend({},c,d),v=t(d.template),O.element=function(){return v},O.opener=function(){return u},O.options=t.proxy(g,O,d),O.handlers=t.proxy(g,O,d.handlers),O.resize=function(){q&&!W&&p.css("max-height",E()+"px").trigger("lity:resize",[O])},O.close=function(){if(q&&!W){var e;W=!0,(e=O).element().attr(l,"true"),1===a.length&&(o.removeClass("lity-active"),i.off({resize:D,keydown:j})),((a=t.grep(a,function(t){return e!==t})).length?a[0].element():t(".lity-hidden")).removeClass("lity-hidden").each(function(){var e=t(this),n=e.data(s);n?e.attr(l,n):e.removeAttr(l),e.removeData(s)});var d=r();if(f&&(n.activeElement===v[0]||t.contains(v[0],n.activeElement)))try{f.focus()}catch(e){}return p.trigger("lity:close",[O]),v.removeClass("lity-opened").addClass("lity-closed"),h(p.add(v)).always(function(){p.trigger("lity:remove",[O]),v.remove(),v=void 0,d.resolve()}),d.promise()}},m=e,b=O,w=d.handlers,x=d.handler,k="inline",z=t.extend({},w),x&&z[x]?(C=z[x](m,b),k=x):(t.each(["inline","iframe"],function(e,t){delete z[t],z[t]=w[t]}),t.each(z,function(e,t){return!t||!(!t.test||t.test(m,b))||(!1!==(C=t(m,b))?(k=e,!1):void 0)})),y={handler:k,content:C||""},v.attr(l,"false").addClass("lity-loading lity-opened lity-"+y.handler).appendTo("body").focus().on("click","[data-lity-close]",function(e){t(e.target).is("[data-lity-close]")&&O.close()}).trigger("lity:open",[O]),T=O,1===a.unshift(T)&&(o.addClass("lity-active"),i.on({resize:D,keydown:j})),t("body > *").not(T.element()).addClass("lity-hidden").each(function(){var e=t(this);void 0===e.data(s)&&e.data(s,e.attr(l)||null)}).attr(l,"true"),t.when(y.content).always(function(e){p=t(e).css("max-height",E()+"px"),v.find(".lity-loader").each(function(){var e=t(this);h(e).always(function(){e.remove()})}),v.removeClass("lity-loading").find(".lity-content").empty().append(p),q=!0,p.trigger("lity:ready",[O])})}function O(e,i,r){e.preventDefault?(e.preventDefault(),e=(r=t(this)).data("lity-target")||r.attr("rel")||r.attr("src")):r=t(r);var o=new T(e,t.extend({},r.data("lity-options")||r.data("lity"),i),r,n.activeElement);if(!e.preventDefault)return o}return C.test=function(e){return u.test(e)},O.version="2.2.2",O.options=t.proxy(g,O,c),O.handlers=t.proxy(g,O,c.handlers),O.current=z,t(n).on("click.lity","[data-wpd-lity]",O),O});
13
  /* My Content and Settings */
assets/js/wpdiscuz-combo.min.js CHANGED
@@ -7,11 +7,11 @@
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,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br />")+".<br/>.";if(jQuery(textarea).height()!=jQuery(mirror).height())jQuery(textarea).height(jQuery(mirror).height())};var growTextarea=function(){sendContentToMirror(this)};var mirror=createMirror(this);mirror.style.display="none";mirror.style.wordWrap="break-word";mirror.style.padding=jQuery(this).css("padding");mirror.style.width=jQuery(this).css("width");mirror.style.fontFamily=jQuery(this).css("font-family");mirror.style.fontSize=jQuery(this).css("font-size");mirror.style.lineHeight=jQuery(this).css("line-height");this.style.overflow="hidden";this.style.minHeight=this.rows+"em";this.onkeydown=growTextarea;sendContentToMirror(this)})};
9
  /* wpDiscuz */
10
- var wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor);if(wpdiscuzLoadRichEditor)var wpDiscuzEditor=new WpdEditor;function wpdMessagesOnInit(e,t){wpdiscuzAjaxObj.setCommentMessage(e,t),setTimeout(function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)},3e3)}wpdiscuzAjaxObj.setCommentMessage=function(e,t,a){var o="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?o="wpdiscuz-message-success":"warning"===t[n]&&(o="wpdiscuz-message-warning"):"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(a instanceof Array?a[n]:a||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e).prependTo("#wpdiscuz-comment-message").delay(a||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},wpdiscuzAjaxObj.applyFilterOnPhrase=function(e,t,a){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,function(o){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]]&&(e=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]](e,t,a))}),e},jQuery(document).ready(function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType),s=parseInt(wpdiscuzAjaxObj.wc_post_id),d=wpdiscuzAjaxObj.wpdiscuz_nonce,c=parseInt(wpdiscuzAjaxObj.commentListUpdateType),p=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer),r=parseInt(wpdiscuzAjaxObj.liveUpdateGuests),l=wpdiscuzAjaxObj.loadLastCommentId,m=l,w=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 u,f=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate),h=wpdiscuzAjaxObj.storeCommenterData,b=parseInt(wpdiscuzAjaxObj.wmuEnabled),_=wpdiscuzAjaxObj.isCookiesEnabled,g=!0,z=wpdiscuzAjaxObj.cookiehash,v=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),j=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,x=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),C=parseInt(wpdiscuzAjaxObj.enableBubble),k=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),y=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),O=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,A=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),I=wpdiscuzAjaxObj.bubbleLocation,T=wpdiscuzAjaxObj.inlineFeedbackAttractionType,D=(D=parseInt(wpdiscuzAjaxObj.scrollSize))||32,F=[],E=[],M=[],L=!1,R=1,S=e("html").css("scroll-behavior"),P=e("body").css("scroll-behavior");(e(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?e(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .the_champ_login_container").length?e(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .social_connect_form").length?e(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&e(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",function(t){var a=e(".wpd-form").not(":hidden");if(a.length)if(wpdiscuzLoadRichEditor){for(var o=0;o<a.length;o++)if("\n"!==wpDiscuzEditor.createEditor(e(a[o]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(o=0;o<a.length;o++)if(e(a[o]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")}),wpdiscuzLoadRichEditor||(e(document).delegate("textarea.wc_comment","input",function(){ue(e(this))}),e.each(e("textarea.wc_comment"),function(){ue(e(this))})),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(j)}),e(document).on("focus","#wpdcom textarea",function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()}),t)||W({comment_author:Cookies.get("comment_author_"+z),comment_author_email:Cookies.get("comment_author_email_"+z),comment_author_url:Cookies.get("comment_author_url_"+z)});if(e(".wpd-vote-down.wpd-dislike-hidden").remove(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),e(document).on("click","#wpd-editor-source-code-wrapper-bg",function(){e(this).hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")}),wpdiscuzLoadRichEditor&&e(document).on("click","#wpd-insert-source-code",function(){var t=wpDiscuzEditor.createEditor("#"+e("#wpd-editor-uid").val());t.deleteText(0,t.getLength(),Quill.sources.USER);var a=e("#wpd-editor-source-code").val();a.length&&t.clipboard.dangerouslyPasteHTML(0,a,Quill.sources.USER),t.update(),e("#wpd-editor-source-code-wrapper-bg").hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")}),e(document).on("click",".wpd-reply-button",function(){var i=Y(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()},j):setTimeout(function(){e("#wc-textarea-"+i).trigger("focus")},j),e("#wpd-secondary-form-wrapper-"+i).slideToggle(j)):function(a){var o=Y(a,0);e("#wpdiscuz_form_anchor-"+o).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(o));var n=e("#wpd-secondary-form-wrapper-"+o);if(!t){var i={comment_author:Cookies.get("comment_author_"+z),comment_author_email:Cookies.get("comment_author_email_"+z),comment_author_url:Cookies.get("comment_author_url_"+z)};W(i)}wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+o).focus()},j):setTimeout(function(){e("#wc-textarea-"+o).trigger("focus")},j);n.slideToggle(j,function(){a.addClass("wpdiscuz-clonned")})}(e(this)),function(t){if((a||o)&&"2.0"===n){var i=J(t);setTimeout(function(){if(!E[i])try{E[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){e("#wpdiscuz-recaptcha-field-"+t).val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-"+t).val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3)}}(i)}),e(document).on("click","#wpdcom .wpd-comment-link [data-comment-url]",function(){var t=e(this).data("comment-url"),a=e("<input/>");a.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),a.trigger("select"),document.execCommand("copy"),a.remove(),wpdiscuzAjaxObj.setCommentMessage(t+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)}),e(document).on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",function(e){e.preventDefault()}),e(document).on("click",".wpd-toggle.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked");var a=Y(e(this),0),o=e(this),n=e(".fas",o);!o.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&v?function(t,a){var o=J(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",o),he(x,!0,n).done(function(o){a.addClass("wpd_not_clicked"),"object"==typeof o&&o.success&&(e("#wpd-comm-"+t).replaceWith(o.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle .wpd-view-replies .wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),e("#wpd-comm-"+t+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),fe(o)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,n){console.log(n),a.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}(a,t):e("#wpd-comm-"+a+"> .wpd-reply").slideToggle(700,function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),o.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),o.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),t.addClass("wpd_not_clicked")})}),e(document).on("mouseenter",".wpd-new-loaded-comment",function(){e(this).removeClass("wpd-new-loaded-comment")}),e(document).on("click",".wpd-sbs-toggle",function(){e(".wpdiscuz-subscribe-bar").slideToggle(j)}),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm)&&!t&&wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&e("#wpdiscuz-subscribe-form").length&&("2.0"===n?(setTimeout(function(){try{grecaptcha.render("wpdiscuz-recaptcha-subscribe-form",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-subscribe-form").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val()?e(".wpdiscuz-recaptcha",e(this)).css("border","none"):(e(".wpdiscuz-recaptcha",e(this)).css("border","1px solid red"),t.preventDefault())})):"3.0"===n&&e(document).on("click","#wpdiscuz_subscription_button",function(t){var a=e(this).parents("#wpdiscuz-subscribe-form");t.preventDefault();try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then(function(e){console.log(5555),document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=e,a.trigger("submit")},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}})),(a||o)&&"2.0"===n){var q=e(window).width(),H=e("#wpdcom").width();H>=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%"})),H>=940&&H<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%"})),H>=810&&H<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%"})),H>=730&&H<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%"})),H>=610&&H<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%"})),q>650&&(H>=510&&H<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"})),H>=470&&H<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"})),H<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 U(t,a,o){he(x||b,!1,a).done(function(a){if(e(o).addClass("wpd_not_clicked"),"object"==typeof a)if(a.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(j),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),e(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html);var n=j;a.data.is_main?ie(a.data.message):(n=j+700,e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).slideToggle(700),1==a.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).after(a.data.message):e("#wpd-comm-"+a.data.uniqueid).after(a.data.message)),function(e){if(!e.data.held_moderate){var t=new FormData;t.append("action","wpdCheckNotificationType"),t.append("comment_id",e.data.new_comment_id),t.append("email",e.data.comment_author_email),t.append("isParent",e.data.is_main),he(x,!0,t)}}(a),function(e){if(e.data.redirect>0&&e.data.new_comment_id){var t=new FormData;t.append("action","wpdRedirect"),t.append("commentId",e.data.new_comment_id),he(x,!0,t).done(function(e){"object"==typeof e&&e.success&&setTimeout(function(){location.href=e.data},2e3)}).fail(function(e,t,a){console.log(a)})}}(a),_&&g?function(t){var a=t.comment_author_email,o=t.comment_author,n=t.comment_author_url;null==h?(Cookies.set("comment_author_email_"+z,a),Cookies.set("comment_author_"+z,o),n.length&&Cookies.set("comment_author_url_"+z,n)):(h=parseInt(h),Cookies.set("comment_author_email_"+z,a,{expires:h,path:"/"}),Cookies.set("comment_author_"+z,o,{expires:h,path:"/"}),n.length&&Cookies.set("comment_author_url_"+z,n,{expires:h,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(a.data):g||e(".wpd-cookies-checkbox").prop("checked",!1),t.get(0).reset(),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]):ue(t.find(".wc_comment")),W(a.data),e(".wmu-preview-wrap",t).remove(),F.length&&(F.forEach(function(e){e.parents(".wpd-field-checkbox").remove()}),F=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){oe(),e("html, body").animate({scrollTop:e("#comment-"+a.data.new_comment_id).offset().top-D},1e3,ne)},n),fe(a,t)}else a.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"),fe(a,t));else wpdiscuzAjaxObj.setCommentMessage(a,"error");e("#wpdiscuz-loading-bar").fadeOut(250),L=!1}).fail(function(t,a,n){console.log(n),e(o).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}function W(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 V(t,a){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(a),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}e(document).on("click",".wc_comm_submit.wpd_not_clicked",function(){var i=e(this),s=1,d=e(this).parents("form");if(d.hasClass("wpd_main_comm_form")||(s=function(t){var a=t.attr("class").split(" "),o="";return e.each(a,function(e,t){"wpd_comment_level"===Z(t,!1)&&(o=Z(t,!0))}),parseInt(o)+1}(e(this).parents(".wpd-comment"))),ae(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)){L=!0,function(t){e(".wpd-agreement-checkbox",t).each(function(){e(this).hasClass("wpd_agreement_hide")&&_&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+z,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each(function(){F.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")||(g=!1):t&&(g=!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),U(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 U(d,c,i)}var p,r;!function(e){if((a||o)&&"2.0"===n){var t=J(e);grecaptcha.reset(E[t])}}(e(".wpdiscuz_unique_id",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wc_msg_required_fields,"wc_msg_required_fields",d),"error")}),e(document).on("click",".wpd_editable_comment",function(){u&&e(".wpdiscuz-edit-form-wrap").length&&V(Y(e(".wpdiscuz-edit-form-wrap"),0),u);var t=e(this),a=Y(t,0),o=J(a),n=new FormData;n.append("action","wpdEditComment"),n.append("commentId",o),u=e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-text").get(0),he(x,!0,n).done(function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){var n=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+a);n.clipboard.dangerouslyPasteHTML(0,o.data.content),n.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+a).val(o.data.content),ue(e("#wc-textarea-edit_"+a));e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wc_save_edited_comment",function(){var t=e(this),a=Y(t),o=J(a),n=e("#wpd-comm-"+a+" #wpdiscuz-edit-form");if(ae(n,"#wpd-editor-edit_"+a),n.on("submit",function(e){e.preventDefault()}),n[0].checkValidity()){var i=new FormData;i.append("action","wpdSaveEditedComment"),i.append("commentId",o),e(":input",n).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&i.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&i.append(this.name+"",e(this).val())}),he(x,!0,i).done(function(n){"object"==typeof n?(n.success?(V(a,n.data.message),n.data.lastEdited&&(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(n.data.lastEdited).insertAfter("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),n.data.twitterShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",n.data.twitterShareLink),n.data.whatsappShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",n.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error"),fe(n,o)):console.log(n),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=Y(e(this));V(t,u),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!f&&w&&(R=0,1==w?setTimeout(function(){Q(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),Q(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&Q(!1,t,"wpd-loaded","wpd-loading")});var B=!1;function K(){var t=e("#wpdiscuzHasMoreComments").val(),a=e(document).height(),o=e(window).height()+e(window).scrollTop();a&&o&&(100*o/a>=80&&!1===B&&1==t&&(B=!0,Q(!1,e(".wpd-load-more-submit"))))}function Q(t,a,o,n){a&&(a.toggleClass(o),a.toggleClass(n));var s=new FormData;s.append("action","wpdLoadMoreComments");var d=e(".wpdiscuz-sort-button-active").attr("data-sorting");d&&s.append("sorting",d),s.append("offset",R),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||""),he(x,!t||1!=w,s).done(function(s){"object"==typeof s&&s.success&&(R++,t&&e(".wpd-comment").remove(),e(".wpdiscuz_single").remove(),e(".wpdiscuz-comment-pagination").before(s.data.comment_list),N(s,t&&2!==i),B=!1,s.data.loadLastCommentId&&(l=s.data.loadLastCommentId),fe(s),t&&G(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))}).fail(function(t,i,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))})}function N(t,a){var o;0==t.data.is_show_load_more?(e("#wpdiscuzHasMoreComments").val(0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()):(o=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",o),2!==i&&e(".wpdiscuz-comment-pagination").show(),e("#wpdiscuzHasMoreComments").val(1),a&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show()),fe(t)}function G(t){var a=location.href.match(/#comment\-(\d+)/);if(null!==a){var o=a[1];if(e("#comment-"+o).length)setTimeout(function(){oe(),e("html, body").animate({scrollTop:e("#comment-"+o).parents("[id^=wpd-comm-]").offset().top-D},1e3,ne),t&&$(o)},500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",o),he(x,!0,n).done(function(a){if("object"==typeof a&&a.success){var n="#comment-"+o;e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),fe(a),oe(),e("html, body").animate({scrollTop:e(n).offset().top-D},1e3,ne),t&&$(o)}e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}}function $(t){setTimeout(function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")},1100)}function X(e){if(void 0!==e.data.message)for(var t,a=e.data.message,o=0;o<a.length;o++)ee((t=a[o]).comment_parent,t.comment_html)}function Y(e,t){var a="";return(a=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(a.lastIndexOf("-")+1)}function J(e){return e.substring(0,e.indexOf("_"))}function Z(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function ee(t,a){if(0==t)ie(a);else{var o=Y(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+o).after(a)}}function te(){var t=[];return e(".wpd-comment-right").each(function(){t.push(J(Y(e(this),0)))}),t.join(",")}function ae(t,a){var o=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(a+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),a=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");a=(a=(a=(a=a.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),t.val(a)}(t),e.each(o,function(){e("input",this).prop("required",!1),0===e("input:checked",this).length?e("input",e(this)).prop("required",!0):e(".wpd-field-invalid",this).remove()})}function oe(){e("html, body").css("scroll-behavior","unset")}function ne(){e("html").css("scroll-behavior",S),e("body").css("scroll-behavior",P)}function ie(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function se(t){t?t.prop("required")||(t.val()?t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):e.each(e(".wc_email"),function(t,a){var o=e(a);o.prop("required")||(o.val()?o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==i||f||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),K(),e(window).scroll(function(){K()})),wpdiscuzAjaxObj.setLoadMoreVisibility=N,e(document).on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",function(){var t=e(this);e(t).removeClass("wpd_not_clicked");var a,o=J(Y(t));a=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",o),n.append("voteType",a),he(x,!0,n).done(function(n){if(e(t).addClass("wpd_not_clicked"),"object"==typeof n){if(n.success){if("total"===n.data.buttonsStyle){var i=e(".wpd-comment-footer .wpd-vote-result",e("#comment-"+o)),s=n.data.votes;i.text(n.data.votesHumanReadable),i.attr("title",s),i.removeClass("wpd-up wpd-down"),s>0&&i.addClass("wpd-up"),s<0&&i.addClass("wpd-down")}else{var d=e(".wpd-comment-footer .wpd-vote-result-like",e("#comment-"+o)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+o));d.text(n.data.likeCountHumanReadable),d.attr("title",n.data.likeCount),c.text(n.data.dislikeCountHumanReadable),c.attr("title",n.data.dislikeCount),parseInt(n.data.likeCount)>0?d.addClass("wpd-up"):d.removeClass("wpd-up"),parseInt(n.data.dislikeCount)<0?c.addClass("wpd-down"):c.removeClass("wpd-down")}var p=e(".wpd-comment-footer .wpd-vote-up",e("#comment-"+o)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+o));p.removeClass("wpd-up"),r.removeClass("wpd-down"),n.data.curUserReaction>0?p.addClass("wpd-up"):n.data.curUserReaction<0&&r.addClass("wpd-down")}else n.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error");fe(n,o,a)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,o,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click","body",function(t){var a=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?a.css({display:a.is(":visible")?"none":"flex"}):a.hide()}),e(document).on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var t=e(this),a=e(this).attr("data-sorting");if(a){e(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),t.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var o=new FormData;o.append("action","wpdSorting"),o.append("sorting",a);var n=e(".wpdf-active").attr("data-filter-type");o.append("wpdType",n||""),he(x,!0,o).done(function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),N(t,!1),R=1),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){G(!1)},1!=w&&G(!1),e(document).on("click",".wpdiscuz-readmore",function(){var t=Y(e(this)),a=J(t),o=new FormData;o.append("action","wpdReadMore"),o.append("commentId",a),he(x,!0,o).done(function(o){"object"==typeof o?(o.success?(e("#comment-"+a+" .wpd-comment-text").replaceWith(" "+o.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(o.data),fe(o)):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("change",".wpd-required-group",function(){0!==e("input:checked",this).length?e("input",e(this)).prop("required",!1):e("input",e(this)).prop("required",!0)}),e(document).on("click",".wpdiscuz-spoiler",function(){e(this).next().slideToggle(),e(this).hasClass("wpdiscuz-spoiler-closed")?e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"):e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"),e(this).toggleClass("wpdiscuz-spoiler-closed")}),e(document).on("click",".wpd-tools i",function(){var t=e(this).siblings(".wpd-tools-actions");t.is(":visible")||e(this).parents(".wpd-comment-right").attr("id")!==e("[id^=comment-]","#wpdcom").last().attr("id")||e("#comments").css({paddingBottom:"160px"}),t.css({display:t.is(":visible")?"none":"flex"})}),e(document).on("mouseleave",".wpd-comment-right",function(){e(this).find(".wpd-tools-actions").hide(),e("#comments").css({paddingBottom:"0"})}),e(document).on("click",".wpd_stick_btn",function(){var t=J(Y(e(this),0)),a=new FormData;a.append("action","wpdStickComment"),a.append("commentId",t),he(x,!0,a).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd_close_btn",function(){var t=J(Y(e(this),0)),a=new FormData;a.append("action","wpdCloseThread"),a.append("commentId",t),he(x,!0,a).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var t=e(this),a=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+a),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&o.append("sorting",n),o.append("lastParentId",0),o.append("offset",0),R=1,o.append("wpdType",t.hasClass("wpdf-active")?"":a),o.append("isFirstLoad",1),e(this).hasClass("wpdf-inline")?e(this).hasClass("wpdf-active")?e(".wpd-comment-info-bar").hide():e(".wpd-comment-info-bar").css("display","flex"):e(".wpd-comment-info-bar").hide(),he(x,!1,o).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(a.data.comment_list),N(a),l=a.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),fe(a)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpdf-reacted.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdMostReactedComment"),he(x,!1,a).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e("#comment-"+a.data.commentId).length||e(".wpd-thread-list").prepend(a.data.message),fe(a),oe(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-D},1e3,ne))}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")})}),e(document).on("click",".wpdf-hottest.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdHottestThread"),he(x,!1,a).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.commentId).length?e("#comment-"+a.data.commentId).parents("[id^=wpd-comm-"+a.data.commentId+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),fe(a),oe(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-D},1e3,ne))}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")})}),e(document).on("click",".wpd-filter-view-all",function(){e(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")}),e(document).on("click",".wpd-follow-link.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=J(Y(t,0)),o=new FormData;o.append("action","wpdFollowUser"),o.append("commentId",a),he(x,!0,o).done(function(a){t.addClass("wpd_not_clicked"),"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.code],a.data.code,t),"success"),t.removeClass("wpd-follow-active"),a.data.followTip&&t.attr("wpd-tooltip",a.data.followTip),a.data.followClass&&t.addClass(a.data.followClass)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),se(),e(document).on("keyup",".wc_email",function(){se(e(this))}),C&&e("#wpdcom").length){if(e("#wpd-bubble-wrapper").hover(function(){e(this).addClass("wpd-bubble-hover")},function(){e(this).removeClass("wpd-bubble-hover")}),y&&!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*O)},1e3*y),"content_left"===I)if(e(".entry-content").length){var de=(ce=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?ce:25;e("#wpd-bubble-wrapper").css({left:de+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){de=(ce=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?ce:25;e("#wpd-bubble-wrapper").css({left:de+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var ce;de=(ce=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?ce:25;e("#wpd-bubble-wrapper").css({left:de+"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"===I?(e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===I&&(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(){oe(),e("#tab-title-reviews").length&&e("#tab-title-reviews a").trigger("click"),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-(D+28)},1e3,function(){ne(),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"),G(!0);var a=t.match(/#comment\-(\d+)/);M=M.filter(function(e){return e!=a[1]}),e("#wpd-bubble-count .wpd-new-comments-count").text(M.length),0==M.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),e(document).on("click","#wpd-bubble-count",function(){if(M.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",M.join()),he(x,!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}),X(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),M=[],e(".wpd-new-loaded-comment").length&&(oe(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-(D+28)},1e3,ne)),fe(t)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,a){console.log(a)})}})}if((C&&k||c)&&(t||!t&&r)&&setTimeout(function t(){e.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:s,lastId:m,visibleCommentIds:te()}}).done(function(a){if(!L)if("object"==typeof a){if(a.commentIDsToRemove.forEach(function(t){e("[id^=wpd-comm-"+t+"]").remove()}),a.ids.length){c&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",l),i.append("visibleCommentIds",te()),he(x,!1,i).done(function(t){L||"object"==typeof t&&t.success&&(X(t),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),l=t.data.loadLastCommentId)}).fail(function(e,t,a){console.log(a)})),a.ids=a.ids.filter(function(t){if(!e("#comment-"+t).length)return t});var o=5e3;m=parseInt(a.ids[a.ids.length-1]),M=M.concat(a.ids),A&&a.commentText&&(e("#wpd-bubble-author-avatar").html(a.avatar),e("#wpd-bubble-author-name").html(a.authorName),e("#wpd-bubble-comment-date span").html(a.commentDate),e("#wpd-bubble-comment-text").html(a.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",a.commentLink),e("#wpd-bubble-notification-message").show(),o=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=a.ids.length,e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),e("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout(function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")},o),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}a.all_comments_count=parseInt(a.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(a.all_comments_count_bubble_html),e(".wpd-thread-info").html(a.all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.all_comments_count)}else console.log(a);var i;setTimeout(t,p)}).fail(function(e,a,o){console.log(o),setTimeout(t,p)})},p),e(".wpd-inline-form-wrapper").length){var pe=new FormData;pe.append("action","wpdGetInlineCommentForm"),he(x,!1,pe).done(function(t){"object"==typeof t?t.success?(e(".wpd-inline-form-wrapper").append(t.data),e.each(e("[name=_wpd_inline_nonce]"),function(){var t=e(this).attr("id"),a=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+a.substring(a.lastIndexOf("-")+1))}),e(".wpd-inline-opened").addClass("wpd-active"),e(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),e(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),e(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),we()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data]),t.data,"error"):console.log(t)}).fail(function(e,t,a){console.log(a)})}function re(t){if(e(t).hasClass("wpd-inline-shortcode"))var a=e(t).attr("id");else a=e(t).parents(".wpd-inline-shortcode").attr("id");return a.substring(a.lastIndexOf("-")+1)}function le(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function me(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var t=e(this),a=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&a>0&&a<300&&("blink"===T?(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"),we(t.siblings(".wpd-inline-form-wrapper"))))})}function we(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(a=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var a;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(a=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}}else e.each(e(".wpd-inline-form-wrapper:visible"),function(){if(e(this).offset().left<=10)e(this).css("left",Math.ceil(parseInt(e(this).css("left"))-e(this).offset().left+10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))<3&&(t=3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;");else if(e(this).offset().left+e(this).width()>document.body.clientWidth-10){var t;e(this).css("left",Math.ceil(parseInt(e(this).css("left"))+(document.body.clientWidth-(e(this).offset().left+e(this).width()))-10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))>e(this).width()-3&&(t=e(this).width()-3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;")}})}function ue(t){var a,o=0;if(t.parents(".wpd_main_comm_form").length)o=parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents(".wpd_main_comm_form");else if(t.parents(".wpd-secondary-form-wrapper").length)o=parseInt(wpdiscuzAjaxObj.replyTextMaxLength),a=t.parents(".wpd-secondary-form-wrapper");else if(t.parents("#wpdiscuz-edit-form").length){var n=Y(t);o=parseInt(n.substring(n.lastIndexOf("_")+1))?parseInt(wpdiscuzAjaxObj.replyTextMaxLength):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents("#wpdiscuz-edit-form")}if(o&&a){var i=t.val().length,s=e(".wpd-editor-char-counter",a),d=o-i;s.html(d),d<=10?s.addClass("error"):s.removeClass("error")}}function fe(t,a,o,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,a,o,n):console.log(t.data.callbackFunctions[e]+" is not a function")})}function he(t,a,o){a&&e("#wpdiscuz-loading-bar").show(),o.append("postId",s),o.append("wpdiscuz_nonce",d);var n=o.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(o=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](o,t,a))});var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:o,contentType:!1,processData:!1})}e(document).on("click","body",function(t){if(e(t.target).hasClass("wpd-inline-form-close")||e(t.target).parents(".wpd-inline-form-close").length)t.preventDefault(),e(t.target).parents(".wpd-inline-form-wrapper").hide(),e(t.target).parents(".wpd-inline-shortcode").removeClass("wpd-active"),e(t.target).parents(".wpd-inline-form-wrapper").siblings(".wpd-inline-icon").removeClass("wpd-open");else if(!e(t.target).hasClass("wpd-inline-form-wrapper")&&!e(t.target).parents(".wpd-inline-form-wrapper").length){le();var a="";e(t.target).hasClass("wpd-inline-icon")?a=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(a=e(t.target).parents(".wpd-inline-icon")),a.length&&a.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(a.parents(".wpd-inline-shortcode").addClass("wpd-active"),a.siblings(".wpd-inline-form-wrapper").show(),a.addClass("wpd-open"),a.removeClass("wpd-ignored"),we(a.siblings(".wpd-inline-form-wrapper")))}(!e(t.target).hasClass("wpd-last-inline-comments-wrapper")&&!e(t.target).parents(".wpd-last-inline-comments-wrapper").length||e(t.target).parents(".wpd-last-inline-comments-wrapper").length&&e(t.target).hasClass("wpd-load-inline-comment"))&&e(".wpd-last-inline-comments-wrapper").remove()}),e(document).on("click",".wpd-inline-submit.wpd_not_clicked",function(t){t.preventDefault();var a=e(this),o=e(this).parents(".wpd_inline_comm_form");if(o[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",re(o)),e.each(e("input, textarea",o),function(t,a){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(a).attr("name"),e(a).val()):n.append(e(a).attr("name"),e(a).val())}),he(x,!0,n).done(function(t){if(a.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){o[0].reset(),le();var n=parseInt(t.data.newCount),i=a.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),e(".wpd-thread-info").attr("data-comments-count",t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.message&&ie(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data,a),"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("keydown",".wpd-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_comm_submit").trigger("click")}),e(document).on("keydown","#wpdiscuz-edit-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_save_edited_comment").trigger("click")}),e(document).on("keydown",".wpd-inline-comment-content",function(t){t.ctrlKey&&13==t.keyCode&&e(this).parents(".wpd_inline_comm_form").find(".wpd-inline-submit.wpd_not_clicked").trigger("click")}),e(document).on("click",".wpd-inline-icon-count.wpd-has-comments",function(){var t=e(this),a=new FormData;a.append("action","wpdGetLastInlineComments"),a.append("inline_form_id",re(t)),he(x,!0,a).done(function(a){"object"==typeof a?a.success?e(a.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-view-all-inline-comments",function(t){t.preventDefault(),e(this).parents(".wpd-last-inline-comments-wrapper").remove(),e(".wpdf-inline").hasClass("wpdf-active")||e(".wpdf-inline").trigger("click"),oe(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-D},1e3,ne)}),e(document).on("click",".wpd-feedback-content-link",function(t){t.preventDefault();var a=e(this).data("feedback-content-id");oe(),e("html, body").animate({scrollTop:e("#wpd-inline-"+a).offset().top-(D+6)},1e3,function(){ne(),e("#wpd-inline-"+a).addClass("wpd-active")})}),"scroll_open"!==T&&"blink"!==T||(me(),e(window).on("scroll",me)),e(document).on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var t=new FormData,a=e(this).index();a>=0&&a<5&&(t.append("action","wpdUserRate"),t.append("rating",a+1),he(x,!0,t).done(function(t){"object"==typeof t?t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data),"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))}),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){t.preventDefault();var a,o,i=e(this);if(i[0].checkValidity()&&(a=i,o=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).val().length?(o=!1,e(".wpdiscuz-recaptcha",a).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&e(".wpdiscuz-recaptcha",a).css("border","none"),o)){var s=new FormData;s.append("action","wpdAddSubscription"),e("*",i).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&s.append(this.name+"",e(this).val()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&s.append(this.name+"",e(this).val())}),he(x,!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),L=!1}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wpd-unsubscribe",function(t){t.preventDefault();var a=new FormData;a.append("action","wpdUnsubscribe"),a.append("sid",e(this).data("sid")),a.append("skey",e(this).data("skey")),he(x,!0,a).done(function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250),L=!1}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=he});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 */
14
- jQuery(document).ready(function(e){if(e(document).on("click","#wpdcom .wmu-upload-wrap",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0)}),e(document).on("change",".wmu-add-files",function(){var a=e(this),t=a.parents(".wpd_comm_form"),d=a[0].files?a[0].files:[];d.length&&function(a,t,d){var o=new FormData;o.append("action","wmuUploadFiles"),o.append("wmu_nonce",wpdiscuzAjaxObj.wmuSecurity),o.append("wmuAttachmentsData",e(".wmu-attachments-data",t).val()),o.append("uniqueId",t.find(".wpdiscuz_unique_id").val());var i=0;e.each(d,function(e,a){i+=a.size,o.append(wpdiscuzAjaxObj.wmuInput+"["+e+"]",a)}),i>parseInt(wpdiscuzAjaxObj.wmuMaxFileSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseMaxFileSize,"wmuPhraseMaxFileSize",a),"error",3e3):i>parseInt(wpdiscuzAjaxObj.wmuPostMaxSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhrasePostMaxSize,"wmuPhrasePostMaxSize",a),"error",3e3):wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(a){a.success?(e(".wmu-attached-data-info",t).remove(),e(".wmu-add-files",t).after(a.data.attachmentsHtml),a.data.tooltip&&e(".wmu-upload-wrap",t).attr("wpd-tooltip",a.data.tooltip),function(a,t){e.each(t.data.previewsData,function(t,d){e(".wmu-action-wrap .wmu-"+t+"-tab",a).html(""),e.each(d,function(d,o){var i=o.id,r="",s=o.fullname,u=o.shortname;t==wpdiscuzAjaxObj.wmuKeyImages?(r=o.url,u=""):t==wpdiscuzAjaxObj.wmuKeyVideos?r=wpdiscuzAjaxObj.wmuIconVideo:t==wpdiscuzAjaxObj.wmuKeyFiles&&(r=wpdiscuzAjaxObj.wmuIconFile);var n='<div class="wmu-preview [PREVIEW_TYPE_CLASS]" title="[PREVIEW_TITLE]" data-wmu-type="[PREVIEW_TYPE]" data-wmu-attachment="[PREVIEW_ID]"><div class="wmu-preview-remove"><img class="wmu-preview-img" src="[PREVIEW_ICON]"><div class="wmu-file-name">[PREVIEW_FILENAME]</div><div class="wmu-delete">&nbsp;</div></div></div>';n=(n=(n=(n=(n=(n=n.replace("[PREVIEW_TYPE_CLASS]","wmu-preview-"+t)).replace("[PREVIEW_TITLE]",s)).replace("[PREVIEW_TYPE]",t)).replace("[PREVIEW_ID]",i)).replace("[PREVIEW_ICON]",r)).replace("[PREVIEW_FILENAME]",u),e(".wmu-action-wrap .wmu-"+t+"-tab",a).removeClass("wmu-hide").append(n)})})}(t,a),a.data.errors&&(wpdiscuzAjaxObj.setCommentMessage(a.data.errors,"error",3e3),console.log(a.data.errors))):a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.errorCode],a.data.errorCode,t),"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250)})}(a,t,d)}),e(document).on("click",".wmu-attachment-delete",function(a){if(confirm(wpdiscuzAjaxObj.wmuPhraseConfirmDelete)){var t=e(this).data("wmu-attachment"),d=new FormData;d.append("action","wmuDeleteAttachment"),d.append("wmu_nonce",wpdiscuzAjaxObj.wmuSecurity),d.append("attachmentId",t),wpdiscuzAjaxObj.getAjaxObj(!0,!0,d).done(function(a){if(a.success){var d=e(".wmu-attachment-"+t).parents(".wmu-comment-attachments");e(".wmu-attachment-"+t).remove(),e(".wmu-attached-images *",d).length||e(".wmu-attached-images",d).remove(),e(".wmu-attached-videos *",d).length||e(".wmu-attached-videos",d).remove(),e(".wmu-attached-files *",d).length||e(".wmu-attached-files",d).remove()}else a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.errorCode],a.data.errorCode,d),"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250)})}else console.log("canceled")}),e(document).on("click",".wmu-preview",function(){var a=e(this),t=a.parents(".wpd_comm_form"),d=(a.data("wmu-type"),a.data("wmu-attachment")),o=new FormData;o.append("action","wmuRemoveAttachmentPreview"),o.append("attachmentId",d),o.append("wmu_nonce",wpdiscuzAjaxObj.wmuSecurity),o.append("wmuAttachmentsData",e(".wmu-attachments-data",t).val()),o.append("uniqueId",t.find(".wpdiscuz_unique_id").val()),wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(d){if(d.success){a.remove();var o=e(".wmu-tabs",t);e.each(o,function(a,t){e(".wmu-preview",t).length?e(t).removeClass("wmu-hide"):e(t).addClass("wmu-hide")}),e(".wmu-attached-data-info",t).remove(),e(".wmu-add-files",t).after(d.data.attachmentsHtml),d.data.tooltip&&e(".wmu-upload-wrap",t).attr("wpd-tooltip",d.data.tooltip)}else d.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[d.data.errorCode],d.data.errorCode,t),"error",3e3):d.data.error&&wpdiscuzAjaxObj.setCommentMessage(d.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250)})}),parseInt(wpdiscuzAjaxObj.wmuIsLightbox)){function a(){e(".wmu-lightbox").colorbox({maxHeight:"95%",maxWidth:"95%",rel:"wmu-lightbox",fixed:!0})}a(),wpdiscuzAjaxObj.wmuAddLightBox=a}wpdiscuzAjaxObj.wmuHideAll=function(a,t){"object"==typeof a?a.success?(e(".wmu-tabs",t).addClass("wmu-hide"),e(".wmu-preview",t).remove(),e(".wmu-attached-data-info",t).remove()):console.log(a.data):console.log(a)}});
15
  /* Lity */
16
  !function(e,t){"function"==typeof define&&define.amd?define(["jquery"],function(n){return t(e,n)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(e,require("jquery")):e.lity=t(e,e.jQuery||e.Zepto)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=e.document,i=t(e),r=t.Deferred,o=t("html"),a=[],l="aria-hidden",s="lity-"+l,d='a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),iframe,object,embed,[contenteditable],[tabindex]:not([tabindex^="-"])',c={esc:!0,handler:null,handlers:{image:C,inline:function(e,n){var i,r,o;try{i=t(e)}catch(e){return!1}if(!i.length)return!1;return r=t('<i style="display:none !important"/>'),o=i.hasClass("lity-hide"),n.element().one("lity:remove",function(){r.before(i).remove(),o&&!i.closest(".lity-content").length&&i.addClass("lity-hide")}),i.removeClass("lity-hide").after(r)},youtube:function(e){var n=f.exec(e);if(!n)return!1;return k(x(e,w("https://www.youtube"+(n[2]||"")+".com/embed/"+n[4],t.extend({autoplay:1},b(n[5]||"")))))},vimeo:function(e){var n=y.exec(e);if(!n)return!1;return k(x(e,w("https://player.vimeo.com/video/"+n[3],t.extend({autoplay:1},b(n[4]||"")))))},googlemaps:function(e){var t=v.exec(e);if(!t)return!1;return k(x(e,w("https://www.google."+t[3]+"/maps?"+t[6],{output:t[6].indexOf("layer=c")>0?"svembed":"embed"})))},facebookvideo:function(e){var n=p.exec(e);if(!n)return!1;0!==e.indexOf("http")&&(e="https:"+e);return k(x(e,w("https://www.facebook.com/plugins/video.php?href="+e,t.extend({autoplay:1},b(n[4]||"")))))},iframe:k},template:'<div class="lity" role="dialog" aria-label="Dialog Window (Press escape to close)" tabindex="-1"><div class="lity-wrap" data-lity-close role="document"><div class="lity-loader" aria-hidden="true">Loading...</div><div class="lity-container"><div class="lity-content"></div><button class="lity-close" type="button" aria-label="Close (Press escape to close)" data-lity-close>&times;</button></div></div></div>'},u=/(^data:image\/)|(\.(png|jpe?g|gif|svg|webp|bmp|ico|tiff?)(\?\S*)?$)/i,f=/(youtube(-nocookie)?\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11})(.*)?/i,y=/(vimeo(pro)?.com)\/(?:[^\d]+)?(\d+)\??(.*)?$/,v=/((maps|www)\.)?google\.([^\/\?]+)\/?((maps\/?)?\?)(.*)/i,p=/(facebook\.com)\/([a-z0-9_-]*)\/videos\/([0-9]*)(.*)?$/i,m=function(){var e=n.createElement("div"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in t)if(void 0!==e.style[i])return t[i];return!1}();function h(e){var t=r();return m&&e.length?(e.one(m,t.resolve),setTimeout(t.resolve,500)):t.resolve(),t.promise()}function g(e,n,i){if(1===arguments.length)return t.extend({},e);if("string"==typeof n){if(void 0===i)return void 0===e[n]?null:e[n];e[n]=i}else t.extend(e,n);return this}function b(e){for(var t,n=decodeURI(e.split("#")[0]).split("&"),i={},r=0,o=n.length;r<o;r++)n[r]&&(i[(t=n[r].split("="))[0]]=t[1]);return i}function w(e,n){return e+(e.indexOf("?")>-1?"&":"?")+t.param(n)}function x(e,t){var n=e.indexOf("#");return-1===n?t:(n>0&&(e=e.substr(n)),t+e)}function C(e,n){var i=n.opener()&&n.opener().data("lity-desc")||"Image with no description",o=t('<img src="'+e+'" alt="'+i+'"/>'),a=r(),l=function(){var e;a.reject((e="Failed loading image",t('<span class="lity-error"/>').append(e)))};return o.on("load",function(){if(0===this.naturalWidth)return l();a.resolve(o)}).on("error",l),a.promise()}function k(e){return'<div class="lity-iframe-container"><iframe frameborder="0" allowfullscreen src="'+e+'"/></div>'}function E(){return n.documentElement.clientHeight?.9*n.documentElement.clientHeight:Math.round(.9*i.height())}function j(e){var t,i,r,o=z();o&&(27===e.keyCode&&o.options("esc")&&o.close(),9===e.keyCode&&(t=e,i=o.element().find(d),r=i.index(n.activeElement),t.shiftKey&&r<=0?(i.get(i.length-1).focus(),t.preventDefault()):t.shiftKey||r!==i.length-1||(i.get(0).focus(),t.preventDefault())))}function D(){t.each(a,function(e,t){t.resize()})}function z(){return 0===a.length?null:a[0]}function T(e,d,u,f){var y,v,p,m,b,w,x,C,k,z,T,O=this,q=!1,W=!1;d=t.extend({},c,d),v=t(d.template),O.element=function(){return v},O.opener=function(){return u},O.options=t.proxy(g,O,d),O.handlers=t.proxy(g,O,d.handlers),O.resize=function(){q&&!W&&p.css("max-height",E()+"px").trigger("lity:resize",[O])},O.close=function(){if(q&&!W){var e;W=!0,(e=O).element().attr(l,"true"),1===a.length&&(o.removeClass("lity-active"),i.off({resize:D,keydown:j})),((a=t.grep(a,function(t){return e!==t})).length?a[0].element():t(".lity-hidden")).removeClass("lity-hidden").each(function(){var e=t(this),n=e.data(s);n?e.attr(l,n):e.removeAttr(l),e.removeData(s)});var d=r();if(f&&(n.activeElement===v[0]||t.contains(v[0],n.activeElement)))try{f.focus()}catch(e){}return p.trigger("lity:close",[O]),v.removeClass("lity-opened").addClass("lity-closed"),h(p.add(v)).always(function(){p.trigger("lity:remove",[O]),v.remove(),v=void 0,d.resolve()}),d.promise()}},m=e,b=O,w=d.handlers,x=d.handler,k="inline",z=t.extend({},w),x&&z[x]?(C=z[x](m,b),k=x):(t.each(["inline","iframe"],function(e,t){delete z[t],z[t]=w[t]}),t.each(z,function(e,t){return!t||!(!t.test||t.test(m,b))||(!1!==(C=t(m,b))?(k=e,!1):void 0)})),y={handler:k,content:C||""},v.attr(l,"false").addClass("lity-loading lity-opened lity-"+y.handler).appendTo("body").focus().on("click","[data-lity-close]",function(e){t(e.target).is("[data-lity-close]")&&O.close()}).trigger("lity:open",[O]),T=O,1===a.unshift(T)&&(o.addClass("lity-active"),i.on({resize:D,keydown:j})),t("body > *").not(T.element()).addClass("lity-hidden").each(function(){var e=t(this);void 0===e.data(s)&&e.data(s,e.attr(l)||null)}).attr(l,"true"),t.when(y.content).always(function(e){p=t(e).css("max-height",E()+"px"),v.find(".lity-loader").each(function(){var e=t(this);h(e).always(function(){e.remove()})}),v.removeClass("lity-loading").find(".lity-content").empty().append(p),q=!0,p.trigger("lity:ready",[O])})}function O(e,i,r){e.preventDefault?(e.preventDefault(),e=(r=t(this)).data("lity-target")||r.attr("rel")||r.attr("src")):r=t(r);var o=new T(e,t.extend({},r.data("lity-options")||r.data("lity"),i),r,n.activeElement);if(!e.preventDefault)return o}return C.test=function(e){return u.test(e)},O.version="2.2.2",O.options=t.proxy(g,O,c),O.handlers=t.proxy(g,O,c.handlers),O.current=z,t(n).on("click.lity","[data-wpd-lity]",O),O});
17
  /* My Content and Settings */
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,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br />")+".<br/>.";if(jQuery(textarea).height()!=jQuery(mirror).height())jQuery(textarea).height(jQuery(mirror).height())};var growTextarea=function(){sendContentToMirror(this)};var mirror=createMirror(this);mirror.style.display="none";mirror.style.wordWrap="break-word";mirror.style.padding=jQuery(this).css("padding");mirror.style.width=jQuery(this).css("width");mirror.style.fontFamily=jQuery(this).css("font-family");mirror.style.fontSize=jQuery(this).css("font-size");mirror.style.lineHeight=jQuery(this).css("line-height");this.style.overflow="hidden";this.style.minHeight=this.rows+"em";this.onkeydown=growTextarea;sendContentToMirror(this)})};
9
  /* wpDiscuz */
10
+ var wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor);if(wpdiscuzLoadRichEditor)var wpDiscuzEditor=new WpdEditor;function wpdMessagesOnInit(e,t){wpdiscuzAjaxObj.setCommentMessage(e,t),setTimeout(function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)},3e3)}wpdiscuzAjaxObj.setCommentMessage=function(e,t,a){var o="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?o="wpdiscuz-message-success":"warning"===t[n]&&(o="wpdiscuz-message-warning"):"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(a instanceof Array?a[n]:a||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e).prependTo("#wpdiscuz-comment-message").delay(a||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},wpdiscuzAjaxObj.applyFilterOnPhrase=function(e,t,a){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,function(o){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]]&&(e=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]](e,t,a))}),e},jQuery(document).ready(function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType),s=parseInt(wpdiscuzAjaxObj.wc_post_id);wpdiscuzAjaxObj.wpdiscuz_nonce="";var 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=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate),f=wpdiscuzAjaxObj.storeCommenterData,h=parseInt(wpdiscuzAjaxObj.wmuEnabled),b=wpdiscuzAjaxObj.isCookiesEnabled,_=!0,g=wpdiscuzAjaxObj.cookiehash,z=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),j=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,v=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),x=parseInt(wpdiscuzAjaxObj.enableBubble),C=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),y=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,O=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),A=wpdiscuzAjaxObj.bubbleLocation,I=wpdiscuzAjaxObj.inlineFeedbackAttractionType,T=(T=parseInt(wpdiscuzAjaxObj.scrollSize))||32,D=[],F=[],E=[],M=!1,L=1,R=e("html").css("scroll-behavior"),S=e("body").css("scroll-behavior");(e(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?e(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .the_champ_login_container").length?e(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .social_connect_form").length?e(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&e(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",function(t){var a=e(".wpd-form").not(":hidden");if(a.length)if(wpdiscuzLoadRichEditor){for(var o=0;o<a.length;o++)if("\n"!==wpDiscuzEditor.createEditor(e(a[o]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(o=0;o<a.length;o++)if(e(a[o]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")}),wpdiscuzLoadRichEditor||(e(document).delegate("textarea.wc_comment","input",function(){we(e(this))}),e.each(e("textarea.wc_comment"),function(){we(e(this))})),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(j)}),e(document).on("focus","#wpdcom textarea",function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()}),t)||U({comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)});if(e(".wpd-vote-down.wpd-dislike-hidden").remove(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),e(document).on("click","#wpd-editor-source-code-wrapper-bg",function(){e(this).hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")}),wpdiscuzLoadRichEditor&&e(document).on("click","#wpd-insert-source-code",function(){var t=wpDiscuzEditor.createEditor("#"+e("#wpd-editor-uid").val());t.deleteText(0,t.getLength(),Quill.sources.USER);var a=e("#wpd-editor-source-code").val();a.length&&t.clipboard.dangerouslyPasteHTML(0,a,Quill.sources.USER),t.update(),e("#wpd-editor-source-code-wrapper-bg").hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")}),e(document).on("click",".wpd-reply-button",function(){var i=X(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()},j):setTimeout(function(){e("#wc-textarea-"+i).trigger("focus")},j),e("#wpd-secondary-form-wrapper-"+i).slideToggle(j)):function(a){var o=X(a,0);e("#wpdiscuz_form_anchor-"+o).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(o));var n=e("#wpd-secondary-form-wrapper-"+o);if(!t){var i={comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)};U(i)}wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+o).focus()},j):setTimeout(function(){e("#wc-textarea-"+o).trigger("focus")},j);n.slideToggle(j,function(){a.addClass("wpdiscuz-clonned")})}(e(this)),function(t){if((a||o)&&"2.0"===n){var i=Y(t);setTimeout(function(){if(!F[i])try{F[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){e("#wpdiscuz-recaptcha-field-"+t).val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-"+t).val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3)}}(i)}),e(document).on("click","#wpdcom .wpd-comment-link [data-comment-url]",function(){var t=e(this).data("comment-url"),a=e("<input/>");a.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),a.trigger("select"),document.execCommand("copy"),a.remove(),wpdiscuzAjaxObj.setCommentMessage(t+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)}),e(document).on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",function(e){e.preventDefault()}),e(document).on("click",".wpd-toggle.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked");var a=X(e(this),0),o=e(this),n=e(".fas",o);!o.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&z?function(t,a){var o=Y(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",o),fe(v,!0,n).done(function(o){a.addClass("wpd_not_clicked"),"object"==typeof o&&o.success&&(e("#wpd-comm-"+t).replaceWith(o.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle .wpd-view-replies .wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),e("#wpd-comm-"+t+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),ue(o)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,n){console.log(n),a.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}(a,t):e("#wpd-comm-"+a+"> .wpd-reply").slideToggle(700,function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),o.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),o.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),t.addClass("wpd_not_clicked")})}),e(document).on("mouseenter",".wpd-new-loaded-comment",function(){e(this).removeClass("wpd-new-loaded-comment")}),e(document).on("click",".wpd-sbs-toggle",function(){e(".wpdiscuz-subscribe-bar").slideToggle(j)}),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm)&&!t&&wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&e("#wpdiscuz-subscribe-form").length&&("2.0"===n?(setTimeout(function(){try{grecaptcha.render("wpdiscuz-recaptcha-subscribe-form",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-subscribe-form").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val()?e(".wpdiscuz-recaptcha",e(this)).css("border","none"):(e(".wpdiscuz-recaptcha",e(this)).css("border","1px solid red"),t.preventDefault())})):"3.0"===n&&e(document).on("click","#wpdiscuz_subscription_button",function(t){var a=e(this).parents("#wpdiscuz-subscribe-form");t.preventDefault();try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then(function(e){console.log(5555),document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=e,a.trigger("submit")},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}})),(a||o)&&"2.0"===n){var P=e(window).width(),q=e("#wpdcom").width();q>=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%"})),q>=940&&q<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%"})),q>=810&&q<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%"})),q>=730&&q<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%"})),q>=610&&q<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%"})),P>650&&(q>=510&&q<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"})),q>=470&&q<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"})),q<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,a,o){fe(v||h,!1,a).done(function(a){if(e(o).addClass("wpd_not_clicked"),"object"==typeof a)if(a.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(j),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),e(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html);var n=j;a.data.is_main?ne(a.data.message):(n=j+700,e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).slideToggle(700),1==a.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).after(a.data.message):e("#wpd-comm-"+a.data.uniqueid).after(a.data.message)),function(e){if(!e.data.held_moderate){var t=new FormData;t.append("action","wpdCheckNotificationType"),t.append("comment_id",e.data.new_comment_id),t.append("email",e.data.comment_author_email),t.append("isParent",e.data.is_main),fe(v,!0,t)}}(a),function(e){if(e.data.redirect>0&&e.data.new_comment_id){var t=new FormData;t.append("action","wpdRedirect"),t.append("commentId",e.data.new_comment_id),fe(v,!0,t).done(function(e){"object"==typeof e&&e.success&&setTimeout(function(){location.href=e.data},2e3)}).fail(function(e,t,a){console.log(a)})}}(a),b&&_?function(t){var a=t.comment_author_email,o=t.comment_author,n=t.comment_author_url;null==f?(Cookies.set("comment_author_email_"+g,a),Cookies.set("comment_author_"+g,o),n.length&&Cookies.set("comment_author_url_"+g,n)):(f=parseInt(f),Cookies.set("comment_author_email_"+g,a,{expires:f,path:"/"}),Cookies.set("comment_author_"+g,o,{expires:f,path:"/"}),n.length&&Cookies.set("comment_author_url_"+g,n,{expires:f,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(a.data):_||e(".wpd-cookies-checkbox").prop("checked",!1),t.get(0).reset(),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]):we(t.find(".wc_comment")),U(a.data),e(".wmu-preview-wrap",t).remove(),D.length&&(D.forEach(function(e){e.parents(".wpd-field-checkbox").remove()}),D=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.new_comment_id).offset().top-T},1e3,oe)},n),ue(a,t)}else a.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"),ue(a,t));else wpdiscuzAjaxObj.setCommentMessage(a,"error");e("#wpdiscuz-loading-bar").fadeOut(250),M=!1}).fail(function(t,a,n){console.log(n),e(o).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}function U(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 W(t,a){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(a),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}e(document).on("click",".wc_comm_submit.wpd_not_clicked",function(){var i=e(this),s=1,d=e(this).parents("form");if(d.hasClass("wpd_main_comm_form")||(s=function(t){var a=t.attr("class").split(" "),o="";return e.each(a,function(e,t){"wpd_comment_level"===J(t,!1)&&(o=J(t,!0))}),parseInt(o)+1}(e(this).parents(".wpd-comment"))),te(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)){M=!0,function(t){e(".wpd-agreement-checkbox",t).each(function(){e(this).hasClass("wpd_agreement_hide")&&b&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+g,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each(function(){D.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")||(_=!1):t&&(_=!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((a||o)&&"2.0"===n){var t=Y(e);grecaptcha.reset(F[t])}}(e(".wpdiscuz_unique_id",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wc_msg_required_fields,"wc_msg_required_fields",d),"error")}),e(document).on("click",".wpd_editable_comment",function(){w&&e(".wpdiscuz-edit-form-wrap").length&&W(X(e(".wpdiscuz-edit-form-wrap"),0),w);var t=e(this),a=X(t,0),o=Y(a),n=new FormData;n.append("action","wpdEditComment"),n.append("commentId",o),w=e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-text").get(0),fe(v,!0,n).done(function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){var n=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+a);n.clipboard.dangerouslyPasteHTML(0,o.data.content),n.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+a).val(o.data.content),we(e("#wc-textarea-edit_"+a));e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wc_save_edited_comment",function(){var t=e(this),a=X(t),o=Y(a),n=e("#wpd-comm-"+a+" #wpdiscuz-edit-form");if(te(n,"#wpd-editor-edit_"+a),n.on("submit",function(e){e.preventDefault()}),n[0].checkValidity()){var i=new FormData;i.append("action","wpdSaveEditedComment"),i.append("commentId",o),e(":input",n).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&i.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&i.append(this.name+"",e(this).val())}),fe(v,!0,i).done(function(n){"object"==typeof n?(n.success?(W(a,n.data.message),n.data.lastEdited&&(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(n.data.lastEdited).insertAfter("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),n.data.twitterShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",n.data.twitterShareLink),n.data.whatsappShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",n.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error"),ue(n,o)):console.log(n),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=X(e(this));W(t,w),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!u&&m&&(L=0,1==m?setTimeout(function(){B(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),B(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&B(!1,t,"wpd-loaded","wpd-loading")});var N=!1;function V(){var t=e("#wpdiscuzHasMoreComments").val(),a=e(document).height(),o=e(window).height()+e(window).scrollTop();a&&o&&(100*o/a>=80&&!1===N&&1==t&&(N=!0,B(!1,e(".wpd-load-more-submit"))))}function B(t,a,o,n){a&&(a.toggleClass(o),a.toggleClass(n));var s=new FormData;s.append("action","wpdLoadMoreComments");var d=e(".wpdiscuz-sort-button-active").attr("data-sorting");d&&s.append("sorting",d),s.append("offset",L),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||""),fe(v,!t||1!=m,s).done(function(s){"object"==typeof s&&s.success&&(L++,t&&e(".wpd-comment").remove(),e(".wpdiscuz_single").remove(),e(".wpdiscuz-comment-pagination").before(s.data.comment_list),K(s,t&&2!==i),N=!1,s.data.loadLastCommentId&&(r=s.data.loadLastCommentId),ue(s),t&&Q(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))}).fail(function(t,i,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))})}function K(t,a){var o;0==t.data.is_show_load_more?(e("#wpdiscuzHasMoreComments").val(0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()):(o=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",o),2!==i&&e(".wpdiscuz-comment-pagination").show(),e("#wpdiscuzHasMoreComments").val(1),a&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show()),ue(t)}function Q(t){var a=location.href.match(/#comment\-(\d+)/);if(null!==a){var o=a[1];if(e("#comment-"+o).length)setTimeout(function(){ae(),e("html, body").animate({scrollTop:e("#comment-"+o).parents("[id^=wpd-comm-]").offset().top-T},1e3,oe),t&&G(o)},500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",o),fe(v,!0,n).done(function(a){if("object"==typeof a&&a.success){var n="#comment-"+o;e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e(n).offset().top-T},1e3,oe),t&&G(o)}e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}}function G(t){setTimeout(function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")},1100)}function $(e){if(void 0!==e.data.message)for(var t,a=e.data.message,o=0;o<a.length;o++)Z((t=a[o]).comment_parent,t.comment_html)}function X(e,t){var a="";return(a=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(a.lastIndexOf("-")+1)}function Y(e){return e.substring(0,e.indexOf("_"))}function J(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function Z(t,a){if(0==t)ne(a);else{var o=X(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+o).after(a)}}function ee(){var t=[];return e(".wpd-comment-right").each(function(){t.push(Y(X(e(this),0)))}),t.join(",")}function te(t,a){var o=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(a+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),a=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");a=(a=(a=(a=a.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),t.val(a)}(t),e.each(o,function(){e("input",this).prop("required",!1),0===e("input:checked",this).length?e("input",e(this)).prop("required",!0):e(".wpd-field-invalid",this).remove()})}function ae(){e("html, body").css("scroll-behavior","unset")}function oe(){e("html").css("scroll-behavior",R),e("body").css("scroll-behavior",S)}function ne(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function ie(t){t?t.prop("required")||(t.val()?t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):e.each(e(".wc_email"),function(t,a){var o=e(a);o.prop("required")||(o.val()?o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==i||u||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),V(),e(window).scroll(function(){V()})),wpdiscuzAjaxObj.setLoadMoreVisibility=K,e(document).on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",function(){var t=e(this);e(t).removeClass("wpd_not_clicked");var a,o=Y(X(t));a=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",o),n.append("voteType",a),fe(v,!0,n).done(function(n){if(e(t).addClass("wpd_not_clicked"),"object"==typeof n){if(n.success){if("total"===n.data.buttonsStyle){var i=e(".wpd-comment-footer .wpd-vote-result",e("#comment-"+o)),s=n.data.votes;i.text(n.data.votesHumanReadable),i.attr("title",s),i.removeClass("wpd-up wpd-down"),s>0&&i.addClass("wpd-up"),s<0&&i.addClass("wpd-down")}else{var d=e(".wpd-comment-footer .wpd-vote-result-like",e("#comment-"+o)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+o));d.text(n.data.likeCountHumanReadable),d.attr("title",n.data.likeCount),c.text(n.data.dislikeCountHumanReadable),c.attr("title",n.data.dislikeCount),parseInt(n.data.likeCount)>0?d.addClass("wpd-up"):d.removeClass("wpd-up"),parseInt(n.data.dislikeCount)<0?c.addClass("wpd-down"):c.removeClass("wpd-down")}var p=e(".wpd-comment-footer .wpd-vote-up",e("#comment-"+o)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+o));p.removeClass("wpd-up"),r.removeClass("wpd-down"),n.data.curUserReaction>0?p.addClass("wpd-up"):n.data.curUserReaction<0&&r.addClass("wpd-down")}else n.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error");ue(n,o,a)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,o,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click","body",function(t){var a=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?a.css({display:a.is(":visible")?"none":"flex"}):a.hide()}),e(document).on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var t=e(this),a=e(this).attr("data-sorting");if(a){e(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),t.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var o=new FormData;o.append("action","wpdSorting"),o.append("sorting",a);var n=e(".wpdf-active").attr("data-filter-type");o.append("wpdType",n||""),fe(v,!0,o).done(function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),K(t,!1),L=1),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){Q(!1)},1!=m&&Q(!1),e(document).on("click",".wpdiscuz-readmore",function(){var t=X(e(this)),a=Y(t),o=new FormData;o.append("action","wpdReadMore"),o.append("commentId",a),fe(v,!0,o).done(function(o){"object"==typeof o?(o.success?(e("#comment-"+a+" .wpd-comment-text").replaceWith(" "+o.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(o.data),ue(o)):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("change",".wpd-required-group",function(){0!==e("input:checked",this).length?e("input",e(this)).prop("required",!1):e("input",e(this)).prop("required",!0)}),e(document).on("click",".wpdiscuz-spoiler",function(){e(this).next().slideToggle(),e(this).hasClass("wpdiscuz-spoiler-closed")?e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"):e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"),e(this).toggleClass("wpdiscuz-spoiler-closed")}),e(document).on("click",".wpd-tools i",function(){var t=e(this).siblings(".wpd-tools-actions");t.is(":visible")||e(this).parents(".wpd-comment-right").attr("id")!==e("[id^=comment-]","#wpdcom").last().attr("id")||e("#comments").css({paddingBottom:"160px"}),t.css({display:t.is(":visible")?"none":"flex"})}),e(document).on("mouseleave",".wpd-comment-right",function(){e(this).find(".wpd-tools-actions").hide(),e("#comments").css({paddingBottom:"0"})}),e(document).on("click",".wpd_stick_btn",function(){var t=Y(X(e(this),0)),a=new FormData;a.append("action","wpdStickComment"),a.append("commentId",t),fe(v,!0,a).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd_close_btn",function(){var t=Y(X(e(this),0)),a=new FormData;a.append("action","wpdCloseThread"),a.append("commentId",t),fe(v,!0,a).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var t=e(this),a=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+a),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&o.append("sorting",n),o.append("lastParentId",0),o.append("offset",0),L=1,o.append("wpdType",t.hasClass("wpdf-active")?"":a),o.append("isFirstLoad",1),e(this).hasClass("wpdf-inline")?e(this).hasClass("wpdf-active")?e(".wpd-comment-info-bar").hide():e(".wpd-comment-info-bar").css("display","flex"):e(".wpd-comment-info-bar").hide(),fe(v,!1,o).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(a.data.comment_list),K(a),r=a.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),ue(a)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpdf-reacted.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdMostReactedComment"),fe(v,!1,a).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e("#comment-"+a.data.commentId).length||e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-T},1e3,oe))}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")})}),e(document).on("click",".wpdf-hottest.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdHottestThread"),fe(v,!1,a).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.commentId).length?e("#comment-"+a.data.commentId).parents("[id^=wpd-comm-"+a.data.commentId+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-T},1e3,oe))}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")})}),e(document).on("click",".wpd-filter-view-all",function(){e(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")}),e(document).on("click",".wpd-follow-link.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=Y(X(t,0)),o=new FormData;o.append("action","wpdFollowUser"),o.append("commentId",a),fe(v,!0,o).done(function(a){t.addClass("wpd_not_clicked"),"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.code],a.data.code,t),"success"),t.removeClass("wpd-follow-active"),a.data.followTip&&t.attr("wpd-tooltip",a.data.followTip),a.data.followClass&&t.addClass(a.data.followClass),ue(a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),ie(),e(document).on("keyup",".wc_email",function(){ie(e(this))}),x&&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*y)},1e3*k),"content_left"===A)if(e(".entry-content").length){var se=(de=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){se=(de=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var de;se=(de=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"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"===A?(e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===A&&(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(){ae(),e("#tab-title-reviews").length&&e("#tab-title-reviews a").trigger("click"),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-(T+28)},1e3,function(){oe(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover"),wpdiscuzLoadRichEditor?e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0").focus():e("#wc-textarea-0_0").length&&e("#wc-textarea-0_0").trigger("focus")})}),e(document).on("click","#wpd-bubble-comment-close",function(t){t.preventDefault(),e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),e(document).on("click","#wpd-bubble-comment-reply-link a",function(){var t=e(this).attr("href");setTimeout(function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),Q(!0);var a=t.match(/#comment\-(\d+)/);E=E.filter(function(e){return e!=a[1]}),e("#wpd-bubble-count .wpd-new-comments-count").text(E.length),0==E.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),e(document).on("click","#wpd-bubble-count",function(){if(E.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",E.join()),fe(v,!0,t).done(function(t){"object"==typeof t&&t.success&&(t.data.message=t.data.message.filter(function(t){if(!e("#comment-"+t.comment_id).length)return t}),$(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),E=[],e(".wpd-new-loaded-comment").length&&(ae(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-(T+28)},1e3,oe)),ue(t)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,a){console.log(a)})}})}if((x&&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:ee()}}).done(function(a){if(!M)if("object"==typeof a){if(a.commentIDsToRemove.forEach(function(t){e("[id^=wpd-comm-"+t+"]").remove()}),a.ids.length){d&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",r),i.append("visibleCommentIds",ee()),fe(v,!1,i).done(function(t){M||"object"==typeof t&&t.success&&($(t),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),r=t.data.loadLastCommentId)}).fail(function(e,t,a){console.log(a)})),a.ids=a.ids.filter(function(t){if(!e("#comment-"+t).length)return t});var o=5e3;l=parseInt(a.ids[a.ids.length-1]),E=E.concat(a.ids),O&&a.commentText&&(e("#wpd-bubble-author-avatar").html(a.avatar),e("#wpd-bubble-author-name").html(a.authorName),e("#wpd-bubble-comment-date span").html(a.commentDate),e("#wpd-bubble-comment-text").html(a.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",a.commentLink),e("#wpd-bubble-notification-message").show(),o=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=a.ids.length,e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),e("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout(function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")},o),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}a.all_comments_count=parseInt(a.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(a.all_comments_count_bubble_html),e(".wpd-thread-info").html(a.all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.all_comments_count)}else console.log(a);var i;setTimeout(t,c)}).fail(function(e,a,o){console.log(o),setTimeout(t,c)})},c),e(".wpd-inline-form-wrapper").length){var ce=new FormData;ce.append("action","wpdGetInlineCommentForm"),fe(v,!1,ce).done(function(t){"object"==typeof t?t.success?(e(".wpd-inline-form-wrapper").append(t.data),e.each(e("[name=_wpd_inline_nonce]"),function(){var t=e(this).attr("id"),a=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+a.substring(a.lastIndexOf("-")+1))}),e(".wpd-inline-opened").addClass("wpd-active"),e(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),e(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),e(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),me()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data]),t.data,"error"):console.log(t)}).fail(function(e,t,a){console.log(a)})}function pe(t){if(e(t).hasClass("wpd-inline-shortcode"))var a=e(t).attr("id");else a=e(t).parents(".wpd-inline-shortcode").attr("id");return a.substring(a.lastIndexOf("-")+1)}function re(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function le(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var t=e(this),a=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&a>0&&a<300&&("blink"===I?(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"),me(t.siblings(".wpd-inline-form-wrapper"))))})}function me(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(a=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var a;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(a=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}}else e.each(e(".wpd-inline-form-wrapper:visible"),function(){if(e(this).offset().left<=10)e(this).css("left",Math.ceil(parseInt(e(this).css("left"))-e(this).offset().left+10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))<3&&(t=3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;");else if(e(this).offset().left+e(this).width()>document.body.clientWidth-10){var t;e(this).css("left",Math.ceil(parseInt(e(this).css("left"))+(document.body.clientWidth-(e(this).offset().left+e(this).width()))-10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))>e(this).width()-3&&(t=e(this).width()-3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;")}})}function we(t){var a,o=0;if(t.parents(".wpd_main_comm_form").length)o=parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents(".wpd_main_comm_form");else if(t.parents(".wpd-secondary-form-wrapper").length)o=parseInt(wpdiscuzAjaxObj.replyTextMaxLength),a=t.parents(".wpd-secondary-form-wrapper");else if(t.parents("#wpdiscuz-edit-form").length){var n=X(t);o=parseInt(n.substring(n.lastIndexOf("_")+1))?parseInt(wpdiscuzAjaxObj.replyTextMaxLength):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents("#wpdiscuz-edit-form")}if(o&&a){var i=t.val().length,s=e(".wpd-editor-char-counter",a),d=o-i;s.html(d),d<=10?s.addClass("error"):s.removeClass("error")}}function ue(t,a,o,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,a,o,n):"function"==typeof window[t.data.callbackFunctions[e]]?window[t.data.callbackFunctions[e]](t,a,o,n):console.log(t.data.callbackFunctions[e]+" is not a function")})}function fe(t,a,o){a&&e("#wpdiscuz-loading-bar").show(),o.append("postId",s),o.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce);var n=o.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(o=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](o,t,a))});var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:o,contentType:!1,processData:!1})}function he(){var e=new FormData;e.append("action","wpdGetNonce"),e.append("key",wpdiscuzAjaxObj.wpdiscuz_nonce_key),fe(v,!1,e).done(function(e){"object"==typeof e?e.success?wpdiscuzAjaxObj.wpdiscuz_nonce=e.data:wpdiscuzAjaxObj.setCommentMessage(e.data,"error"):console.log(e)}).fail(function(e,t,a){console.log(a)})}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){re();var a="";e(t.target).hasClass("wpd-inline-icon")?a=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(a=e(t.target).parents(".wpd-inline-icon")),a.length&&a.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(a.parents(".wpd-inline-shortcode").addClass("wpd-active"),a.siblings(".wpd-inline-form-wrapper").show(),a.addClass("wpd-open"),a.removeClass("wpd-ignored"),me(a.siblings(".wpd-inline-form-wrapper")))}(!e(t.target).hasClass("wpd-last-inline-comments-wrapper")&&!e(t.target).parents(".wpd-last-inline-comments-wrapper").length||e(t.target).parents(".wpd-last-inline-comments-wrapper").length&&e(t.target).hasClass("wpd-load-inline-comment"))&&e(".wpd-last-inline-comments-wrapper").remove()}),e(document).on("click",".wpd-inline-submit.wpd_not_clicked",function(t){t.preventDefault();var a=e(this),o=e(this).parents(".wpd_inline_comm_form");if(o[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",pe(o)),e.each(e("input, textarea",o),function(t,a){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(a).attr("name"),e(a).val()):n.append(e(a).attr("name"),e(a).val())}),fe(v,!0,n).done(function(t){if(a.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){o[0].reset(),re();var n=parseInt(t.data.newCount),i=a.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),e(".wpd-thread-info").attr("data-comments-count",t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.message&&ne(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data,a),"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("keydown",".wpd-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_comm_submit").trigger("click")}),e(document).on("keydown","#wpdiscuz-edit-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_save_edited_comment").trigger("click")}),e(document).on("keydown",".wpd-inline-comment-content",function(t){t.ctrlKey&&13==t.keyCode&&e(this).parents(".wpd_inline_comm_form").find(".wpd-inline-submit.wpd_not_clicked").trigger("click")}),e(document).on("click",".wpd-inline-icon-count.wpd-has-comments",function(){var t=e(this),a=new FormData;a.append("action","wpdGetLastInlineComments"),a.append("inline_form_id",pe(t)),fe(v,!0,a).done(function(a){"object"==typeof a?a.success?e(a.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-view-all-inline-comments",function(t){t.preventDefault(),e(this).parents(".wpd-last-inline-comments-wrapper").remove(),e(".wpdf-inline").hasClass("wpdf-active")||e(".wpdf-inline").trigger("click"),ae(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-T},1e3,oe)}),e(document).on("click",".wpd-feedback-content-link",function(t){t.preventDefault();var a=e(this).data("feedback-content-id");ae(),e("html, body").animate({scrollTop:e("#wpd-inline-"+a).offset().top-(T+6)},1e3,function(){oe(),e("#wpd-inline-"+a).addClass("wpd-active")})}),"scroll_open"!==I&&"blink"!==I||(le(),e(window).on("scroll",le)),e(document).on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var t=new FormData,a=e(this).index();a>=0&&a<5&&(t.append("action","wpdUserRate"),t.append("rating",a+1),fe(v,!0,t).done(function(t){"object"==typeof t?(t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data),"error"),ue(t)):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))}),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){t.preventDefault();var a,o,i=e(this);if(i[0].checkValidity()&&(a=i,o=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).val().length?(o=!1,e(".wpdiscuz-recaptcha",a).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&e(".wpdiscuz-recaptcha",a).css("border","none"),o)){var s=new FormData;s.append("action","wpdAddSubscription"),e("*",i).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&s.append(this.name+"",e(this).val()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&s.append(this.name+"",e(this).val())}),fe(v,!0,s).done(function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):wpdiscuzAjaxObj.setCommentMessage(t,"error"),e("#wpdiscuz-loading-bar").fadeOut(250),M=!1}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wpd-unsubscribe",function(t){t.preventDefault();var a=new FormData;a.append("action","wpdUnsubscribe"),a.append("sid",e(this).data("sid")),a.append("skey",e(this).data("skey")),fe(v,!0,a).done(function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250),M=!1}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=fe,wpdiscuzAjaxObj.initNonce=he,he()});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 */
14
+ jQuery(document).ready(function(e){if(e(document).on("click","#wpdcom .wmu-upload-wrap",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0)}),e(document).on("change",".wmu-add-files",function(){var a=e(this),t=a.parents(".wpd_comm_form"),d=a[0].files?a[0].files:[];d.length&&function(a,t,d){var o=new FormData;o.append("action","wmuUploadFiles"),o.append("wmuAttachmentsData",e(".wmu-attachments-data",t).val()),o.append("uniqueId",t.find(".wpdiscuz_unique_id").val());var i=0;e.each(d,function(e,a){i+=a.size,o.append(wpdiscuzAjaxObj.wmuInput+"["+e+"]",a)}),i>parseInt(wpdiscuzAjaxObj.wmuMaxFileSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseMaxFileSize,"wmuPhraseMaxFileSize",a),"error",3e3):i>parseInt(wpdiscuzAjaxObj.wmuPostMaxSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhrasePostMaxSize,"wmuPhrasePostMaxSize",a),"error",3e3):wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(a){a.success?(e(".wmu-attached-data-info",t).remove(),e(".wmu-add-files",t).after(a.data.attachmentsHtml),a.data.tooltip&&e(".wmu-upload-wrap",t).attr("wpd-tooltip",a.data.tooltip),function(a,t){e.each(t.data.previewsData,function(t,d){e(".wmu-action-wrap .wmu-"+t+"-tab",a).html(""),e.each(d,function(d,o){var i=o.id,r="",s=o.fullname,u=o.shortname;t==wpdiscuzAjaxObj.wmuKeyImages?(r=o.url,u=""):t==wpdiscuzAjaxObj.wmuKeyVideos?r=wpdiscuzAjaxObj.wmuIconVideo:t==wpdiscuzAjaxObj.wmuKeyFiles&&(r=wpdiscuzAjaxObj.wmuIconFile);var m='<div class="wmu-preview [PREVIEW_TYPE_CLASS]" title="[PREVIEW_TITLE]" data-wmu-type="[PREVIEW_TYPE]" data-wmu-attachment="[PREVIEW_ID]"><div class="wmu-preview-remove"><img class="wmu-preview-img" src="[PREVIEW_ICON]"><div class="wmu-file-name">[PREVIEW_FILENAME]</div><div class="wmu-delete">&nbsp;</div></div></div>';m=(m=(m=(m=(m=(m=m.replace("[PREVIEW_TYPE_CLASS]","wmu-preview-"+t)).replace("[PREVIEW_TITLE]",s)).replace("[PREVIEW_TYPE]",t)).replace("[PREVIEW_ID]",i)).replace("[PREVIEW_ICON]",r)).replace("[PREVIEW_FILENAME]",u),e(".wmu-action-wrap .wmu-"+t+"-tab",a).removeClass("wmu-hide").append(m)})})}(t,a),a.data.errors&&(wpdiscuzAjaxObj.setCommentMessage(a.data.errors,"error",3e3),console.log(a.data.errors))):a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.errorCode],a.data.errorCode,t),"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250)})}(a,t,d)}),e(document).on("click",".wmu-attachment-delete",function(a){if(confirm(wpdiscuzAjaxObj.wmuPhraseConfirmDelete)){var t=e(this).data("wmu-attachment"),d=new FormData;d.append("action","wmuDeleteAttachment"),d.append("attachmentId",t),wpdiscuzAjaxObj.getAjaxObj(!0,!0,d).done(function(a){if(a.success){var d=e(".wmu-attachment-"+t).parents(".wmu-comment-attachments");e(".wmu-attachment-"+t).remove(),e(".wmu-attached-images *",d).length||e(".wmu-attached-images",d).remove(),e(".wmu-attached-videos *",d).length||e(".wmu-attached-videos",d).remove(),e(".wmu-attached-files *",d).length||e(".wmu-attached-files",d).remove()}else a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.errorCode],a.data.errorCode,d),"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250)})}else console.log("canceled")}),e(document).on("click",".wmu-preview",function(){var a=e(this),t=a.parents(".wpd_comm_form"),d=(a.data("wmu-type"),a.data("wmu-attachment")),o=new FormData;o.append("action","wmuRemoveAttachmentPreview"),o.append("attachmentId",d),o.append("wmuAttachmentsData",e(".wmu-attachments-data",t).val()),o.append("uniqueId",t.find(".wpdiscuz_unique_id").val()),wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(d){if(d.success){a.remove();var o=e(".wmu-tabs",t);e.each(o,function(a,t){e(".wmu-preview",t).length?e(t).removeClass("wmu-hide"):e(t).addClass("wmu-hide")}),e(".wmu-attached-data-info",t).remove(),e(".wmu-add-files",t).after(d.data.attachmentsHtml),d.data.tooltip&&e(".wmu-upload-wrap",t).attr("wpd-tooltip",d.data.tooltip)}else d.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[d.data.errorCode],d.data.errorCode,t),"error",3e3):d.data.error&&wpdiscuzAjaxObj.setCommentMessage(d.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250)})}),parseInt(wpdiscuzAjaxObj.wmuIsLightbox)){function a(){e(".wmu-lightbox").colorbox({maxHeight:"95%",maxWidth:"95%",rel:"wmu-lightbox",fixed:!0})}a(),wpdiscuzAjaxObj.wmuAddLightBox=a}wpdiscuzAjaxObj.wmuHideAll=function(a,t){"object"==typeof a?a.success?(e(".wmu-tabs",t).addClass("wmu-hide"),e(".wmu-preview",t).remove(),e(".wmu-attached-data-info",t).remove()):console.log(a.data):console.log(a)}});
15
  /* Lity */
16
  !function(e,t){"function"==typeof define&&define.amd?define(["jquery"],function(n){return t(e,n)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(e,require("jquery")):e.lity=t(e,e.jQuery||e.Zepto)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=e.document,i=t(e),r=t.Deferred,o=t("html"),a=[],l="aria-hidden",s="lity-"+l,d='a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),iframe,object,embed,[contenteditable],[tabindex]:not([tabindex^="-"])',c={esc:!0,handler:null,handlers:{image:C,inline:function(e,n){var i,r,o;try{i=t(e)}catch(e){return!1}if(!i.length)return!1;return r=t('<i style="display:none !important"/>'),o=i.hasClass("lity-hide"),n.element().one("lity:remove",function(){r.before(i).remove(),o&&!i.closest(".lity-content").length&&i.addClass("lity-hide")}),i.removeClass("lity-hide").after(r)},youtube:function(e){var n=f.exec(e);if(!n)return!1;return k(x(e,w("https://www.youtube"+(n[2]||"")+".com/embed/"+n[4],t.extend({autoplay:1},b(n[5]||"")))))},vimeo:function(e){var n=y.exec(e);if(!n)return!1;return k(x(e,w("https://player.vimeo.com/video/"+n[3],t.extend({autoplay:1},b(n[4]||"")))))},googlemaps:function(e){var t=v.exec(e);if(!t)return!1;return k(x(e,w("https://www.google."+t[3]+"/maps?"+t[6],{output:t[6].indexOf("layer=c")>0?"svembed":"embed"})))},facebookvideo:function(e){var n=p.exec(e);if(!n)return!1;0!==e.indexOf("http")&&(e="https:"+e);return k(x(e,w("https://www.facebook.com/plugins/video.php?href="+e,t.extend({autoplay:1},b(n[4]||"")))))},iframe:k},template:'<div class="lity" role="dialog" aria-label="Dialog Window (Press escape to close)" tabindex="-1"><div class="lity-wrap" data-lity-close role="document"><div class="lity-loader" aria-hidden="true">Loading...</div><div class="lity-container"><div class="lity-content"></div><button class="lity-close" type="button" aria-label="Close (Press escape to close)" data-lity-close>&times;</button></div></div></div>'},u=/(^data:image\/)|(\.(png|jpe?g|gif|svg|webp|bmp|ico|tiff?)(\?\S*)?$)/i,f=/(youtube(-nocookie)?\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11})(.*)?/i,y=/(vimeo(pro)?.com)\/(?:[^\d]+)?(\d+)\??(.*)?$/,v=/((maps|www)\.)?google\.([^\/\?]+)\/?((maps\/?)?\?)(.*)/i,p=/(facebook\.com)\/([a-z0-9_-]*)\/videos\/([0-9]*)(.*)?$/i,m=function(){var e=n.createElement("div"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in t)if(void 0!==e.style[i])return t[i];return!1}();function h(e){var t=r();return m&&e.length?(e.one(m,t.resolve),setTimeout(t.resolve,500)):t.resolve(),t.promise()}function g(e,n,i){if(1===arguments.length)return t.extend({},e);if("string"==typeof n){if(void 0===i)return void 0===e[n]?null:e[n];e[n]=i}else t.extend(e,n);return this}function b(e){for(var t,n=decodeURI(e.split("#")[0]).split("&"),i={},r=0,o=n.length;r<o;r++)n[r]&&(i[(t=n[r].split("="))[0]]=t[1]);return i}function w(e,n){return e+(e.indexOf("?")>-1?"&":"?")+t.param(n)}function x(e,t){var n=e.indexOf("#");return-1===n?t:(n>0&&(e=e.substr(n)),t+e)}function C(e,n){var i=n.opener()&&n.opener().data("lity-desc")||"Image with no description",o=t('<img src="'+e+'" alt="'+i+'"/>'),a=r(),l=function(){var e;a.reject((e="Failed loading image",t('<span class="lity-error"/>').append(e)))};return o.on("load",function(){if(0===this.naturalWidth)return l();a.resolve(o)}).on("error",l),a.promise()}function k(e){return'<div class="lity-iframe-container"><iframe frameborder="0" allowfullscreen src="'+e+'"/></div>'}function E(){return n.documentElement.clientHeight?.9*n.documentElement.clientHeight:Math.round(.9*i.height())}function j(e){var t,i,r,o=z();o&&(27===e.keyCode&&o.options("esc")&&o.close(),9===e.keyCode&&(t=e,i=o.element().find(d),r=i.index(n.activeElement),t.shiftKey&&r<=0?(i.get(i.length-1).focus(),t.preventDefault()):t.shiftKey||r!==i.length-1||(i.get(0).focus(),t.preventDefault())))}function D(){t.each(a,function(e,t){t.resize()})}function z(){return 0===a.length?null:a[0]}function T(e,d,u,f){var y,v,p,m,b,w,x,C,k,z,T,O=this,q=!1,W=!1;d=t.extend({},c,d),v=t(d.template),O.element=function(){return v},O.opener=function(){return u},O.options=t.proxy(g,O,d),O.handlers=t.proxy(g,O,d.handlers),O.resize=function(){q&&!W&&p.css("max-height",E()+"px").trigger("lity:resize",[O])},O.close=function(){if(q&&!W){var e;W=!0,(e=O).element().attr(l,"true"),1===a.length&&(o.removeClass("lity-active"),i.off({resize:D,keydown:j})),((a=t.grep(a,function(t){return e!==t})).length?a[0].element():t(".lity-hidden")).removeClass("lity-hidden").each(function(){var e=t(this),n=e.data(s);n?e.attr(l,n):e.removeAttr(l),e.removeData(s)});var d=r();if(f&&(n.activeElement===v[0]||t.contains(v[0],n.activeElement)))try{f.focus()}catch(e){}return p.trigger("lity:close",[O]),v.removeClass("lity-opened").addClass("lity-closed"),h(p.add(v)).always(function(){p.trigger("lity:remove",[O]),v.remove(),v=void 0,d.resolve()}),d.promise()}},m=e,b=O,w=d.handlers,x=d.handler,k="inline",z=t.extend({},w),x&&z[x]?(C=z[x](m,b),k=x):(t.each(["inline","iframe"],function(e,t){delete z[t],z[t]=w[t]}),t.each(z,function(e,t){return!t||!(!t.test||t.test(m,b))||(!1!==(C=t(m,b))?(k=e,!1):void 0)})),y={handler:k,content:C||""},v.attr(l,"false").addClass("lity-loading lity-opened lity-"+y.handler).appendTo("body").focus().on("click","[data-lity-close]",function(e){t(e.target).is("[data-lity-close]")&&O.close()}).trigger("lity:open",[O]),T=O,1===a.unshift(T)&&(o.addClass("lity-active"),i.on({resize:D,keydown:j})),t("body > *").not(T.element()).addClass("lity-hidden").each(function(){var e=t(this);void 0===e.data(s)&&e.data(s,e.attr(l)||null)}).attr(l,"true"),t.when(y.content).always(function(e){p=t(e).css("max-height",E()+"px"),v.find(".lity-loader").each(function(){var e=t(this);h(e).always(function(){e.remove()})}),v.removeClass("lity-loading").find(".lity-content").empty().append(p),q=!0,p.trigger("lity:ready",[O])})}function O(e,i,r){e.preventDefault?(e.preventDefault(),e=(r=t(this)).data("lity-target")||r.attr("rel")||r.attr("src")):r=t(r);var o=new T(e,t.extend({},r.data("lity-options")||r.data("lity"),i),r,n.activeElement);if(!e.preventDefault)return o}return C.test=function(e){return u.test(e)},O.version="2.2.2",O.options=t.proxy(g,O,c),O.handlers=t.proxy(g,O,c.handlers),O.current=z,t(n).on("click.lity","[data-wpd-lity]",O),O});
17
  /* My Content and Settings */
assets/js/wpdiscuz-mu-backend.js CHANGED
@@ -24,7 +24,7 @@ jQuery(document).ready(function ($) {
24
  var clicked = $(this);
25
  var attachmentId = clicked.data('wmu-attachment');
26
  data.append('action', 'wmuDeleteAttachment');
27
- data.append('wmu_nonce', wpdiscuzMUJsObj.wmuSecurity);
28
  data.append('attachmentId', attachmentId);
29
  var ajax = wmuGetAjaxObj(data);
30
  ajax.done(function (r) {
24
  var clicked = $(this);
25
  var attachmentId = clicked.data('wmu-attachment');
26
  data.append('action', 'wmuDeleteAttachment');
27
+ data.append('wpdiscuz_nonce', wpdiscuzMUJsObj.wpdiscuz_nonce);
28
  data.append('attachmentId', attachmentId);
29
  var ajax = wmuGetAjaxObj(data);
30
  ajax.done(function (r) {
assets/js/wpdiscuz-mu-frontend.js CHANGED
@@ -15,8 +15,7 @@ jQuery(document).ready(function ($) {
15
 
16
  function wmuUploadFiles(btn, form, files) {
17
  var data = new FormData();
18
- data.append('action', 'wmuUploadFiles');
19
- data.append('wmu_nonce', wpdiscuzAjaxObj.wmuSecurity);
20
  data.append('wmuAttachmentsData', $('.wmu-attachments-data', form).val());
21
  data.append('uniqueId', form.find('.wpdiscuz_unique_id').val());
22
  var size = 0;
@@ -91,8 +90,7 @@ jQuery(document).ready(function ($) {
91
  var btn = $(this);
92
  var attachmentId = btn.data('wmu-attachment');
93
  var data = new FormData();
94
- data.append('action', 'wmuDeleteAttachment');
95
- data.append('wmu_nonce', wpdiscuzAjaxObj.wmuSecurity);
96
  data.append('attachmentId', attachmentId);
97
  wpdiscuzAjaxObj.getAjaxObj(true, true, data)
98
  .done(function (r) {
@@ -136,8 +134,7 @@ jQuery(document).ready(function ($) {
136
  var id = btn.data('wmu-attachment');
137
  var data = new FormData();
138
  data.append('action', 'wmuRemoveAttachmentPreview');
139
- data.append('attachmentId', id);
140
- data.append('wmu_nonce', wpdiscuzAjaxObj.wmuSecurity);
141
  data.append('wmuAttachmentsData', $('.wmu-attachments-data', form).val());
142
  data.append('uniqueId', form.find('.wpdiscuz_unique_id').val());
143
  wpdiscuzAjaxObj.getAjaxObj(true, true, data)
15
 
16
  function wmuUploadFiles(btn, form, files) {
17
  var data = new FormData();
18
+ data.append('action', 'wmuUploadFiles');
 
19
  data.append('wmuAttachmentsData', $('.wmu-attachments-data', form).val());
20
  data.append('uniqueId', form.find('.wpdiscuz_unique_id').val());
21
  var size = 0;
90
  var btn = $(this);
91
  var attachmentId = btn.data('wmu-attachment');
92
  var data = new FormData();
93
+ data.append('action', 'wmuDeleteAttachment');
 
94
  data.append('attachmentId', attachmentId);
95
  wpdiscuzAjaxObj.getAjaxObj(true, true, data)
96
  .done(function (r) {
134
  var id = btn.data('wmu-attachment');
135
  var data = new FormData();
136
  data.append('action', 'wmuRemoveAttachmentPreview');
137
+ data.append('attachmentId', id);
 
138
  data.append('wmuAttachmentsData', $('.wmu-attachments-data', form).val());
139
  data.append('uniqueId', form.find('.wpdiscuz_unique_id').val());
140
  wpdiscuzAjaxObj.getAjaxObj(true, true, data)
assets/js/wpdiscuz-mu-frontend.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(e){if(e(document).on("click","#wpdcom .wmu-upload-wrap",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0)}),e(document).on("change",".wmu-add-files",function(){var a=e(this),t=a.parents(".wpd_comm_form"),d=a[0].files?a[0].files:[];d.length&&function(a,t,d){var o=new FormData;o.append("action","wmuUploadFiles"),o.append("wmu_nonce",wpdiscuzAjaxObj.wmuSecurity),o.append("wmuAttachmentsData",e(".wmu-attachments-data",t).val()),o.append("uniqueId",t.find(".wpdiscuz_unique_id").val());var i=0;e.each(d,function(e,a){i+=a.size,o.append(wpdiscuzAjaxObj.wmuInput+"["+e+"]",a)}),i>parseInt(wpdiscuzAjaxObj.wmuMaxFileSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseMaxFileSize,"wmuPhraseMaxFileSize",a),"error",3e3):i>parseInt(wpdiscuzAjaxObj.wmuPostMaxSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhrasePostMaxSize,"wmuPhrasePostMaxSize",a),"error",3e3):wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(a){a.success?(e(".wmu-attached-data-info",t).remove(),e(".wmu-add-files",t).after(a.data.attachmentsHtml),a.data.tooltip&&e(".wmu-upload-wrap",t).attr("wpd-tooltip",a.data.tooltip),function(a,t){e.each(t.data.previewsData,function(t,d){e(".wmu-action-wrap .wmu-"+t+"-tab",a).html(""),e.each(d,function(d,o){var i=o.id,r="",s=o.fullname,u=o.shortname;t==wpdiscuzAjaxObj.wmuKeyImages?(r=o.url,u=""):t==wpdiscuzAjaxObj.wmuKeyVideos?r=wpdiscuzAjaxObj.wmuIconVideo:t==wpdiscuzAjaxObj.wmuKeyFiles&&(r=wpdiscuzAjaxObj.wmuIconFile);var n='<div class="wmu-preview [PREVIEW_TYPE_CLASS]" title="[PREVIEW_TITLE]" data-wmu-type="[PREVIEW_TYPE]" data-wmu-attachment="[PREVIEW_ID]"><div class="wmu-preview-remove"><img class="wmu-preview-img" src="[PREVIEW_ICON]"><div class="wmu-file-name">[PREVIEW_FILENAME]</div><div class="wmu-delete">&nbsp;</div></div></div>';n=(n=(n=(n=(n=(n=n.replace("[PREVIEW_TYPE_CLASS]","wmu-preview-"+t)).replace("[PREVIEW_TITLE]",s)).replace("[PREVIEW_TYPE]",t)).replace("[PREVIEW_ID]",i)).replace("[PREVIEW_ICON]",r)).replace("[PREVIEW_FILENAME]",u),e(".wmu-action-wrap .wmu-"+t+"-tab",a).removeClass("wmu-hide").append(n)})})}(t,a),a.data.errors&&(wpdiscuzAjaxObj.setCommentMessage(a.data.errors,"error",3e3),console.log(a.data.errors))):a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.errorCode],a.data.errorCode,t),"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250)})}(a,t,d)}),e(document).on("click",".wmu-attachment-delete",function(a){if(confirm(wpdiscuzAjaxObj.wmuPhraseConfirmDelete)){var t=e(this).data("wmu-attachment"),d=new FormData;d.append("action","wmuDeleteAttachment"),d.append("wmu_nonce",wpdiscuzAjaxObj.wmuSecurity),d.append("attachmentId",t),wpdiscuzAjaxObj.getAjaxObj(!0,!0,d).done(function(a){if(a.success){var d=e(".wmu-attachment-"+t).parents(".wmu-comment-attachments");e(".wmu-attachment-"+t).remove(),e(".wmu-attached-images *",d).length||e(".wmu-attached-images",d).remove(),e(".wmu-attached-videos *",d).length||e(".wmu-attached-videos",d).remove(),e(".wmu-attached-files *",d).length||e(".wmu-attached-files",d).remove()}else a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.errorCode],a.data.errorCode,d),"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250)})}else console.log("canceled")}),e(document).on("click",".wmu-preview",function(){var a=e(this),t=a.parents(".wpd_comm_form"),d=(a.data("wmu-type"),a.data("wmu-attachment")),o=new FormData;o.append("action","wmuRemoveAttachmentPreview"),o.append("attachmentId",d),o.append("wmu_nonce",wpdiscuzAjaxObj.wmuSecurity),o.append("wmuAttachmentsData",e(".wmu-attachments-data",t).val()),o.append("uniqueId",t.find(".wpdiscuz_unique_id").val()),wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(d){if(d.success){a.remove();var o=e(".wmu-tabs",t);e.each(o,function(a,t){e(".wmu-preview",t).length?e(t).removeClass("wmu-hide"):e(t).addClass("wmu-hide")}),e(".wmu-attached-data-info",t).remove(),e(".wmu-add-files",t).after(d.data.attachmentsHtml),d.data.tooltip&&e(".wmu-upload-wrap",t).attr("wpd-tooltip",d.data.tooltip)}else d.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[d.data.errorCode],d.data.errorCode,t),"error",3e3):d.data.error&&wpdiscuzAjaxObj.setCommentMessage(d.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250)})}),parseInt(wpdiscuzAjaxObj.wmuIsLightbox)){function a(){e(".wmu-lightbox").colorbox({maxHeight:"95%",maxWidth:"95%",rel:"wmu-lightbox",fixed:!0})}a(),wpdiscuzAjaxObj.wmuAddLightBox=a}wpdiscuzAjaxObj.wmuHideAll=function(a,t){"object"==typeof a?a.success?(e(".wmu-tabs",t).addClass("wmu-hide"),e(".wmu-preview",t).remove(),e(".wmu-attached-data-info",t).remove()):console.log(a.data):console.log(a)}});
1
+ jQuery(document).ready(function(e){if(e(document).on("click","#wpdcom .wmu-upload-wrap",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0)}),e(document).on("change",".wmu-add-files",function(){var a=e(this),t=a.parents(".wpd_comm_form"),d=a[0].files?a[0].files:[];d.length&&function(a,t,d){var o=new FormData;o.append("action","wmuUploadFiles"),o.append("wmuAttachmentsData",e(".wmu-attachments-data",t).val()),o.append("uniqueId",t.find(".wpdiscuz_unique_id").val());var i=0;e.each(d,function(e,a){i+=a.size,o.append(wpdiscuzAjaxObj.wmuInput+"["+e+"]",a)}),i>parseInt(wpdiscuzAjaxObj.wmuMaxFileSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhraseMaxFileSize,"wmuPhraseMaxFileSize",a),"error",3e3):i>parseInt(wpdiscuzAjaxObj.wmuPostMaxSize)?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wmuPhrasePostMaxSize,"wmuPhrasePostMaxSize",a),"error",3e3):wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(a){a.success?(e(".wmu-attached-data-info",t).remove(),e(".wmu-add-files",t).after(a.data.attachmentsHtml),a.data.tooltip&&e(".wmu-upload-wrap",t).attr("wpd-tooltip",a.data.tooltip),function(a,t){e.each(t.data.previewsData,function(t,d){e(".wmu-action-wrap .wmu-"+t+"-tab",a).html(""),e.each(d,function(d,o){var i=o.id,r="",s=o.fullname,u=o.shortname;t==wpdiscuzAjaxObj.wmuKeyImages?(r=o.url,u=""):t==wpdiscuzAjaxObj.wmuKeyVideos?r=wpdiscuzAjaxObj.wmuIconVideo:t==wpdiscuzAjaxObj.wmuKeyFiles&&(r=wpdiscuzAjaxObj.wmuIconFile);var m='<div class="wmu-preview [PREVIEW_TYPE_CLASS]" title="[PREVIEW_TITLE]" data-wmu-type="[PREVIEW_TYPE]" data-wmu-attachment="[PREVIEW_ID]"><div class="wmu-preview-remove"><img class="wmu-preview-img" src="[PREVIEW_ICON]"><div class="wmu-file-name">[PREVIEW_FILENAME]</div><div class="wmu-delete">&nbsp;</div></div></div>';m=(m=(m=(m=(m=(m=m.replace("[PREVIEW_TYPE_CLASS]","wmu-preview-"+t)).replace("[PREVIEW_TITLE]",s)).replace("[PREVIEW_TYPE]",t)).replace("[PREVIEW_ID]",i)).replace("[PREVIEW_ICON]",r)).replace("[PREVIEW_FILENAME]",u),e(".wmu-action-wrap .wmu-"+t+"-tab",a).removeClass("wmu-hide").append(m)})})}(t,a),a.data.errors&&(wpdiscuzAjaxObj.setCommentMessage(a.data.errors,"error",3e3),console.log(a.data.errors))):a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.errorCode],a.data.errorCode,t),"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250)})}(a,t,d)}),e(document).on("click",".wmu-attachment-delete",function(a){if(confirm(wpdiscuzAjaxObj.wmuPhraseConfirmDelete)){var t=e(this).data("wmu-attachment"),d=new FormData;d.append("action","wmuDeleteAttachment"),d.append("attachmentId",t),wpdiscuzAjaxObj.getAjaxObj(!0,!0,d).done(function(a){if(a.success){var d=e(".wmu-attachment-"+t).parents(".wmu-comment-attachments");e(".wmu-attachment-"+t).remove(),e(".wmu-attached-images *",d).length||e(".wmu-attached-images",d).remove(),e(".wmu-attached-videos *",d).length||e(".wmu-attached-videos",d).remove(),e(".wmu-attached-files *",d).length||e(".wmu-attached-files",d).remove()}else a.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.errorCode],a.data.errorCode,d),"error",3e3):a.data.error&&wpdiscuzAjaxObj.setCommentMessage(a.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250)})}else console.log("canceled")}),e(document).on("click",".wmu-preview",function(){var a=e(this),t=a.parents(".wpd_comm_form"),d=(a.data("wmu-type"),a.data("wmu-attachment")),o=new FormData;o.append("action","wmuRemoveAttachmentPreview"),o.append("attachmentId",d),o.append("wmuAttachmentsData",e(".wmu-attachments-data",t).val()),o.append("uniqueId",t.find(".wpdiscuz_unique_id").val()),wpdiscuzAjaxObj.getAjaxObj(!0,!0,o).done(function(d){if(d.success){a.remove();var o=e(".wmu-tabs",t);e.each(o,function(a,t){e(".wmu-preview",t).length?e(t).removeClass("wmu-hide"):e(t).addClass("wmu-hide")}),e(".wmu-attached-data-info",t).remove(),e(".wmu-add-files",t).after(d.data.attachmentsHtml),d.data.tooltip&&e(".wmu-upload-wrap",t).attr("wpd-tooltip",d.data.tooltip)}else d.data.errorCode?wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[d.data.errorCode],d.data.errorCode,t),"error",3e3):d.data.error&&wpdiscuzAjaxObj.setCommentMessage(d.data.error,"error",3e3);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,t,d){console.log(d),e("#wpdiscuz-loading-bar").fadeOut(250)})}),parseInt(wpdiscuzAjaxObj.wmuIsLightbox)){function a(){e(".wmu-lightbox").colorbox({maxHeight:"95%",maxWidth:"95%",rel:"wmu-lightbox",fixed:!0})}a(),wpdiscuzAjaxObj.wmuAddLightBox=a}wpdiscuzAjaxObj.wmuHideAll=function(a,t){"object"==typeof a?a.success?(e(".wmu-tabs",t).addClass("wmu-hide"),e(".wmu-preview",t).remove(),e(".wmu-attached-data-info",t).remove()):console.log(a.data):console.log(a)}});
assets/js/wpdiscuz.js CHANGED
@@ -1,14 +1,14 @@
1
  ;
2
  var wpdiscuzLoadRichEditor = parseInt(wpdiscuzAjaxObj.loadRichEditor);
3
  if (wpdiscuzLoadRichEditor) {
4
- var wpDiscuzEditor = new WpdEditor();
5
  }
6
 
7
  function wpdMessagesOnInit(message, type) {
8
- wpdiscuzAjaxObj.setCommentMessage(message, type);
9
- setTimeout(function() {
10
- location.href = location.href.substring(0, location.href.indexOf('wpdiscuzUrlAnchor') - 1);
11
- }, 3000);
12
  }
13
 
14
  /**
@@ -16,118 +16,118 @@ function wpdMessagesOnInit(message, type) {
16
  * @param {string/array} type(s) - message(s) type(s). acceptable values error/success/warning
17
  * @param {string/array} delay(s) - timeout(s) before message(s) disappears
18
  */
19
- wpdiscuzAjaxObj.setCommentMessage = function(message, type, delay) {
20
- var className = 'wpdiscuz-message-error';
21
- if (message instanceof Array) {
22
- for (var i in message) {
23
- if (type instanceof Array) {
24
- if (type[i] === 'success') {
25
- className = 'wpdiscuz-message-success';
26
- } else if (type[i] === 'warning') {
27
- className = 'wpdiscuz-message-warning';
28
- }
29
- } else {
30
- if (type === 'success') {
31
- className = 'wpdiscuz-message-success';
32
- } else if (type === 'warning') {
33
- className = 'wpdiscuz-message-warning';
34
- }
35
- }
36
- jQuery('<div/>')
37
- .addClass(className)
38
- .html(message[i])
39
- .prependTo('#wpdiscuz-comment-message')
40
- .delay(delay instanceof Array ? delay[i] : delay ? delay : 4000)
41
- .fadeOut(1000, function() {
42
- jQuery(this).remove();
43
- });
44
- }
45
- } else {
46
- if (type === 'success') {
47
- className = 'wpdiscuz-message-success';
48
- } else if (type === 'warning') {
49
- className = 'wpdiscuz-message-warning';
50
- }
51
- jQuery('<div/>')
52
- .addClass(className)
53
- .html(message)
54
- .prependTo('#wpdiscuz-comment-message')
55
- .delay(delay ? delay : 4000)
56
- .fadeOut(1000, function() {
57
- jQuery(this).remove();
58
- });
59
- }
60
  };
61
 
62
- wpdiscuzAjaxObj.applyFilterOnPhrase = function(phrase, key, el) {
63
- if (wpdiscuzAjaxObj.phraseFilters) {
64
- jQuery.each(wpdiscuzAjaxObj.phraseFilters, function(i) {
65
- if (typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[i]] === "function") {
66
- phrase = wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[i]](phrase, key, el);
67
- }
68
- });
69
- }
70
- return phrase;
71
  };
72
- jQuery(document).ready(function($) {
73
- /* global wpdiscuzAjaxObj */
74
- /* global Cookies */
75
- /* global grecaptcha */
76
- /* global Quill */
77
- $('body').addClass('wpdiscuz_' + wpdiscuzAjaxObj.version);
78
- var isUserLoggedIn = wpdiscuzAjaxObj.is_user_logged_in;
79
- var isShowCaptchaForGuests = wpdiscuzAjaxObj.wc_captcha_show_for_guest == 1 && !isUserLoggedIn;
80
- var isShowCaptchaForMembers = wpdiscuzAjaxObj.wc_captcha_show_for_members == 1 && isUserLoggedIn;
81
- var wpdiscuzRecaptchaVersion = wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion;
82
- var commentListLoadType = parseInt(wpdiscuzAjaxObj.commentListLoadType);
83
- var wpdiscuzPostId = parseInt(wpdiscuzAjaxObj.wc_post_id);
84
- var wpdiscuzNonce = wpdiscuzAjaxObj.wpdiscuz_nonce;
85
- var commentListUpdateType = parseInt(wpdiscuzAjaxObj.commentListUpdateType);
86
- var commentListUpdateTimer = parseInt(wpdiscuzAjaxObj.commentListUpdateTimer) * 1000;
87
- var enableGuestsLiveUpdate = parseInt(wpdiscuzAjaxObj.liveUpdateGuests);
88
- var loadLastCommentId = wpdiscuzAjaxObj.loadLastCommentId;
89
- var bubbleLastCommentId = loadLastCommentId;
90
- var firstLoadWithAjax = parseInt(wpdiscuzAjaxObj.firstLoadWithAjax);
91
- if (Cookies.get('wpdiscuz_comments_sorting')) {
92
- Cookies.remove('wpdiscuz_comments_sorting', {path: ''});
93
- }
94
- if (Cookies.get('wordpress_last_visit')) {
95
- Cookies.remove('wordpress_last_visit', {path: ''});
96
- }
97
- if (Cookies.get('wpdiscuz_last_visit')) {
98
- Cookies.remove('wpdiscuz_last_visit', {path: ''});
99
- }
100
- var wordpressIsPaginate = parseInt(wpdiscuzAjaxObj.wordpressIsPaginate);
101
- var storeCommenterData = wpdiscuzAjaxObj.storeCommenterData;
102
- var wpdiscuzUploader = parseInt(wpdiscuzAjaxObj.wmuEnabled);
103
- var isCookiesEnabled = wpdiscuzAjaxObj.isCookiesEnabled;
104
- var wpdCookiesConsent = true;
105
- var wpdiscuzCookiehash = wpdiscuzAjaxObj.cookiehash;
106
- var isLoadOnlyParentComments = parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments);
107
- var enableDropAnimation = parseInt(wpdiscuzAjaxObj.enableDropAnimation) ? 500 : 0;
108
- var isNativeAjaxEnabled = parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled);
109
- var bubbleEnabled = parseInt(wpdiscuzAjaxObj.enableBubble);
110
- var bubbleLiveUpdate = parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate);
111
- var bubbleHintTimeout = parseInt(wpdiscuzAjaxObj.bubbleHintTimeout);
112
- var bubbleHintHideTimeout = parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout) ? parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout) : 5;
113
- var bubbleShowNewCommentMessage = parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage);
114
- var bubbleLocation = wpdiscuzAjaxObj.bubbleLocation;
115
- var inlineFeedbackAttractionType = wpdiscuzAjaxObj.inlineFeedbackAttractionType;
116
- var scrollSize = parseInt(wpdiscuzAjaxObj.scrollSize);
117
- var scrollSize = scrollSize ? scrollSize : 32;
118
- var wpdiscuzAgreementFields = [];
119
- var reCaptchaWidgets = [];
120
- var bubbleNewCommentIds = [];
121
- var addingComment = false;
122
- var wpdiscuzLoadCount = 1;
123
-
124
- var htmlScrollBehavior = $('html').css('scroll-behavior');
125
- var bodyScrollBehavior = $('body').css('scroll-behavior');
126
-
127
- loginButtonsClone();
128
- if (wpdiscuzLoadRichEditor && $('#wpd-editor-0_0').length) {
129
- wpDiscuzEditor.createEditor('#wpd-editor-0_0');
130
- }
131
 
132
  window.addEventListener('beforeunload', function (e) {
133
  var forms = $('.wpd-form').not(':hidden');
@@ -152,2172 +152,2198 @@ jQuery(document).ready(function($) {
152
  }
153
  });
154
 
155
- if (!wpdiscuzLoadRichEditor) {
156
- $(document).delegate('textarea.wc_comment', 'input', function () {
157
- setTextareaCharCount($(this));
158
- });
159
-
160
- $.each($('textarea.wc_comment'), function () {
161
- setTextareaCharCount($(this));
162
- });
163
- }
164
-
165
- $(document).on('focus', '#wpdcom .ql-editor, #wpdcom .wc_comment', function() {
166
- $('.wpd-form-foot', $(this).parents('.wpd_comm_form')).slideDown(enableDropAnimation);
167
- });
168
- $(document).on('focus', '#wpdcom textarea', function() {
169
- if (!$(this).next('.autogrow-textarea-mirror').length) {
170
- $(this).autoGrow();
171
- }
172
- });
173
-
174
- if (!isUserLoggedIn) {
175
- var commentAuthorCookies = {
176
- comment_author: Cookies.get('comment_author_' + wpdiscuzCookiehash),
177
- comment_author_email: Cookies.get('comment_author_email_' + wpdiscuzCookiehash),
178
- comment_author_url: Cookies.get('comment_author_url_' + wpdiscuzCookiehash)
179
- };
180
- setCookieInForm(commentAuthorCookies);
181
- }
182
-
183
- $('.wpd-vote-down.wpd-dislike-hidden').remove();
184
- $('.wpd-toolbar-hidden').prev('[id^=wpd-editor-]').css('border-bottom', "1px solid #dddddd");
185
-
186
- $(document).on('click', '#wpd-editor-source-code-wrapper-bg', function() {
187
- $(this).hide();
188
- $('#wpd-editor-source-code-wrapper').hide();
189
- $('#wpd-editor-uid').val('');
190
- $('#wpd-editor-source-code').val('');
191
- });
192
-
193
- if (wpdiscuzLoadRichEditor) {
194
- $(document).on('click', '#wpd-insert-source-code', function() {
195
- var editor = wpDiscuzEditor.createEditor('#' + $('#wpd-editor-uid').val());
196
- editor.deleteText(0, editor.getLength(), Quill.sources.USER);
197
- var html = $('#wpd-editor-source-code').val();
198
- if (html.length) {
199
- editor.clipboard.dangerouslyPasteHTML(0, html, Quill.sources.USER);
200
- }
201
- editor.update();
202
- $('#wpd-editor-source-code-wrapper-bg').hide();
203
- $('#wpd-editor-source-code-wrapper').hide();
204
- $('#wpd-editor-uid').val('');
205
- $('#wpd-editor-source-code').val('');
206
- });
207
- }
208
-
209
- $(document).on('click', '.wpd-reply-button', function() {
210
- var uniqueID = getUniqueID($(this), 0);
211
- if ($(this).hasClass('wpdiscuz-clonned')) {
212
- if (wpdiscuzLoadRichEditor) {
213
- setTimeout(function() {
214
- wpDiscuzEditor.createEditor('#wpd-editor-' + uniqueID).focus();
215
- }, enableDropAnimation);
216
- } else {
217
- setTimeout(function() {
218
- $('#wc-textarea-' + uniqueID).trigger('focus');
219
- }, enableDropAnimation);
220
- }
221
- $('#wpd-secondary-form-wrapper-' + uniqueID).slideToggle(enableDropAnimation);
222
- } else {
223
- cloneSecondaryForm($(this));
224
- }
225
- generateReCaptcha(uniqueID);
226
- });
227
-
228
- $(document).on('click', '#wpdcom .wpd-comment-link [data-comment-url]', function() {
229
- var val = $(this).data('comment-url');
230
- var el = $('<input/>');
231
- el.appendTo('body').css({'position': 'absolute', 'top': '-10000000px'}).val(val);
232
- el.trigger('select');
233
- document.execCommand('copy');
234
- el.remove();
235
- wpdiscuzAjaxObj.setCommentMessage(val + '<br/>' + wpdiscuzAjaxObj.wc_copied_to_clipboard, 'success', 5000);
236
- });
237
-
238
- $(document).on('click', '.wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit', function(e) {
239
- e.preventDefault();
240
- });
241
-
242
- $(document).on('click', '.wpd-toggle.wpd_not_clicked', function() {
243
- var btn = $(this);
244
- btn.removeClass('wpd_not_clicked');
245
- var uniqueID = getUniqueID($(this), 0);
246
- var toggle = $(this);
247
- var icon = $('.fas', toggle);
248
- if (!toggle.parents('.wpd-comment:not(.wpd-reply)').children('.wpd-reply').length && isLoadOnlyParentComments) {
249
- wpdiscuzShowReplies(uniqueID, btn);
250
- } else {
251
- $('#wpd-comm-' + uniqueID + '> .wpd-reply').slideToggle(700, function() {
252
- if ($(this).is(':hidden')) {
253
- icon.removeClass('fa-chevron-up');
254
- icon.addClass('fa-chevron-down');
255
- toggle.find('.wpd-view-replies-text').text(wpdiscuzAjaxObj.wc_show_replies_text);
256
- toggle.attr('wpd-tooltip', wpdiscuzAjaxObj.wc_show_replies_text);
257
- } else {
258
- icon.removeClass('fa-chevron-down');
259
- icon.addClass('fa-chevron-up');
260
- toggle.find('.wpd-view-replies-text').text(wpdiscuzAjaxObj.wc_hide_replies_text);
261
- toggle.attr('wpd-tooltip', wpdiscuzAjaxObj.wc_hide_replies_text);
262
- }
263
- btn.addClass('wpd_not_clicked');
264
- });
265
- }
266
- });
267
-
268
- $(document).on('mouseenter', '.wpd-new-loaded-comment', function() {
269
- $(this).removeClass('wpd-new-loaded-comment');
270
- });
271
-
272
- $(document).on('click', '.wpd-sbs-toggle', function() {
273
- $('.wpdiscuz-subscribe-bar').slideToggle(enableDropAnimation);
274
- });
275
  //============================== reCAPTCHA ============================== //
276
- if (parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm) && !isUserLoggedIn && wpdiscuzAjaxObj.wpDiscuzReCaptchaSK && $('#wpdiscuz-subscribe-form').length) {
277
- if (wpdiscuzRecaptchaVersion === '2.0') {
278
- setTimeout(function() {
279
- try {
280
- grecaptcha.render('wpdiscuz-recaptcha-subscribe-form', {
281
- 'sitekey': wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,
282
- 'theme': wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,
283
- 'callback': function(response) {
284
- $('#wpdiscuz-recaptcha-field-subscribe-form').val('key');
285
- },
286
- 'expired-callback': function() {
287
- $('#wpdiscuz-recaptcha-field-subscribe-form').val("");
288
- }
289
- });
290
- } catch (e) {
291
- console.log(e);
292
- wpdiscuzAjaxObj.setCommentMessage('reCaptcha Error: ' + e.message, 'error');
293
- }
294
- }, 1000);
295
-
296
- $(document).on('submit', '#wpdiscuz-subscribe-form', function(e) {
297
- if (!$('#wpdiscuz-recaptcha-field-subscribe-form').val()) {
298
- $('.wpdiscuz-recaptcha', $(this)).css('border', '1px solid red');
299
- e.preventDefault();
300
- } else {
301
- $('.wpdiscuz-recaptcha', $(this)).css('border', 'none');
302
- }
303
- });
304
- } else if (wpdiscuzRecaptchaVersion === '3.0') {
305
- $(document).on('click', '#wpdiscuz_subscription_button', function(e) {
306
- var subscriptionForm = $(this).parents('#wpdiscuz-subscribe-form');
307
- e.preventDefault();
308
- try {
309
- grecaptcha.ready(function() {
310
- grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK, {action: 'wpdiscuz/wpdAddSubscription'})
311
- .then(function(token) {
312
- console.log(5555);
313
- document.getElementById('wpdiscuz-recaptcha-field-subscribe-form').value = token;
314
- subscriptionForm.trigger('submit');
315
- }, function(reason) {
316
- wpdiscuzAjaxObj.setCommentMessage('reCaptcha Error', 'error');
317
- console.log(reason);
318
- });
319
- });
320
- } catch (e) {
321
- console.log(e);
322
- wpdiscuzAjaxObj.setCommentMessage('reCaptcha Error: ' + e.message, 'error');
323
- }
324
- });
325
- }
326
- }
327
-
328
- function generateReCaptcha(uniqueId) {
329
- if ((isShowCaptchaForGuests || isShowCaptchaForMembers) && wpdiscuzRecaptchaVersion === '2.0') {
330
- var commentId = getCommentID(uniqueId);
331
- setTimeout(function() {
332
- if (!reCaptchaWidgets[commentId]) {
333
- try {
334
- reCaptchaWidgets[commentId] = grecaptcha.render('wpdiscuz-recaptcha-' + uniqueId, {
335
- 'sitekey': wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,
336
- 'theme': wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,
337
- 'callback': function(response) {
338
- $('#wpdiscuz-recaptcha-field-' + uniqueId).val('key');
339
- },
340
- 'expired-callback': function() {
341
- $('#wpdiscuz-recaptcha-field-' + uniqueId).val("");
342
- }
343
- });
344
- } catch (e) {
345
- console.log(e);
346
- wpdiscuzAjaxObj.setCommentMessage('reCaptcha Error: ' + e.message, 'error');
347
- }
348
- }
349
- }, 1000);
350
- }
351
- }
352
-
353
- function resetReCaptcha(uniqueId) {
354
- if ((isShowCaptchaForGuests || isShowCaptchaForMembers) && wpdiscuzRecaptchaVersion === '2.0') {
355
- var commentId = getCommentID(uniqueId);
356
- grecaptcha.reset(reCaptchaWidgets[commentId]);
357
- }
358
- }
359
-
360
- function wpdReCaptchaValidate(form) {
361
- var wpdGoogleRecaptchaValid = true;
362
- if (wpdiscuzRecaptchaVersion === '2.0' && $('input[name=wc_captcha]', form).length && !$('input[name=wc_captcha]', form).val().length) {
363
- wpdGoogleRecaptchaValid = false;
364
- $('.wpdiscuz-recaptcha', form).css('border', '1px solid red');
365
- } else if (wpdiscuzRecaptchaVersion === '2.0' && $('input[name=wc_captcha]', form).length) {
366
- $('.wpdiscuz-recaptcha', form).css('border', 'none');
367
- }
368
- return wpdGoogleRecaptchaValid;
369
- }
370
-
371
- function wpdReCaptchaValidateOnSubscribeForm(form) {
372
- var wpdGoogleRecaptchaValid = true;
373
- if (wpdiscuzRecaptchaVersion === '2.0' && $('input[name=wpdiscuz_recaptcha_subscribe_form]', form).length && !$('input[name=wpdiscuz_recaptcha_subscribe_form]', form).val().length) {
374
- wpdGoogleRecaptchaValid = false;
375
- $('.wpdiscuz-recaptcha', form).css('border', '1px solid red');
376
- } else if (wpdiscuzRecaptchaVersion === '2.0' && $('input[name=wpdiscuz_recaptcha_subscribe_form]', form).length) {
377
- $('.wpdiscuz-recaptcha', form).css('border', 'none');
378
- }
379
- return wpdGoogleRecaptchaValid;
380
- }
381
-
382
- if ((isShowCaptchaForGuests || isShowCaptchaForMembers) && wpdiscuzRecaptchaVersion === '2.0') {
383
- var ww = $(window).width();
384
- var wpcomm = $('#wpdcom').width();
385
- if (wpcomm >= 1100) {
386
- $("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({
387
- "transform-origin": "right 0",
388
- "-webkit-transform-origin": "right 0",
389
- "transform": "scale(0.9)",
390
- "-webkit-transform": "scale(0.9)"
391
- });
392
- $("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({
393
- "transform-origin": "right 0",
394
- "-webkit-transform-origin": "right 0",
395
- "transform": "scale(0.9)",
396
- "-webkit-transform": "scale(0.9)"
397
- });
398
- $("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({"width": "65%"});
399
- $("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({"width": "35%"});
400
- }
401
- if (wpcomm >= 940 && wpcomm < 1100) {
402
- $("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({
403
- "transform-origin": "right 0",
404
- "-webkit-transform-origin": "right 0",
405
- "transform": "scale(0.9)",
406
- "-webkit-transform": "scale(0.9)"
407
- });
408
- $("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({
409
- "transform-origin": "right 0",
410
- "-webkit-transform-origin": "right 0",
411
- "transform": "scale(0.9)",
412
- "-webkit-transform": "scale(0.9)"
413
- });
414
- $("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({"width": "60%"});
415
- $("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({"width": "40%"});
416
- }
417
- if (wpcomm >= 810 && wpcomm < 940) {
418
- $("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({
419
- "transform": "scale(0.9)",
420
- "-webkit-transform": "scale(0.9)"
421
- });
422
- $("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({
423
- "transform": "scale(0.8)",
424
- "-webkit-transform": "scale(0.8)"
425
- });
426
- $("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({"width": "40%"});
427
- $("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({"width": "60%"});
428
- }
429
- if (wpcomm >= 730 && wpcomm < 810) {
430
- $("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({
431
- "transform": "scale(0.9)",
432
- "-webkit-transform": "scale(0.9)"
433
- });
434
- $("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({
435
- "transform-origin": "right 0",
436
- "-webkit-transform-origin": "right 0",
437
- "transform": "scale(0.8)",
438
- "-webkit-transform": "scale(0.8)"
439
- });
440
- $("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({"width": "45%"});
441
- $("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({"width": "55%"});
442
- }
443
- if (wpcomm >= 610 && wpcomm < 730) {
444
- $("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({
445
- "transform": "scale(0.85)",
446
- "-webkit-transform": "scale(0.85)"
447
- });
448
- $("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({
449
- "transform": "scale(0.8)",
450
- "-webkit-transform": "scale(0.8)"
451
- });
452
- $("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({"width": "43%"});
453
- $("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({"width": "55%"});
454
- $("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({"width": "30%"});
455
- $("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({"width": "70%"});
456
- }
457
- if (ww > 650) {
458
- if (wpcomm >= 510 && wpcomm < 610) {
459
- $("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({
460
- "transform-origin": "center 0",
461
- "-webkit-transform-origin": "center 0",
462
- "transform": "scale(0.77)",
463
- "-webkit-transform": "scale(0.77)"
464
- });
465
- $("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({
466
- "transform-origin": "right 0",
467
- "-webkit-transform-origin": "right 0",
468
- "transform": "scale(0.77)",
469
- "-webkit-transform": "scale(0.77)"
470
- });
471
- $("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({"width": "35%"});
472
- $("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({"width": "63%"});
473
- $("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({
474
- "width": "30%",
475
- "position": "relative",
476
- "right": "-60px"
477
- });
478
- $("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({"width": "70%"});
479
- $("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left": "0px"});
480
- }
481
- if (wpcomm >= 470 && wpcomm < 510) {
482
- $("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({
483
- "transform-origin": "center 0",
484
- "-webkit-transform-origin": "center 0",
485
- "transform": "scale(0.77)",
486
- "-webkit-transform": "scale(0.77)"
487
- });
488
- $("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({
489
- "transform-origin": "right 0",
490
- "-webkit-transform-origin": "right 0",
491
- "transform": "scale(0.77)",
492
- "-webkit-transform": "scale(0.77)"
493
- });
494
- $("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({"width": "40%"});
495
- $("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({"width": "60%"});
496
- $("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({
497
- "float": "none",
498
- "width": "100%",
499
- "display": "block"
500
- });
501
- $("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({
502
- "float": "none",
503
- "width": "100%",
504
- "display": "block"
505
- });
506
- $("#wpdcom .wpd_main_comm_form .wc-form-footer").css({"margin-left": "0px"});
507
- $("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left": "0px"});
508
- }
509
- if (wpcomm < 470) {
510
- $("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({
511
- "margin": "0px auto",
512
- "transform-origin": "center 0",
513
- "-webkit-transform-origin": "center 0"
514
- });
515
- $("#wpdcom .wpd-form-col-left").css({"float": "none", "width": "100%", "display": "block"});
516
- $("#wpdcom .wpd-form-col-right").css({"float": "none", "width": "100%", "display": "block"});
517
- $("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left": "0px"});
518
- $("#wpdcom .wpd-secondary-form-wrapper .wc_notification_checkboxes").css({"text-align": "center"});
519
- $("#wpdcom .wpd-secondary-form-wrapper .wc-field-submit").css({"text-align": "center"});
520
- }
521
- }
522
- }
523
 
524
  //============================== /reCAPTCHA ============================== //
525
  //============================== ADD COMMENT FUNCTION ============================== //
526
 
527
- $(document).on('click', '.wc_comm_submit.wpd_not_clicked', function() {
528
- var currentSubmitBtn = $(this);
529
- var depth = 1;
530
- var wcForm = $(this).parents('form');
531
- if (!wcForm.hasClass('wpd_main_comm_form')) {
532
- depth = getCommentDepth($(this).parents('.wpd-comment'));
533
- }
534
-
535
- wpdValidateFieldRequired(wcForm, '#wpd-editor-' + $('.wpdiscuz_unique_id', wcForm).val());
536
- wcForm.on('submit', function(e) {
537
- e.preventDefault();
538
- });
539
- if ($('.wc_comment', wcForm).val().trim() === '') {
540
- wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wc_msg_required_fields, 'wc_msg_required_fields', wcForm), 'error');
541
- return;
542
- }
543
- if (wcForm[0].checkValidity() && wpdReCaptchaValidate(wcForm)) {
544
- addingComment = true;
545
- addAgreementInCookie(wcForm);
546
- $(currentSubmitBtn).removeClass('wpd_not_clicked');
547
- var data = new FormData();
548
- data.append('action', 'wpdAddComment');
549
- var inputs = $(":input", wcForm);
550
- inputs.each(function() {
551
- if (this.name != '' && this.type != 'checkbox' && this.type != 'radio') {
552
- data.append(this.name + '', $(this).val().trim());
553
- }
554
- if (this.type == 'checkbox' || this.type == 'radio') {
555
- if ($(this).is(':checked')) {
556
- data.append(this.name + '', $(this).val());
557
- }
558
- }
559
- });
560
-
561
- data.append('wpd_comment_depth', depth);
562
-
563
- if (wpdiscuzAjaxObj.wpdiscuz_zs) {
564
- data.append('wpdiscuz_zs', wpdiscuzAjaxObj.wpdiscuz_zs);
565
- }
566
-
567
- if ($('.wpd-cookies-checkbox', wcForm).length) {
568
- if (!$('.wpd-cookies-checkbox', wcForm).prop("checked")) {
569
- wpdCookiesConsent = false;
570
- }
571
- } else if (isUserLoggedIn) {
572
- wpdCookiesConsent = false;
573
- }
574
- $('#wpdiscuz-loading-bar').show();
575
- if (wpdiscuzAjaxObj.wpDiscuzReCaptchaSK && wpdiscuzRecaptchaVersion === '3.0' && ((wpdiscuzAjaxObj.wc_captcha_show_for_guest == 1 && !wpdiscuzAjaxObj.is_user_logged_in) || (wpdiscuzAjaxObj.wc_captcha_show_for_members == 1 && wpdiscuzAjaxObj.is_user_logged_in))) {
576
- try {
577
- grecaptcha.ready(function() {
578
- grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK, {action: 'wpdiscuz/addComment'})
579
- .then(function(token) {
580
- data.append('g-recaptcha-response', token);
581
- wpdiscuzSendComment(wcForm, data, currentSubmitBtn);
582
- }, function(reason) {
583
- wpdiscuzAjaxObj.setCommentMessage('reCaptcha Error', 'error');
584
- console.log(reason);
585
- });
586
- });
587
- } catch (e) {
588
- console.log(e);
589
- wpdiscuzAjaxObj.setCommentMessage('reCaptcha Error: ' + e.message, 'error');
590
- $('#wpdiscuz-loading-bar').fadeOut(250);
591
- }
592
- } else {
593
- wpdiscuzSendComment(wcForm, data, currentSubmitBtn);
594
- }
595
-
596
- }
597
- resetReCaptcha($('.wpdiscuz_unique_id', wcForm).val());
598
- wpdiscuzReset();
599
- });
600
-
601
- function wpdiscuzSendComment(wcForm, data, currentSubmitBtn) {
602
- getAjaxObj(isNativeAjaxEnabled || wpdiscuzUploader, false, data)
603
- .done(function(r) {
604
- $(currentSubmitBtn).addClass('wpd_not_clicked');
605
- if (typeof r === 'object') {
606
- if (r.success) {
607
- if (wpdiscuzAjaxObj.commentFormView === "collapsed") {
608
- $('.wpd-form-foot', wcForm).slideUp(enableDropAnimation);
609
- }
610
- r.data.wc_all_comments_count_new = parseInt(r.data.wc_all_comments_count_new);
611
- $('.wpd-thread-info').html(r.data.wc_all_comments_count_before_threads_html);
612
- $('.wpd-thread-info').attr('data-comments-count', r.data.wc_all_comments_count_new);
613
- $('#wpd-bubble-all-comments-count').replaceWith(r.data.wc_all_comments_count_bubble_html);
614
- var animateDelay = enableDropAnimation;
615
- if (r.data.is_main) {
616
- addCommentsAfterSticky(r.data.message);
617
- } else {
618
- animateDelay = enableDropAnimation + 700;
619
- $('#wpd-secondary-form-wrapper-' + r.data.uniqueid).slideToggle(700);
620
- if (r.data.is_in_same_container == 1) {
621
- $('#wpd-secondary-form-wrapper-' + r.data.uniqueid).after(r.data.message);
622
- } else {
623
- $('#wpd-comm-' + r.data.uniqueid).after(r.data.message);
624
- }
625
- }
626
- notifySubscribers(r);
627
- wpdiscuzRedirect(r);
628
- if (isCookiesEnabled && wpdCookiesConsent) {
629
- addCookie(r.data);
630
- } else if (!wpdCookiesConsent) {
631
- $('.wpd-cookies-checkbox').prop('checked', false);
632
- }
633
- wcForm.get(0).reset();
634
- if (wpdiscuzLoadRichEditor) {
635
- wpDiscuzEditor.createEditor('#wpd-editor-' + $('.wpdiscuz_unique_id', wcForm).val()).setContents([{insert: '\n'}]);
636
- } else {
637
- setTextareaCharCount(wcForm.find('.wc_comment'));
638
- }
639
- setCookieInForm(r.data);
640
- $('.wmu-preview-wrap', wcForm).remove();
641
- deleteAgreementFields();
642
- if (parseInt(wpdiscuzAjaxObj.scrollToComment)) {
643
- setTimeout(function() {
644
- unsetHtmlAndBodyScrollBehaviors();
645
- $('html, body').animate({
646
- scrollTop: $('#comment-' + r.data.new_comment_id).offset().top - scrollSize
647
- }, 1000, restoreHtmlAndBodyScrollBehaviors);
648
- }, animateDelay);
649
- }
650
- runCallbacks(r, wcForm);
651
- } else if (r.data) {
652
- wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[r.data], r.data, wcForm), 'error');
653
- runCallbacks(r, wcForm);
654
- }
655
- } else {
656
- wpdiscuzAjaxObj.setCommentMessage(r, 'error');
657
- }
658
- $('#wpdiscuz-loading-bar').fadeOut(250);
659
- addingComment = false;
660
- })
661
- .fail(function(jqXHR, textStatus, errorThrown) {
662
- console.log(errorThrown);
663
- $(currentSubmitBtn).addClass('wpd_not_clicked');
664
- $('#wpdiscuz-loading-bar').fadeOut(250);
665
- });
666
- }
667
-
668
- function notifySubscribers(r) {
669
- if (!r.data.held_moderate) {
670
- var data = new FormData();
671
- data.append('action', 'wpdCheckNotificationType');
672
- data.append('comment_id', r.data.new_comment_id);
673
- data.append('email', r.data.comment_author_email);
674
- data.append('isParent', r.data.is_main);
675
- getAjaxObj(isNativeAjaxEnabled, true, data);
676
- }
677
- }
678
-
679
- function wpdiscuzRedirect(r) {
680
- if (r.data.redirect > 0 && r.data.new_comment_id) {
681
- var data = new FormData();
682
- data.append('action', 'wpdRedirect');
683
- data.append('commentId', r.data.new_comment_id);
684
- getAjaxObj(isNativeAjaxEnabled, true, data)
685
- .done(function(r) {
686
- if (typeof r === 'object') {
687
- if (r.success) {
688
- setTimeout(function() {
689
- location.href = r.data;
690
- }, 2000);
691
- }
692
- }
693
- })
694
- .fail(function(jqXHR, textStatus, errorThrown) {
695
- console.log(errorThrown);
696
- });
697
- }
698
- }
699
-
700
- function setCookieInForm(obj) {
701
- $('.wpd_comm_form .wc_name').val(obj.comment_author);
702
- if (obj.comment_author_email && obj.comment_author_email.indexOf('@example.com') < 0) {
703
- $('.wpd_comm_form .wc_email').val(obj.comment_author_email);
704
- }
705
- if (obj.comment_author_url) {
706
- $('.wpd_comm_form .wc_website').val(obj.comment_author_url);
707
- }
708
- }
709
-
710
- function addCookie(obj) {
711
- var email = obj.comment_author_email;
712
- var name = obj.comment_author;
713
- var weburl = obj.comment_author_url;
714
- if (storeCommenterData == null) {
715
- Cookies.set('comment_author_email_' + wpdiscuzCookiehash, email);
716
- Cookies.set('comment_author_' + wpdiscuzCookiehash, name);
717
- if (weburl.length) {
718
- Cookies.set('comment_author_url_' + wpdiscuzCookiehash, weburl);
719
- }
720
- } else {
721
- storeCommenterData = parseInt(storeCommenterData);
722
- Cookies.set('comment_author_email_' + wpdiscuzCookiehash, email, {expires: storeCommenterData, path: '/'});
723
- Cookies.set('comment_author_' + wpdiscuzCookiehash, name, {expires: storeCommenterData, path: '/'});
724
- if (weburl.length) {
725
- Cookies.set('comment_author_url_' + wpdiscuzCookiehash, weburl, {
726
- expires: storeCommenterData,
727
- path: '/'
728
- });
729
- }
730
- }
731
- if ($('.wpd-cookies-checkbox').length) {
732
- $('.wpd-cookies-checkbox').prop('checked', true);
733
- }
734
- }
735
 
736
  //============================== /ADD COMMENT FUNCTION ============================== //
737
  //============================== EDIT COMMENT FUNCTION ============================== //
738
- var wcCommentTextBeforeEditing;
739
-
740
- $(document).on('click', '.wpd_editable_comment', function() {
741
- if (wcCommentTextBeforeEditing && $('.wpdiscuz-edit-form-wrap').length) {
742
- wpdCancelOrSave(getUniqueID($('.wpdiscuz-edit-form-wrap'), 0), wcCommentTextBeforeEditing);
743
- }
744
- var el = $(this);
745
- var uniqueID = getUniqueID(el, 0);
746
- var commentID = getCommentID(uniqueID);
747
- var data = new FormData();
748
- data.append('action', 'wpdEditComment');
749
- data.append('commentId', commentID);
750
- wcCommentTextBeforeEditing = $('#wpd-comm-' + uniqueID + ' > .wpd-comment-wrap .wpd-comment-text').get(0);
751
- getAjaxObj(isNativeAjaxEnabled, true, data)
752
- .done(function(r) {
753
- if (typeof r === 'object') {
754
- if (r.success) {
755
- $('#wpd-comm-' + uniqueID + ' > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text').replaceWith(r.data.html);
756
- if (wpdiscuzLoadRichEditor) {
757
- var currentEditor = wpDiscuzEditor.createEditor('#wpd-editor-edit_' + uniqueID);
758
- currentEditor.clipboard.dangerouslyPasteHTML(0, r.data.content);
759
- currentEditor.update();
760
- $('.wpd-toolbar-hidden').prev('[id^=wpd-editor-]').css('border-bottom', "1px solid #dddddd");
761
- } else {
762
- $('#wc-textarea-edit_' + uniqueID).val(r.data.content);
763
- setTextareaCharCount($('#wc-textarea-edit_' + uniqueID));
764
- }
765
- $('#wpd-comm-' + uniqueID + ' > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment').hide();
766
- $('#wpd-comm-' + uniqueID + ' > .wpd-comment-wrap .wpd-comment-last-edited').hide();
767
- } else {
768
- wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[r.data], r.data, el), 'error');
769
- }
770
- } else {
771
- console.log(r);
772
- }
773
- $('#wpdiscuz-loading-bar').fadeOut(250);
774
- })
775
- .fail(function(jqXHR, textStatus, errorThrown) {
776
- console.log(errorThrown);
777
- $('#wpdiscuz-loading-bar').fadeOut(250);
778
- });
779
- });
780
-
781
- $(document).on('click', '.wc_save_edited_comment', function() {
782
- var el = $(this)
783
- var uniqueID = getUniqueID(el);
784
- var commentID = getCommentID(uniqueID);
785
- var editCommentForm = $('#wpd-comm-' + uniqueID + ' #wpdiscuz-edit-form');
786
- wpdValidateFieldRequired(editCommentForm, '#wpd-editor-edit_' + uniqueID);
787
- editCommentForm.on('submit', function(e) {
788
- e.preventDefault();
789
- });
790
-
791
- if (editCommentForm[0].checkValidity()) {
792
- var data = new FormData();
793
- data.append('action', 'wpdSaveEditedComment');
794
- data.append('commentId', commentID);
795
- var inputs = $(":input", editCommentForm);
796
- inputs.each(function() {
797
- if (this.name !== '' && this.type !== 'checkbox' && this.type !== 'radio') {
798
- data.append(this.name + '', $(this).val());
799
- }
800
- if (this.type === 'checkbox' || this.type === 'radio') {
801
- if ($(this).is(':checked')) {
802
- data.append(this.name + '', $(this).val());
803
- }
804
- }
805
- });
806
-
807
- getAjaxObj(isNativeAjaxEnabled, true, data)
808
- .done(function(r) {
809
- if (typeof r === 'object') {
810
- if (r.success) {
811
- wpdCancelOrSave(uniqueID, r.data.message);
812
- if (r.data.lastEdited) {
813
- $('#wpd-comm-' + uniqueID + ' > .wpd-comment-wrap .wpd-comment-last-edited').remove();
814
- $(r.data.lastEdited).insertAfter('#wpd-comm-' + uniqueID + ' > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text');
815
- }
816
- if (r.data.twitterShareLink) {
817
- $('#wpd-comm-' + uniqueID + ' > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw').attr('href', r.data.twitterShareLink);
818
- }
819
- if (r.data.whatsappShareLink) {
820
- $('#wpd-comm-' + uniqueID + ' > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp').attr('href', r.data.whatsappShareLink);
821
- }
822
- if (wpdiscuzLoadRichEditor) {
823
- wpDiscuzEditor.removeEditor('#wpd-editor-edit_' + uniqueID);
824
- }
825
- } else {
826
- wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[r.data], r.data, el), 'error');
827
- }
828
- runCallbacks(r, commentID);
829
- } else {
830
- console.log(r);
831
- }
832
- $('#wpdiscuz-loading-bar').fadeOut(250);
833
- })
834
- .fail(function(jqXHR, textStatus, errorThrown) {
835
- console.log(errorThrown);
836
- $('#wpdiscuz-loading-bar').fadeOut(250);
837
- });
838
- }
839
- });
840
-
841
- $(document).on('click', '.wc_cancel_edit', function() {
842
- var uniqueID = getUniqueID($(this));
843
- wpdCancelOrSave(uniqueID, wcCommentTextBeforeEditing);
844
- if (wpdiscuzLoadRichEditor) {
845
- wpDiscuzEditor.removeEditor('#wpd-editor-edit_' + uniqueID);
846
- }
847
- });
848
-
849
- function wpdCancelOrSave(uniqueID, content) {
850
- $('#wpd-comm-' + uniqueID + ' > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment').show();
851
- $('#wpd-comm-' + uniqueID + ' .wpdiscuz-edit-form-wrap').replaceWith(content);
852
- $('#wpd-comm-' + uniqueID + ' > .wpd-comment-wrap .wpd-comment-last-edited').show();
853
- }
854
 
855
  //============================== /EDIT COMMENT FUNCTION ============================== //
856
  //============================== LOAD MORE ============================== //
857
- if (!wordpressIsPaginate && firstLoadWithAjax) {
858
- wpdiscuzLoadCount = 0;
859
- if (firstLoadWithAjax == 1) {
860
- setTimeout(function() {
861
- wpdiscuzLoadComments(true);
862
- }, 500);
863
- } else {
864
- $(document).on('click', '.wpd-load-comments', function() {
865
- $(this).parent('.wpd-load-more-submit-wrap').remove();
866
- wpdiscuzLoadComments(true);
867
- });
868
- }
869
- }
870
-
871
- $(document).on('click', '.wpd-load-more-submit', function() {
872
- var loadButton = $(this);
873
- var loaded = 'wpd-loaded';
874
- var loading = 'wpd-loading';
875
- if (loadButton.hasClass(loaded)) {
876
- wpdiscuzLoadComments(false, loadButton, loaded, loading);
877
- }
878
- });
879
-
880
- var isRun = false;
881
- if (commentListLoadType === 2 && !wordpressIsPaginate) {
882
- $('.wpd-load-more-submit').parents('.wpdiscuz-comment-pagination').hide();
883
- wpdiscuzScrollEvents();
884
- $(window).scroll(function() {
885
- wpdiscuzScrollEvents();
886
- });
887
- }
888
-
889
- function wpdiscuzScrollEvents() {
890
- var wpdiscuzHasMoreComments = $('#wpdiscuzHasMoreComments').val();
891
- var scrollHeight = $(document).height();
892
- var scrollPosition = $(window).height() + $(window).scrollTop();
893
- if (scrollHeight && scrollPosition) {
894
- var scrollPercent = scrollPosition * 100 / scrollHeight;
895
- if (scrollPercent >= 80 && isRun === false && wpdiscuzHasMoreComments == 1) {
896
- isRun = true;
897
- wpdiscuzLoadComments(false, $('.wpd-load-more-submit'));
898
- }
899
- }
900
- }
901
-
902
- function wpdiscuzLoadComments(isFirstLoad, loadButton, loaded, loading) {
903
- if (loadButton) {
904
- loadButton.toggleClass(loaded);
905
- loadButton.toggleClass(loading);
906
- }
907
- var data = new FormData();
908
- data.append('action', 'wpdLoadMoreComments');
909
- var sorting = $('.wpdiscuz-sort-button-active').attr('data-sorting');
910
- if (sorting) {
911
- data.append('sorting', sorting);
912
- }
913
- data.append('offset', wpdiscuzLoadCount);
914
- data.append('lastParentId', getLastParentID());
915
- data.append('isFirstLoad', isFirstLoad ? 1 : 0);
916
- var filterType = $('.wpdf-active').attr('data-filter-type');
917
- data.append('wpdType', filterType ? filterType : '');
918
- getAjaxObj(isNativeAjaxEnabled, isFirstLoad && firstLoadWithAjax == 1 ? false : true, data)
919
- .done(function(r) {
920
- if (typeof r === 'object') {
921
- if (r.success) {
922
- wpdiscuzLoadCount++;
923
- if (isFirstLoad) {
924
- $('.wpd-comment').remove();
925
- }
926
- $('.wpdiscuz_single').remove();
927
- $('.wpdiscuz-comment-pagination').before(r.data.comment_list);
928
- setLoadMoreVisibility(r, isFirstLoad && commentListLoadType !== 2);
929
- isRun = false;
930
- if (r.data.loadLastCommentId) {
931
- loadLastCommentId = r.data.loadLastCommentId;
932
- }
933
- runCallbacks(r);
934
- if (isFirstLoad) {
935
- getSingleComment(false);
936
- }
937
- }
938
- }
939
- $('#wpdiscuz-loading-bar').fadeOut(250);
940
- $('.wpd-load-more-submit').blur();
941
- if (loadButton) {
942
- loadButton.toggleClass(loaded);
943
- loadButton.toggleClass(loading);
944
- }
945
- })
946
- .fail(function(jqXHR, textStatus, errorThrown) {
947
- console.log(errorThrown);
948
- $('#wpdiscuz-loading-bar').fadeOut(250);
949
- $('.wpd-load-more-submit').blur();
950
- if (loadButton) {
951
- loadButton.toggleClass(loaded);
952
- loadButton.toggleClass(loading);
953
- }
954
- });
955
- }
956
-
957
- function setLoadMoreVisibility(r, showPagination) {
958
- if (r.data.is_show_load_more == false) {
959
- $('#wpdiscuzHasMoreComments').val(0);
960
- $('.wpd-load-more-submit').parents('.wpdiscuz-comment-pagination').hide();
961
- } else {
962
- setLastParentID(r.data.last_parent_id);
963
- $('#wpdiscuzHasMoreComments').val(1);
964
- if (showPagination) {
965
- $('.wpd-load-more-submit').parents('.wpdiscuz-comment-pagination').show();
966
- }
967
- }
968
-
969
- runCallbacks(r);
970
- }
971
-
972
- wpdiscuzAjaxObj.setLoadMoreVisibility = setLoadMoreVisibility;
973
  //============================== /LOAD MORE ============================== //
974
  //============================== VOTE ============================== //
975
- $(document).on('click', '.wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked', function() {
976
- var currentVoteBtn = $(this);
977
- $(currentVoteBtn).removeClass('wpd_not_clicked');
978
- var uniqueId = getUniqueID(currentVoteBtn);
979
- var commentID = getCommentID(uniqueId);
980
- var voteType;
981
- if ($(this).hasClass('wpd-vote-up')) {
982
- voteType = 1;
983
- } else {
984
- voteType = -1;
985
- }
986
-
987
- var data = new FormData();
988
- data.append('action', 'wpdVoteOnComment');
989
- data.append('commentId', commentID);
990
- data.append('voteType', voteType);
991
- getAjaxObj(isNativeAjaxEnabled, true, data)
992
- .done(function(r) {
993
- $(currentVoteBtn).addClass('wpd_not_clicked');
994
- if (typeof r === 'object') {
995
- if (r.success) {
996
- if (r.data.buttonsStyle === 'total') {
997
- var voteCountDiv = $('.wpd-comment-footer .wpd-vote-result', $('#comment-' + commentID));
998
- var votes = r.data.votes;
999
- voteCountDiv.text(r.data.votesHumanReadable);
1000
- voteCountDiv.attr('title', votes);
1001
- voteCountDiv.removeClass('wpd-up wpd-down');
1002
- if (votes > 0) {
1003
- voteCountDiv.addClass('wpd-up');
1004
- }
1005
- if (votes < 0) {
1006
- voteCountDiv.addClass('wpd-down');
1007
- }
1008
- } else {
1009
- var likeCountDiv = $('.wpd-comment-footer .wpd-vote-result-like', $('#comment-' + commentID));
1010
- var dislikeCountDiv = $('.wpd-comment-footer .wpd-vote-result-dislike', $('#comment-' + commentID));
1011
- likeCountDiv.text(r.data.likeCountHumanReadable);
1012
- likeCountDiv.attr('title', r.data.likeCount);
1013
- dislikeCountDiv.text(r.data.dislikeCountHumanReadable);
1014
- dislikeCountDiv.attr('title', r.data.dislikeCount);
1015
- parseInt(r.data.likeCount) > 0 ? likeCountDiv.addClass('wpd-up') : likeCountDiv.removeClass('wpd-up');
1016
- parseInt(r.data.dislikeCount) < 0 ? dislikeCountDiv.addClass('wpd-down') : dislikeCountDiv.removeClass('wpd-down');
1017
- }
1018
- var voteUpDiv = $('.wpd-comment-footer .wpd-vote-up', $('#comment-' + commentID));
1019
- var voteDownDiv = $('.wpd-comment-footer .wpd-vote-down', $('#comment-' + commentID));
1020
- voteUpDiv.removeClass('wpd-up');
1021
- voteDownDiv.removeClass('wpd-down');
1022
- if (r.data.curUserReaction > 0) {
1023
- voteUpDiv.addClass('wpd-up');
1024
- } else if (r.data.curUserReaction < 0) {
1025
- voteDownDiv.addClass('wpd-down');
1026
- }
1027
- } else if (r.data) {
1028
- wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[r.data], r.data, currentVoteBtn), 'error');
1029
- }
1030
- runCallbacks(r, commentID, voteType);
1031
- } else {
1032
- console.log(r);
1033
- }
1034
- $('#wpdiscuz-loading-bar').fadeOut(250);
1035
- })
1036
- .fail(function(jqXHR, textStatus, errorThrown) {
1037
- console.log(errorThrown);
1038
- $(currentVoteBtn).addClass('wpd_not_clicked');
1039
- $('#wpdiscuz-loading-bar').fadeOut(250);
1040
- });
1041
- });
1042
  //============================== /VOTE ============================== //
1043
  //============================== SORTING ============================== //
1044
- $(document).on('click', 'body', function(e) {
1045
- var children = $('.wpdiscuz-sort-buttons');
1046
- if ($(e.target).hasClass('wpdf-sorting') || $(e.target).parent().hasClass('wpdf-sorting')) {
1047
- children.css({display: children.is(':visible') ? 'none' : 'flex'});
1048
- } else {
1049
- children.hide();
1050
- }
1051
- });
1052
- $(document).on('click', '.wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)', function() {
1053
- var clickedBtn = $(this);
1054
- var sorting = $(this).attr("data-sorting");
1055
- if (sorting) {
1056
- $('.wpdiscuz-sort-button.wpdiscuz-sort-button-active').removeClass('wpdiscuz-sort-button-active').appendTo('.wpdiscuz-sort-buttons');
1057
- clickedBtn.addClass('wpdiscuz-sort-button-active').prependTo('.wpdf-sorting');
1058
- var data = new FormData();
1059
- data.append('action', 'wpdSorting');
1060
- data.append('sorting', sorting);
1061
- var filterType = $('.wpdf-active').attr('data-filter-type');
1062
- data.append('wpdType', filterType ? filterType : '');
1063
- getAjaxObj(isNativeAjaxEnabled, true, data)
1064
- .done(function(r) {
1065
- if (typeof r === 'object') {
1066
- if (r.success) {
1067
- $('#wpdcom .wpd-comment').remove();
1068
- $('#wpdcom .wpd-thread-list').prepend(r.data.message);
1069
- setLoadMoreVisibility(r, false);
1070
- wpdiscuzLoadCount = 1;
1071
- }
1072
- }
1073
- $('#wpdiscuz-loading-bar').fadeOut(250);
1074
- })
1075
- .fail(function(jqXHR, textStatus, errorThrown) {
1076
- console.log(errorThrown);
1077
- $('#wpdiscuz-loading-bar').fadeOut(250);
1078
- });
1079
- }
1080
- });
1081
  //============================== /SORTING ============================== //
1082
  //============================== SINGLE COMMENT ============================== //
1083
- function getSingleComment(showReply) {
1084
- var loc = location.href;
1085
- var matches = loc.match(/#comment\-(\d+)/);
1086
- if (matches !== null) {
1087
- var commentId = matches[1];
1088
- if (!$('#comment-' + commentId).length) {
1089
- var data = new FormData();
1090
- data.append('action', 'wpdGetSingleComment');
1091
- data.append('commentId', commentId);
1092
- getAjaxObj(isNativeAjaxEnabled, true, data)
1093
- .done(function(r) {
1094
- if (typeof r === 'object') {
1095
- if (r.success) {
1096
- var scrollToSelector = '#comment-' + commentId;
1097
- if ($('#comment-' + r.data.parentCommentID).length) {
1098
- $('#comment-' + r.data.parentCommentID).parents('[id^=wpd-comm-' + r.data.parentCommentID + ']').replaceWith(r.data.message);
1099
- } else {
1100
- $('.wpd-thread-list').prepend(r.data.message);
1101
- }
1102
-
1103
- runCallbacks(r);
1104
-
1105
- unsetHtmlAndBodyScrollBehaviors();
1106
- $('html, body').animate({
1107
- scrollTop: $(scrollToSelector).offset().top - scrollSize
1108
- }, 1000, restoreHtmlAndBodyScrollBehaviors);
1109
- if (showReply) {
1110
- showReplyForm(commentId);
1111
- }
1112
- }
1113
- }
1114
- $('#wpdiscuz-loading-bar').fadeOut(250);
1115
- })
1116
- .fail(function(jqXHR, textStatus, errorThrown) {
1117
- console.log(errorThrown);
1118
- $('#wpdiscuz-loading-bar').fadeOut(250);
1119
- });
1120
- } else {
1121
- setTimeout(function() {
1122
- unsetHtmlAndBodyScrollBehaviors();
1123
- $('html, body').animate({
1124
- scrollTop: $('#comment-' + commentId).parents('[id^=wpd-comm-]').offset().top - scrollSize
1125
- }, 1000, restoreHtmlAndBodyScrollBehaviors);
1126
- if (showReply) {
1127
- showReplyForm(commentId);
1128
- }
1129
- }, 500);
1130
- }
1131
- }
1132
- }
1133
-
1134
- window.onhashchange = function() {
1135
- getSingleComment(false);
1136
- };
1137
- if (firstLoadWithAjax != 1) {
1138
- getSingleComment(false);
1139
- }
1140
-
1141
- function showReplyForm(commentId) {
1142
- setTimeout(function() {
1143
- if (!$('#comment-' + commentId).siblings('.wpd-secondary-form-wrapper').is(':visible')) {
1144
- $('#comment-' + commentId).find('.wpd-reply-button').trigger('click');
1145
- }
1146
- }, 1100);
1147
- }
1148
 
1149
  //============================== /SINGLE COMMENT ============================== //
1150
  //============================== LIVE UPDATE ============================== //
1151
- function liveUpdate() {
1152
- var data = new FormData();
1153
- data.append('action', 'wpdUpdateAutomatically');
1154
- data.append('loadLastCommentId', loadLastCommentId);
1155
- data.append('visibleCommentIds', getVisibleCommentIds());
1156
- getAjaxObj(isNativeAjaxEnabled, false, data)
1157
- .done(function(r) {
1158
- if (!addingComment) {
1159
- if (typeof r === 'object') {
1160
- if (r.success) {
1161
- liveUpdateImmediately(r);
1162
- r.data.wc_all_comments_count_new = parseInt(r.data.wc_all_comments_count_new);
1163
- $('.wpd-thread-info').html(r.data.wc_all_comments_count_before_threads_html);
1164
- $('.wpd-thread-info').attr('data-comments-count', r.data.wc_all_comments_count_new);
1165
- $('#wpd-bubble-all-comments-count').replaceWith(r.data.wc_all_comments_count_bubble_html);
1166
- loadLastCommentId = r.data.loadLastCommentId;
1167
- }
1168
- }
1169
- }
1170
- })
1171
- .fail(function(jqXHR, textStatus, errorThrown) {
1172
- console.log(errorThrown);
1173
- });
1174
- }
1175
-
1176
- function liveUpdateImmediately(r) {
1177
- if (r.data.message !== undefined) {
1178
- var commentObject;
1179
- var message = r.data.message;
1180
- for (var i = 0; i < message.length; i++) {
1181
- commentObject = message[i];
1182
- addCommentToTree(commentObject.comment_parent, commentObject.comment_html);
1183
- }
1184
- }
1185
- }
1186
 
1187
  //============================== /LIVE UPDATE ============================== //
1188
  //============================== READ MORE ============================== //
1189
- $(document).on('click', '.wpdiscuz-readmore', function() {
1190
- var uniqueId = getUniqueID($(this));
1191
- var commentId = getCommentID(uniqueId);
1192
- var data = new FormData();
1193
- data.append('action', 'wpdReadMore');
1194
- data.append('commentId', commentId);
1195
- getAjaxObj(isNativeAjaxEnabled, true, data)
1196
- .done(function(r) {
1197
- if (typeof r === 'object') {
1198
- if (r.success) {
1199
- $('#comment-' + commentId + ' .wpd-comment-text').replaceWith(' ' + r.data.message);
1200
- $('#wpdiscuz-readmore-' + uniqueId).remove();
1201
- } else {
1202
- console.log(r.data);
1203
- }
1204
- runCallbacks(r);
1205
- } else {
1206
- console.log(r);
1207
- }
1208
- $('#wpdiscuz-loading-bar').fadeOut(250);
1209
- })
1210
- .fail(function(jqXHR, textStatus, errorThrown) {
1211
- console.log(errorThrown);
1212
- $('#wpdiscuz-loading-bar').fadeOut(250);
1213
- });
1214
- });
1215
  //============================== /READ MORE ============================== //
1216
  //============================== FUNCTIONS ============================== //
1217
 
1218
- function cloneSecondaryForm(field) {
1219
- var uniqueId = getUniqueID(field, 0);
1220
- $('#wpdiscuz_form_anchor-' + uniqueId).before(replaceUniqueId(uniqueId));
1221
- var secondaryFormWrapper = $('#wpd-secondary-form-wrapper-' + uniqueId);
1222
- if (!isUserLoggedIn) {
1223
- var commentAuthorCookies = {
1224
- comment_author: Cookies.get('comment_author_' + wpdiscuzCookiehash),
1225
- comment_author_email: Cookies.get('comment_author_email_' + wpdiscuzCookiehash),
1226
- comment_author_url: Cookies.get('comment_author_url_' + wpdiscuzCookiehash)
1227
- };
1228
- setCookieInForm(commentAuthorCookies);
1229
- }
1230
- if (wpdiscuzLoadRichEditor) {
1231
- setTimeout(function() {
1232
- wpDiscuzEditor.createEditor('#wpd-editor-' + uniqueId).focus();
1233
- }, enableDropAnimation);
1234
- } else {
1235
- setTimeout(function() {
1236
- $('#wc-textarea-' + uniqueId).trigger('focus');
1237
- }, enableDropAnimation);
1238
- }
1239
- secondaryFormWrapper.slideToggle(enableDropAnimation, function() {
1240
- field.addClass('wpdiscuz-clonned');
1241
- });
1242
- }
1243
-
1244
- function replaceUniqueId(uniqueId) {
1245
- var secondaryForm = $('#wpdiscuz_hidden_secondary_form').html();
1246
- return secondaryForm.replace(/wpdiscuzuniqueid/g, uniqueId);
1247
- }
1248
-
1249
- function getUniqueID(field, isMain) {
1250
- var fieldID = '';
1251
- if (isMain) {
1252
- fieldID = field.parents('.wpd-main-form-wrapper').attr('id');
1253
- } else {
1254
- fieldID = field.parents('.wpd-comment').attr('id');
1255
- }
1256
- return fieldID.substring(fieldID.lastIndexOf('-') + 1);
1257
- }
1258
-
1259
- function getCommentID(uniqueID) {
1260
- return uniqueID.substring(0, uniqueID.indexOf('_'));
1261
- }
1262
-
1263
- function getLastParentID() {
1264
- return $('.wpd-load-more-submit').attr("data-lastparentid");
1265
- }
1266
-
1267
- function setLastParentID(lastParentID) {
1268
- $('.wpd-load-more-submit').attr("data-lastparentid", lastParentID);
1269
- if (commentListLoadType !== 2) {
1270
- $('.wpdiscuz-comment-pagination').show();
1271
- }
1272
- }
1273
-
1274
- function getCommentDepth(field) {
1275
- var fieldClasses = field.attr('class');
1276
- var classesArray = fieldClasses.split(' ');
1277
- var depth = '';
1278
- $.each(classesArray, function(index, value) {
1279
- if ('wpd_comment_level' === getParentDepth(value, false)) {
1280
- depth = getParentDepth(value, true);
1281
- }
1282
- });
1283
- return parseInt(depth) + 1;
1284
- }
1285
-
1286
- function getParentDepth(depthValue, isNumberPart) {
1287
- var depth = '';
1288
- if (isNumberPart) {
1289
- depth = depthValue.substring(depthValue.indexOf('-') + 1);
1290
- } else {
1291
- depth = depthValue.substring(0, depthValue.indexOf('-'));
1292
- }
1293
- return depth;
1294
- }
1295
-
1296
- function addCommentToTree(parentId, comment) {
1297
- if (parentId == 0) {
1298
- addCommentsAfterSticky(comment);
1299
- } else {
1300
- var parentUniqueId = getUniqueID($('#comment-' + parentId), 0);
1301
- $('#wpdiscuz_form_anchor-' + parentUniqueId).after(comment);
1302
- }
1303
- }
1304
-
1305
- function getVisibleCommentIds() {
1306
- var visibleCommentIds = [];
1307
- $('.wpd-comment-right').each(function() {
1308
- visibleCommentIds.push(getCommentID(getUniqueID($(this), 0)));
1309
- });
1310
- return visibleCommentIds.join(',');
1311
- }
1312
-
1313
- function loginButtonsClone() {
1314
- if ($('.wc_social_plugin_wrapper .wp-social-login-provider-list').length) {
1315
- $('.wc_social_plugin_wrapper .wp-social-login-provider-list').clone().prependTo('#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content');
1316
- } else if ($('.wc_social_plugin_wrapper .the_champ_login_container').length) {
1317
- $('.wc_social_plugin_wrapper .the_champ_login_container').clone().prependTo('#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content');
1318
- } else if ($('.wc_social_plugin_wrapper .social_connect_form').length) {
1319
- $('.wc_social_plugin_wrapper .social_connect_form').clone().prependTo('#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content');
1320
- } else if ($('.wc_social_plugin_wrapper .oneall_social_login_providers').length) {
1321
- $('.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');
1322
- }
1323
- }
1324
-
1325
- function wpdiscuzReset() {
1326
- $('.wpdiscuz_reset').val("");
1327
- }
1328
-
1329
- function wpdValidateFieldRequired(form, editorId) {
1330
- var fieldsGroup = form.find('.wpd-required-group');
1331
- if (wpdiscuzLoadRichEditor) {
1332
- form.find('.wc_comment').val($(editorId + '>.ql-editor').html());
1333
- }
1334
- wpdSanitizeCommentText(form);
1335
- $.each(fieldsGroup, function() {
1336
- $('input', this).prop('required', false);
1337
- var checkedFields = $('input:checked', this);
1338
- if (checkedFields.length === 0) {
1339
- $('input', $(this)).prop('required', true);
1340
- } else {
1341
- $('.wpd-field-invalid', this).remove();
1342
- }
1343
- });
1344
- }
1345
-
1346
- function wpdSanitizeCommentText(form) {
1347
- var textarea = form.find('.wc_comment');
1348
- var commentText = textarea.val().trim();
1349
- var replacedText = commentText.replace(/<p><br><\/p>/g, "\n").replace(/<p>(.*?)<\/p>/g, "$1\n");
1350
- replacedText = replacedText.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g, " $3 ");
1351
- replacedText = replacedText.replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g, " $1 ");
1352
- replacedText = replacedText.replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g, " $3 ");
1353
- replacedText = replacedText.replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g, " $2 ");
1354
- textarea.val(replacedText);
1355
- }
1356
-
1357
- function unsetHtmlAndBodyScrollBehaviors() {
1358
- $('html, body').css('scroll-behavior', 'unset');
1359
- }
1360
-
1361
- function restoreHtmlAndBodyScrollBehaviors() {
1362
- $('html').css('scroll-behavior', htmlScrollBehavior);
1363
- $('body').css('scroll-behavior', bodyScrollBehavior);
1364
- }
1365
-
1366
- $(document).on('change', '.wpd-required-group', function() {
1367
- if ($('input:checked', this).length !== 0) {
1368
- $('input', $(this)).prop('required', false);
1369
- } else {
1370
- $('input', $(this)).prop('required', true);
1371
- }
1372
- });
1373
-
1374
- /* SPOILER */
1375
- $(document).on('click', '.wpdiscuz-spoiler', function() {
1376
- $(this).next().slideToggle();
1377
- if ($(this).hasClass('wpdiscuz-spoiler-closed')) {
1378
- $(this).parents('.wpdiscuz-spoiler-wrap').find('.fa-plus').removeClass('fa-plus').addClass('fa-minus');
1379
- } else {
1380
- $(this).parents('.wpdiscuz-spoiler-wrap').find('.fa-minus').removeClass('fa-minus').addClass('fa-plus');
1381
- }
1382
- $(this).toggleClass('wpdiscuz-spoiler-closed');
1383
- });
1384
-
1385
- function wpdiscuzShowReplies(uniqueId, btn) {
1386
- var commentId = getCommentID(uniqueId);
1387
- var data = new FormData();
1388
- data.append('action', 'wpdShowReplies');
1389
- data.append('commentId', commentId);
1390
- getAjaxObj(isNativeAjaxEnabled, true, data)
1391
- .done(function(r) {
1392
- btn.addClass('wpd_not_clicked');
1393
- if (typeof r === 'object') {
1394
- if (r.success) {
1395
- $('#wpd-comm-' + uniqueId).replaceWith(r.data.comment_list);
1396
- $('#wpd-comm-' + uniqueId + ' .wpd-toggle .fas').removeClass('fa-chevron-down').addClass('fa-chevron-up');
1397
- $('#wpd-comm-' + uniqueId + ' .wpd-toggle .wpd-view-replies .wpd-view-replies-text').text(wpdiscuzAjaxObj.wc_hide_replies_text);
1398
- $('#wpd-comm-' + uniqueId + ' .wpd-toggle').attr('wpd-tooltip', wpdiscuzAjaxObj.wc_hide_replies_text);
1399
-
1400
- runCallbacks(r);
1401
- }
1402
- }
1403
- $('#wpdiscuz-loading-bar').fadeOut(250);
1404
- })
1405
- .fail(function(jqXHR, textStatus, errorThrown) {
1406
- console.log(errorThrown);
1407
- btn.addClass('wpd_not_clicked');
1408
- $('#wpdiscuz-loading-bar').fadeOut(250);
1409
- });
1410
- }
1411
-
1412
- $(document).on('click', '.wpd-tools i', function() {
1413
- var sibling = $(this).siblings('.wpd-tools-actions');
1414
- if (!sibling.is(':visible') && $(this).parents('.wpd-comment-right').attr('id') === $('[id^=comment-]', '#wpdcom').last().attr('id')) {
1415
- $('#comments').css({paddingBottom: '160px'});
1416
- }
1417
- sibling.css({display: sibling.is(':visible') ? 'none' : 'flex'});
1418
- });
1419
- $(document).on('mouseleave', '.wpd-comment-right', function() {
1420
- $(this).find('.wpd-tools-actions').hide();
1421
- $('#comments').css({paddingBottom: '0'});
1422
- });
1423
-
1424
- $(document).on('click', '.wpd_stick_btn', function() {
1425
- var uniqueId = getUniqueID($(this), 0);
1426
- var commentId = getCommentID(uniqueId);
1427
- var data = new FormData();
1428
- data.append('action', 'wpdStickComment');
1429
- data.append('commentId', commentId);
1430
- getAjaxObj(isNativeAjaxEnabled, true, data)
1431
- .done(function(r) {
1432
- if (typeof r === 'object') {
1433
- if (r.success) {
1434
- location.reload(true);
1435
- }
1436
- }
1437
- $('#wpdiscuz-loading-bar').fadeOut(250);
1438
- })
1439
- .fail(function(jqXHR, textStatus, errorThrown) {
1440
- console.log(errorThrown);
1441
- $('#wpdiscuz-loading-bar').fadeOut(250);
1442
- });
1443
- });
1444
-
1445
- $(document).on('click', '.wpd_close_btn', function() {
1446
- var uniqueId = getUniqueID($(this), 0);
1447
- var commentId = getCommentID(uniqueId);
1448
- var data = new FormData();
1449
- data.append('action', 'wpdCloseThread');
1450
- data.append('commentId', commentId);
1451
- getAjaxObj(isNativeAjaxEnabled, true, data)
1452
- .done(function(r) {
1453
- if (typeof r === 'object') {
1454
- if (r.success) {
1455
- location.reload(true);
1456
- }
1457
- }
1458
- $('#wpdiscuz-loading-bar').fadeOut(250);
1459
- })
1460
- .fail(function(jqXHR, textStatus, errorThrown) {
1461
- console.log(errorThrown);
1462
- $('#wpdiscuz-loading-bar').fadeOut(250);
1463
- });
1464
- });
1465
-
1466
- $(document).on('click', '.wpd-filter.wpd_not_clicked[data-filter-type]', function() {
1467
- var btn = $(this);
1468
- var type = btn.attr('data-filter-type');
1469
- wpdiscuzAjaxObj.resetActiveFilters('.wpdf-' + type);
1470
- btn.removeClass('wpd_not_clicked');
1471
- $('.fas', btn).addClass('fa-pulse fa-spinner');
1472
- var data = new FormData();
1473
- data.append('action', 'wpdLoadMoreComments');
1474
- var sorting = $('.wpdiscuz-sort-button-active').attr('data-sorting');
1475
- if (sorting) {
1476
- data.append('sorting', sorting);
1477
- }
1478
- data.append('lastParentId', 0);
1479
- data.append('offset', 0);
1480
- wpdiscuzLoadCount = 1;
1481
- data.append('wpdType', btn.hasClass('wpdf-active') ? '' : type);
1482
- data.append('isFirstLoad', 1);
1483
- if ($(this).hasClass('wpdf-inline')) {
1484
- if ($(this).hasClass('wpdf-active')) {
1485
- $('.wpd-comment-info-bar').hide();
1486
- } else {
1487
- $('.wpd-comment-info-bar').css('display', 'flex');
1488
- }
1489
- } else {
1490
- $('.wpd-comment-info-bar').hide();
1491
- }
1492
- getAjaxObj(isNativeAjaxEnabled, false, data)
1493
- .done(function(r) {
1494
- btn.addClass('wpd_not_clicked');
1495
- $('.fas', btn).removeClass('fa-pulse fa-spinner');
1496
- if (typeof r === 'object') {
1497
- if (r.success) {
1498
- btn.toggleClass('wpdf-active');
1499
- $('.wpd-load-comments').remove();
1500
- $('.wpd-comment').remove();
1501
- $('.wpd-thread-list').prepend(r.data.comment_list);
1502
- setLoadMoreVisibility(r);
1503
- loadLastCommentId = r.data.loadLastCommentId;
1504
- $('.wpd-load-more-submit').blur();
1505
- runCallbacks(r);
1506
- }
1507
- }
1508
- $('#wpdiscuz-loading-bar').fadeOut(250);
1509
- })
1510
- .fail(function(jqXHR, textStatus, errorThrown) {
1511
- console.log(errorThrown);
1512
- $('#wpdiscuz-loading-bar').fadeOut(250);
1513
- });
1514
- });
1515
-
1516
- $(document).on('click', '.wpdf-reacted.wpd_not_clicked', function() {
1517
- var btn = $(this);
1518
- btn.removeClass('wpd_not_clicked');
1519
- $('.fas', btn).addClass('fa-pulse fa-spinner');
1520
- var data = new FormData();
1521
- data.append('action', 'wpdMostReactedComment');
1522
- getAjaxObj(isNativeAjaxEnabled, false, data)
1523
- .done(function(r) {
1524
- btn.addClass('wpd_not_clicked');
1525
- $('.fas', btn).removeClass('fa-pulse fa-spinner');
1526
- if (typeof r === 'object') {
1527
- if (r.success) {
1528
- if ($('#comment-' + r.data.parentCommentID).length) {
1529
- $('#comment-' + r.data.parentCommentID).parents('[id^=wpd-comm-' + r.data.parentCommentID + ']').replaceWith(r.data.message);
1530
- } else if (!$('#comment-' + r.data.commentId).length) {
1531
- $('.wpd-thread-list').prepend(r.data.message);
1532
- }
1533
-
1534
- runCallbacks(r);
1535
- unsetHtmlAndBodyScrollBehaviors();
1536
- $('html, body').animate({
1537
- scrollTop: $('#comment-' + r.data.commentId).offset().top - scrollSize
1538
- }, 1000, restoreHtmlAndBodyScrollBehaviors);
1539
- }
1540
- }
1541
- })
1542
- .fail(function(jqXHR, textStatus, errorThrown) {
1543
- console.log(errorThrown);
1544
- $('.fas', btn).removeClass('fa-pulse fa-spinner');
1545
- });
1546
- });
1547
-
1548
- $(document).on('click', '.wpdf-hottest.wpd_not_clicked', function() {
1549
- var btn = $(this);
1550
- btn.removeClass('wpd_not_clicked');
1551
- $('.fas', btn).addClass('fa-pulse fa-spinner');
1552
- var data = new FormData();
1553
- data.append('action', 'wpdHottestThread');
1554
- getAjaxObj(isNativeAjaxEnabled, false, data)
1555
- .done(function(r) {
1556
- btn.addClass('wpd_not_clicked');
1557
- $('.fas', btn).removeClass('fa-pulse fa-spinner');
1558
- if (typeof r === 'object') {
1559
- if (r.success) {
1560
- if ($('#comment-' + r.data.commentId).length) {
1561
- $('#comment-' + r.data.commentId).parents('[id^=wpd-comm-' + r.data.commentId + ']').replaceWith(r.data.message);
1562
- } else {
1563
- $('.wpd-thread-list').prepend(r.data.message);
1564
- }
1565
-
1566
- runCallbacks(r);
1567
-
1568
- unsetHtmlAndBodyScrollBehaviors();
1569
- $('html, body').animate({
1570
- scrollTop: $('#comment-' + r.data.commentId).offset().top - scrollSize
1571
- }, 1000, restoreHtmlAndBodyScrollBehaviors);
1572
- }
1573
- }
1574
- })
1575
- .fail(function(jqXHR, textStatus, errorThrown) {
1576
- console.log(errorThrown);
1577
- $('.fas', btn).removeClass('fa-pulse fa-spinner');
1578
- });
1579
- });
1580
-
1581
- $(document).on('click', '.wpd-filter-view-all', function() {
1582
- $('.wpdf-inline.wpdf-active.wpd_not_clicked').trigger('click');
1583
- });
1584
-
1585
-
1586
- function addAgreementInCookie(wcForm) {
1587
- $('.wpd-agreement-checkbox', wcForm).each(function() {
1588
- if ($(this).hasClass('wpd_agreement_hide') && isCookiesEnabled && $(this).prop('checked')) {
1589
- Cookies.set($(this).attr('name') + '_' + wpdiscuzCookiehash, 1, {expires: 30, path: '/'});
1590
- $('input[name=' + $(this).attr('name') + ']').each(function() {
1591
- wpdiscuzAgreementFields.push($(this));
1592
- });
1593
- }
1594
- });
1595
- }
1596
-
1597
- function deleteAgreementFields() {
1598
- if (wpdiscuzAgreementFields.length) {
1599
- wpdiscuzAgreementFields.forEach(function(item) {
1600
- item.parents('.wpd-field-checkbox').remove();
1601
- });
1602
- wpdiscuzAgreementFields = [];
1603
- }
1604
- }
1605
-
1606
- $(document).on('click', '.wpd-follow-link.wpd_not_clicked', function() {
1607
- var btn = $(this);
1608
- btn.removeClass('wpd_not_clicked');
1609
- $('.fas', btn).addClass('fa-pulse fa-spinner');
1610
- var uniqueId = getUniqueID(btn, 0);
1611
- var commentId = getCommentID(uniqueId);
1612
- var data = new FormData();
1613
- data.append('action', 'wpdFollowUser');
1614
- data.append('commentId', commentId);
1615
- getAjaxObj(isNativeAjaxEnabled, true, data)
1616
- .done(function(r) {
1617
- btn.addClass('wpd_not_clicked');
1618
- if (typeof r === 'object') {
1619
- if (r.success) {
1620
- wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[r.data.code], r.data.code, btn), 'success');
1621
- btn.removeClass('wpd-follow-active');
1622
- if (r.data.followTip) {
1623
- btn.attr('wpd-tooltip', r.data.followTip)
1624
- }
1625
- if (r.data.followClass) {
1626
- btn.addClass(r.data.followClass);
1627
- }
1628
- } else {
1629
- wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[r.data], r.data, btn), 'error');
1630
- }
1631
- } else {
1632
- console.log(r);
1633
- }
1634
- $('.fas', btn).removeClass('fa-pulse fa-spinner');
1635
- $('#wpdiscuz-loading-bar').fadeOut(250);
1636
- })
1637
- .fail(function(jqXHR, textStatus, errorThrown) {
1638
- console.log(errorThrown);
1639
- $('.fas', btn).removeClass('fa-pulse fa-spinner');
1640
- $('#wpdiscuz-loading-bar').fadeOut(250);
1641
- });
1642
- });
1643
-
1644
- function addCommentsAfterSticky(comment) {
1645
- if ($('.wpd-sticky-comment').last()[0]) {
1646
- $(comment).insertAfter($('.wpd-sticky-comment').last()[0]);
1647
- } else {
1648
- $('.wpd-thread-list').prepend(comment);
1649
- }
1650
- }
1651
-
1652
- function showHideNotificationType(current) {
1653
- if (current) {
1654
- if (!current.prop('required')) {
1655
- if (current.val()) {
1656
- current.parents('form').find('[name=wpdiscuz_notification_type]').parent().css('display', 'inline-block');
1657
- } else {
1658
- current.parents('form').find('[name=wpdiscuz_notification_type]').parent().css('display', 'none');
1659
- }
1660
- }
1661
- } else {
1662
- $.each($('.wc_email'), function(i, val) {
1663
- var obj = $(val);
1664
- if (!obj.prop('required')) {
1665
- if (obj.val()) {
1666
- obj.parents('form').find('[name=wpdiscuz_notification_type]').parent().css('display', 'inline-block');
1667
- } else {
1668
- obj.parents('form').find('[name=wpdiscuz_notification_type]').parent().css('display', 'none');
1669
- }
1670
- }
1671
- });
1672
- }
1673
- }
1674
-
1675
- showHideNotificationType();
1676
-
1677
- $(document).on('keyup', '.wc_email', function() {
1678
- showHideNotificationType($(this));
1679
- });
 
1680
 
1681
  //========================= BUBBLE =====================//
1682
- if (bubbleEnabled && $('#wpdcom').length) {
1683
- $('#wpd-bubble-wrapper').hover(function() {
1684
- $(this).addClass('wpd-bubble-hover');
1685
- }, function() {
1686
- $(this).removeClass('wpd-bubble-hover');
1687
- });
1688
- if (bubbleHintTimeout && !Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)) {
1689
- setTimeout(function() {
1690
- $('#wpd-bubble-wrapper').addClass('wpd-bubble-hover');
1691
- Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint, '1', {expires: 7, path: '/'});
1692
- setTimeout(function() {
1693
- $('#wpd-bubble-wrapper').removeClass('wpd-bubble-hover');
1694
- }, bubbleHintHideTimeout * 1000);
1695
- }, bubbleHintTimeout * 1000);
1696
- }
1697
- if ('content_left' === bubbleLocation) {
1698
- if ($('.entry-content').length) {
1699
- var left = Math.min($('.entry-content').offset().left, $('#wpdcom').offset().left) - 120;
1700
- var bubbleLeft = left > 25 ? left : 25;
1701
- $('#wpd-bubble-wrapper').css({left: bubbleLeft + 'px'});
1702
- $('#wpd-bubble-wrapper').addClass('wpd-left-content');
1703
- } else if ($('.post-entry').length) {
1704
- var left = Math.min($('.post-entry').offset().left, $('#wpdcom').offset().left) - 120;
1705
- var bubbleLeft = left > 25 ? left : 25;
1706
- $('#wpd-bubble-wrapper').css({left: bubbleLeft + 'px'});
1707
- $('#wpd-bubble-wrapper').addClass('wpd-left-content');
1708
- } else if ($('.container').length) {
1709
- var left = Math.min($('.container').offset().left, $('#wpdcom').offset().left) - 120;
1710
- var bubbleLeft = left > 25 ? left : 25;
1711
- $('#wpd-bubble-wrapper').css({left: bubbleLeft + 'px'});
1712
- $('#wpd-bubble-wrapper').addClass('wpd-left-content');
1713
- } else {
1714
- $('#wpd-bubble-wrapper').css({left: '25px'});
1715
- $('#wpd-bubble-wrapper').addClass('wpd-left-corner');
1716
- }
1717
- } else if ('left_corner' === bubbleLocation) {
1718
- $('#wpd-bubble-wrapper').css({left: '25px'});
1719
- $('#wpd-bubble-wrapper').addClass('wpd-left-corner');
1720
- } else if ('right_corner' === bubbleLocation) {
1721
- $('#wpd-bubble-wrapper').css({right: '25px'});
1722
- $('#wpd-bubble-wrapper').addClass('wpd-right-corner');
1723
- }
1724
-
1725
- $('#wpd-bubble-wrapper').show();
1726
-
1727
- $(document).on('click', '#wpd-bubble-add-message-close', function(e) {
1728
- e.preventDefault();
1729
- e.stopPropagation();
1730
- $('#wpd-bubble-wrapper').removeClass('wpd-bubble-hover');
1731
- });
1732
-
1733
- $(document).on('click', '#wpd-bubble', function() {
1734
- unsetHtmlAndBodyScrollBehaviors();
1735
- if ($('#tab-title-reviews').length) {
1736
- $('#tab-title-reviews a').trigger('click');
1737
- }
1738
- $('html, body').animate({
1739
- scrollTop: $('#wpdcom').offset().top - (scrollSize + 28)
1740
- }, 1000, function() {
1741
- restoreHtmlAndBodyScrollBehaviors();
1742
- $('#wpd-bubble-wrapper').removeClass('wpd-bubble-hover');
1743
- if (wpdiscuzLoadRichEditor) {
1744
- if ($('#wpd-editor-0_0').length) {
1745
- wpDiscuzEditor.createEditor('#wpd-editor-0_0').focus();
1746
- }
1747
- } else if ($('#wc-textarea-0_0').length) {
1748
- $('#wc-textarea-0_0').trigger('focus');
1749
- }
1750
- });
1751
- });
1752
-
1753
- $(document).on('click', '#wpd-bubble-comment-close', function(e) {
1754
- e.preventDefault();
1755
- $('#wpd-bubble-notification-message').hide();
1756
- $('#wpd-bubble-wrapper').removeClass('wpd-new-comment-added');
1757
- });
1758
-
1759
- $(document).on('click', '#wpd-bubble-comment-reply-link a', function() {
1760
- var href = $(this).attr('href');
1761
- setTimeout(function() {
1762
- $('#wpd-bubble-notification-message').hide();
1763
- $('#wpd-bubble-wrapper').removeClass('wpd-new-comment-added');
1764
- getSingleComment(true);
1765
- var commentId = href.match(/#comment\-(\d+)/);
1766
- bubbleNewCommentIds = bubbleNewCommentIds.filter(function(val) {
1767
- return val != commentId[1];
1768
- });
1769
- $('#wpd-bubble-count .wpd-new-comments-count').text(bubbleNewCommentIds.length);
1770
- if (bubbleNewCommentIds.length == 0) {
1771
- $('#wpd-bubble-count').removeClass('wpd-new-comments');
1772
- }
1773
- }, 100);
1774
- });
1775
-
1776
- $(document).on('click', '#wpd-bubble-count', function() {
1777
- if (bubbleNewCommentIds.length) {
1778
- var data = new FormData();
1779
- data.append('action', 'wpdBubbleUpdate');
1780
- data.append('newCommentIds', bubbleNewCommentIds.join());
1781
- getAjaxObj(isNativeAjaxEnabled, true, data)
1782
- .done(function(r) {
1783
- if (typeof r === 'object') {
1784
- if (r.success) {
1785
- r.data.message = r.data.message.filter(function(comment) {
1786
- if (!$('#comment-' + comment.comment_id).length) {
1787
- return comment;
1788
- }
1789
- });
1790
- liveUpdateImmediately(r);
1791
- $('#wpd-bubble-count').removeClass('wpd-new-comments');
1792
- $('#wpd-bubble-count .wpd-new-comments-count').text('0');
1793
- bubbleNewCommentIds = [];
1794
- if ($('.wpd-new-loaded-comment').length) {
1795
- unsetHtmlAndBodyScrollBehaviors();
1796
- $('html, body').animate({
1797
- scrollTop: $($('.wpd-new-loaded-comment')[0]).offset().top - (scrollSize + 28)
1798
- }, 1000, restoreHtmlAndBodyScrollBehaviors);
1799
- }
1800
- runCallbacks(r);
1801
- }
1802
- }
1803
- $('#wpdiscuz-loading-bar').fadeOut(250);
1804
- })
1805
- .fail(function(jqXHR, textStatus, errorThrown) {
1806
- console.log(errorThrown);
1807
- });
1808
- }
1809
- });
1810
-
1811
- }
1812
-
1813
- function bubbleAjax() {
1814
- $.ajax({
1815
- type: 'GET',
1816
- url: wpdiscuzAjaxObj.bubbleUpdateUrl,
1817
- beforeSend: function(xhr) {
1818
- xhr.setRequestHeader('X-WP-Nonce', wpdiscuzAjaxObj.restNonce);
1819
- },
1820
- data: {
1821
- postId: wpdiscuzPostId,
1822
- lastId: bubbleLastCommentId,
1823
- visibleCommentIds: getVisibleCommentIds(),
1824
- }
1825
- }).done(function(r) {
1826
- if (!addingComment) {
1827
- if (typeof r === 'object') {
1828
- r.commentIDsToRemove.forEach(function(id) {
1829
- $('[id^=wpd-comm-' + id + ']').remove();
1830
- });
1831
- if (r.ids.length) {
1832
- if (commentListUpdateType) {
1833
- liveUpdate();
1834
- }
1835
- r.ids = r.ids.filter(function(id) {
1836
- if (!$('#comment-' + id).length) {
1837
- return id;
1838
- }
1839
- });
1840
- var timeout = 5000;
1841
- bubbleLastCommentId = parseInt(r.ids[r.ids.length - 1]);
1842
- bubbleNewCommentIds = bubbleNewCommentIds.concat(r.ids);
1843
- if (bubbleShowNewCommentMessage && r.commentText) {
1844
- $('#wpd-bubble-author-avatar').html(r.avatar);
1845
- $('#wpd-bubble-author-name').html(r.authorName);
1846
- $('#wpd-bubble-comment-date span').html(r.commentDate);
1847
- $('#wpd-bubble-comment-text').html(r.commentText);
1848
- $('#wpd-bubble-comment-reply-link a').attr('href', r.commentLink);
1849
- $('#wpd-bubble-notification-message').show();
1850
- timeout = 10000;
1851
- }
1852
- var count = parseInt($('.wpd-new-comments-count').text());
1853
- count += r.ids.length;
1854
- $('#wpd-bubble-wrapper').removeClass('wpd-new-comment-added');
1855
- $('#wpd-bubble-wrapper').addClass('wpd-new-comment-added');
1856
- setTimeout(function() {
1857
- $('#wpd-bubble-notification-message').hide();
1858
- $('#wpd-bubble-wrapper').removeClass('wpd-new-comment-added');
1859
- }, timeout);
1860
- $('.wpd-new-comments-count').text(count);
1861
- $('#wpd-bubble-count').addClass('wpd-new-comments');
1862
- }
1863
- r.all_comments_count = parseInt(r.all_comments_count);
1864
- $('#wpd-bubble-all-comments-count').replaceWith(r.all_comments_count_bubble_html);
1865
- $('.wpd-thread-info').html(r.all_comments_count_before_threads_html);
1866
- $('.wpd-thread-info').attr('data-comments-count', r.all_comments_count);
1867
- } else {
1868
- console.log(r);
1869
- }
1870
- }
1871
- setTimeout(bubbleAjax, commentListUpdateTimer);
1872
- }).fail(function(jqXHR, textStatus, errorThrown) {
1873
- console.log(errorThrown);
1874
- setTimeout(bubbleAjax, commentListUpdateTimer);
1875
- });
1876
- }
1877
-
1878
- if (((bubbleEnabled && bubbleLiveUpdate) || commentListUpdateType) && (isUserLoggedIn || (!isUserLoggedIn && enableGuestsLiveUpdate))) {
1879
- setTimeout(bubbleAjax, commentListUpdateTimer);
1880
- }
1881
  //========================= /BUBBLE =====================//
1882
  //========================= INLINE COMMENTS =====================//
1883
- if ($('.wpd-inline-form-wrapper').length) {
1884
- var data = new FormData();
1885
- data.append('action', 'wpdGetInlineCommentForm');
1886
- getAjaxObj(isNativeAjaxEnabled, false, data)
1887
- .done(function(r) {
1888
- if (typeof r === 'object') {
1889
- if (r.success) {
1890
- $('.wpd-inline-form-wrapper').append(r.data);
1891
- $.each($('[name=_wpd_inline_nonce]'), function() {
1892
- var id = $(this).attr('id');
1893
- var parentId = $(this).parents('.wpd-inline-shortcode').attr('id');
1894
- $(this).attr('id', id + '-' + parentId.substring(parentId.lastIndexOf('-') + 1));
1895
- });
1896
- $('.wpd-inline-opened').addClass('wpd-active');
1897
- $('.wpd-inline-opened').find('.wpd-inline-form-wrapper').show();
1898
- $('.wpd-inline-opened').find('.wpd-inline-icon').addClass('wpd-open');
1899
- $('.wpd-inline-opened').find('.wpd-inline-icon').removeClass('wpd-ignored');
1900
- fixInlineFormsPosition();
1901
- } else {
1902
- wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[r.data]), r.data, 'error');
1903
- }
1904
- } else {
1905
- console.log(r);
1906
- }
1907
- })
1908
- .fail(function(jqXHR, textStatus, errorThrown) {
1909
- console.log(errorThrown);
1910
- });
1911
- }
1912
- $(document).on('click', 'body', function(e) {
1913
- if ($(e.target).hasClass('wpd-inline-form-close') || $(e.target).parents('.wpd-inline-form-close').length) {
1914
- e.preventDefault();
1915
- $(e.target).parents('.wpd-inline-form-wrapper').hide();
1916
- $(e.target).parents('.wpd-inline-shortcode').removeClass('wpd-active');
1917
- $(e.target).parents('.wpd-inline-form-wrapper').siblings('.wpd-inline-icon').removeClass('wpd-open');
1918
- } else if (!$(e.target).hasClass('wpd-inline-form-wrapper') && !$(e.target).parents('.wpd-inline-form-wrapper').length) {
1919
- hideInlineForms();
1920
- var currentEl = '';
1921
- if ($(e.target).hasClass('wpd-inline-icon')) {
1922
- currentEl = $(e.target);
1923
- } else if ($(e.target).parents('.wpd-inline-icon').length) {
1924
- currentEl = $(e.target).parents('.wpd-inline-icon');
1925
- }
1926
- if (currentEl.length && currentEl.parents('.wpd-inline-shortcode').find('.wpd-inline-form').length) {
1927
- currentEl.parents('.wpd-inline-shortcode').addClass('wpd-active');
1928
- currentEl.siblings('.wpd-inline-form-wrapper').show();
1929
- currentEl.addClass('wpd-open');
1930
- currentEl.removeClass('wpd-ignored');
1931
- fixInlineFormsPosition(currentEl.siblings('.wpd-inline-form-wrapper'));
1932
- }
1933
- }
1934
- if ((!$(e.target).hasClass('wpd-last-inline-comments-wrapper') && !$(e.target).parents('.wpd-last-inline-comments-wrapper').length) || ($(e.target).parents('.wpd-last-inline-comments-wrapper').length && $(e.target).hasClass('wpd-load-inline-comment'))) {
1935
- $('.wpd-last-inline-comments-wrapper').remove();
1936
- }
1937
- });
1938
- $(document).on('click', '.wpd-inline-submit.wpd_not_clicked', function(e) {
1939
- e.preventDefault();
1940
- var clickedButton = $(this);
1941
- var form = $(this).parents('.wpd_inline_comm_form');
1942
- if (form[0].checkValidity()) {
1943
- $(this).removeClass('wpd_not_clicked');
1944
- var data = new FormData();
1945
- data.append('action', 'wpdAddInlineComment');
1946
- data.append('inline_form_id', getInlineFormId(form));
1947
- $.each($('input, textarea', form), function(i, val) {
1948
- if (this.type === 'checkbox') {
1949
- if ($(this).is(':checked')) {
1950
- data.append($(val).attr('name'), $(val).val());
1951
- }
1952
- } else {
1953
- data.append($(val).attr('name'), $(val).val());
1954
- }
1955
- });
1956
- getAjaxObj(isNativeAjaxEnabled, true, data)
1957
- .done(function(r) {
1958
- clickedButton.addClass('wpd_not_clicked');
1959
- if (typeof r === 'object') {
1960
- if (r.success) {
1961
- form[0].reset();
1962
- hideInlineForms();
1963
- var newCount = parseInt(r.data.newCount);
1964
- var countEl = clickedButton.parents('.wpd-inline-icon-wrapper').find('.wpd-inline-icon-count');
1965
- countEl.text(newCount);
1966
- if (newCount) {
1967
- countEl.addClass('wpd-has-comments');
1968
- } else {
1969
- countEl.removeClass('wpd-has-comments');
1970
- }
1971
- r.data.allCommentsCountNew = parseInt(r.data.allCommentsCountNew);
1972
- $('.wpd-thread-info').html(r.data.allCommentsCountBeforeThreadsHtml);
1973
- $('.wpd-thread-info').attr('data-comments-count', r.data.allCommentsCountNew);
1974
- $('#wpd-bubble-all-comments-count').replaceWith(r.data.allCommentsCountBubbleHtml);
1975
- if (r.data.message) {
1976
- addCommentsAfterSticky(r.data.message);
1977
- }
1978
- wpdiscuzAjaxObj.setCommentMessage(r.data.notification, 'success');
1979
- } else if (r.data) {
1980
- wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[r.data], r.data, clickedButton), 'error');
1981
- }
1982
- } else {
1983
- wpdiscuzAjaxObj.setCommentMessage(r, 'error');
1984
- }
1985
- $('#wpdiscuz-loading-bar').fadeOut(250);
1986
- })
1987
- .fail(function(jqXHR, textStatus, errorThrown) {
1988
- console.log(errorThrown);
1989
- $('#wpdiscuz-loading-bar').fadeOut(250);
1990
- });
1991
- }
1992
- });
1993
- $(document).on('keydown', '.wpd-form', function(e) {
1994
- if (e.ctrlKey && e.keyCode == 13) {
1995
- $(this).find('.wc_comm_submit').trigger('click');
1996
- }
1997
- });
1998
- $(document).on('keydown', '#wpdiscuz-edit-form', function(e) {
1999
- if (e.ctrlKey && e.keyCode == 13) {
2000
- $(this).find('.wc_save_edited_comment').trigger('click');
2001
- }
2002
- });
2003
- $(document).on('keydown', '.wpd-inline-comment-content', function(e) {
2004
- if (e.ctrlKey && e.keyCode == 13) {
2005
- $(this).parents('.wpd_inline_comm_form').find('.wpd-inline-submit.wpd_not_clicked').trigger('click');
2006
- }
2007
- });
2008
- $(document).on('click', '.wpd-inline-icon-count.wpd-has-comments', function() {
2009
- var clickedButton = $(this);
2010
- var data = new FormData();
2011
- data.append('action', 'wpdGetLastInlineComments');
2012
- data.append('inline_form_id', getInlineFormId(clickedButton));
2013
- getAjaxObj(isNativeAjaxEnabled, true, data)
2014
- .done(function(r) {
2015
- if (typeof r === 'object') {
2016
- if (r.success) {
2017
- $(r.data).insertAfter(clickedButton);
2018
- } else {
2019
- wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[r.data], r.data, clickedButton), 'error');
2020
- }
2021
- } else {
2022
- console.log(r);
2023
- }
2024
- $('#wpdiscuz-loading-bar').fadeOut(250);
2025
- })
2026
- .fail(function(jqXHR, textStatus, errorThrown) {
2027
- console.log(errorThrown);
2028
- $('#wpdiscuz-loading-bar').fadeOut(250);
2029
- });
2030
- });
2031
- $(document).on('click', '.wpd-view-all-inline-comments', function(e) {
2032
- e.preventDefault();
2033
- $(this).parents('.wpd-last-inline-comments-wrapper').remove();
2034
- if (!$('.wpdf-inline').hasClass('wpdf-active')) {
2035
- $('.wpdf-inline').trigger('click');
2036
- }
2037
- unsetHtmlAndBodyScrollBehaviors();
2038
- $('html, body').animate({
2039
- scrollTop: $('.wpdf-inline').offset().top - scrollSize
2040
- }, 1000, restoreHtmlAndBodyScrollBehaviors);
2041
- });
2042
- $(document).on('click', '.wpd-feedback-content-link', function(e) {
2043
- e.preventDefault();
2044
- var feedbackId = $(this).data('feedback-content-id');
2045
- unsetHtmlAndBodyScrollBehaviors();
2046
- $('html, body').animate({
2047
- scrollTop: $('#wpd-inline-' + feedbackId).offset().top - (scrollSize + 6)
2048
- }, 1000, function() {
2049
- restoreHtmlAndBodyScrollBehaviors();
2050
- $('#wpd-inline-' + feedbackId).addClass('wpd-active');
2051
- });
2052
- });
2053
- if (inlineFeedbackAttractionType === 'scroll_open' || inlineFeedbackAttractionType === 'blink') {
2054
- inlineAttraction();
2055
- $(window).on('scroll', inlineAttraction);
2056
- }
2057
-
2058
- function getInlineFormId(el) {
2059
- if ($(el).hasClass('wpd-inline-shortcode')) {
2060
- var elId = $(el).attr('id');
2061
- } else {
2062
- var elId = $(el).parents('.wpd-inline-shortcode').attr('id');
2063
- }
2064
- return elId.substring(elId.lastIndexOf('-') + 1);
2065
- }
2066
-
2067
- function hideInlineForms() {
2068
- $('.wpd-inline-form-wrapper').hide();
2069
- $('.wpd-inline-shortcode').removeClass('wpd-active');
2070
- $('.wpd-inline-icon').removeClass('wpd-open');
2071
- }
2072
-
2073
- function inlineAttraction() {
2074
- $.each($('.wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon'), function() {
2075
- var el = $(this);
2076
- var diff = el.offset().top - window.pageYOffset;
2077
- if (el.parents('.wpd-inline-shortcode').find('.wpd-inline-form').length && diff > 0 && diff < 300) {
2078
- if (inlineFeedbackAttractionType === 'blink') {
2079
- el.addClass('wpd-blink');
2080
- setTimeout(function() {
2081
- el.removeClass('wpd-blink');
2082
- }, 3000);
2083
- } else {
2084
- el.parents('.wpd-inline-shortcode').addClass('wpd-active');
2085
- el.siblings('.wpd-inline-form-wrapper').show();
2086
- el.addClass('wpd-open');
2087
- fixInlineFormsPosition(el.siblings('.wpd-inline-form-wrapper'));
2088
- }
2089
- }
2090
- });
2091
- }
2092
-
2093
- function fixInlineFormsPosition(form) {
2094
- if (form) {
2095
- if (form.offset().left <= 10) {
2096
- form.css('left', Math.ceil(parseInt(form.css('left')) - form.offset().left + 10));
2097
- var beforeLeft = Math.ceil(form.siblings('.wpd-inline-icon.wpd-open').offset().left - form.offset().left + 2);
2098
- if (beforeLeft < 3) {
2099
- beforeLeft = 3;
2100
- }
2101
- document.styleSheets[0].addRule('#' + form.parents('.wpd-inline-shortcode').attr('id') + ' .wpd-inline-form-wrapper::before', 'left: ' + beforeLeft + 'px;');
2102
- } else if (form.offset().left + form.width() > document.body.clientWidth - 10) {
2103
- form.css('left', Math.ceil(parseInt(form.css('left')) + (document.body.clientWidth - (form.offset().left + form.width())) - 10));
2104
- var beforeLeft = Math.ceil(form.siblings('.wpd-inline-icon.wpd-open').offset().left - form.offset().left + 2);
2105
- if (beforeLeft > form.width() - 3) {
2106
- beforeLeft = form.width() - 3;
2107
- }
2108
- document.styleSheets[0].addRule('#' + form.parents('.wpd-inline-shortcode').attr('id') + ' .wpd-inline-form-wrapper::before', 'left: ' + beforeLeft + 'px;');
2109
- }
2110
- } else {
2111
- $.each($('.wpd-inline-form-wrapper:visible'), function() {
2112
- if ($(this).offset().left <= 10) {
2113
- $(this).css('left', Math.ceil(parseInt($(this).css('left')) - $(this).offset().left + 10));
2114
- var beforeLeft = Math.ceil($(this).siblings('.wpd-inline-icon.wpd-open').offset().left - $(this).offset().left + 2);
2115
- if (beforeLeft < 3) {
2116
- beforeLeft = 3;
2117
- }
2118
- document.styleSheets[0].addRule('#' + $(this).parents('.wpd-inline-shortcode').attr('id') + ' .wpd-inline-form-wrapper::before', 'left: ' + beforeLeft + 'px;');
2119
- } else if ($(this).offset().left + $(this).width() > document.body.clientWidth - 10) {
2120
- $(this).css('left', Math.ceil(parseInt($(this).css('left')) + (document.body.clientWidth - ($(this).offset().left + $(this).width())) - 10));
2121
- var beforeLeft = Math.ceil($(this).siblings('.wpd-inline-icon.wpd-open').offset().left - $(this).offset().left + 2);
2122
- if (beforeLeft > $(this).width() - 3) {
2123
- beforeLeft = $(this).width() - 3;
2124
- }
2125
- document.styleSheets[0].addRule('#' + $(this).parents('.wpd-inline-shortcode').attr('id') + ' .wpd-inline-form-wrapper::before', 'left: ' + beforeLeft + 'px;');
2126
- }
2127
- });
2128
- }
2129
- }
2130
 
2131
  //========================= /INLINE COMMENTS =====================//
2132
  //========================= POST RATING =====================//
2133
- $(document).on('click', '#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg', function() {
2134
- var data = new FormData();
2135
- var rating = $(this).index();
2136
- if (rating >= 0 && rating < 5) {
2137
- data.append('action', 'wpdUserRate');
2138
- data.append('rating', rating + 1);
2139
- getAjaxObj(isNativeAjaxEnabled, true, data)
2140
- .done(function(r) {
2141
- if (typeof r === 'object') {
2142
- if (r.success) {
2143
- location.reload(true);
2144
- } else {
2145
- wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[r.data], r.data), 'error');
2146
- }
2147
- } else {
2148
- console.log(r);
2149
- }
2150
- $('#wpdiscuz-loading-bar').fadeOut(250);
2151
- })
2152
- .fail(function(jqXHR, textStatus, errorThrown) {
2153
- console.log(errorThrown);
2154
- $('#wpdiscuz-loading-bar').fadeOut(250);
2155
- });
2156
- }
2157
- });
 
2158
  //========================= /POST RATING =====================//
2159
 
2160
- $(document).on('submit', '#wpdiscuz-subscribe-form', function(e) {
2161
- e.preventDefault();
2162
- var wcForm = $(this);
2163
- if (wcForm[0].checkValidity() && wpdReCaptchaValidateOnSubscribeForm(wcForm)) {
2164
- var data = new FormData();
2165
- data.append('action', 'wpdAddSubscription');
2166
- var elements = $("*", wcForm);
2167
- elements.each(function() {
2168
- if (this.name != '' && this.type != 'checkbox' && this.type != 'radio') {
2169
- data.append(this.name + '', $(this).val());
2170
- }
2171
- if (this.type == 'checkbox' || this.type == 'radio') {
2172
- if ($(this).is(':checked')) {
2173
- data.append(this.name + '', $(this).val());
2174
- }
2175
- }
2176
- });
2177
- getAjaxObj(isNativeAjaxEnabled, true, data)
2178
- .done(function(r) {
2179
- if (typeof r === 'object') {
2180
- if (r.success) {
2181
- wpdiscuzAjaxObj.setCommentMessage(r.data, 'success');
2182
- setTimeout(function() {
2183
- location.reload(true);
2184
- }, 3000);
2185
- } else {
2186
- wpdiscuzAjaxObj.setCommentMessage(r.data, 'error');
2187
- }
2188
- } else {
2189
- wpdiscuzAjaxObj.setCommentMessage(r, 'error');
2190
- }
2191
- $('#wpdiscuz-loading-bar').fadeOut(250);
2192
- addingComment = false;
2193
- })
2194
- .fail(function(jqXHR, textStatus, errorThrown) {
2195
- console.log(errorThrown);
2196
- $('#wpdiscuz-loading-bar').fadeOut(250);
2197
- });
2198
- }
2199
- });
2200
- $(document).on('click', '.wpd-unsubscribe',function(e) {
2201
- e.preventDefault();
2202
- var data = new FormData();
2203
- data.append('action', 'wpdUnsubscribe');
2204
- data.append('sid', $(this).data('sid'));
2205
- data.append('skey', $(this).data('skey'));
2206
- getAjaxObj(isNativeAjaxEnabled, true, data).done(function(r) {
2207
- if (typeof r === 'object') {
2208
- if (r.success) {
2209
- wpdiscuzAjaxObj.setCommentMessage(r.data, 'success');
2210
- setTimeout(function() {
2211
- location.reload(true);
2212
- }, 3000);
2213
- } else {
2214
- wpdiscuzAjaxObj.setCommentMessage(r.data, 'error');
2215
- }
2216
- } else {
2217
- console.log(r);
2218
- }
2219
- $('#wpdiscuz-loading-bar').fadeOut(250);
2220
- addingComment = false;
2221
- }).fail(function(jqXHR, textStatus, errorThrown) {
2222
- console.log(errorThrown);
2223
- $('#wpdiscuz-loading-bar').fadeOut(250);
2224
- });
2225
- });
2226
-
2227
- function setTextareaCharCount(elem) {
2228
- var commentTextMaxLength = 0;
2229
- var textareaWrap;
2230
- if (elem.parents('.wpd_main_comm_form').length) {
2231
- commentTextMaxLength = parseInt(wpdiscuzAjaxObj.commentTextMaxLength);
2232
- textareaWrap = elem.parents('.wpd_main_comm_form');
2233
- } else if (elem.parents('.wpd-secondary-form-wrapper').length) {
2234
- commentTextMaxLength = parseInt(wpdiscuzAjaxObj.replyTextMaxLength);
2235
- textareaWrap = elem.parents('.wpd-secondary-form-wrapper');
2236
- } else if (elem.parents('#wpdiscuz-edit-form').length) {
2237
- var uniquid = getUniqueID(elem);
2238
- commentTextMaxLength = parseInt(uniquid.substring(uniquid.lastIndexOf('_') + 1)) ? parseInt(wpdiscuzAjaxObj.replyTextMaxLength) : parseInt(wpdiscuzAjaxObj.commentTextMaxLength);
2239
- textareaWrap = elem.parents('#wpdiscuz-edit-form');
2240
- }
2241
- if (commentTextMaxLength && textareaWrap) {
2242
- var currLength = elem.val().length;
2243
- var charCountDiv = $('.wpd-editor-char-counter', textareaWrap);
2244
- var left = commentTextMaxLength - currLength;
2245
- charCountDiv.html(left);
2246
- if (left <= 10) {
2247
- charCountDiv.addClass('error');
2248
- } else {
2249
- charCountDiv.removeClass('error');
2250
- }
2251
- }
2252
- }
2253
-
2254
- wpdiscuzAjaxObj.resetActiveFilters = function(currentItemSelector) {
2255
- $('.wpd-filter.wpdf-active' + (currentItemSelector ? ':not(' + currentItemSelector + ')' : '')).removeClass('wpdf-active');
2256
- };
2257
-
2258
- function runCallbacks(r, commentID, voteType, wcForm) {
2259
- if (r.data.callbackFunctions) {
2260
- $.each(r.data.callbackFunctions, function(i) {
2261
- if (typeof wpdiscuzAjaxObj[r.data.callbackFunctions[i]] === "function") {
2262
- wpdiscuzAjaxObj[r.data.callbackFunctions[i]](r, commentID, voteType, wcForm);
2263
- } else {
2264
- console.log(r.data.callbackFunctions[i] + " is not a function");
2265
- }
2266
- });
2267
- }
2268
- }
2269
-
2270
- /**
2271
- * @param {int/bool} isNative - use native or custom ajax
2272
- * @param {bool} isShowTopLoading - show loading bar
2273
- * @param {object} data - data for ajax request
2274
- * @returns {jqXHR}
2275
- */
2276
- function getAjaxObj(isNative, isShowTopLoading, data) {
2277
- if (isShowTopLoading) {
2278
- $('#wpdiscuz-loading-bar').show();
2279
- }
2280
- data.append('postId', wpdiscuzPostId);
2281
- data.append('wpdiscuz_nonce', wpdiscuzNonce);
2282
- var action = data.get('action');
2283
- if (wpdiscuzAjaxObj.dataFilterCallbacks && wpdiscuzAjaxObj.dataFilterCallbacks[action]) {
2284
- $.each(wpdiscuzAjaxObj.dataFilterCallbacks[action], function(i) {
2285
- if (typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[action][i]] === "function") {
2286
- data = wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[action][i]](data, isNative, isShowTopLoading);
2287
- }
2288
- });
2289
- }
2290
- var url = isNative ? wpdiscuzAjaxObj.url : wpdiscuzAjaxObj.customAjaxUrl;
2291
- return $.ajax({
2292
- type: 'POST',
2293
- url: url,
2294
- data: data,
2295
- contentType: false,
2296
- processData: false
2297
- });
2298
- }
2299
-
2300
- wpdiscuzAjaxObj.getAjaxObj = getAjaxObj;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2301
 
2302
  });
2303
  //========================= reCAPTCHA =====================//
2304
- var onloadCallback = function() {
2305
- if (document.getElementById('wpdiscuz-recaptcha-0_0') && wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion === '2.0' && ((wpdiscuzAjaxObj.wc_captcha_show_for_guest == 1 && !wpdiscuzAjaxObj.is_user_logged_in) || (wpdiscuzAjaxObj.wc_captcha_show_for_members == 1 && wpdiscuzAjaxObj.is_user_logged_in))) {
2306
- try {
2307
- grecaptcha.render('wpdiscuz-recaptcha-0_0', {
2308
- 'sitekey': wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,
2309
- 'theme': wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,
2310
- 'callback': function(response) {
2311
- jQuery('#wpdiscuz-recaptcha-field-0_0').val('key');
2312
- },
2313
- 'expired-callback': function() {
2314
- jQuery('#wpdiscuz-recaptcha-field-0_0').val("");
2315
- }
2316
- });
2317
- } catch (e) {
2318
- console.log(e);
2319
- wpdiscuzAjaxObj.setCommentMessage('reCaptcha Error: ' + e.message, 'error');
2320
- }
2321
- }
2322
  };
2323
  //========================= /reCAPTCHA =====================//
1
  ;
2
  var wpdiscuzLoadRichEditor = parseInt(wpdiscuzAjaxObj.loadRichEditor);
3
  if (wpdiscuzLoadRichEditor) {
4
+ var wpDiscuzEditor = new WpdEditor();
5
  }
6
 
7
  function wpdMessagesOnInit(message, type) {
8
+ wpdiscuzAjaxObj.setCommentMessage(message, type);
9
+ setTimeout(function () {
10
+ location.href = location.href.substring(0, location.href.indexOf('wpdiscuzUrlAnchor') - 1);
11
+ }, 3000);
12
  }
13
 
14
  /**
16
  * @param {string/array} type(s) - message(s) type(s). acceptable values error/success/warning
17
  * @param {string/array} delay(s) - timeout(s) before message(s) disappears
18
  */
19
+ wpdiscuzAjaxObj.setCommentMessage = function (message, type, delay) {
20
+ var className = 'wpdiscuz-message-error';
21
+ if (message instanceof Array) {
22
+ for (var i in message) {
23
+ if (type instanceof Array) {
24
+ if (type[i] === 'success') {
25
+ className = 'wpdiscuz-message-success';
26
+ } else if (type[i] === 'warning') {
27
+ className = 'wpdiscuz-message-warning';
28
+ }
29
+ } else {
30
+ if (type === 'success') {
31
+ className = 'wpdiscuz-message-success';
32
+ } else if (type === 'warning') {
33
+ className = 'wpdiscuz-message-warning';
34
+ }
35
+ }
36
+ jQuery('<div/>')
37
+ .addClass(className)
38
+ .html(message[i])
39
+ .prependTo('#wpdiscuz-comment-message')
40
+ .delay(delay instanceof Array ? delay[i] : delay ? delay : 4000)
41
+ .fadeOut(1000, function () {
42
+ jQuery(this).remove();
43
+ });
44
+ }
45
+ } else {
46
+ if (type === 'success') {
47
+ className = 'wpdiscuz-message-success';
48
+ } else if (type === 'warning') {
49
+ className = 'wpdiscuz-message-warning';
50
+ }
51
+ jQuery('<div/>')
52
+ .addClass(className)
53
+ .html(message)
54
+ .prependTo('#wpdiscuz-comment-message')
55
+ .delay(delay ? delay : 4000)
56
+ .fadeOut(1000, function () {
57
+ jQuery(this).remove();
58
+ });
59
+ }
60
  };
61
 
62
+ wpdiscuzAjaxObj.applyFilterOnPhrase = function (phrase, key, el) {
63
+ if (wpdiscuzAjaxObj.phraseFilters) {
64
+ jQuery.each(wpdiscuzAjaxObj.phraseFilters, function (i) {
65
+ if (typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[i]] === "function") {
66
+ phrase = wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[i]](phrase, key, el);
67
+ }
68
+ });
69
+ }
70
+ return phrase;
71
  };
72
+ jQuery(document).ready(function ($) {
73
+ /* global wpdiscuzAjaxObj */
74
+ /* global Cookies */
75
+ /* global grecaptcha */
76
+ /* global Quill */
77
+ $('body').addClass('wpdiscuz_' + wpdiscuzAjaxObj.version);
78
+ var isUserLoggedIn = wpdiscuzAjaxObj.is_user_logged_in;
79
+ var isShowCaptchaForGuests = wpdiscuzAjaxObj.wc_captcha_show_for_guest == 1 && !isUserLoggedIn;
80
+ var isShowCaptchaForMembers = wpdiscuzAjaxObj.wc_captcha_show_for_members == 1 && isUserLoggedIn;
81
+ var wpdiscuzRecaptchaVersion = wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion;
82
+ var commentListLoadType = parseInt(wpdiscuzAjaxObj.commentListLoadType);
83
+ var wpdiscuzPostId = parseInt(wpdiscuzAjaxObj.wc_post_id);
84
+ wpdiscuzAjaxObj.wpdiscuz_nonce = '';
85
+ var commentListUpdateType = parseInt(wpdiscuzAjaxObj.commentListUpdateType);
86
+ var commentListUpdateTimer = parseInt(wpdiscuzAjaxObj.commentListUpdateTimer) * 1000;
87
+ var enableGuestsLiveUpdate = parseInt(wpdiscuzAjaxObj.liveUpdateGuests);
88
+ var loadLastCommentId = wpdiscuzAjaxObj.loadLastCommentId;
89
+ var bubbleLastCommentId = loadLastCommentId;
90
+ var firstLoadWithAjax = parseInt(wpdiscuzAjaxObj.firstLoadWithAjax);
91
+ if (Cookies.get('wpdiscuz_comments_sorting')) {
92
+ Cookies.remove('wpdiscuz_comments_sorting', {path: ''});
93
+ }
94
+ if (Cookies.get('wordpress_last_visit')) {
95
+ Cookies.remove('wordpress_last_visit', {path: ''});
96
+ }
97
+ if (Cookies.get('wpdiscuz_last_visit')) {
98
+ Cookies.remove('wpdiscuz_last_visit', {path: ''});
99
+ }
100
+ var wordpressIsPaginate = parseInt(wpdiscuzAjaxObj.wordpressIsPaginate);
101
+ var storeCommenterData = wpdiscuzAjaxObj.storeCommenterData;
102
+ var wpdiscuzUploader = parseInt(wpdiscuzAjaxObj.wmuEnabled);
103
+ var isCookiesEnabled = wpdiscuzAjaxObj.isCookiesEnabled;
104
+ var wpdCookiesConsent = true;
105
+ var wpdiscuzCookiehash = wpdiscuzAjaxObj.cookiehash;
106
+ var isLoadOnlyParentComments = parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments);
107
+ var enableDropAnimation = parseInt(wpdiscuzAjaxObj.enableDropAnimation) ? 500 : 0;
108
+ var isNativeAjaxEnabled = parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled);
109
+ var bubbleEnabled = parseInt(wpdiscuzAjaxObj.enableBubble);
110
+ var bubbleLiveUpdate = parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate);
111
+ var bubbleHintTimeout = parseInt(wpdiscuzAjaxObj.bubbleHintTimeout);
112
+ var bubbleHintHideTimeout = parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout) ? parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout) : 5;
113
+ var bubbleShowNewCommentMessage = parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage);
114
+ var bubbleLocation = wpdiscuzAjaxObj.bubbleLocation;
115
+ var inlineFeedbackAttractionType = wpdiscuzAjaxObj.inlineFeedbackAttractionType;
116
+ var scrollSize = parseInt(wpdiscuzAjaxObj.scrollSize);
117
+ var scrollSize = scrollSize ? scrollSize : 32;
118
+ var wpdiscuzAgreementFields = [];
119
+ var reCaptchaWidgets = [];
120
+ var bubbleNewCommentIds = [];
121
+ var addingComment = false;
122
+ var wpdiscuzLoadCount = 1;
123
+
124
+ var htmlScrollBehavior = $('html').css('scroll-behavior');
125
+ var bodyScrollBehavior = $('body').css('scroll-behavior');
126
+
127
+ loginButtonsClone();
128
+ if (wpdiscuzLoadRichEditor && $('#wpd-editor-0_0').length) {
129
+ wpDiscuzEditor.createEditor('#wpd-editor-0_0');
130
+ }
131
 
132
  window.addEventListener('beforeunload', function (e) {
133
  var forms = $('.wpd-form').not(':hidden');
152
  }
153
  });
154
 
155
+ if (!wpdiscuzLoadRichEditor) {
156
+ $(document).delegate('textarea.wc_comment', 'input', function () {
157
+ setTextareaCharCount($(this));
158
+ });
159
+
160
+ $.each($('textarea.wc_comment'), function () {
161
+ setTextareaCharCount($(this));
162
+ });
163
+ }
164
+
165
+ $(document).on('focus', '#wpdcom .ql-editor, #wpdcom .wc_comment', function () {
166
+ $('.wpd-form-foot', $(this).parents('.wpd_comm_form')).slideDown(enableDropAnimation);
167
+ });
168
+ $(document).on('focus', '#wpdcom textarea', function () {
169
+ if (!$(this).next('.autogrow-textarea-mirror').length) {
170
+ $(this).autoGrow();
171
+ }
172
+ });
173
+
174
+ if (!isUserLoggedIn) {
175
+ var commentAuthorCookies = {
176
+ comment_author: Cookies.get('comment_author_' + wpdiscuzCookiehash),
177
+ comment_author_email: Cookies.get('comment_author_email_' + wpdiscuzCookiehash),
178
+ comment_author_url: Cookies.get('comment_author_url_' + wpdiscuzCookiehash)
179
+ };
180
+ setCookieInForm(commentAuthorCookies);
181
+ }
182
+
183
+ $('.wpd-vote-down.wpd-dislike-hidden').remove();
184
+ $('.wpd-toolbar-hidden').prev('[id^=wpd-editor-]').css('border-bottom', "1px solid #dddddd");
185
+
186
+ $(document).on('click', '#wpd-editor-source-code-wrapper-bg', function () {
187
+ $(this).hide();
188
+ $('#wpd-editor-source-code-wrapper').hide();
189
+ $('#wpd-editor-uid').val('');
190
+ $('#wpd-editor-source-code').val('');
191
+ });
192
+
193
+ if (wpdiscuzLoadRichEditor) {
194
+ $(document).on('click', '#wpd-insert-source-code', function () {
195
+ var editor = wpDiscuzEditor.createEditor('#' + $('#wpd-editor-uid').val());
196
+ editor.deleteText(0, editor.getLength(), Quill.sources.USER);
197
+ var html = $('#wpd-editor-source-code').val();
198
+ if (html.length) {
199
+ editor.clipboard.dangerouslyPasteHTML(0, html, Quill.sources.USER);
200
+ }
201
+ editor.update();
202
+ $('#wpd-editor-source-code-wrapper-bg').hide();
203
+ $('#wpd-editor-source-code-wrapper').hide();
204
+ $('#wpd-editor-uid').val('');
205
+ $('#wpd-editor-source-code').val('');
206
+ });
207
+ }
208
+
209
+ $(document).on('click', '.wpd-reply-button', function () {
210
+ var uniqueID = getUniqueID($(this), 0);
211
+ if ($(this).hasClass('wpdiscuz-clonned')) {
212
+ if (wpdiscuzLoadRichEditor) {
213
+ setTimeout(function () {
214
+ wpDiscuzEditor.createEditor('#wpd-editor-' + uniqueID).focus();
215
+ }, enableDropAnimation);
216
+ } else {
217
+ setTimeout(function () {
218
+ $('#wc-textarea-' + uniqueID).trigger('focus');
219
+ }, enableDropAnimation);
220
+ }
221
+ $('#wpd-secondary-form-wrapper-' + uniqueID).slideToggle(enableDropAnimation);
222
+ } else {
223
+ cloneSecondaryForm($(this));
224
+ }
225
+ generateReCaptcha(uniqueID);
226
+ });
227
+
228
+ $(document).on('click', '#wpdcom .wpd-comment-link [data-comment-url]', function () {
229
+ var val = $(this).data('comment-url');
230
+ var el = $('<input/>');
231
+ el.appendTo('body').css({'position': 'absolute', 'top': '-10000000px'}).val(val);
232
+ el.trigger('select');
233
+ document.execCommand('copy');
234
+ el.remove();
235
+ wpdiscuzAjaxObj.setCommentMessage(val + '<br/>' + wpdiscuzAjaxObj.wc_copied_to_clipboard, 'success', 5000);
236
+ });
237
+
238
+ $(document).on('click', '.wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit', function (e) {
239
+ e.preventDefault();
240
+ });
241
+
242
+ $(document).on('click', '.wpd-toggle.wpd_not_clicked', function () {
243
+ var btn = $(this);
244
+ btn.removeClass('wpd_not_clicked');
245
+ var uniqueID = getUniqueID($(this), 0);
246
+ var toggle = $(this);
247
+ var icon = $('.fas', toggle);
248
+ if (!toggle.parents('.wpd-comment:not(.wpd-reply)').children('.wpd-reply').length && isLoadOnlyParentComments) {
249
+ wpdiscuzShowReplies(uniqueID, btn);
250
+ } else {
251
+ $('#wpd-comm-' + uniqueID + '> .wpd-reply').slideToggle(700, function () {
252
+ if ($(this).is(':hidden')) {
253
+ icon.removeClass('fa-chevron-up');
254
+ icon.addClass('fa-chevron-down');
255
+ toggle.find('.wpd-view-replies-text').text(wpdiscuzAjaxObj.wc_show_replies_text);
256
+ toggle.attr('wpd-tooltip', wpdiscuzAjaxObj.wc_show_replies_text);
257
+ } else {
258
+ icon.removeClass('fa-chevron-down');
259
+ icon.addClass('fa-chevron-up');
260
+ toggle.find('.wpd-view-replies-text').text(wpdiscuzAjaxObj.wc_hide_replies_text);
261
+ toggle.attr('wpd-tooltip', wpdiscuzAjaxObj.wc_hide_replies_text);
262
+ }
263
+ btn.addClass('wpd_not_clicked');
264
+ });
265
+ }
266
+ });
267
+
268
+ $(document).on('mouseenter', '.wpd-new-loaded-comment', function () {
269
+ $(this).removeClass('wpd-new-loaded-comment');
270
+ });
271
+
272
+ $(document).on('click', '.wpd-sbs-toggle', function () {
273
+ $('.wpdiscuz-subscribe-bar').slideToggle(enableDropAnimation);
274
+ });
275
  //============================== reCAPTCHA ============================== //
276
+ if (parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm) && !isUserLoggedIn && wpdiscuzAjaxObj.wpDiscuzReCaptchaSK && $('#wpdiscuz-subscribe-form').length) {
277
+ if (wpdiscuzRecaptchaVersion === '2.0') {
278
+ setTimeout(function () {
279
+ try {
280
+ grecaptcha.render('wpdiscuz-recaptcha-subscribe-form', {
281
+ 'sitekey': wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,
282
+ 'theme': wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,
283
+ 'callback': function (response) {
284
+ $('#wpdiscuz-recaptcha-field-subscribe-form').val('key');
285
+ },
286
+ 'expired-callback': function () {
287
+ $('#wpdiscuz-recaptcha-field-subscribe-form').val("");
288
+ }
289
+ });
290
+ } catch (e) {
291
+ console.log(e);
292
+ wpdiscuzAjaxObj.setCommentMessage('reCaptcha Error: ' + e.message, 'error');
293
+ }
294
+ }, 1000);
295
+
296
+ $(document).on('submit', '#wpdiscuz-subscribe-form', function (e) {
297
+ if (!$('#wpdiscuz-recaptcha-field-subscribe-form').val()) {
298
+ $('.wpdiscuz-recaptcha', $(this)).css('border', '1px solid red');
299
+ e.preventDefault();
300
+ } else {
301
+ $('.wpdiscuz-recaptcha', $(this)).css('border', 'none');
302
+ }
303
+ });
304
+ } else if (wpdiscuzRecaptchaVersion === '3.0') {
305
+ $(document).on('click', '#wpdiscuz_subscription_button', function (e) {
306
+ var subscriptionForm = $(this).parents('#wpdiscuz-subscribe-form');
307
+ e.preventDefault();
308
+ try {
309
+ grecaptcha.ready(function () {
310
+ grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK, {action: 'wpdiscuz/wpdAddSubscription'})
311
+ .then(function (token) {
312
+ console.log(5555);
313
+ document.getElementById('wpdiscuz-recaptcha-field-subscribe-form').value = token;
314
+ subscriptionForm.trigger('submit');
315
+ }, function (reason) {
316
+ wpdiscuzAjaxObj.setCommentMessage('reCaptcha Error', 'error');
317
+ console.log(reason);
318
+ });
319
+ });
320
+ } catch (e) {
321
+ console.log(e);
322
+ wpdiscuzAjaxObj.setCommentMessage('reCaptcha Error: ' + e.message, 'error');
323
+ }
324
+ });
325
+ }
326
+ }
327
+
328
+ function generateReCaptcha(uniqueId) {
329
+ if ((isShowCaptchaForGuests || isShowCaptchaForMembers) && wpdiscuzRecaptchaVersion === '2.0') {
330
+ var commentId = getCommentID(uniqueId);
331
+ setTimeout(function () {
332
+ if (!reCaptchaWidgets[commentId]) {
333
+ try {
334
+ reCaptchaWidgets[commentId] = grecaptcha.render('wpdiscuz-recaptcha-' + uniqueId, {
335
+ 'sitekey': wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,
336
+ 'theme': wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,
337
+ 'callback': function (response) {
338
+ $('#wpdiscuz-recaptcha-field-' + uniqueId).val('key');
339
+ },
340
+ 'expired-callback': function () {
341
+ $('#wpdiscuz-recaptcha-field-' + uniqueId).val("");
342
+ }
343
+ });
344
+ } catch (e) {
345
+ console.log(e);
346
+ wpdiscuzAjaxObj.setCommentMessage('reCaptcha Error: ' + e.message, 'error');
347
+ }
348
+ }
349
+ }, 1000);
350
+ }
351
+ }
352
+
353
+ function resetReCaptcha(uniqueId) {
354
+ if ((isShowCaptchaForGuests || isShowCaptchaForMembers) && wpdiscuzRecaptchaVersion === '2.0') {
355
+ var commentId = getCommentID(uniqueId);
356
+ grecaptcha.reset(reCaptchaWidgets[commentId]);
357
+ }
358
+ }
359
+
360
+ function wpdReCaptchaValidate(form) {
361
+ var wpdGoogleRecaptchaValid = true;
362
+ if (wpdiscuzRecaptchaVersion === '2.0' && $('input[name=wc_captcha]', form).length && !$('input[name=wc_captcha]', form).val().length) {
363
+ wpdGoogleRecaptchaValid = false;
364
+ $('.wpdiscuz-recaptcha', form).css('border', '1px solid red');
365
+ } else if (wpdiscuzRecaptchaVersion === '2.0' && $('input[name=wc_captcha]', form).length) {
366
+ $('.wpdiscuz-recaptcha', form).css('border', 'none');
367
+ }
368
+ return wpdGoogleRecaptchaValid;
369
+ }
370
+
371
+ function wpdReCaptchaValidateOnSubscribeForm(form) {
372
+ var wpdGoogleRecaptchaValid = true;
373
+ if (wpdiscuzRecaptchaVersion === '2.0' && $('input[name=wpdiscuz_recaptcha_subscribe_form]', form).length && !$('input[name=wpdiscuz_recaptcha_subscribe_form]', form).val().length) {
374
+ wpdGoogleRecaptchaValid = false;
375
+ $('.wpdiscuz-recaptcha', form).css('border', '1px solid red');
376
+ } else if (wpdiscuzRecaptchaVersion === '2.0' && $('input[name=wpdiscuz_recaptcha_subscribe_form]', form).length) {
377
+ $('.wpdiscuz-recaptcha', form).css('border', 'none');
378
+ }
379
+ return wpdGoogleRecaptchaValid;
380
+ }
381
+
382
+ if ((isShowCaptchaForGuests || isShowCaptchaForMembers) && wpdiscuzRecaptchaVersion === '2.0') {
383
+ var ww = $(window).width();
384
+ var wpcomm = $('#wpdcom').width();
385
+ if (wpcomm >= 1100) {
386
+ $("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({
387
+ "transform-origin": "right 0",
388
+ "-webkit-transform-origin": "right 0",
389
+ "transform": "scale(0.9)",
390
+ "-webkit-transform": "scale(0.9)"
391
+ });
392
+ $("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({
393
+ "transform-origin": "right 0",
394
+ "-webkit-transform-origin": "right 0",
395
+ "transform": "scale(0.9)",
396
+ "-webkit-transform": "scale(0.9)"
397
+ });
398
+ $("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({"width": "65%"});
399
+ $("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({"width": "35%"});
400
+ }
401
+ if (wpcomm >= 940 && wpcomm < 1100) {
402
+ $("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({
403
+ "transform-origin": "right 0",
404
+ "-webkit-transform-origin": "right 0",
405
+ "transform": "scale(0.9)",
406
+ "-webkit-transform": "scale(0.9)"
407
+ });
408
+ $("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({
409
+ "transform-origin": "right 0",
410
+ "-webkit-transform-origin": "right 0",
411
+ "transform": "scale(0.9)",
412
+ "-webkit-transform": "scale(0.9)"
413
+ });
414
+ $("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({"width": "60%"});
415
+ $("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({"width": "40%"});
416
+ }
417
+ if (wpcomm >= 810 && wpcomm < 940) {
418
+ $("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({
419
+ "transform": "scale(0.9)",
420
+ "-webkit-transform": "scale(0.9)"
421
+ });
422
+ $("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({
423
+ "transform": "scale(0.8)",
424
+ "-webkit-transform": "scale(0.8)"
425
+ });
426
+ $("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({"width": "40%"});
427
+ $("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({"width": "60%"});
428
+ }
429
+ if (wpcomm >= 730 && wpcomm < 810) {
430
+ $("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({
431
+ "transform": "scale(0.9)",
432
+ "-webkit-transform": "scale(0.9)"
433
+ });
434
+ $("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({
435
+ "transform-origin": "right 0",
436
+ "-webkit-transform-origin": "right 0",
437
+ "transform": "scale(0.8)",
438
+ "-webkit-transform": "scale(0.8)"
439
+ });
440
+ $("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({"width": "45%"});
441
+ $("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({"width": "55%"});
442
+ }
443
+ if (wpcomm >= 610 && wpcomm < 730) {
444
+ $("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({
445
+ "transform": "scale(0.85)",
446
+ "-webkit-transform": "scale(0.85)"
447
+ });
448
+ $("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({
449
+ "transform": "scale(0.8)",
450
+ "-webkit-transform": "scale(0.8)"
451
+ });
452
+ $("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({"width": "43%"});
453
+ $("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({"width": "55%"});
454
+ $("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({"width": "30%"});
455
+ $("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({"width": "70%"});
456
+ }
457
+ if (ww > 650) {
458
+ if (wpcomm >= 510 && wpcomm < 610) {
459
+ $("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({
460
+ "transform-origin": "center 0",
461
+ "-webkit-transform-origin": "center 0",
462
+ "transform": "scale(0.77)",
463
+ "-webkit-transform": "scale(0.77)"
464
+ });
465
+ $("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({
466
+ "transform-origin": "right 0",
467
+ "-webkit-transform-origin": "right 0",
468
+ "transform": "scale(0.77)",
469
+ "-webkit-transform": "scale(0.77)"
470
+ });
471
+ $("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({"width": "35%"});
472
+ $("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({"width": "63%"});
473
+ $("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({
474
+ "width": "30%",
475
+ "position": "relative",
476
+ "right": "-60px"
477
+ });
478
+ $("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({"width": "70%"});
479
+ $("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left": "0px"});
480
+ }
481
+ if (wpcomm >= 470 && wpcomm < 510) {
482
+ $("#wpdcom .wpd_main_comm_form .wpd-field-captcha .wpdiscuz-recaptcha").css({
483
+ "transform-origin": "center 0",
484
+ "-webkit-transform-origin": "center 0",
485
+ "transform": "scale(0.77)",
486
+ "-webkit-transform": "scale(0.77)"
487
+ });
488
+ $("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({
489
+ "transform-origin": "right 0",
490
+ "-webkit-transform-origin": "right 0",
491
+ "transform": "scale(0.77)",
492
+ "-webkit-transform": "scale(0.77)"
493
+ });
494
+ $("#wpdcom .wpd_main_comm_form .wpd-form-col-left").css({"width": "40%"});
495
+ $("#wpdcom .wpd_main_comm_form .wpd-form-col-right").css({"width": "60%"});
496
+ $("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-left").css({
497
+ "float": "none",
498
+ "width": "100%",
499
+ "display": "block"
500
+ });
501
+ $("#wpdcom .wpd-secondary-form-wrapper .wpd-form-col-right").css({
502
+ "float": "none",
503
+ "width": "100%",
504
+ "display": "block"
505
+ });
506
+ $("#wpdcom .wpd_main_comm_form .wc-form-footer").css({"margin-left": "0px"});
507
+ $("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left": "0px"});
508
+ }
509
+ if (wpcomm < 470) {
510
+ $("#wpdcom .wpd-secondary-form-wrapper .wpd-field-captcha .wpdiscuz-recaptcha").css({
511
+ "margin": "0px auto",
512
+ "transform-origin": "center 0",
513
+ "-webkit-transform-origin": "center 0"
514
+ });
515
+ $("#wpdcom .wpd-form-col-left").css({"float": "none", "width": "100%", "display": "block"});
516
+ $("#wpdcom .wpd-form-col-right").css({"float": "none", "width": "100%", "display": "block"});
517
+ $("#wpdcom .wpd-secondary-form-wrapper .wc-form-footer").css({"margin-left": "0px"});
518
+ $("#wpdcom .wpd-secondary-form-wrapper .wc_notification_checkboxes").css({"text-align": "center"});
519
+ $("#wpdcom .wpd-secondary-form-wrapper .wc-field-submit").css({"text-align": "center"});
520
+ }
521
+ }
522
+ }
523
 
524
  //============================== /reCAPTCHA ============================== //
525
  //============================== ADD COMMENT FUNCTION ============================== //
526
 
527
+ $(document).on('click', '.wc_comm_submit.wpd_not_clicked', function () {
528
+ var currentSubmitBtn = $(this);
529
+ var depth = 1;
530
+ var wcForm = $(this).parents('form');
531
+ if (!wcForm.hasClass('wpd_main_comm_form')) {
532
+ depth = getCommentDepth($(this).parents('.wpd-comment'));
533
+ }
534
+
535
+ wpdValidateFieldRequired(wcForm, '#wpd-editor-' + $('.wpdiscuz_unique_id', wcForm).val());
536
+ wcForm.on('submit', function (e) {
537
+ e.preventDefault();
538
+ });
539
+ if ($('.wc_comment', wcForm).val().trim() === '') {
540
+ wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wc_msg_required_fields, 'wc_msg_required_fields', wcForm), 'error');
541
+ return;
542
+ }
543
+ if (wcForm[0].checkValidity() && wpdReCaptchaValidate(wcForm)) {
544
+ addingComment = true;
545
+ addAgreementInCookie(wcForm);
546
+ $(currentSubmitBtn).removeClass('wpd_not_clicked');
547
+ var data = new FormData();
548
+ data.append('action', 'wpdAddComment');
549
+ var inputs = $(":input", wcForm);
550
+ inputs.each(function () {
551
+ if (this.name != '' && this.type != 'checkbox' && this.type != 'radio') {
552
+ data.append(this.name + '', $(this).val().trim());
553
+ }
554
+ if (this.type == 'checkbox' || this.type == 'radio') {
555
+ if ($(this).is(':checked')) {
556
+ data.append(this.name + '', $(this).val());
557
+ }
558
+ }
559
+ });
560
+
561
+ data.append('wpd_comment_depth', depth);
562
+
563
+ if (wpdiscuzAjaxObj.wpdiscuz_zs) {
564
+ data.append('wpdiscuz_zs', wpdiscuzAjaxObj.wpdiscuz_zs);
565
+ }
566
+
567
+ if ($('.wpd-cookies-checkbox', wcForm).length) {
568
+ if (!$('.wpd-cookies-checkbox', wcForm).prop("checked")) {
569
+ wpdCookiesConsent = false;
570
+ }
571
+ } else if (isUserLoggedIn) {
572
+ wpdCookiesConsent = false;
573
+ }
574
+ $('#wpdiscuz-loading-bar').show();
575
+ if (wpdiscuzAjaxObj.wpDiscuzReCaptchaSK && wpdiscuzRecaptchaVersion === '3.0' && ((wpdiscuzAjaxObj.wc_captcha_show_for_guest == 1 && !wpdiscuzAjaxObj.is_user_logged_in) || (wpdiscuzAjaxObj.wc_captcha_show_for_members == 1 && wpdiscuzAjaxObj.is_user_logged_in))) {
576
+ try {
577
+ grecaptcha.ready(function () {
578
+ grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK, {action: 'wpdiscuz/addComment'})
579
+ .then(function (token) {
580
+ data.append('g-recaptcha-response', token);
581
+ wpdiscuzSendComment(wcForm, data, currentSubmitBtn);
582
+ }, function (reason) {
583
+ wpdiscuzAjaxObj.setCommentMessage('reCaptcha Error', 'error');
584
+ console.log(reason);
585
+ });
586
+ });
587
+ } catch (e) {
588
+ console.log(e);
589
+ wpdiscuzAjaxObj.setCommentMessage('reCaptcha Error: ' + e.message, 'error');
590
+ $('#wpdiscuz-loading-bar').fadeOut(250);
591
+ }
592
+ } else {
593
+ wpdiscuzSendComment(wcForm, data, currentSubmitBtn);
594
+ }
595
+
596
+ }
597
+ resetReCaptcha($('.wpdiscuz_unique_id', wcForm).val());
598
+ wpdiscuzReset();
599
+ });
600
+
601
+ function wpdiscuzSendComment(wcForm, data, currentSubmitBtn) {
602
+ getAjaxObj(isNativeAjaxEnabled || wpdiscuzUploader, false, data)
603
+ .done(function (r) {
604
+ $(currentSubmitBtn).addClass('wpd_not_clicked');
605
+ if (typeof r === 'object') {
606
+ if (r.success) {
607
+ if (wpdiscuzAjaxObj.commentFormView === "collapsed") {
608
+ $('.wpd-form-foot', wcForm).slideUp(enableDropAnimation);
609
+ }
610
+ r.data.wc_all_comments_count_new = parseInt(r.data.wc_all_comments_count_new);
611
+ $('.wpd-thread-info').html(r.data.wc_all_comments_count_before_threads_html);
612
+ $('.wpd-thread-info').attr('data-comments-count', r.data.wc_all_comments_count_new);
613
+ $('#wpd-bubble-all-comments-count').replaceWith(r.data.wc_all_comments_count_bubble_html);
614
+ var animateDelay = enableDropAnimation;
615
+ if (r.data.is_main) {
616
+ addCommentsAfterSticky(r.data.message);
617
+ } else {
618
+ animateDelay = enableDropAnimation + 700;
619
+ $('#wpd-secondary-form-wrapper-' + r.data.uniqueid).slideToggle(700);
620
+ if (r.data.is_in_same_container == 1) {
621
+ $('#wpd-secondary-form-wrapper-' + r.data.uniqueid).after(r.data.message);
622
+ } else {
623
+ $('#wpd-comm-' + r.data.uniqueid).after(r.data.message);
624
+ }
625
+ }
626
+ notifySubscribers(r);
627
+ wpdiscuzRedirect(r);
628
+ if (isCookiesEnabled && wpdCookiesConsent) {
629
+ addCookie(r.data);
630
+ } else if (!wpdCookiesConsent) {
631
+ $('.wpd-cookies-checkbox').prop('checked', false);
632
+ }
633
+ wcForm.get(0).reset();
634
+ if (wpdiscuzLoadRichEditor) {
635
+ wpDiscuzEditor.createEditor('#wpd-editor-' + $('.wpdiscuz_unique_id', wcForm).val()).setContents([{insert: '\n'}]);
636
+ } else {
637
+ setTextareaCharCount(wcForm.find('.wc_comment'));
638
+ }
639
+ setCookieInForm(r.data);
640
+ $('.wmu-preview-wrap', wcForm).remove();
641
+ deleteAgreementFields();
642
+ if (parseInt(wpdiscuzAjaxObj.scrollToComment)) {
643
+ setTimeout(function () {
644
+ unsetHtmlAndBodyScrollBehaviors();
645
+ $('html, body').animate({
646
+ scrollTop: $('#comment-' + r.data.new_comment_id).offset().top - scrollSize
647
+ }, 1000, restoreHtmlAndBodyScrollBehaviors);
648
+ }, animateDelay);
649
+ }
650
+ runCallbacks(r, wcForm);
651
+ } else if (r.data) {
652
+ wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[r.data], r.data, wcForm), 'error');
653
+ runCallbacks(r, wcForm);
654
+ }
655
+ } else {
656
+ wpdiscuzAjaxObj.setCommentMessage(r, 'error');
657
+ }
658
+ $('#wpdiscuz-loading-bar').fadeOut(250);
659
+ addingComment = false;
660
+ })
661
+ .fail(function (jqXHR, textStatus, errorThrown) {
662
+ console.log(errorThrown);
663
+ $(currentSubmitBtn).addClass('wpd_not_clicked');
664
+ $('#wpdiscuz-loading-bar').fadeOut(250);
665
+ });
666
+ }
667
+
668
+ function notifySubscribers(r) {
669
+ if (!r.data.held_moderate) {
670
+ var data = new FormData();
671
+ data.append('action', 'wpdCheckNotificationType');
672
+ data.append('comment_id', r.data.new_comment_id);
673
+ data.append('email', r.data.comment_author_email);
674
+ data.append('isParent', r.data.is_main);
675
+ getAjaxObj(isNativeAjaxEnabled, true, data);
676
+ }
677
+ }
678
+
679
+ function wpdiscuzRedirect(r) {
680
+ if (r.data.redirect > 0 && r.data.new_comment_id) {
681
+ var data = new FormData();
682
+ data.append('action', 'wpdRedirect');
683
+ data.append('commentId', r.data.new_comment_id);
684
+ getAjaxObj(isNativeAjaxEnabled, true, data)
685
+ .done(function (r) {
686
+ if (typeof r === 'object') {
687
+ if (r.success) {
688
+ setTimeout(function () {
689
+ location.href = r.data;
690
+ }, 2000);
691
+ }
692
+ }
693
+ })
694
+ .fail(function (jqXHR, textStatus, errorThrown) {
695
+ console.log(errorThrown);
696
+ });
697
+ }
698
+ }
699
+
700
+ function setCookieInForm(obj) {
701
+ $('.wpd_comm_form .wc_name').val(obj.comment_author);
702
+ if (obj.comment_author_email && obj.comment_author_email.indexOf('@example.com') < 0) {
703
+ $('.wpd_comm_form .wc_email').val(obj.comment_author_email);
704
+ }
705
+ if (obj.comment_author_url) {
706
+ $('.wpd_comm_form .wc_website').val(obj.comment_author_url);
707
+ }
708
+ }
709
+
710
+ function addCookie(obj) {
711
+ var email = obj.comment_author_email;
712
+ var name = obj.comment_author;
713
+ var weburl = obj.comment_author_url;
714
+ if (storeCommenterData == null) {
715
+ Cookies.set('comment_author_email_' + wpdiscuzCookiehash, email);
716
+ Cookies.set('comment_author_' + wpdiscuzCookiehash, name);
717
+ if (weburl.length) {
718
+ Cookies.set('comment_author_url_' + wpdiscuzCookiehash, weburl);
719
+ }
720
+ } else {
721
+ storeCommenterData = parseInt(storeCommenterData);
722
+ Cookies.set('comment_author_email_' + wpdiscuzCookiehash, email, {expires: storeCommenterData, path: '/'});
723
+ Cookies.set('comment_author_' + wpdiscuzCookiehash, name, {expires: storeCommenterData, path: '/'});
724
+ if (weburl.length) {
725
+ Cookies.set('comment_author_url_' + wpdiscuzCookiehash, weburl, {
726
+ expires: storeCommenterData,
727
+ path: '/'
728
+ });
729
+ }
730
+ }
731
+ if ($('.wpd-cookies-checkbox').length) {
732
+ $('.wpd-cookies-checkbox').prop('checked', true);
733
+ }
734
+ }
735
 
736
  //============================== /ADD COMMENT FUNCTION ============================== //
737
  //============================== EDIT COMMENT FUNCTION ============================== //
738
+ var wcCommentTextBeforeEditing;
739
+
740
+ $(document).on('click', '.wpd_editable_comment', function () {
741
+ if (wcCommentTextBeforeEditing && $('.wpdiscuz-edit-form-wrap').length) {
742
+ wpdCancelOrSave(getUniqueID($('.wpdiscuz-edit-form-wrap'), 0), wcCommentTextBeforeEditing);
743
+ }
744
+ var el = $(this);
745
+ var uniqueID = getUniqueID(el, 0);
746
+ var commentID = getCommentID(uniqueID);
747
+ var data = new FormData();
748
+ data.append('action', 'wpdEditComment');
749
+ data.append('commentId', commentID);
750
+ wcCommentTextBeforeEditing = $('#wpd-comm-' + uniqueID + ' > .wpd-comment-wrap .wpd-comment-text').get(0);
751
+ getAjaxObj(isNativeAjaxEnabled, true, data)
752
+ .done(function (r) {
753
+ if (typeof r === 'object') {
754
+ if (r.success) {
755
+ $('#wpd-comm-' + uniqueID + ' > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text').replaceWith(r.data.html);
756
+ if (wpdiscuzLoadRichEditor) {
757
+ var currentEditor = wpDiscuzEditor.createEditor('#wpd-editor-edit_' + uniqueID);
758
+ currentEditor.clipboard.dangerouslyPasteHTML(0, r.data.content);
759
+ currentEditor.update();
760
+ $('.wpd-toolbar-hidden').prev('[id^=wpd-editor-]').css('border-bottom', "1px solid #dddddd");
761
+ } else {
762
+ $('#wc-textarea-edit_' + uniqueID).val(r.data.content);
763
+ setTextareaCharCount($('#wc-textarea-edit_' + uniqueID));
764
+ }
765
+ $('#wpd-comm-' + uniqueID + ' > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment').hide();
766
+ $('#wpd-comm-' + uniqueID + ' > .wpd-comment-wrap .wpd-comment-last-edited').hide();
767
+ } else {
768
+ wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[r.data], r.data, el), 'error');
769
+ }
770
+ } else {
771
+ console.log(r);
772
+ }
773
+ $('#wpdiscuz-loading-bar').fadeOut(250);
774
+ })
775
+ .fail(function (jqXHR, textStatus, errorThrown) {
776
+ console.log(errorThrown);
777
+ $('#wpdiscuz-loading-bar').fadeOut(250);
778
+ });
779
+ });
780
+
781
+ $(document).on('click', '.wc_save_edited_comment', function () {
782
+ var el = $(this)
783
+ var uniqueID = getUniqueID(el);
784
+ var commentID = getCommentID(uniqueID);
785
+ var editCommentForm = $('#wpd-comm-' + uniqueID + ' #wpdiscuz-edit-form');
786
+ wpdValidateFieldRequired(editCommentForm, '#wpd-editor-edit_' + uniqueID);
787
+ editCommentForm.on('submit', function (e) {
788
+ e.preventDefault();
789
+ });
790
+
791
+ if (editCommentForm[0].checkValidity()) {
792
+ var data = new FormData();
793
+ data.append('action', 'wpdSaveEditedComment');
794
+ data.append('commentId', commentID);
795
+ var inputs = $(":input", editCommentForm);
796
+ inputs.each(function () {
797
+ if (this.name !== '' && this.type !== 'checkbox' && this.type !== 'radio') {
798
+ data.append(this.name + '', $(this).val());
799
+ }
800
+ if (this.type === 'checkbox' || this.type === 'radio') {
801
+ if ($(this).is(':checked')) {
802
+ data.append(this.name + '', $(this).val());
803
+ }
804
+ }
805
+ });
806
+
807
+ getAjaxObj(isNativeAjaxEnabled, true, data)
808
+ .done(function (r) {
809
+ if (typeof r === 'object') {
810
+ if (r.success) {
811
+ wpdCancelOrSave(uniqueID, r.data.message);
812
+ if (r.data.lastEdited) {
813
+ $('#wpd-comm-' + uniqueID + ' > .wpd-comment-wrap .wpd-comment-last-edited').remove();
814
+ $(r.data.lastEdited).insertAfter('#wpd-comm-' + uniqueID + ' > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text');
815
+ }
816
+ if (r.data.twitterShareLink) {
817
+ $('#wpd-comm-' + uniqueID + ' > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw').attr('href', r.data.twitterShareLink);
818
+ }
819
+ if (r.data.whatsappShareLink) {
820
+ $('#wpd-comm-' + uniqueID + ' > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp').attr('href', r.data.whatsappShareLink);
821
+ }
822
+ if (wpdiscuzLoadRichEditor) {
823
+ wpDiscuzEditor.removeEditor('#wpd-editor-edit_' + uniqueID);
824
+ }
825
+ } else {
826
+ wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[r.data], r.data, el), 'error');
827
+ }
828
+ runCallbacks(r, commentID);
829
+ } else {
830
+ console.log(r);
831
+ }
832
+ $('#wpdiscuz-loading-bar').fadeOut(250);
833
+ })
834
+ .fail(function (jqXHR, textStatus, errorThrown) {
835
+ console.log(errorThrown);
836
+ $('#wpdiscuz-loading-bar').fadeOut(250);
837
+ });
838
+ }
839
+ });
840
+
841
+ $(document).on('click', '.wc_cancel_edit', function () {
842
+ var uniqueID = getUniqueID($(this));
843
+ wpdCancelOrSave(uniqueID, wcCommentTextBeforeEditing);
844
+ if (wpdiscuzLoadRichEditor) {
845
+ wpDiscuzEditor.removeEditor('#wpd-editor-edit_' + uniqueID);
846
+ }
847
+ });
848
+
849
+ function wpdCancelOrSave(uniqueID, content) {
850
+ $('#wpd-comm-' + uniqueID + ' > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment').show();
851
+ $('#wpd-comm-' + uniqueID + ' .wpdiscuz-edit-form-wrap').replaceWith(content);
852
+ $('#wpd-comm-' + uniqueID + ' > .wpd-comment-wrap .wpd-comment-last-edited').show();
853
+ }
854
 
855
  //============================== /EDIT COMMENT FUNCTION ============================== //
856
  //============================== LOAD MORE ============================== //
857
+ if (!wordpressIsPaginate && firstLoadWithAjax) {
858
+ wpdiscuzLoadCount = 0;
859
+ if (firstLoadWithAjax == 1) {
860
+ setTimeout(function () {
861
+ wpdiscuzLoadComments(true);
862
+ }, 500);
863
+ } else {
864
+ $(document).on('click', '.wpd-load-comments', function () {
865
+ $(this).parent('.wpd-load-more-submit-wrap').remove();
866
+ wpdiscuzLoadComments(true);
867
+ });
868
+ }
869
+ }
870
+
871
+ $(document).on('click', '.wpd-load-more-submit', function () {
872
+ var loadButton = $(this);
873
+ var loaded = 'wpd-loaded';
874
+ var loading = 'wpd-loading';
875
+ if (loadButton.hasClass(loaded)) {
876
+ wpdiscuzLoadComments(false, loadButton, loaded, loading);
877
+ }
878
+ });
879
+
880
+ var isRun = false;
881
+ if (commentListLoadType === 2 && !wordpressIsPaginate) {
882
+ $('.wpd-load-more-submit').parents('.wpdiscuz-comment-pagination').hide();
883
+ wpdiscuzScrollEvents();
884
+ $(window).scroll(function () {
885
+ wpdiscuzScrollEvents();
886
+ });
887
+ }
888
+
889
+ function wpdiscuzScrollEvents() {
890
+ var wpdiscuzHasMoreComments = $('#wpdiscuzHasMoreComments').val();
891
+ var scrollHeight = $(document).height();
892
+ var scrollPosition = $(window).height() + $(window).scrollTop();
893
+ if (scrollHeight && scrollPosition) {
894
+ var scrollPercent = scrollPosition * 100 / scrollHeight;
895
+ if (scrollPercent >= 80 && isRun === false && wpdiscuzHasMoreComments == 1) {
896
+ isRun = true;
897
+ wpdiscuzLoadComments(false, $('.wpd-load-more-submit'));
898
+ }
899
+ }
900
+ }
901
+
902
+ function wpdiscuzLoadComments(isFirstLoad, loadButton, loaded, loading) {
903
+ if (loadButton) {
904
+ loadButton.toggleClass(loaded);
905
+ loadButton.toggleClass(loading);
906
+ }
907
+ var data = new FormData();
908
+ data.append('action', 'wpdLoadMoreComments');
909
+ var sorting = $('.wpdiscuz-sort-button-active').attr('data-sorting');
910
+ if (sorting) {
911
+ data.append('sorting', sorting);
912
+ }
913
+ data.append('offset', wpdiscuzLoadCount);
914
+ data.append('lastParentId', getLastParentID());
915
+ data.append('isFirstLoad', isFirstLoad ? 1 : 0);
916
+ var filterType = $('.wpdf-active').attr('data-filter-type');
917
+ data.append('wpdType', filterType ? filterType : '');
918
+ getAjaxObj(isNativeAjaxEnabled, isFirstLoad && firstLoadWithAjax == 1 ? false : true, data)
919
+ .done(function (r) {
920
+ if (typeof r === 'object') {
921
+ if (r.success) {
922
+ wpdiscuzLoadCount++;
923
+ if (isFirstLoad) {
924
+ $('.wpd-comment').remove();
925
+ }
926
+ $('.wpdiscuz_single').remove();
927
+ $('.wpdiscuz-comment-pagination').before(r.data.comment_list);
928
+ setLoadMoreVisibility(r, isFirstLoad && commentListLoadType !== 2);
929
+ isRun = false;
930
+ if (r.data.loadLastCommentId) {
931
+ loadLastCommentId = r.data.loadLastCommentId;
932
+ }
933
+ runCallbacks(r);
934
+ if (isFirstLoad) {
935
+ getSingleComment(false);
936
+ }
937
+ }
938
+ }
939
+ $('#wpdiscuz-loading-bar').fadeOut(250);
940
+ $('.wpd-load-more-submit').blur();
941
+ if (loadButton) {
942
+ loadButton.toggleClass(loaded);
943
+ loadButton.toggleClass(loading);
944
+ }
945
+ })
946
+ .fail(function (jqXHR, textStatus, errorThrown) {
947
+ console.log(errorThrown);
948
+ $('#wpdiscuz-loading-bar').fadeOut(250);
949
+ $('.wpd-load-more-submit').blur();
950
+ if (loadButton) {
951
+ loadButton.toggleClass(loaded);
952
+ loadButton.toggleClass(loading);
953
+ }
954
+ });
955
+ }
956
+
957
+ function setLoadMoreVisibility(r, showPagination) {
958
+ if (r.data.is_show_load_more == false) {
959
+ $('#wpdiscuzHasMoreComments').val(0);
960
+ $('.wpd-load-more-submit').parents('.wpdiscuz-comment-pagination').hide();
961
+ } else {
962
+ setLastParentID(r.data.last_parent_id);
963
+ $('#wpdiscuzHasMoreComments').val(1);
964
+ if (showPagination) {
965
+ $('.wpd-load-more-submit').parents('.wpdiscuz-comment-pagination').show();
966
+ }
967
+ }
968
+
969
+ runCallbacks(r);
970
+ }
971
+
972
+ wpdiscuzAjaxObj.setLoadMoreVisibility = setLoadMoreVisibility;
973
  //============================== /LOAD MORE ============================== //
974
  //============================== VOTE ============================== //
975
+ $(document).on('click', '.wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked', function () {
976
+ var currentVoteBtn = $(this);
977
+ $(currentVoteBtn).removeClass('wpd_not_clicked');
978
+ var uniqueId = getUniqueID(currentVoteBtn);
979
+ var commentID = getCommentID(uniqueId);
980
+ var voteType;
981
+ if ($(this).hasClass('wpd-vote-up')) {
982
+ voteType = 1;
983
+ } else {
984
+ voteType = -1;
985
+ }
986
+
987
+ var data = new FormData();
988
+ data.append('action', 'wpdVoteOnComment');
989
+ data.append('commentId', commentID);
990
+ data.append('voteType', voteType);
991
+ getAjaxObj(isNativeAjaxEnabled, true, data)
992
+ .done(function (r) {
993
+ $(currentVoteBtn).addClass('wpd_not_clicked');
994
+ if (typeof r === 'object') {
995
+ if (r.success) {
996
+ if (r.data.buttonsStyle === 'total') {
997
+ var voteCountDiv = $('.wpd-comment-footer .wpd-vote-result', $('#comment-' + commentID));
998
+ var votes = r.data.votes;
999
+ voteCountDiv.text(r.data.votesHumanReadable);
1000
+ voteCountDiv.attr('title', votes);
1001
+ voteCountDiv.removeClass('wpd-up wpd-down');
1002
+ if (votes > 0) {
1003
+ voteCountDiv.addClass('wpd-up');
1004
+ }
1005
+ if (votes < 0) {
1006
+ voteCountDiv.addClass('wpd-down');
1007
+ }
1008
+ } else {
1009
+ var likeCountDiv = $('.wpd-comment-footer .wpd-vote-result-like', $('#comment-' + commentID));
1010
+ var dislikeCountDiv = $('.wpd-comment-footer .wpd-vote-result-dislike', $('#comment-' + commentID));
1011
+ likeCountDiv.text(r.data.likeCountHumanReadable);
1012
+ likeCountDiv.attr('title', r.data.likeCount);
1013
+ dislikeCountDiv.text(r.data.dislikeCountHumanReadable);
1014
+ dislikeCountDiv.attr('title', r.data.dislikeCount);
1015
+ parseInt(r.data.likeCount) > 0 ? likeCountDiv.addClass('wpd-up') : likeCountDiv.removeClass('wpd-up');
1016
+ parseInt(r.data.dislikeCount) < 0 ? dislikeCountDiv.addClass('wpd-down') : dislikeCountDiv.removeClass('wpd-down');
1017
+ }
1018
+ var voteUpDiv = $('.wpd-comment-footer .wpd-vote-up', $('#comment-' + commentID));
1019
+ var voteDownDiv = $('.wpd-comment-footer .wpd-vote-down', $('#comment-' + commentID));
1020
+ voteUpDiv.removeClass('wpd-up');
1021
+ voteDownDiv.removeClass('wpd-down');
1022
+ if (r.data.curUserReaction > 0) {
1023
+ voteUpDiv.addClass('wpd-up');
1024
+ } else if (r.data.curUserReaction < 0) {
1025
+ voteDownDiv.addClass('wpd-down');
1026
+ }
1027
+ } else if (r.data) {
1028
+ wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[r.data], r.data, currentVoteBtn), 'error');
1029
+ }
1030
+ runCallbacks(r, commentID, voteType);
1031
+ } else {
1032
+ console.log(r);
1033
+ }
1034
+ $('#wpdiscuz-loading-bar').fadeOut(250);
1035
+ })
1036
+ .fail(function (jqXHR, textStatus, errorThrown) {
1037
+ console.log(errorThrown);
1038
+ $(currentVoteBtn).addClass('wpd_not_clicked');
1039
+ $('#wpdiscuz-loading-bar').fadeOut(250);
1040
+ });
1041
+ });
1042
  //============================== /VOTE ============================== //
1043
  //============================== SORTING ============================== //
1044
+ $(document).on('click', 'body', function (e) {
1045
+ var children = $('.wpdiscuz-sort-buttons');
1046
+ if ($(e.target).hasClass('wpdf-sorting') || $(e.target).parent().hasClass('wpdf-sorting')) {
1047
+ children.css({display: children.is(':visible') ? 'none' : 'flex'});
1048
+ } else {
1049
+ children.hide();
1050
+ }
1051
+ });
1052
+ $(document).on('click', '.wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)', function () {
1053
+ var clickedBtn = $(this);
1054
+ var sorting = $(this).attr("data-sorting");
1055
+ if (sorting) {
1056
+ $('.wpdiscuz-sort-button.wpdiscuz-sort-button-active').removeClass('wpdiscuz-sort-button-active').appendTo('.wpdiscuz-sort-buttons');
1057
+ clickedBtn.addClass('wpdiscuz-sort-button-active').prependTo('.wpdf-sorting');
1058
+ var data = new FormData();
1059
+ data.append('action', 'wpdSorting');
1060
+ data.append('sorting', sorting);
1061
+ var filterType = $('.wpdf-active').attr('data-filter-type');
1062
+ data.append('wpdType', filterType ? filterType : '');
1063
+ getAjaxObj(isNativeAjaxEnabled, true, data)
1064
+ .done(function (r) {
1065
+ if (typeof r === 'object') {
1066
+ if (r.success) {
1067
+ $('#wpdcom .wpd-comment').remove();
1068
+ $('#wpdcom .wpd-thread-list').prepend(r.data.message);
1069
+ setLoadMoreVisibility(r, false);
1070
+ wpdiscuzLoadCount = 1;
1071
+ }
1072
+ }
1073
+ $('#wpdiscuz-loading-bar').fadeOut(250);
1074
+ })
1075
+ .fail(function (jqXHR, textStatus, errorThrown) {
1076
+ console.log(errorThrown);
1077
+ $('#wpdiscuz-loading-bar').fadeOut(250);
1078
+ });
1079
+ }
1080
+ });
1081
  //============================== /SORTING ============================== //
1082
  //============================== SINGLE COMMENT ============================== //
1083
+ function getSingleComment(showReply) {
1084
+ var loc = location.href;
1085
+ var matches = loc.match(/#comment\-(\d+)/);
1086
+ if (matches !== null) {
1087
+ var commentId = matches[1];
1088
+ if (!$('#comment-' + commentId).length) {
1089
+ var data = new FormData();
1090
+ data.append('action', 'wpdGetSingleComment');
1091
+ data.append('commentId', commentId);
1092
+ getAjaxObj(isNativeAjaxEnabled, true, data)
1093
+ .done(function (r) {
1094
+ if (typeof r === 'object') {
1095
+ if (r.success) {
1096
+ var scrollToSelector = '#comment-' + commentId;
1097
+ if ($('#comment-' + r.data.parentCommentID).length) {
1098
+ $('#comment-' + r.data.parentCommentID).parents('[id^=wpd-comm-' + r.data.parentCommentID + ']').replaceWith(r.data.message);
1099
+ } else {
1100
+ $('.wpd-thread-list').prepend(r.data.message);
1101
+ }
1102
+
1103
+ runCallbacks(r);
1104
+
1105
+ unsetHtmlAndBodyScrollBehaviors();
1106
+ $('html, body').animate({
1107
+ scrollTop: $(scrollToSelector).offset().top - scrollSize
1108
+ }, 1000, restoreHtmlAndBodyScrollBehaviors);
1109
+ if (showReply) {
1110
+ showReplyForm(commentId);
1111
+ }
1112
+ }
1113
+ }
1114
+ $('#wpdiscuz-loading-bar').fadeOut(250);
1115
+ })
1116
+ .fail(function (jqXHR, textStatus, errorThrown) {
1117
+ console.log(errorThrown);
1118
+ $('#wpdiscuz-loading-bar').fadeOut(250);
1119
+ });
1120
+ } else {
1121
+ setTimeout(function () {
1122
+ unsetHtmlAndBodyScrollBehaviors();
1123
+ $('html, body').animate({
1124
+ scrollTop: $('#comment-' + commentId).parents('[id^=wpd-comm-]').offset().top - scrollSize
1125
+ }, 1000, restoreHtmlAndBodyScrollBehaviors);
1126
+ if (showReply) {
1127
+ showReplyForm(commentId);
1128
+ }
1129
+ }, 500);
1130
+ }
1131
+ }
1132
+ }
1133
+
1134
+ window.onhashchange = function () {
1135
+ getSingleComment(false);
1136
+ };
1137
+ if (firstLoadWithAjax != 1) {
1138
+ getSingleComment(false);
1139
+ }
1140
+
1141
+ function showReplyForm(commentId) {
1142
+ setTimeout(function () {
1143
+ if (!$('#comment-' + commentId).siblings('.wpd-secondary-form-wrapper').is(':visible')) {
1144
+ $('#comment-' + commentId).find('.wpd-reply-button').trigger('click');
1145
+ }
1146
+ }, 1100);
1147
+ }
1148
 
1149
  //============================== /SINGLE COMMENT ============================== //
1150
  //============================== LIVE UPDATE ============================== //
1151
+ function liveUpdate() {
1152
+ var data = new FormData();
1153
+ data.append('action', 'wpdUpdateAutomatically');
1154
+ data.append('loadLastCommentId', loadLastCommentId);
1155
+ data.append('visibleCommentIds', getVisibleCommentIds());
1156
+ getAjaxObj(isNativeAjaxEnabled, false, data)
1157
+ .done(function (r) {
1158
+ if (!addingComment) {
1159
+ if (typeof r === 'object') {
1160
+ if (r.success) {
1161
+ liveUpdateImmediately(r);
1162
+ r.data.wc_all_comments_count_new = parseInt(r.data.wc_all_comments_count_new);
1163
+ $('.wpd-thread-info').html(r.data.wc_all_comments_count_before_threads_html);
1164
+ $('.wpd-thread-info').attr('data-comments-count', r.data.wc_all_comments_count_new);
1165
+ $('#wpd-bubble-all-comments-count').replaceWith(r.data.wc_all_comments_count_bubble_html);
1166
+ loadLastCommentId = r.data.loadLastCommentId;
1167
+ }
1168
+ }
1169
+ }
1170
+ })
1171
+ .fail(function (jqXHR, textStatus, errorThrown) {
1172
+ console.log(errorThrown);
1173
+ });
1174
+ }
1175
+
1176
+ function liveUpdateImmediately(r) {
1177
+ if (r.data.message !== undefined) {
1178
+ var commentObject;
1179
+ var message = r.data.message;
1180
+ for (var i = 0; i < message.length; i++) {
1181
+ commentObject = message[i];
1182
+ addCommentToTree(commentObject.comment_parent, commentObject.comment_html);
1183
+ }
1184
+ }
1185
+ }
1186
 
1187
  //============================== /LIVE UPDATE ============================== //
1188
  //============================== READ MORE ============================== //
1189
+ $(document).on('click', '.wpdiscuz-readmore', function () {
1190
+ var uniqueId = getUniqueID($(this));
1191
+ var commentId = getCommentID(uniqueId);
1192
+ var data = new FormData();
1193
+ data.append('action', 'wpdReadMore');
1194
+ data.append('commentId', commentId);
1195
+ getAjaxObj(isNativeAjaxEnabled, true, data)
1196
+ .done(function (r) {
1197
+ if (typeof r === 'object') {
1198
+ if (r.success) {
1199
+ $('#comment-' + commentId + ' .wpd-comment-text').replaceWith(' ' + r.data.message);
1200
+ $('#wpdiscuz-readmore-' + uniqueId).remove();
1201
+ } else {
1202
+ console.log(r.data);
1203
+ }
1204
+ runCallbacks(r);
1205
+ } else {
1206
+ console.log(r);
1207
+ }
1208
+ $('#wpdiscuz-loading-bar').fadeOut(250);
1209
+ })
1210
+ .fail(function (jqXHR, textStatus, errorThrown) {
1211
+ console.log(errorThrown);
1212
+ $('#wpdiscuz-loading-bar').fadeOut(250);
1213
+ });
1214
+ });
1215
  //============================== /READ MORE ============================== //
1216
  //============================== FUNCTIONS ============================== //
1217
 
1218
+ function cloneSecondaryForm(field) {
1219
+ var uniqueId = getUniqueID(field, 0);
1220
+ $('#wpdiscuz_form_anchor-' + uniqueId).before(replaceUniqueId(uniqueId));
1221
+ var secondaryFormWrapper = $('#wpd-secondary-form-wrapper-' + uniqueId);
1222
+ if (!isUserLoggedIn) {
1223
+ var commentAuthorCookies = {
1224
+ comment_author: Cookies.get('comment_author_' + wpdiscuzCookiehash),
1225
+ comment_author_email: Cookies.get('comment_author_email_' + wpdiscuzCookiehash),
1226
+ comment_author_url: Cookies.get('comment_author_url_' + wpdiscuzCookiehash)
1227
+ };
1228
+ setCookieInForm(commentAuthorCookies);
1229
+ }
1230
+ if (wpdiscuzLoadRichEditor) {
1231
+ setTimeout(function () {
1232
+ wpDiscuzEditor.createEditor('#wpd-editor-' + uniqueId).focus();
1233
+ }, enableDropAnimation);
1234
+ } else {
1235
+ setTimeout(function () {
1236
+ $('#wc-textarea-' + uniqueId).trigger('focus');
1237
+ }, enableDropAnimation);
1238
+ }
1239
+ secondaryFormWrapper.slideToggle(enableDropAnimation, function () {
1240
+ field.addClass('wpdiscuz-clonned');
1241
+ });
1242
+ }
1243
+
1244
+ function replaceUniqueId(uniqueId) {
1245
+ var secondaryForm = $('#wpdiscuz_hidden_secondary_form').html();
1246
+ return secondaryForm.replace(/wpdiscuzuniqueid/g, uniqueId);
1247
+ }
1248
+
1249
+ function getUniqueID(field, isMain) {
1250
+ var fieldID = '';
1251
+ if (isMain) {
1252
+ fieldID = field.parents('.wpd-main-form-wrapper').attr('id');
1253
+ } else {
1254
+ fieldID = field.parents('.wpd-comment').attr('id');
1255
+ }
1256
+ return fieldID.substring(fieldID.lastIndexOf('-') + 1);
1257
+ }
1258
+
1259
+ function getCommentID(uniqueID) {
1260
+ return uniqueID.substring(0, uniqueID.indexOf('_'));
1261
+ }
1262
+
1263
+ function getLastParentID() {
1264
+ return $('.wpd-load-more-submit').attr("data-lastparentid");
1265
+ }
1266
+
1267
+ function setLastParentID(lastParentID) {
1268
+ $('.wpd-load-more-submit').attr("data-lastparentid", lastParentID);
1269
+ if (commentListLoadType !== 2) {
1270
+ $('.wpdiscuz-comment-pagination').show();
1271
+ }
1272
+ }
1273
+
1274
+ function getCommentDepth(field) {
1275
+ var fieldClasses = field.attr('class');
1276
+ var classesArray = fieldClasses.split(' ');
1277
+ var depth = '';
1278
+ $.each(classesArray, function (index, value) {
1279
+ if ('wpd_comment_level' === getParentDepth(value, false)) {
1280
+ depth = getParentDepth(value, true);
1281
+ }
1282
+ });
1283
+ return parseInt(depth) + 1;
1284
+ }
1285
+
1286
+ function getParentDepth(depthValue, isNumberPart) {
1287
+ var depth = '';
1288
+ if (isNumberPart) {
1289
+ depth = depthValue.substring(depthValue.indexOf('-') + 1);
1290
+ } else {
1291
+ depth = depthValue.substring(0, depthValue.indexOf('-'));
1292
+ }
1293
+ return depth;
1294
+ }
1295
+
1296
+ function addCommentToTree(parentId, comment) {
1297
+ if (parentId == 0) {
1298
+ addCommentsAfterSticky(comment);
1299
+ } else {
1300
+ var parentUniqueId = getUniqueID($('#comment-' + parentId), 0);
1301
+ $('#wpdiscuz_form_anchor-' + parentUniqueId).after(comment);
1302
+ }
1303
+ }
1304
+
1305
+ function getVisibleCommentIds() {
1306
+ var visibleCommentIds = [];
1307
+ $('.wpd-comment-right').each(function () {
1308
+ visibleCommentIds.push(getCommentID(getUniqueID($(this), 0)));
1309
+ });
1310
+ return visibleCommentIds.join(',');
1311
+ }
1312
+
1313
+ function loginButtonsClone() {
1314
+ if ($('.wc_social_plugin_wrapper .wp-social-login-provider-list').length) {
1315
+ $('.wc_social_plugin_wrapper .wp-social-login-provider-list').clone().prependTo('#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content');
1316
+ } else if ($('.wc_social_plugin_wrapper .the_champ_login_container').length) {
1317
+ $('.wc_social_plugin_wrapper .the_champ_login_container').clone().prependTo('#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content');
1318
+ } else if ($('.wc_social_plugin_wrapper .social_connect_form').length) {
1319
+ $('.wc_social_plugin_wrapper .social_connect_form').clone().prependTo('#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content');
1320
+ } else if ($('.wc_social_plugin_wrapper .oneall_social_login_providers').length) {
1321
+ $('.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');
1322
+ }
1323
+ }
1324
+
1325
+ function wpdiscuzReset() {
1326
+ $('.wpdiscuz_reset').val("");
1327
+ }
1328
+
1329
+ function wpdValidateFieldRequired(form, editorId) {
1330
+ var fieldsGroup = form.find('.wpd-required-group');
1331
+ if (wpdiscuzLoadRichEditor) {
1332
+ form.find('.wc_comment').val($(editorId + '>.ql-editor').html());
1333
+ }
1334
+ wpdSanitizeCommentText(form);
1335
+ $.each(fieldsGroup, function () {
1336
+ $('input', this).prop('required', false);
1337
+ var checkedFields = $('input:checked', this);
1338
+ if (checkedFields.length === 0) {
1339
+ $('input', $(this)).prop('required', true);
1340
+ } else {
1341
+ $('.wpd-field-invalid', this).remove();
1342
+ }
1343
+ });
1344
+ }
1345
+
1346
+ function wpdSanitizeCommentText(form) {
1347
+ var textarea = form.find('.wc_comment');
1348
+ var commentText = textarea.val().trim();
1349
+ var replacedText = commentText.replace(/<p><br><\/p>/g, "\n").replace(/<p>(.*?)<\/p>/g, "$1\n");
1350
+ replacedText = replacedText.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g, " $3 ");
1351
+ replacedText = replacedText.replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g, " $1 ");
1352
+ replacedText = replacedText.replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g, " $3 ");
1353
+ replacedText = replacedText.replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g, " $2 ");
1354
+ textarea.val(replacedText);
1355
+ }
1356
+
1357
+ function unsetHtmlAndBodyScrollBehaviors() {
1358
+ $('html, body').css('scroll-behavior', 'unset');
1359
+ }
1360
+
1361
+ function restoreHtmlAndBodyScrollBehaviors() {
1362
+ $('html').css('scroll-behavior', htmlScrollBehavior);
1363
+ $('body').css('scroll-behavior', bodyScrollBehavior);
1364
+ }
1365
+
1366
+ $(document).on('change', '.wpd-required-group', function () {
1367
+ if ($('input:checked', this).length !== 0) {
1368
+ $('input', $(this)).prop('required', false);
1369
+ } else {
1370
+ $('input', $(this)).prop('required', true);
1371
+ }
1372
+ });
1373
+
1374
+ /* SPOILER */
1375
+ $(document).on('click', '.wpdiscuz-spoiler', function () {
1376
+ $(this).next().slideToggle();
1377
+ if ($(this).hasClass('wpdiscuz-spoiler-closed')) {
1378
+ $(this).parents('.wpdiscuz-spoiler-wrap').find('.fa-plus').removeClass('fa-plus').addClass('fa-minus');
1379
+ } else {
1380
+ $(this).parents('.wpdiscuz-spoiler-wrap').find('.fa-minus').removeClass('fa-minus').addClass('fa-plus');
1381
+ }
1382
+ $(this).toggleClass('wpdiscuz-spoiler-closed');
1383
+ });
1384
+
1385
+ function wpdiscuzShowReplies(uniqueId, btn) {
1386
+ var commentId = getCommentID(uniqueId);
1387
+ var data = new FormData();
1388
+ data.append('action', 'wpdShowReplies');
1389
+ data.append('commentId', commentId);
1390
+ getAjaxObj(isNativeAjaxEnabled, true, data)
1391
+ .done(function (r) {
1392
+ btn.addClass('wpd_not_clicked');
1393
+ if (typeof r === 'object') {
1394
+ if (r.success) {
1395
+ $('#wpd-comm-' + uniqueId).replaceWith(r.data.comment_list);
1396
+ $('#wpd-comm-' + uniqueId + ' .wpd-toggle .fas').removeClass('fa-chevron-down').addClass('fa-chevron-up');
1397
+ $('#wpd-comm-' + uniqueId + ' .wpd-toggle .wpd-view-replies .wpd-view-replies-text').text(wpdiscuzAjaxObj.wc_hide_replies_text);
1398
+ $('#wpd-comm-' + uniqueId + ' .wpd-toggle').attr('wpd-tooltip', wpdiscuzAjaxObj.wc_hide_replies_text);
1399
+
1400
+ runCallbacks(r);
1401
+ }
1402
+ }
1403
+ $('#wpdiscuz-loading-bar').fadeOut(250);
1404
+ })
1405
+ .fail(function (jqXHR, textStatus, errorThrown) {
1406
+ console.log(errorThrown);
1407
+ btn.addClass('wpd_not_clicked');
1408
+ $('#wpdiscuz-loading-bar').fadeOut(250);
1409
+ });
1410
+ }
1411
+
1412
+ $(document).on('click', '.wpd-tools i', function () {
1413
+ var sibling = $(this).siblings('.wpd-tools-actions');
1414
+ if (!sibling.is(':visible') && $(this).parents('.wpd-comment-right').attr('id') === $('[id^=comment-]', '#wpdcom').last().attr('id')) {
1415
+ $('#comments').css({paddingBottom: '160px'});
1416
+ }
1417
+ sibling.css({display: sibling.is(':visible') ? 'none' : 'flex'});
1418
+ });
1419
+ $(document).on('mouseleave', '.wpd-comment-right', function () {
1420
+ $(this).find('.wpd-tools-actions').hide();
1421
+ $('#comments').css({paddingBottom: '0'});
1422
+ });
1423
+
1424
+ $(document).on('click', '.wpd_stick_btn', function () {
1425
+ var uniqueId = getUniqueID($(this), 0);
1426
+ var commentId = getCommentID(uniqueId);
1427
+ var data = new FormData();
1428
+ data.append('action', 'wpdStickComment');
1429
+ data.append('commentId', commentId);
1430
+ getAjaxObj(isNativeAjaxEnabled, true, data)
1431
+ .done(function (r) {
1432
+ if (typeof r === 'object') {
1433
+ if (r.success) {
1434
+ location.reload(true);
1435
+ }
1436
+ }
1437
+ $('#wpdiscuz-loading-bar').fadeOut(250);
1438
+ })
1439
+ .fail(function (jqXHR, textStatus, errorThrown) {
1440
+ console.log(errorThrown);
1441
+ $('#wpdiscuz-loading-bar').fadeOut(250);
1442
+ });
1443
+ });
1444
+
1445
+ $(document).on('click', '.wpd_close_btn', function () {
1446
+ var uniqueId = getUniqueID($(this), 0);
1447
+ var commentId = getCommentID(uniqueId);
1448
+ var data = new FormData();
1449
+ data.append('action', 'wpdCloseThread');
1450
+ data.append('commentId', commentId);
1451
+ getAjaxObj(isNativeAjaxEnabled, true, data)
1452
+ .done(function (r) {
1453
+ if (typeof r === 'object') {
1454
+ if (r.success) {
1455
+ location.reload(true);
1456
+ }
1457
+ }
1458
+ $('#wpdiscuz-loading-bar').fadeOut(250);
1459
+ })
1460
+ .fail(function (jqXHR, textStatus, errorThrown) {
1461
+ console.log(errorThrown);
1462
+ $('#wpdiscuz-loading-bar').fadeOut(250);
1463
+ });
1464
+ });
1465
+
1466
+ $(document).on('click', '.wpd-filter.wpd_not_clicked[data-filter-type]', function () {
1467
+ var btn = $(this);
1468
+ var type = btn.attr('data-filter-type');
1469
+ wpdiscuzAjaxObj.resetActiveFilters('.wpdf-' + type);
1470
+ btn.removeClass('wpd_not_clicked');
1471
+ $('.fas', btn).addClass('fa-pulse fa-spinner');
1472
+ var data = new FormData();
1473
+ data.append('action', 'wpdLoadMoreComments');
1474
+ var sorting = $('.wpdiscuz-sort-button-active').attr('data-sorting');
1475
+ if (sorting) {
1476
+ data.append('sorting', sorting);
1477
+ }
1478
+ data.append('lastParentId', 0);
1479
+ data.append('offset', 0);
1480
+ wpdiscuzLoadCount = 1;
1481
+ data.append('wpdType', btn.hasClass('wpdf-active') ? '' : type);
1482
+ data.append('isFirstLoad', 1);
1483
+ if ($(this).hasClass('wpdf-inline')) {
1484
+ if ($(this).hasClass('wpdf-active')) {
1485
+ $('.wpd-comment-info-bar').hide();
1486
+ } else {
1487
+ $('.wpd-comment-info-bar').css('display', 'flex');
1488
+ }
1489
+ } else {
1490
+ $('.wpd-comment-info-bar').hide();
1491
+ }
1492
+ getAjaxObj(isNativeAjaxEnabled, false, data)
1493
+ .done(function (r) {
1494
+ btn.addClass('wpd_not_clicked');
1495
+ $('.fas', btn).removeClass('fa-pulse fa-spinner');
1496
+ if (typeof r === 'object') {
1497
+ if (r.success) {
1498
+ btn.toggleClass('wpdf-active');
1499
+ $('.wpd-load-comments').remove();
1500
+ $('.wpd-comment').remove();
1501
+ $('.wpd-thread-list').prepend(r.data.comment_list);
1502
+ setLoadMoreVisibility(r);
1503
+ loadLastCommentId = r.data.loadLastCommentId;
1504
+ $('.wpd-load-more-submit').blur();
1505
+ runCallbacks(r);
1506
+ }
1507
+ }
1508
+ $('#wpdiscuz-loading-bar').fadeOut(250);
1509
+ })
1510
+ .fail(function (jqXHR, textStatus, errorThrown) {
1511
+ console.log(errorThrown);
1512
+ $('#wpdiscuz-loading-bar').fadeOut(250);
1513
+ });
1514
+ });
1515
+
1516
+ $(document).on('click', '.wpdf-reacted.wpd_not_clicked', function () {
1517
+ var btn = $(this);
1518
+ btn.removeClass('wpd_not_clicked');
1519
+ $('.fas', btn).addClass('fa-pulse fa-spinner');
1520
+ var data = new FormData();
1521
+ data.append('action', 'wpdMostReactedComment');
1522
+ getAjaxObj(isNativeAjaxEnabled, false, data)
1523
+ .done(function (r) {
1524
+ btn.addClass('wpd_not_clicked');
1525
+ $('.fas', btn).removeClass('fa-pulse fa-spinner');
1526
+ if (typeof r === 'object') {
1527
+ if (r.success) {
1528
+ if ($('#comment-' + r.data.parentCommentID).length) {
1529
+ $('#comment-' + r.data.parentCommentID).parents('[id^=wpd-comm-' + r.data.parentCommentID + ']').replaceWith(r.data.message);
1530
+ } else if (!$('#comment-' + r.data.commentId).length) {
1531
+ $('.wpd-thread-list').prepend(r.data.message);
1532
+ }
1533
+
1534
+ runCallbacks(r);
1535
+ unsetHtmlAndBodyScrollBehaviors();
1536
+ $('html, body').animate({
1537
+ scrollTop: $('#comment-' + r.data.commentId).offset().top - scrollSize
1538
+ }, 1000, restoreHtmlAndBodyScrollBehaviors);
1539
+ }
1540
+ }
1541
+ })
1542
+ .fail(function (jqXHR, textStatus, errorThrown) {
1543
+ console.log(errorThrown);
1544
+ $('.fas', btn).removeClass('fa-pulse fa-spinner');
1545
+ });
1546
+ });
1547
+
1548
+ $(document).on('click', '.wpdf-hottest.wpd_not_clicked', function () {
1549
+ var btn = $(this);
1550
+ btn.removeClass('wpd_not_clicked');
1551
+ $('.fas', btn).addClass('fa-pulse fa-spinner');
1552
+ var data = new FormData();
1553
+ data.append('action', 'wpdHottestThread');
1554
+ getAjaxObj(isNativeAjaxEnabled, false, data)
1555
+ .done(function (r) {
1556
+ btn.addClass('wpd_not_clicked');
1557
+ $('.fas', btn).removeClass('fa-pulse fa-spinner');
1558
+ if (typeof r === 'object') {
1559
+ if (r.success) {
1560
+ if ($('#comment-' + r.data.commentId).length) {
1561
+ $('#comment-' + r.data.commentId).parents('[id^=wpd-comm-' + r.data.commentId + ']').replaceWith(r.data.message);
1562
+ } else {
1563
+ $('.wpd-thread-list').prepend(r.data.message);
1564
+ }
1565
+
1566
+ runCallbacks(r);
1567
+
1568
+ unsetHtmlAndBodyScrollBehaviors();
1569
+ $('html, body').animate({
1570
+ scrollTop: $('#comment-' + r.data.commentId).offset().top - scrollSize
1571
+ }, 1000, restoreHtmlAndBodyScrollBehaviors);
1572
+ }
1573
+ }
1574
+ })
1575
+ .fail(function (jqXHR, textStatus, errorThrown) {
1576
+ console.log(errorThrown);
1577
+ $('.fas', btn).removeClass('fa-pulse fa-spinner');
1578
+ });
1579
+ });
1580
+
1581
+ $(document).on('click', '.wpd-filter-view-all', function () {
1582
+ $('.wpdf-inline.wpdf-active.wpd_not_clicked').trigger('click');
1583
+ });
1584
+
1585
+
1586
+ function addAgreementInCookie(wcForm) {
1587
+ $('.wpd-agreement-checkbox', wcForm).each(function () {
1588
+ if ($(this).hasClass('wpd_agreement_hide') && isCookiesEnabled && $(this).prop('checked')) {
1589
+ Cookies.set($(this).attr('name') + '_' + wpdiscuzCookiehash, 1, {expires: 30, path: '/'});
1590
+ $('input[name=' + $(this).attr('name') + ']').each(function () {
1591
+ wpdiscuzAgreementFields.push($(this));
1592
+ });
1593
+ }
1594
+ });
1595
+ }
1596
+
1597
+ function deleteAgreementFields() {
1598
+ if (wpdiscuzAgreementFields.length) {
1599
+ wpdiscuzAgreementFields.forEach(function (item) {
1600
+ item.parents('.wpd-field-checkbox').remove();
1601
+ });
1602
+ wpdiscuzAgreementFields = [];
1603
+ }
1604
+ }
1605
+
1606
+ $(document).on('click', '.wpd-follow-link.wpd_not_clicked', function () {
1607
+ var btn = $(this);
1608
+ btn.removeClass('wpd_not_clicked');
1609
+ $('.fas', btn).addClass('fa-pulse fa-spinner');
1610
+ var uniqueId = getUniqueID(btn, 0);
1611
+ var commentId = getCommentID(uniqueId);
1612
+ var data = new FormData();
1613
+ data.append('action', 'wpdFollowUser');
1614
+ data.append('commentId', commentId);
1615
+ getAjaxObj(isNativeAjaxEnabled, true, data)
1616
+ .done(function (r) {
1617
+ btn.addClass('wpd_not_clicked');
1618
+ if (typeof r === 'object') {
1619
+ if (r.success) {
1620
+ wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[r.data.code], r.data.code, btn), 'success');
1621
+ btn.removeClass('wpd-follow-active');
1622
+ if (r.data.followTip) {
1623
+ btn.attr('wpd-tooltip', r.data.followTip)
1624
+ }
1625
+ if (r.data.followClass) {
1626
+ btn.addClass(r.data.followClass);
1627
+ }
1628
+ runCallbacks(r);
1629
+ } else {
1630
+ wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[r.data], r.data, btn), 'error');
1631
+ }
1632
+ } else {
1633
+ console.log(r);
1634
+ }
1635
+ $('.fas', btn).removeClass('fa-pulse fa-spinner');
1636
+ $('#wpdiscuz-loading-bar').fadeOut(250);
1637
+ })
1638
+ .fail(function (jqXHR, textStatus, errorThrown) {
1639
+ console.log(errorThrown);
1640
+ $('.fas', btn).removeClass('fa-pulse fa-spinner');
1641
+ $('#wpdiscuz-loading-bar').fadeOut(250);
1642
+ });
1643
+ });
1644
+
1645
+ function addCommentsAfterSticky(comment) {
1646
+ if ($('.wpd-sticky-comment').last()[0]) {
1647
+ $(comment).insertAfter($('.wpd-sticky-comment').last()[0]);
1648
+ } else {
1649
+ $('.wpd-thread-list').prepend(comment);
1650
+ }
1651
+ }
1652
+
1653
+ function showHideNotificationType(current) {
1654
+ if (current) {
1655
+ if (!current.prop('required')) {
1656
+ if (current.val()) {
1657
+ current.parents('form').find('[name=wpdiscuz_notification_type]').parent().css('display', 'inline-block');
1658
+ } else {
1659
+ current.parents('form').find('[name=wpdiscuz_notification_type]').parent().css('display', 'none');
1660
+ }
1661
+ }
1662
+ } else {
1663
+ $.each($('.wc_email'), function (i, val) {
1664
+ var obj = $(val);
1665
+ if (!obj.prop('required')) {
1666
+ if (obj.val()) {
1667
+ obj.parents('form').find('[name=wpdiscuz_notification_type]').parent().css('display', 'inline-block');
1668
+ } else {
1669
+ obj.parents('form').find('[name=wpdiscuz_notification_type]').parent().css('display', 'none');
1670
+ }
1671
+ }
1672
+ });
1673
+ }
1674
+ }
1675
+
1676
+ showHideNotificationType();
1677
+
1678
+ $(document).on('keyup', '.wc_email', function () {
1679
+ showHideNotificationType($(this));
1680
+ });
1681
 
1682
  //========================= BUBBLE =====================//
1683
+ if (bubbleEnabled && $('#wpdcom').length) {
1684
+ $('#wpd-bubble-wrapper').hover(function () {
1685
+ $(this).addClass('wpd-bubble-hover');
1686
+ }, function () {
1687
+ $(this).removeClass('wpd-bubble-hover');
1688
+ });
1689
+ if (bubbleHintTimeout && !Cookies.get(wpdiscuzAjaxObj.cookieHideBubbleHint)) {
1690
+ setTimeout(function () {
1691
+ $('#wpd-bubble-wrapper').addClass('wpd-bubble-hover');
1692
+ Cookies.set(wpdiscuzAjaxObj.cookieHideBubbleHint, '1', {expires: 7, path: '/'});
1693
+ setTimeout(function () {
1694
+ $('#wpd-bubble-wrapper').removeClass('wpd-bubble-hover');
1695
+ }, bubbleHintHideTimeout * 1000);
1696
+ }, bubbleHintTimeout * 1000);
1697
+ }
1698
+ if ('content_left' === bubbleLocation) {
1699
+ if ($('.entry-content').length) {
1700
+ var left = Math.min($('.entry-content').offset().left, $('#wpdcom').offset().left) - 120;
1701
+ var bubbleLeft = left > 25 ? left : 25;
1702
+ $('#wpd-bubble-wrapper').css({left: bubbleLeft + 'px'});
1703
+ $('#wpd-bubble-wrapper').addClass('wpd-left-content');
1704
+ } else if ($('.post-entry').length) {
1705
+ var left = Math.min($('.post-entry').offset().left, $('#wpdcom').offset().left) - 120;
1706
+ var bubbleLeft = left > 25 ? left : 25;
1707
+ $('#wpd-bubble-wrapper').css({left: bubbleLeft + 'px'});
1708
+ $('#wpd-bubble-wrapper').addClass('wpd-left-content');
1709
+ } else if ($('.container').length) {
1710
+ var left = Math.min($('.container').offset().left, $('#wpdcom').offset().left) - 120;
1711
+ var bubbleLeft = left > 25 ? left : 25;
1712
+ $('#wpd-bubble-wrapper').css({left: bubbleLeft + 'px'});
1713
+ $('#wpd-bubble-wrapper').addClass('wpd-left-content');
1714
+ } else {
1715
+ $('#wpd-bubble-wrapper').css({left: '25px'});
1716
+ $('#wpd-bubble-wrapper').addClass('wpd-left-corner');
1717
+ }
1718
+ } else if ('left_corner' === bubbleLocation) {
1719
+ $('#wpd-bubble-wrapper').css({left: '25px'});
1720
+ $('#wpd-bubble-wrapper').addClass('wpd-left-corner');
1721
+ } else if ('right_corner' === bubbleLocation) {
1722
+ $('#wpd-bubble-wrapper').css({right: '25px'});
1723
+ $('#wpd-bubble-wrapper').addClass('wpd-right-corner');
1724
+ }
1725
+
1726
+ $('#wpd-bubble-wrapper').show();
1727
+
1728
+ $(document).on('click', '#wpd-bubble-add-message-close', function (e) {
1729
+ e.preventDefault();
1730
+ e.stopPropagation();
1731
+ $('#wpd-bubble-wrapper').removeClass('wpd-bubble-hover');
1732
+ });
1733
+
1734
+ $(document).on('click', '#wpd-bubble', function () {
1735
+ unsetHtmlAndBodyScrollBehaviors();
1736
+ if ($('#tab-title-reviews').length) {
1737
+ $('#tab-title-reviews a').trigger('click');
1738
+ }
1739
+ $('html, body').animate({
1740
+ scrollTop: $('#wpdcom').offset().top - (scrollSize + 28)
1741
+ }, 1000, function () {
1742
+ restoreHtmlAndBodyScrollBehaviors();
1743
+ $('#wpd-bubble-wrapper').removeClass('wpd-bubble-hover');
1744
+ if (wpdiscuzLoadRichEditor) {
1745
+ if ($('#wpd-editor-0_0').length) {
1746
+ wpDiscuzEditor.createEditor('#wpd-editor-0_0').focus();
1747
+ }
1748
+ } else if ($('#wc-textarea-0_0').length) {
1749
+ $('#wc-textarea-0_0').trigger('focus');
1750
+ }
1751
+ });
1752
+ });
1753
+
1754
+ $(document).on('click', '#wpd-bubble-comment-close', function (e) {
1755
+ e.preventDefault();
1756
+ $('#wpd-bubble-notification-message').hide();
1757
+ $('#wpd-bubble-wrapper').removeClass('wpd-new-comment-added');
1758
+ });
1759
+
1760
+ $(document).on('click', '#wpd-bubble-comment-reply-link a', function () {
1761
+ var href = $(this).attr('href');
1762
+ setTimeout(function () {
1763
+ $('#wpd-bubble-notification-message').hide();
1764
+ $('#wpd-bubble-wrapper').removeClass('wpd-new-comment-added');
1765
+ getSingleComment(true);
1766
+ var commentId = href.match(/#comment\-(\d+)/);
1767
+ bubbleNewCommentIds = bubbleNewCommentIds.filter(function (val) {
1768
+ return val != commentId[1];
1769
+ });
1770
+ $('#wpd-bubble-count .wpd-new-comments-count').text(bubbleNewCommentIds.length);
1771
+ if (bubbleNewCommentIds.length == 0) {
1772
+ $('#wpd-bubble-count').removeClass('wpd-new-comments');
1773
+ }
1774
+ }, 100);
1775
+ });
1776
+
1777
+ $(document).on('click', '#wpd-bubble-count', function () {
1778
+ if (bubbleNewCommentIds.length) {
1779
+ var data = new FormData();
1780
+ data.append('action', 'wpdBubbleUpdate');
1781
+ data.append('newCommentIds', bubbleNewCommentIds.join());
1782
+ getAjaxObj(isNativeAjaxEnabled, true, data)
1783
+ .done(function (r) {
1784
+ if (typeof r === 'object') {
1785
+ if (r.success) {
1786
+ r.data.message = r.data.message.filter(function (comment) {
1787
+ if (!$('#comment-' + comment.comment_id).length) {
1788
+ return comment;
1789
+ }
1790
+ });
1791
+ liveUpdateImmediately(r);
1792
+ $('#wpd-bubble-count').removeClass('wpd-new-comments');
1793
+ $('#wpd-bubble-count .wpd-new-comments-count').text('0');
1794
+ bubbleNewCommentIds = [];
1795
+ if ($('.wpd-new-loaded-comment').length) {
1796
+ unsetHtmlAndBodyScrollBehaviors();
1797
+ $('html, body').animate({
1798
+ scrollTop: $($('.wpd-new-loaded-comment')[0]).offset().top - (scrollSize + 28)
1799
+ }, 1000, restoreHtmlAndBodyScrollBehaviors);
1800
+ }
1801
+ runCallbacks(r);
1802
+ }
1803
+ }
1804
+ $('#wpdiscuz-loading-bar').fadeOut(250);
1805
+ })
1806
+ .fail(function (jqXHR, textStatus, errorThrown) {
1807
+ console.log(errorThrown);
1808
+ });
1809
+ }
1810
+ });
1811
+
1812
+ }
1813
+
1814
+ function bubbleAjax() {
1815
+ $.ajax({
1816
+ type: 'GET',
1817
+ url: wpdiscuzAjaxObj.bubbleUpdateUrl,
1818
+ beforeSend: function (xhr) {
1819
+ xhr.setRequestHeader('X-WP-Nonce', wpdiscuzAjaxObj.restNonce);
1820
+ },
1821
+ data: {
1822
+ postId: wpdiscuzPostId,
1823
+ lastId: bubbleLastCommentId,
1824
+ visibleCommentIds: getVisibleCommentIds(),
1825
+ }
1826
+ }).done(function (r) {
1827
+ if (!addingComment) {
1828
+ if (typeof r === 'object') {
1829
+ r.commentIDsToRemove.forEach(function (id) {
1830
+ $('[id^=wpd-comm-' + id + ']').remove();
1831
+ });
1832
+ if (r.ids.length) {
1833
+ if (commentListUpdateType) {
1834
+ liveUpdate();
1835
+ }
1836
+ r.ids = r.ids.filter(function (id) {
1837
+ if (!$('#comment-' + id).length) {
1838
+ return id;
1839
+ }
1840
+ });
1841
+ var timeout = 5000;
1842
+ bubbleLastCommentId = parseInt(r.ids[r.ids.length - 1]);
1843
+ bubbleNewCommentIds = bubbleNewCommentIds.concat(r.ids);
1844
+ if (bubbleShowNewCommentMessage && r.commentText) {
1845
+ $('#wpd-bubble-author-avatar').html(r.avatar);
1846
+ $('#wpd-bubble-author-name').html(r.authorName);
1847
+ $('#wpd-bubble-comment-date span').html(r.commentDate);
1848
+ $('#wpd-bubble-comment-text').html(r.commentText);
1849
+ $('#wpd-bubble-comment-reply-link a').attr('href', r.commentLink);
1850
+ $('#wpd-bubble-notification-message').show();
1851
+ timeout = 10000;
1852
+ }
1853
+ var count = parseInt($('.wpd-new-comments-count').text());
1854
+ count += r.ids.length;
1855
+ $('#wpd-bubble-wrapper').removeClass('wpd-new-comment-added');
1856
+ $('#wpd-bubble-wrapper').addClass('wpd-new-comment-added');
1857
+ setTimeout(function () {
1858
+ $('#wpd-bubble-notification-message').hide();
1859
+ $('#wpd-bubble-wrapper').removeClass('wpd-new-comment-added');
1860
+ }, timeout);
1861
+ $('.wpd-new-comments-count').text(count);
1862
+ $('#wpd-bubble-count').addClass('wpd-new-comments');
1863
+ }
1864
+ r.all_comments_count = parseInt(r.all_comments_count);
1865
+ $('#wpd-bubble-all-comments-count').replaceWith(r.all_comments_count_bubble_html);
1866
+ $('.wpd-thread-info').html(r.all_comments_count_before_threads_html);
1867
+ $('.wpd-thread-info').attr('data-comments-count', r.all_comments_count);
1868
+ } else {
1869
+ console.log(r);
1870
+ }
1871
+ }
1872
+ setTimeout(bubbleAjax, commentListUpdateTimer);
1873
+ }).fail(function (jqXHR, textStatus, errorThrown) {
1874
+ console.log(errorThrown);
1875
+ setTimeout(bubbleAjax, commentListUpdateTimer);
1876
+ });
1877
+ }
1878
+
1879
+ if (((bubbleEnabled && bubbleLiveUpdate) || commentListUpdateType) && (isUserLoggedIn || (!isUserLoggedIn && enableGuestsLiveUpdate))) {
1880
+ setTimeout(bubbleAjax, commentListUpdateTimer);
1881
+ }
1882
  //========================= /BUBBLE =====================//
1883
  //========================= INLINE COMMENTS =====================//
1884
+ if ($('.wpd-inline-form-wrapper').length) {
1885
+ var data = new FormData();
1886
+ data.append('action', 'wpdGetInlineCommentForm');
1887
+ getAjaxObj(isNativeAjaxEnabled, false, data)
1888
+ .done(function (r) {
1889
+ if (typeof r === 'object') {
1890
+ if (r.success) {
1891
+ $('.wpd-inline-form-wrapper').append(r.data);
1892
+ $.each($('[name=_wpd_inline_nonce]'), function () {
1893
+ var id = $(this).attr('id');
1894
+ var parentId = $(this).parents('.wpd-inline-shortcode').attr('id');
1895
+ $(this).attr('id', id + '-' + parentId.substring(parentId.lastIndexOf('-') + 1));
1896
+ });
1897
+ $('.wpd-inline-opened').addClass('wpd-active');
1898
+ $('.wpd-inline-opened').find('.wpd-inline-form-wrapper').show();
1899
+ $('.wpd-inline-opened').find('.wpd-inline-icon').addClass('wpd-open');
1900
+ $('.wpd-inline-opened').find('.wpd-inline-icon').removeClass('wpd-ignored');
1901
+ fixInlineFormsPosition();
1902
+ } else {
1903
+ wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[r.data]), r.data, 'error');
1904
+ }
1905
+ } else {
1906
+ console.log(r);
1907
+ }
1908
+ })
1909
+ .fail(function (jqXHR, textStatus, errorThrown) {
1910
+ console.log(errorThrown);
1911
+ });
1912
+ }
1913
+ $(document).on('click', 'body', function (e) {
1914
+ if ($(e.target).hasClass('wpd-inline-form-close') || $(e.target).parents('.wpd-inline-form-close').length) {
1915
+ e.preventDefault();
1916
+ $(e.target).parents('.wpd-inline-form-wrapper').hide();
1917
+ $(e.target).parents('.wpd-inline-shortcode').removeClass('wpd-active');
1918
+ $(e.target).parents('.wpd-inline-form-wrapper').siblings('.wpd-inline-icon').removeClass('wpd-open');
1919
+ } else if (!$(e.target).hasClass('wpd-inline-form-wrapper') && !$(e.target).parents('.wpd-inline-form-wrapper').length) {
1920
+ hideInlineForms();
1921
+ var currentEl = '';
1922
+ if ($(e.target).hasClass('wpd-inline-icon')) {
1923
+ currentEl = $(e.target);
1924
+ } else if ($(e.target).parents('.wpd-inline-icon').length) {
1925
+ currentEl = $(e.target).parents('.wpd-inline-icon');
1926
+ }
1927
+ if (currentEl.length && currentEl.parents('.wpd-inline-shortcode').find('.wpd-inline-form').length) {
1928
+ currentEl.parents('.wpd-inline-shortcode').addClass('wpd-active');
1929
+ currentEl.siblings('.wpd-inline-form-wrapper').show();
1930
+ currentEl.addClass('wpd-open');
1931
+ currentEl.removeClass('wpd-ignored');
1932
+ fixInlineFormsPosition(currentEl.siblings('.wpd-inline-form-wrapper'));
1933
+ }
1934
+ }
1935
+ if ((!$(e.target).hasClass('wpd-last-inline-comments-wrapper') && !$(e.target).parents('.wpd-last-inline-comments-wrapper').length) || ($(e.target).parents('.wpd-last-inline-comments-wrapper').length && $(e.target).hasClass('wpd-load-inline-comment'))) {
1936
+ $('.wpd-last-inline-comments-wrapper').remove();
1937
+ }
1938
+ });
1939
+ $(document).on('click', '.wpd-inline-submit.wpd_not_clicked', function (e) {
1940
+ e.preventDefault();
1941
+ var clickedButton = $(this);
1942
+ var form = $(this).parents('.wpd_inline_comm_form');
1943
+ if (form[0].checkValidity()) {
1944
+ $(this).removeClass('wpd_not_clicked');
1945
+ var data = new FormData();
1946
+ data.append('action', 'wpdAddInlineComment');
1947
+ data.append('inline_form_id', getInlineFormId(form));
1948
+ $.each($('input, textarea', form), function (i, val) {
1949
+ if (this.type === 'checkbox') {
1950
+ if ($(this).is(':checked')) {
1951
+ data.append($(val).attr('name'), $(val).val());
1952
+ }
1953
+ } else {
1954
+ data.append($(val).attr('name'), $(val).val());
1955
+ }
1956
+ });
1957
+ getAjaxObj(isNativeAjaxEnabled, true, data)
1958
+ .done(function (r) {
1959
+ clickedButton.addClass('wpd_not_clicked');
1960
+ if (typeof r === 'object') {
1961
+ if (r.success) {
1962
+ form[0].reset();
1963
+ hideInlineForms();
1964
+ var newCount = parseInt(r.data.newCount);
1965
+ var countEl = clickedButton.parents('.wpd-inline-icon-wrapper').find('.wpd-inline-icon-count');
1966
+ countEl.text(newCount);
1967
+ if (newCount) {
1968
+ countEl.addClass('wpd-has-comments');
1969
+ } else {
1970
+ countEl.removeClass('wpd-has-comments');
1971
+ }
1972
+ r.data.allCommentsCountNew = parseInt(r.data.allCommentsCountNew);
1973
+ $('.wpd-thread-info').html(r.data.allCommentsCountBeforeThreadsHtml);
1974
+ $('.wpd-thread-info').attr('data-comments-count', r.data.allCommentsCountNew);
1975
+ $('#wpd-bubble-all-comments-count').replaceWith(r.data.allCommentsCountBubbleHtml);
1976
+ if (r.data.message) {
1977
+ addCommentsAfterSticky(r.data.message);
1978
+ }
1979
+ wpdiscuzAjaxObj.setCommentMessage(r.data.notification, 'success');
1980
+ } else if (r.data) {
1981
+ wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[r.data], r.data, clickedButton), 'error');
1982
+ }
1983
+ } else {
1984
+ wpdiscuzAjaxObj.setCommentMessage(r, 'error');
1985
+ }
1986
+ $('#wpdiscuz-loading-bar').fadeOut(250);
1987
+ })
1988
+ .fail(function (jqXHR, textStatus, errorThrown) {
1989
+ console.log(errorThrown);
1990
+ $('#wpdiscuz-loading-bar').fadeOut(250);
1991
+ });
1992
+ }
1993
+ });
1994
+ $(document).on('keydown', '.wpd-form', function (e) {
1995
+ if (e.ctrlKey && e.keyCode == 13) {
1996
+ $(this).find('.wc_comm_submit').trigger('click');
1997
+ }
1998
+ });
1999
+ $(document).on('keydown', '#wpdiscuz-edit-form', function (e) {
2000
+ if (e.ctrlKey && e.keyCode == 13) {
2001
+ $(this).find('.wc_save_edited_comment').trigger('click');
2002
+ }
2003
+ });
2004
+ $(document).on('keydown', '.wpd-inline-comment-content', function (e) {
2005
+ if (e.ctrlKey && e.keyCode == 13) {
2006
+ $(this).parents('.wpd_inline_comm_form').find('.wpd-inline-submit.wpd_not_clicked').trigger('click');
2007
+ }
2008
+ });
2009
+ $(document).on('click', '.wpd-inline-icon-count.wpd-has-comments', function () {
2010
+ var clickedButton = $(this);
2011
+ var data = new FormData();
2012
+ data.append('action', 'wpdGetLastInlineComments');
2013
+ data.append('inline_form_id', getInlineFormId(clickedButton));
2014
+ getAjaxObj(isNativeAjaxEnabled, true, data)
2015
+ .done(function (r) {
2016
+ if (typeof r === 'object') {
2017
+ if (r.success) {
2018
+ $(r.data).insertAfter(clickedButton);
2019
+ } else {
2020
+ wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[r.data], r.data, clickedButton), 'error');
2021
+ }
2022
+ } else {
2023
+ console.log(r);
2024
+ }
2025
+ $('#wpdiscuz-loading-bar').fadeOut(250);
2026
+ })
2027
+ .fail(function (jqXHR, textStatus, errorThrown) {
2028
+ console.log(errorThrown);
2029
+ $('#wpdiscuz-loading-bar').fadeOut(250);
2030
+ });
2031
+ });
2032
+ $(document).on('click', '.wpd-view-all-inline-comments', function (e) {
2033
+ e.preventDefault();
2034
+ $(this).parents('.wpd-last-inline-comments-wrapper').remove();
2035
+ if (!$('.wpdf-inline').hasClass('wpdf-active')) {
2036
+ $('.wpdf-inline').trigger('click');
2037
+ }
2038
+ unsetHtmlAndBodyScrollBehaviors();
2039
+ $('html, body').animate({
2040
+ scrollTop: $('.wpdf-inline').offset().top - scrollSize
2041
+ }, 1000, restoreHtmlAndBodyScrollBehaviors);
2042
+ });
2043
+ $(document).on('click', '.wpd-feedback-content-link', function (e) {
2044
+ e.preventDefault();
2045
+ var feedbackId = $(this).data('feedback-content-id');
2046
+ unsetHtmlAndBodyScrollBehaviors();
2047
+ $('html, body').animate({
2048
+ scrollTop: $('#wpd-inline-' + feedbackId).offset().top - (scrollSize + 6)
2049
+ }, 1000, function () {
2050
+ restoreHtmlAndBodyScrollBehaviors();
2051
+ $('#wpd-inline-' + feedbackId).addClass('wpd-active');
2052
+ });
2053
+ });
2054
+ if (inlineFeedbackAttractionType === 'scroll_open' || inlineFeedbackAttractionType === 'blink') {
2055
+ inlineAttraction();
2056
+ $(window).on('scroll', inlineAttraction);
2057
+ }
2058
+
2059
+ function getInlineFormId(el) {
2060
+ if ($(el).hasClass('wpd-inline-shortcode')) {
2061
+ var elId = $(el).attr('id');
2062
+ } else {
2063
+ var elId = $(el).parents('.wpd-inline-shortcode').attr('id');
2064
+ }
2065
+ return elId.substring(elId.lastIndexOf('-') + 1);
2066
+ }
2067
+
2068
+ function hideInlineForms() {
2069
+ $('.wpd-inline-form-wrapper').hide();
2070
+ $('.wpd-inline-shortcode').removeClass('wpd-active');
2071
+ $('.wpd-inline-icon').removeClass('wpd-open');
2072
+ }
2073
+
2074
+ function inlineAttraction() {
2075
+ $.each($('.wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon'), function () {
2076
+ var el = $(this);
2077
+ var diff = el.offset().top - window.pageYOffset;
2078
+ if (el.parents('.wpd-inline-shortcode').find('.wpd-inline-form').length && diff > 0 && diff < 300) {
2079
+ if (inlineFeedbackAttractionType === 'blink') {
2080
+ el.addClass('wpd-blink');
2081
+ setTimeout(function () {
2082
+ el.removeClass('wpd-blink');
2083
+ }, 3000);
2084
+ } else {
2085
+ el.parents('.wpd-inline-shortcode').addClass('wpd-active');
2086
+ el.siblings('.wpd-inline-form-wrapper').show();
2087
+ el.addClass('wpd-open');
2088
+ fixInlineFormsPosition(el.siblings('.wpd-inline-form-wrapper'));
2089
+ }
2090
+ }
2091
+ });
2092
+ }
2093
+
2094
+ function fixInlineFormsPosition(form) {
2095
+ if (form) {
2096
+ if (form.offset().left <= 10) {
2097
+ form.css('left', Math.ceil(parseInt(form.css('left')) - form.offset().left + 10));
2098
+ var beforeLeft = Math.ceil(form.siblings('.wpd-inline-icon.wpd-open').offset().left - form.offset().left + 2);
2099
+ if (beforeLeft < 3) {
2100
+ beforeLeft = 3;
2101
+ }
2102
+ document.styleSheets[0].addRule('#' + form.parents('.wpd-inline-shortcode').attr('id') + ' .wpd-inline-form-wrapper::before', 'left: ' + beforeLeft + 'px;');
2103
+ } else if (form.offset().left + form.width() > document.body.clientWidth - 10) {
2104
+ form.css('left', Math.ceil(parseInt(form.css('left')) + (document.body.clientWidth - (form.offset().left + form.width())) - 10));
2105
+ var beforeLeft = Math.ceil(form.siblings('.wpd-inline-icon.wpd-open').offset().left - form.offset().left + 2);
2106
+ if (beforeLeft > form.width() - 3) {
2107
+ beforeLeft = form.width() - 3;
2108
+ }
2109
+ document.styleSheets[0].addRule('#' + form.parents('.wpd-inline-shortcode').attr('id') + ' .wpd-inline-form-wrapper::before', 'left: ' + beforeLeft + 'px;');
2110
+ }
2111
+ } else {
2112
+ $.each($('.wpd-inline-form-wrapper:visible'), function () {
2113
+ if ($(this).offset().left <= 10) {
2114
+ $(this).css('left', Math.ceil(parseInt($(this).css('left')) - $(this).offset().left + 10));
2115
+ var beforeLeft = Math.ceil($(this).siblings('.wpd-inline-icon.wpd-open').offset().left - $(this).offset().left + 2);
2116
+ if (beforeLeft < 3) {
2117
+ beforeLeft = 3;
2118
+ }
2119
+ document.styleSheets[0].addRule('#' + $(this).parents('.wpd-inline-shortcode').attr('id') + ' .wpd-inline-form-wrapper::before', 'left: ' + beforeLeft + 'px;');
2120
+ } else if ($(this).offset().left + $(this).width() > document.body.clientWidth - 10) {
2121
+ $(this).css('left', Math.ceil(parseInt($(this).css('left')) + (document.body.clientWidth - ($(this).offset().left + $(this).width())) - 10));
2122
+ var beforeLeft = Math.ceil($(this).siblings('.wpd-inline-icon.wpd-open').offset().left - $(this).offset().left + 2);
2123
+ if (beforeLeft > $(this).width() - 3) {
2124
+ beforeLeft = $(this).width() - 3;
2125
+ }
2126
+ document.styleSheets[0].addRule('#' + $(this).parents('.wpd-inline-shortcode').attr('id') + ' .wpd-inline-form-wrapper::before', 'left: ' + beforeLeft + 'px;');
2127
+ }
2128
+ });
2129
+ }
2130
+ }
2131
 
2132
  //========================= /INLINE COMMENTS =====================//
2133
  //========================= POST RATING =====================//
2134
+ $(document).on('click', '#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg', function () {
2135
+ var data = new FormData();
2136
+ var rating = $(this).index();
2137
+ if (rating >= 0 && rating < 5) {
2138
+ data.append('action', 'wpdUserRate');
2139
+ data.append('rating', rating + 1);
2140
+ getAjaxObj(isNativeAjaxEnabled, true, data)
2141
+ .done(function (r) {
2142
+ if (typeof r === 'object') {
2143
+ if (r.success) {
2144
+ location.reload(true);
2145
+ } else {
2146
+ wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[r.data], r.data), 'error');
2147
+ }
2148
+ runCallbacks(r);
2149
+ } else {
2150
+ console.log(r);
2151
+ }
2152
+ $('#wpdiscuz-loading-bar').fadeOut(250);
2153
+ })
2154
+ .fail(function (jqXHR, textStatus, errorThrown) {
2155
+ console.log(errorThrown);
2156
+ $('#wpdiscuz-loading-bar').fadeOut(250);
2157
+ });
2158
+ }
2159
+ });
2160
  //========================= /POST RATING =====================//
2161
 
2162
+ $(document).on('submit', '#wpdiscuz-subscribe-form', function (e) {
2163
+ e.preventDefault();
2164
+ var wcForm = $(this);
2165
+ if (wcForm[0].checkValidity() && wpdReCaptchaValidateOnSubscribeForm(wcForm)) {
2166
+ var data = new FormData();
2167
+ data.append('action', 'wpdAddSubscription');
2168
+ var elements = $("*", wcForm);
2169
+ elements.each(function () {
2170
+ if (this.name != '' && this.type != 'checkbox' && this.type != 'radio') {
2171
+ data.append(this.name + '', $(this).val());
2172
+ }
2173
+ if (this.type == 'checkbox' || this.type == 'radio') {
2174
+ if ($(this).is(':checked')) {
2175
+ data.append(this.name + '', $(this).val());
2176
+ }
2177
+ }
2178
+ });
2179
+ getAjaxObj(isNativeAjaxEnabled, true, data)
2180
+ .done(function (r) {
2181
+ if (typeof r === 'object') {
2182
+ if (r.success) {
2183
+ wpdiscuzAjaxObj.setCommentMessage(r.data, 'success');
2184
+ setTimeout(function () {
2185
+ location.reload(true);
2186
+ }, 3000);
2187
+ } else {
2188
+ wpdiscuzAjaxObj.setCommentMessage(r.data, 'error');
2189
+ }
2190
+ } else {
2191
+ wpdiscuzAjaxObj.setCommentMessage(r, 'error');
2192
+ }
2193
+ $('#wpdiscuz-loading-bar').fadeOut(250);
2194
+ addingComment = false;
2195
+ })
2196
+ .fail(function (jqXHR, textStatus, errorThrown) {
2197
+ console.log(errorThrown);
2198
+ $('#wpdiscuz-loading-bar').fadeOut(250);
2199
+ });
2200
+ }
2201
+ });
2202
+ $(document).on('click', '.wpd-unsubscribe', function (e) {
2203
+ e.preventDefault();
2204
+ var data = new FormData();
2205
+ data.append('action', 'wpdUnsubscribe');
2206
+ data.append('sid', $(this).data('sid'));
2207
+ data.append('skey', $(this).data('skey'));
2208
+ getAjaxObj(isNativeAjaxEnabled, true, data).done(function (r) {
2209
+ if (typeof r === 'object') {
2210
+ if (r.success) {
2211
+ wpdiscuzAjaxObj.setCommentMessage(r.data, 'success');
2212
+ setTimeout(function () {
2213
+ location.reload(true);
2214
+ }, 3000);
2215
+ } else {
2216
+ wpdiscuzAjaxObj.setCommentMessage(r.data, 'error');
2217
+ }
2218
+ } else {
2219
+ console.log(r);
2220
+ }
2221
+ $('#wpdiscuz-loading-bar').fadeOut(250);
2222
+ addingComment = false;
2223
+ }).fail(function (jqXHR, textStatus, errorThrown) {
2224
+ console.log(errorThrown);
2225
+ $('#wpdiscuz-loading-bar').fadeOut(250);
2226
+ });
2227
+ });
2228
+
2229
+ function setTextareaCharCount(elem) {
2230
+ var commentTextMaxLength = 0;
2231
+ var textareaWrap;
2232
+ if (elem.parents('.wpd_main_comm_form').length) {
2233
+ commentTextMaxLength = parseInt(wpdiscuzAjaxObj.commentTextMaxLength);
2234
+ textareaWrap = elem.parents('.wpd_main_comm_form');
2235
+ } else if (elem.parents('.wpd-secondary-form-wrapper').length) {
2236
+ commentTextMaxLength = parseInt(wpdiscuzAjaxObj.replyTextMaxLength);
2237
+ textareaWrap = elem.parents('.wpd-secondary-form-wrapper');
2238
+ } else if (elem.parents('#wpdiscuz-edit-form').length) {
2239
+ var uniquid = getUniqueID(elem);
2240
+ commentTextMaxLength = parseInt(uniquid.substring(uniquid.lastIndexOf('_') + 1)) ? parseInt(wpdiscuzAjaxObj.replyTextMaxLength) : parseInt(wpdiscuzAjaxObj.commentTextMaxLength);
2241
+ textareaWrap = elem.parents('#wpdiscuz-edit-form');
2242
+ }
2243
+ if (commentTextMaxLength && textareaWrap) {
2244
+ var currLength = elem.val().length;
2245
+ var charCountDiv = $('.wpd-editor-char-counter', textareaWrap);
2246
+ var left = commentTextMaxLength - currLength;
2247
+ charCountDiv.html(left);
2248
+ if (left <= 10) {
2249
+ charCountDiv.addClass('error');
2250
+ } else {
2251
+ charCountDiv.removeClass('error');
2252
+ }
2253
+ }
2254
+ }
2255
+
2256
+ wpdiscuzAjaxObj.resetActiveFilters = function (currentItemSelector) {
2257
+ $('.wpd-filter.wpdf-active' + (currentItemSelector ? ':not(' + currentItemSelector + ')' : '')).removeClass('wpdf-active');
2258
+ };
2259
+
2260
+ function runCallbacks(r, commentID, voteType, wcForm) {
2261
+ if (r.data.callbackFunctions) {
2262
+ $.each(r.data.callbackFunctions, function (i) {
2263
+ if (typeof wpdiscuzAjaxObj[r.data.callbackFunctions[i]] === "function") {
2264
+ wpdiscuzAjaxObj[r.data.callbackFunctions[i]](r, commentID, voteType, wcForm);
2265
+ } else if (typeof window[r.data.callbackFunctions[i]] === "function") {
2266
+ window[r.data.callbackFunctions[i]](r, commentID, voteType, wcForm);
2267
+ } else {
2268
+ console.log(r.data.callbackFunctions[i] + " is not a function");
2269
+ }
2270
+ });
2271
+ }
2272
+ }
2273
+
2274
+ /**
2275
+ * @param {int/bool} isNative - use native or custom ajax
2276
+ * @param {bool} isShowTopLoading - show loading bar
2277
+ * @param {object} data - data for ajax request
2278
+ * @returns {jqXHR}
2279
+ */
2280
+ function getAjaxObj(isNative, isShowTopLoading, data) {
2281
+ if (isShowTopLoading) {
2282
+ $('#wpdiscuz-loading-bar').show();
2283
+ }
2284
+ data.append('postId', wpdiscuzPostId);
2285
+ data.append('wpdiscuz_nonce', wpdiscuzAjaxObj.wpdiscuz_nonce);
2286
+ var action = data.get('action');
2287
+ if (wpdiscuzAjaxObj.dataFilterCallbacks && wpdiscuzAjaxObj.dataFilterCallbacks[action]) {
2288
+ $.each(wpdiscuzAjaxObj.dataFilterCallbacks[action], function (i) {
2289
+ if (typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[action][i]] === "function") {
2290
+ data = wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[action][i]](data, isNative, isShowTopLoading);
2291
+ }
2292
+ });
2293
+ }
2294
+ var url = isNative ? wpdiscuzAjaxObj.url : wpdiscuzAjaxObj.customAjaxUrl;
2295
+ return $.ajax({
2296
+ type: 'POST',
2297
+ url: url,
2298
+ data: data,
2299
+ contentType: false,
2300
+ processData: false
2301
+ });
2302
+ }
2303
+
2304
+ wpdiscuzAjaxObj.getAjaxObj = getAjaxObj;
2305
+ wpdiscuzAjaxObj.initNonce = initNonce;
2306
+
2307
+ initNonce();
2308
+
2309
+ function initNonce(){
2310
+ var data = new FormData();
2311
+ data.append('action', 'wpdGetNonce');
2312
+ data.append('key', wpdiscuzAjaxObj.wpdiscuz_nonce_key);
2313
+ getAjaxObj(isNativeAjaxEnabled, false, data).done(function (r) {
2314
+ if (typeof r === 'object') {
2315
+ if (r.success) {
2316
+ wpdiscuzAjaxObj.wpdiscuz_nonce = r.data;
2317
+ } else {
2318
+ wpdiscuzAjaxObj.setCommentMessage(r.data, 'error');
2319
+ }
2320
+ } else {
2321
+ console.log(r);
2322
+ }
2323
+ }).fail(function (jqXHR, textStatus, errorThrown) {
2324
+ console.log(errorThrown);
2325
+ });
2326
+ }
2327
 
2328
  });
2329
  //========================= reCAPTCHA =====================//
2330
+ var onloadCallback = function () {
2331
+ if (document.getElementById('wpdiscuz-recaptcha-0_0') && wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion === '2.0' && ((wpdiscuzAjaxObj.wc_captcha_show_for_guest == 1 && !wpdiscuzAjaxObj.is_user_logged_in) || (wpdiscuzAjaxObj.wc_captcha_show_for_members == 1 && wpdiscuzAjaxObj.is_user_logged_in))) {
2332
+ try {
2333
+ grecaptcha.render('wpdiscuz-recaptcha-0_0', {
2334
+ 'sitekey': wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,
2335
+ 'theme': wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,
2336
+ 'callback': function (response) {
2337
+ jQuery('#wpdiscuz-recaptcha-field-0_0').val('key');
2338
+ },
2339
+ 'expired-callback': function () {
2340
+ jQuery('#wpdiscuz-recaptcha-field-0_0').val("");
2341
+ }
2342
+ });
2343
+ } catch (e) {
2344
+ console.log(e);
2345
+ wpdiscuzAjaxObj.setCommentMessage('reCaptcha Error: ' + e.message, 'error');
2346
+ }
2347
+ }
2348
  };
2349
  //========================= /reCAPTCHA =====================//
assets/js/wpdiscuz.min.js CHANGED
@@ -1 +1 @@
1
- var wpdiscuzLoadRichEditor=parseInt(wpdiscuzAjaxObj.loadRichEditor);if(wpdiscuzLoadRichEditor)var wpDiscuzEditor=new WpdEditor;function wpdMessagesOnInit(e,t){wpdiscuzAjaxObj.setCommentMessage(e,t),setTimeout(function(){location.href=location.href.substring(0,location.href.indexOf("wpdiscuzUrlAnchor")-1)},3e3)}wpdiscuzAjaxObj.setCommentMessage=function(e,t,a){var o="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?o="wpdiscuz-message-success":"warning"===t[n]&&(o="wpdiscuz-message-warning"):"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(a instanceof Array?a[n]:a||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e).prependTo("#wpdiscuz-comment-message").delay(a||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},wpdiscuzAjaxObj.applyFilterOnPhrase=function(e,t,a){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,function(o){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]]&&(e=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]](e,t,a))}),e},jQuery(document).ready(function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType),s=parseInt(wpdiscuzAjaxObj.wc_post_id),d=wpdiscuzAjaxObj.wpdiscuz_nonce,c=parseInt(wpdiscuzAjaxObj.commentListUpdateType),p=1e3*parseInt(wpdiscuzAjaxObj.commentListUpdateTimer),r=parseInt(wpdiscuzAjaxObj.liveUpdateGuests),l=wpdiscuzAjaxObj.loadLastCommentId,m=l,w=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 u,f=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate),h=wpdiscuzAjaxObj.storeCommenterData,b=parseInt(wpdiscuzAjaxObj.wmuEnabled),_=wpdiscuzAjaxObj.isCookiesEnabled,g=!0,z=wpdiscuzAjaxObj.cookiehash,v=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),j=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,x=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),C=parseInt(wpdiscuzAjaxObj.enableBubble),k=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),y=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),O=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,A=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),I=wpdiscuzAjaxObj.bubbleLocation,T=wpdiscuzAjaxObj.inlineFeedbackAttractionType,D=(D=parseInt(wpdiscuzAjaxObj.scrollSize))||32,F=[],E=[],M=[],L=!1,R=1,S=e("html").css("scroll-behavior"),P=e("body").css("scroll-behavior");(e(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?e(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .the_champ_login_container").length?e(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .social_connect_form").length?e(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&e(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",function(t){var a=e(".wpd-form").not(":hidden");if(a.length)if(wpdiscuzLoadRichEditor){for(var o=0;o<a.length;o++)if("\n"!==wpDiscuzEditor.createEditor(e(a[o]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(o=0;o<a.length;o++)if(e(a[o]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")}),wpdiscuzLoadRichEditor||(e(document).delegate("textarea.wc_comment","input",function(){ue(e(this))}),e.each(e("textarea.wc_comment"),function(){ue(e(this))})),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(j)}),e(document).on("focus","#wpdcom textarea",function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()}),t)||W({comment_author:Cookies.get("comment_author_"+z),comment_author_email:Cookies.get("comment_author_email_"+z),comment_author_url:Cookies.get("comment_author_url_"+z)});if(e(".wpd-vote-down.wpd-dislike-hidden").remove(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),e(document).on("click","#wpd-editor-source-code-wrapper-bg",function(){e(this).hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")}),wpdiscuzLoadRichEditor&&e(document).on("click","#wpd-insert-source-code",function(){var t=wpDiscuzEditor.createEditor("#"+e("#wpd-editor-uid").val());t.deleteText(0,t.getLength(),Quill.sources.USER);var a=e("#wpd-editor-source-code").val();a.length&&t.clipboard.dangerouslyPasteHTML(0,a,Quill.sources.USER),t.update(),e("#wpd-editor-source-code-wrapper-bg").hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")}),e(document).on("click",".wpd-reply-button",function(){var i=Y(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()},j):setTimeout(function(){e("#wc-textarea-"+i).trigger("focus")},j),e("#wpd-secondary-form-wrapper-"+i).slideToggle(j)):function(a){var o=Y(a,0);e("#wpdiscuz_form_anchor-"+o).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(o));var n=e("#wpd-secondary-form-wrapper-"+o);if(!t){var i={comment_author:Cookies.get("comment_author_"+z),comment_author_email:Cookies.get("comment_author_email_"+z),comment_author_url:Cookies.get("comment_author_url_"+z)};W(i)}wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+o).focus()},j):setTimeout(function(){e("#wc-textarea-"+o).trigger("focus")},j);n.slideToggle(j,function(){a.addClass("wpdiscuz-clonned")})}(e(this)),function(t){if((a||o)&&"2.0"===n){var i=J(t);setTimeout(function(){if(!E[i])try{E[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){e("#wpdiscuz-recaptcha-field-"+t).val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-"+t).val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3)}}(i)}),e(document).on("click","#wpdcom .wpd-comment-link [data-comment-url]",function(){var t=e(this).data("comment-url"),a=e("<input/>");a.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),a.trigger("select"),document.execCommand("copy"),a.remove(),wpdiscuzAjaxObj.setCommentMessage(t+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)}),e(document).on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",function(e){e.preventDefault()}),e(document).on("click",".wpd-toggle.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked");var a=Y(e(this),0),o=e(this),n=e(".fas",o);!o.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&v?function(t,a){var o=J(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",o),he(x,!0,n).done(function(o){a.addClass("wpd_not_clicked"),"object"==typeof o&&o.success&&(e("#wpd-comm-"+t).replaceWith(o.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle .wpd-view-replies .wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),e("#wpd-comm-"+t+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),fe(o)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,n){console.log(n),a.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}(a,t):e("#wpd-comm-"+a+"> .wpd-reply").slideToggle(700,function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),o.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),o.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),t.addClass("wpd_not_clicked")})}),e(document).on("mouseenter",".wpd-new-loaded-comment",function(){e(this).removeClass("wpd-new-loaded-comment")}),e(document).on("click",".wpd-sbs-toggle",function(){e(".wpdiscuz-subscribe-bar").slideToggle(j)}),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm)&&!t&&wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&e("#wpdiscuz-subscribe-form").length&&("2.0"===n?(setTimeout(function(){try{grecaptcha.render("wpdiscuz-recaptcha-subscribe-form",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-subscribe-form").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val()?e(".wpdiscuz-recaptcha",e(this)).css("border","none"):(e(".wpdiscuz-recaptcha",e(this)).css("border","1px solid red"),t.preventDefault())})):"3.0"===n&&e(document).on("click","#wpdiscuz_subscription_button",function(t){var a=e(this).parents("#wpdiscuz-subscribe-form");t.preventDefault();try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then(function(e){console.log(5555),document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=e,a.trigger("submit")},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}})),(a||o)&&"2.0"===n){var q=e(window).width(),H=e("#wpdcom").width();H>=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%"})),H>=940&&H<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%"})),H>=810&&H<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%"})),H>=730&&H<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%"})),H>=610&&H<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%"})),q>650&&(H>=510&&H<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"})),H>=470&&H<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"})),H<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 U(t,a,o){he(x||b,!1,a).done(function(a){if(e(o).addClass("wpd_not_clicked"),"object"==typeof a)if(a.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(j),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),e(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html);var n=j;a.data.is_main?ie(a.data.message):(n=j+700,e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).slideToggle(700),1==a.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).after(a.data.message):e("#wpd-comm-"+a.data.uniqueid).after(a.data.message)),function(e){if(!e.data.held_moderate){var t=new FormData;t.append("action","wpdCheckNotificationType"),t.append("comment_id",e.data.new_comment_id),t.append("email",e.data.comment_author_email),t.append("isParent",e.data.is_main),he(x,!0,t)}}(a),function(e){if(e.data.redirect>0&&e.data.new_comment_id){var t=new FormData;t.append("action","wpdRedirect"),t.append("commentId",e.data.new_comment_id),he(x,!0,t).done(function(e){"object"==typeof e&&e.success&&setTimeout(function(){location.href=e.data},2e3)}).fail(function(e,t,a){console.log(a)})}}(a),_&&g?function(t){var a=t.comment_author_email,o=t.comment_author,n=t.comment_author_url;null==h?(Cookies.set("comment_author_email_"+z,a),Cookies.set("comment_author_"+z,o),n.length&&Cookies.set("comment_author_url_"+z,n)):(h=parseInt(h),Cookies.set("comment_author_email_"+z,a,{expires:h,path:"/"}),Cookies.set("comment_author_"+z,o,{expires:h,path:"/"}),n.length&&Cookies.set("comment_author_url_"+z,n,{expires:h,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(a.data):g||e(".wpd-cookies-checkbox").prop("checked",!1),t.get(0).reset(),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]):ue(t.find(".wc_comment")),W(a.data),e(".wmu-preview-wrap",t).remove(),F.length&&(F.forEach(function(e){e.parents(".wpd-field-checkbox").remove()}),F=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){oe(),e("html, body").animate({scrollTop:e("#comment-"+a.data.new_comment_id).offset().top-D},1e3,ne)},n),fe(a,t)}else a.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"),fe(a,t));else wpdiscuzAjaxObj.setCommentMessage(a,"error");e("#wpdiscuz-loading-bar").fadeOut(250),L=!1}).fail(function(t,a,n){console.log(n),e(o).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}function W(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 V(t,a){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(a),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}e(document).on("click",".wc_comm_submit.wpd_not_clicked",function(){var i=e(this),s=1,d=e(this).parents("form");if(d.hasClass("wpd_main_comm_form")||(s=function(t){var a=t.attr("class").split(" "),o="";return e.each(a,function(e,t){"wpd_comment_level"===Z(t,!1)&&(o=Z(t,!0))}),parseInt(o)+1}(e(this).parents(".wpd-comment"))),ae(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)){L=!0,function(t){e(".wpd-agreement-checkbox",t).each(function(){e(this).hasClass("wpd_agreement_hide")&&_&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+z,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each(function(){F.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")||(g=!1):t&&(g=!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),U(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 U(d,c,i)}var p,r;!function(e){if((a||o)&&"2.0"===n){var t=J(e);grecaptcha.reset(E[t])}}(e(".wpdiscuz_unique_id",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wc_msg_required_fields,"wc_msg_required_fields",d),"error")}),e(document).on("click",".wpd_editable_comment",function(){u&&e(".wpdiscuz-edit-form-wrap").length&&V(Y(e(".wpdiscuz-edit-form-wrap"),0),u);var t=e(this),a=Y(t,0),o=J(a),n=new FormData;n.append("action","wpdEditComment"),n.append("commentId",o),u=e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-text").get(0),he(x,!0,n).done(function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){var n=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+a);n.clipboard.dangerouslyPasteHTML(0,o.data.content),n.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+a).val(o.data.content),ue(e("#wc-textarea-edit_"+a));e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wc_save_edited_comment",function(){var t=e(this),a=Y(t),o=J(a),n=e("#wpd-comm-"+a+" #wpdiscuz-edit-form");if(ae(n,"#wpd-editor-edit_"+a),n.on("submit",function(e){e.preventDefault()}),n[0].checkValidity()){var i=new FormData;i.append("action","wpdSaveEditedComment"),i.append("commentId",o),e(":input",n).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&i.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&i.append(this.name+"",e(this).val())}),he(x,!0,i).done(function(n){"object"==typeof n?(n.success?(V(a,n.data.message),n.data.lastEdited&&(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(n.data.lastEdited).insertAfter("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),n.data.twitterShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",n.data.twitterShareLink),n.data.whatsappShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",n.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error"),fe(n,o)):console.log(n),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=Y(e(this));V(t,u),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!f&&w&&(R=0,1==w?setTimeout(function(){Q(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),Q(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&Q(!1,t,"wpd-loaded","wpd-loading")});var B=!1;function K(){var t=e("#wpdiscuzHasMoreComments").val(),a=e(document).height(),o=e(window).height()+e(window).scrollTop();a&&o&&(100*o/a>=80&&!1===B&&1==t&&(B=!0,Q(!1,e(".wpd-load-more-submit"))))}function Q(t,a,o,n){a&&(a.toggleClass(o),a.toggleClass(n));var s=new FormData;s.append("action","wpdLoadMoreComments");var d=e(".wpdiscuz-sort-button-active").attr("data-sorting");d&&s.append("sorting",d),s.append("offset",R),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||""),he(x,!t||1!=w,s).done(function(s){"object"==typeof s&&s.success&&(R++,t&&e(".wpd-comment").remove(),e(".wpdiscuz_single").remove(),e(".wpdiscuz-comment-pagination").before(s.data.comment_list),N(s,t&&2!==i),B=!1,s.data.loadLastCommentId&&(l=s.data.loadLastCommentId),fe(s),t&&G(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))}).fail(function(t,i,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))})}function N(t,a){var o;0==t.data.is_show_load_more?(e("#wpdiscuzHasMoreComments").val(0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()):(o=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",o),2!==i&&e(".wpdiscuz-comment-pagination").show(),e("#wpdiscuzHasMoreComments").val(1),a&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show()),fe(t)}function G(t){var a=location.href.match(/#comment\-(\d+)/);if(null!==a){var o=a[1];if(e("#comment-"+o).length)setTimeout(function(){oe(),e("html, body").animate({scrollTop:e("#comment-"+o).parents("[id^=wpd-comm-]").offset().top-D},1e3,ne),t&&$(o)},500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",o),he(x,!0,n).done(function(a){if("object"==typeof a&&a.success){var n="#comment-"+o;e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),fe(a),oe(),e("html, body").animate({scrollTop:e(n).offset().top-D},1e3,ne),t&&$(o)}e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}}function $(t){setTimeout(function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")},1100)}function X(e){if(void 0!==e.data.message)for(var t,a=e.data.message,o=0;o<a.length;o++)ee((t=a[o]).comment_parent,t.comment_html)}function Y(e,t){var a="";return(a=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(a.lastIndexOf("-")+1)}function J(e){return e.substring(0,e.indexOf("_"))}function Z(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function ee(t,a){if(0==t)ie(a);else{var o=Y(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+o).after(a)}}function te(){var t=[];return e(".wpd-comment-right").each(function(){t.push(J(Y(e(this),0)))}),t.join(",")}function ae(t,a){var o=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(a+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),a=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");a=(a=(a=(a=a.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),t.val(a)}(t),e.each(o,function(){e("input",this).prop("required",!1),0===e("input:checked",this).length?e("input",e(this)).prop("required",!0):e(".wpd-field-invalid",this).remove()})}function oe(){e("html, body").css("scroll-behavior","unset")}function ne(){e("html").css("scroll-behavior",S),e("body").css("scroll-behavior",P)}function ie(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function se(t){t?t.prop("required")||(t.val()?t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):e.each(e(".wc_email"),function(t,a){var o=e(a);o.prop("required")||(o.val()?o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==i||f||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),K(),e(window).scroll(function(){K()})),wpdiscuzAjaxObj.setLoadMoreVisibility=N,e(document).on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",function(){var t=e(this);e(t).removeClass("wpd_not_clicked");var a,o=J(Y(t));a=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",o),n.append("voteType",a),he(x,!0,n).done(function(n){if(e(t).addClass("wpd_not_clicked"),"object"==typeof n){if(n.success){if("total"===n.data.buttonsStyle){var i=e(".wpd-comment-footer .wpd-vote-result",e("#comment-"+o)),s=n.data.votes;i.text(n.data.votesHumanReadable),i.attr("title",s),i.removeClass("wpd-up wpd-down"),s>0&&i.addClass("wpd-up"),s<0&&i.addClass("wpd-down")}else{var d=e(".wpd-comment-footer .wpd-vote-result-like",e("#comment-"+o)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+o));d.text(n.data.likeCountHumanReadable),d.attr("title",n.data.likeCount),c.text(n.data.dislikeCountHumanReadable),c.attr("title",n.data.dislikeCount),parseInt(n.data.likeCount)>0?d.addClass("wpd-up"):d.removeClass("wpd-up"),parseInt(n.data.dislikeCount)<0?c.addClass("wpd-down"):c.removeClass("wpd-down")}var p=e(".wpd-comment-footer .wpd-vote-up",e("#comment-"+o)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+o));p.removeClass("wpd-up"),r.removeClass("wpd-down"),n.data.curUserReaction>0?p.addClass("wpd-up"):n.data.curUserReaction<0&&r.addClass("wpd-down")}else n.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error");fe(n,o,a)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,o,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click","body",function(t){var a=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?a.css({display:a.is(":visible")?"none":"flex"}):a.hide()}),e(document).on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var t=e(this),a=e(this).attr("data-sorting");if(a){e(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),t.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var o=new FormData;o.append("action","wpdSorting"),o.append("sorting",a);var n=e(".wpdf-active").attr("data-filter-type");o.append("wpdType",n||""),he(x,!0,o).done(function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),N(t,!1),R=1),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){G(!1)},1!=w&&G(!1),e(document).on("click",".wpdiscuz-readmore",function(){var t=Y(e(this)),a=J(t),o=new FormData;o.append("action","wpdReadMore"),o.append("commentId",a),he(x,!0,o).done(function(o){"object"==typeof o?(o.success?(e("#comment-"+a+" .wpd-comment-text").replaceWith(" "+o.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(o.data),fe(o)):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("change",".wpd-required-group",function(){0!==e("input:checked",this).length?e("input",e(this)).prop("required",!1):e("input",e(this)).prop("required",!0)}),e(document).on("click",".wpdiscuz-spoiler",function(){e(this).next().slideToggle(),e(this).hasClass("wpdiscuz-spoiler-closed")?e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"):e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"),e(this).toggleClass("wpdiscuz-spoiler-closed")}),e(document).on("click",".wpd-tools i",function(){var t=e(this).siblings(".wpd-tools-actions");t.is(":visible")||e(this).parents(".wpd-comment-right").attr("id")!==e("[id^=comment-]","#wpdcom").last().attr("id")||e("#comments").css({paddingBottom:"160px"}),t.css({display:t.is(":visible")?"none":"flex"})}),e(document).on("mouseleave",".wpd-comment-right",function(){e(this).find(".wpd-tools-actions").hide(),e("#comments").css({paddingBottom:"0"})}),e(document).on("click",".wpd_stick_btn",function(){var t=J(Y(e(this),0)),a=new FormData;a.append("action","wpdStickComment"),a.append("commentId",t),he(x,!0,a).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd_close_btn",function(){var t=J(Y(e(this),0)),a=new FormData;a.append("action","wpdCloseThread"),a.append("commentId",t),he(x,!0,a).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var t=e(this),a=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+a),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&o.append("sorting",n),o.append("lastParentId",0),o.append("offset",0),R=1,o.append("wpdType",t.hasClass("wpdf-active")?"":a),o.append("isFirstLoad",1),e(this).hasClass("wpdf-inline")?e(this).hasClass("wpdf-active")?e(".wpd-comment-info-bar").hide():e(".wpd-comment-info-bar").css("display","flex"):e(".wpd-comment-info-bar").hide(),he(x,!1,o).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(a.data.comment_list),N(a),l=a.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),fe(a)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpdf-reacted.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdMostReactedComment"),he(x,!1,a).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e("#comment-"+a.data.commentId).length||e(".wpd-thread-list").prepend(a.data.message),fe(a),oe(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-D},1e3,ne))}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")})}),e(document).on("click",".wpdf-hottest.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdHottestThread"),he(x,!1,a).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.commentId).length?e("#comment-"+a.data.commentId).parents("[id^=wpd-comm-"+a.data.commentId+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),fe(a),oe(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-D},1e3,ne))}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")})}),e(document).on("click",".wpd-filter-view-all",function(){e(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")}),e(document).on("click",".wpd-follow-link.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=J(Y(t,0)),o=new FormData;o.append("action","wpdFollowUser"),o.append("commentId",a),he(x,!0,o).done(function(a){t.addClass("wpd_not_clicked"),"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.code],a.data.code,t),"success"),t.removeClass("wpd-follow-active"),a.data.followTip&&t.attr("wpd-tooltip",a.data.followTip),a.data.followClass&&t.addClass(a.data.followClass)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),se(),e(document).on("keyup",".wc_email",function(){se(e(this))}),C&&e("#wpdcom").length){if(e("#wpd-bubble-wrapper").hover(function(){e(this).addClass("wpd-bubble-hover")},function(){e(this).removeClass("wpd-bubble-hover")}),y&&!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*O)},1e3*y),"content_left"===I)if(e(".entry-content").length){var de=(ce=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?ce:25;e("#wpd-bubble-wrapper").css({left:de+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){de=(ce=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?ce:25;e("#wpd-bubble-wrapper").css({left:de+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var ce;de=(ce=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?ce:25;e("#wpd-bubble-wrapper").css({left:de+"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"===I?(e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===I&&(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(){oe(),e("#tab-title-reviews").length&&e("#tab-title-reviews a").trigger("click"),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-(D+28)},1e3,function(){ne(),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"),G(!0);var a=t.match(/#comment\-(\d+)/);M=M.filter(function(e){return e!=a[1]}),e("#wpd-bubble-count .wpd-new-comments-count").text(M.length),0==M.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),e(document).on("click","#wpd-bubble-count",function(){if(M.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",M.join()),he(x,!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}),X(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),M=[],e(".wpd-new-loaded-comment").length&&(oe(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-(D+28)},1e3,ne)),fe(t)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,a){console.log(a)})}})}if((C&&k||c)&&(t||!t&&r)&&setTimeout(function t(){e.ajax({type:"GET",url:wpdiscuzAjaxObj.bubbleUpdateUrl,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",wpdiscuzAjaxObj.restNonce)},data:{postId:s,lastId:m,visibleCommentIds:te()}}).done(function(a){if(!L)if("object"==typeof a){if(a.commentIDsToRemove.forEach(function(t){e("[id^=wpd-comm-"+t+"]").remove()}),a.ids.length){c&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",l),i.append("visibleCommentIds",te()),he(x,!1,i).done(function(t){L||"object"==typeof t&&t.success&&(X(t),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),l=t.data.loadLastCommentId)}).fail(function(e,t,a){console.log(a)})),a.ids=a.ids.filter(function(t){if(!e("#comment-"+t).length)return t});var o=5e3;m=parseInt(a.ids[a.ids.length-1]),M=M.concat(a.ids),A&&a.commentText&&(e("#wpd-bubble-author-avatar").html(a.avatar),e("#wpd-bubble-author-name").html(a.authorName),e("#wpd-bubble-comment-date span").html(a.commentDate),e("#wpd-bubble-comment-text").html(a.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",a.commentLink),e("#wpd-bubble-notification-message").show(),o=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=a.ids.length,e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),e("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout(function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")},o),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}a.all_comments_count=parseInt(a.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(a.all_comments_count_bubble_html),e(".wpd-thread-info").html(a.all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.all_comments_count)}else console.log(a);var i;setTimeout(t,p)}).fail(function(e,a,o){console.log(o),setTimeout(t,p)})},p),e(".wpd-inline-form-wrapper").length){var pe=new FormData;pe.append("action","wpdGetInlineCommentForm"),he(x,!1,pe).done(function(t){"object"==typeof t?t.success?(e(".wpd-inline-form-wrapper").append(t.data),e.each(e("[name=_wpd_inline_nonce]"),function(){var t=e(this).attr("id"),a=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+a.substring(a.lastIndexOf("-")+1))}),e(".wpd-inline-opened").addClass("wpd-active"),e(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),e(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),e(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),we()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data]),t.data,"error"):console.log(t)}).fail(function(e,t,a){console.log(a)})}function re(t){if(e(t).hasClass("wpd-inline-shortcode"))var a=e(t).attr("id");else a=e(t).parents(".wpd-inline-shortcode").attr("id");return a.substring(a.lastIndexOf("-")+1)}function le(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function me(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var t=e(this),a=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&a>0&&a<300&&("blink"===T?(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"),we(t.siblings(".wpd-inline-form-wrapper"))))})}function we(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(a=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var a;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(a=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}}else e.each(e(".wpd-inline-form-wrapper:visible"),function(){if(e(this).offset().left<=10)e(this).css("left",Math.ceil(parseInt(e(this).css("left"))-e(this).offset().left+10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))<3&&(t=3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;");else if(e(this).offset().left+e(this).width()>document.body.clientWidth-10){var t;e(this).css("left",Math.ceil(parseInt(e(this).css("left"))+(document.body.clientWidth-(e(this).offset().left+e(this).width()))-10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))>e(this).width()-3&&(t=e(this).width()-3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;")}})}function ue(t){var a,o=0;if(t.parents(".wpd_main_comm_form").length)o=parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents(".wpd_main_comm_form");else if(t.parents(".wpd-secondary-form-wrapper").length)o=parseInt(wpdiscuzAjaxObj.replyTextMaxLength),a=t.parents(".wpd-secondary-form-wrapper");else if(t.parents("#wpdiscuz-edit-form").length){var n=Y(t);o=parseInt(n.substring(n.lastIndexOf("_")+1))?parseInt(wpdiscuzAjaxObj.replyTextMaxLength):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents("#wpdiscuz-edit-form")}if(o&&a){var i=t.val().length,s=e(".wpd-editor-char-counter",a),d=o-i;s.html(d),d<=10?s.addClass("error"):s.removeClass("error")}}function fe(t,a,o,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,a,o,n):console.log(t.data.callbackFunctions[e]+" is not a function")})}function he(t,a,o){a&&e("#wpdiscuz-loading-bar").show(),o.append("postId",s),o.append("wpdiscuz_nonce",d);var n=o.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(o=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](o,t,a))});var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:o,contentType:!1,processData:!1})}e(document).on("click","body",function(t){if(e(t.target).hasClass("wpd-inline-form-close")||e(t.target).parents(".wpd-inline-form-close").length)t.preventDefault(),e(t.target).parents(".wpd-inline-form-wrapper").hide(),e(t.target).parents(".wpd-inline-shortcode").removeClass("wpd-active"),e(t.target).parents(".wpd-inline-form-wrapper").siblings(".wpd-inline-icon").removeClass("wpd-open");else if(!e(t.target).hasClass("wpd-inline-form-wrapper")&&!e(t.target).parents(".wpd-inline-form-wrapper").length){le();var a="";e(t.target).hasClass("wpd-inline-icon")?a=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(a=e(t.target).parents(".wpd-inline-icon")),a.length&&a.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(a.parents(".wpd-inline-shortcode").addClass("wpd-active"),a.siblings(".wpd-inline-form-wrapper").show(),a.addClass("wpd-open"),a.removeClass("wpd-ignored"),we(a.siblings(".wpd-inline-form-wrapper")))}(!e(t.target).hasClass("wpd-last-inline-comments-wrapper")&&!e(t.target).parents(".wpd-last-inline-comments-wrapper").length||e(t.target).parents(".wpd-last-inline-comments-wrapper").length&&e(t.target).hasClass("wpd-load-inline-comment"))&&e(".wpd-last-inline-comments-wrapper").remove()}),e(document).on("click",".wpd-inline-submit.wpd_not_clicked",function(t){t.preventDefault();var a=e(this),o=e(this).parents(".wpd_inline_comm_form");if(o[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",re(o)),e.each(e("input, textarea",o),function(t,a){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(a).attr("name"),e(a).val()):n.append(e(a).attr("name"),e(a).val())}),he(x,!0,n).done(function(t){if(a.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){o[0].reset(),le();var n=parseInt(t.data.newCount),i=a.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),e(".wpd-thread-info").attr("data-comments-count",t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.message&&ie(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data,a),"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("keydown",".wpd-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_comm_submit").trigger("click")}),e(document).on("keydown","#wpdiscuz-edit-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_save_edited_comment").trigger("click")}),e(document).on("keydown",".wpd-inline-comment-content",function(t){t.ctrlKey&&13==t.keyCode&&e(this).parents(".wpd_inline_comm_form").find(".wpd-inline-submit.wpd_not_clicked").trigger("click")}),e(document).on("click",".wpd-inline-icon-count.wpd-has-comments",function(){var t=e(this),a=new FormData;a.append("action","wpdGetLastInlineComments"),a.append("inline_form_id",re(t)),he(x,!0,a).done(function(a){"object"==typeof a?a.success?e(a.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-view-all-inline-comments",function(t){t.preventDefault(),e(this).parents(".wpd-last-inline-comments-wrapper").remove(),e(".wpdf-inline").hasClass("wpdf-active")||e(".wpdf-inline").trigger("click"),oe(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-D},1e3,ne)}),e(document).on("click",".wpd-feedback-content-link",function(t){t.preventDefault();var a=e(this).data("feedback-content-id");oe(),e("html, body").animate({scrollTop:e("#wpd-inline-"+a).offset().top-(D+6)},1e3,function(){ne(),e("#wpd-inline-"+a).addClass("wpd-active")})}),"scroll_open"!==T&&"blink"!==T||(me(),e(window).on("scroll",me)),e(document).on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var t=new FormData,a=e(this).index();a>=0&&a<5&&(t.append("action","wpdUserRate"),t.append("rating",a+1),he(x,!0,t).done(function(t){"object"==typeof t?t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data),"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))}),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){t.preventDefault();var a,o,i=e(this);if(i[0].checkValidity()&&(a=i,o=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).val().length?(o=!1,e(".wpdiscuz-recaptcha",a).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&e(".wpdiscuz-recaptcha",a).css("border","none"),o)){var s=new FormData;s.append("action","wpdAddSubscription"),e("*",i).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&s.append(this.name+"",e(this).val()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&s.append(this.name+"",e(this).val())}),he(x,!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),L=!1}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wpd-unsubscribe",function(t){t.preventDefault();var a=new FormData;a.append("action","wpdUnsubscribe"),a.append("sid",e(this).data("sid")),a.append("skey",e(this).data("skey")),he(x,!0,a).done(function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250),L=!1}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=he});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,a){var o="wpdiscuz-message-error";if(e instanceof Array)for(var n in e)t instanceof Array?"success"===t[n]?o="wpdiscuz-message-success":"warning"===t[n]&&(o="wpdiscuz-message-warning"):"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e[n]).prependTo("#wpdiscuz-comment-message").delay(a instanceof Array?a[n]:a||4e3).fadeOut(1e3,function(){jQuery(this).remove()});else"success"===t?o="wpdiscuz-message-success":"warning"===t&&(o="wpdiscuz-message-warning"),jQuery("<div/>").addClass(o).html(e).prependTo("#wpdiscuz-comment-message").delay(a||4e3).fadeOut(1e3,function(){jQuery(this).remove()})},wpdiscuzAjaxObj.applyFilterOnPhrase=function(e,t,a){return wpdiscuzAjaxObj.phraseFilters&&jQuery.each(wpdiscuzAjaxObj.phraseFilters,function(o){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]]&&(e=wpdiscuzAjaxObj[wpdiscuzAjaxObj.phraseFilters[o]](e,t,a))}),e},jQuery(document).ready(function(e){e("body").addClass("wpdiscuz_"+wpdiscuzAjaxObj.version);var t=wpdiscuzAjaxObj.is_user_logged_in,a=1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!t,o=1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&t,n=wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion,i=parseInt(wpdiscuzAjaxObj.commentListLoadType),s=parseInt(wpdiscuzAjaxObj.wc_post_id);wpdiscuzAjaxObj.wpdiscuz_nonce="";var 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=parseInt(wpdiscuzAjaxObj.wordpressIsPaginate),f=wpdiscuzAjaxObj.storeCommenterData,h=parseInt(wpdiscuzAjaxObj.wmuEnabled),b=wpdiscuzAjaxObj.isCookiesEnabled,_=!0,g=wpdiscuzAjaxObj.cookiehash,z=parseInt(wpdiscuzAjaxObj.isLoadOnlyParentComments),j=parseInt(wpdiscuzAjaxObj.enableDropAnimation)?500:0,v=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),x=parseInt(wpdiscuzAjaxObj.enableBubble),C=parseInt(wpdiscuzAjaxObj.bubbleLiveUpdate),k=parseInt(wpdiscuzAjaxObj.bubbleHintTimeout),y=parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout)?parseInt(wpdiscuzAjaxObj.bubbleHintHideTimeout):5,O=parseInt(wpdiscuzAjaxObj.bubbleShowNewCommentMessage),A=wpdiscuzAjaxObj.bubbleLocation,I=wpdiscuzAjaxObj.inlineFeedbackAttractionType,T=(T=parseInt(wpdiscuzAjaxObj.scrollSize))||32,D=[],F=[],E=[],M=!1,L=1,R=e("html").css("scroll-behavior"),S=e("body").css("scroll-behavior");(e(".wc_social_plugin_wrapper .wp-social-login-provider-list").length?e(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .the_champ_login_container").length?e(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .social_connect_form").length?e(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"):e(".wc_social_plugin_wrapper .oneall_social_login_providers").length&&e(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wpd-form-wrapper > .wpd-secondary-forms-social-content"),wpdiscuzLoadRichEditor&&e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0"),window.addEventListener("beforeunload",function(t){var a=e(".wpd-form").not(":hidden");if(a.length)if(wpdiscuzLoadRichEditor){for(var o=0;o<a.length;o++)if("\n"!==wpDiscuzEditor.createEditor(e(a[o]).find(".ql-container").attr("id")).getText())return t.preventDefault(),void(t.returnValue="")}else for(o=0;o<a.length;o++)if(e(a[o]).find(".wc_comment").val())return t.preventDefault(),void(t.returnValue="")}),wpdiscuzLoadRichEditor||(e(document).delegate("textarea.wc_comment","input",function(){we(e(this))}),e.each(e("textarea.wc_comment"),function(){we(e(this))})),e(document).on("focus","#wpdcom .ql-editor, #wpdcom .wc_comment",function(){e(".wpd-form-foot",e(this).parents(".wpd_comm_form")).slideDown(j)}),e(document).on("focus","#wpdcom textarea",function(){e(this).next(".autogrow-textarea-mirror").length||e(this).autoGrow()}),t)||U({comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)});if(e(".wpd-vote-down.wpd-dislike-hidden").remove(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd"),e(document).on("click","#wpd-editor-source-code-wrapper-bg",function(){e(this).hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")}),wpdiscuzLoadRichEditor&&e(document).on("click","#wpd-insert-source-code",function(){var t=wpDiscuzEditor.createEditor("#"+e("#wpd-editor-uid").val());t.deleteText(0,t.getLength(),Quill.sources.USER);var a=e("#wpd-editor-source-code").val();a.length&&t.clipboard.dangerouslyPasteHTML(0,a,Quill.sources.USER),t.update(),e("#wpd-editor-source-code-wrapper-bg").hide(),e("#wpd-editor-source-code-wrapper").hide(),e("#wpd-editor-uid").val(""),e("#wpd-editor-source-code").val("")}),e(document).on("click",".wpd-reply-button",function(){var i=X(e(this),0);e(this).hasClass("wpdiscuz-clonned")?(wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+i).focus()},j):setTimeout(function(){e("#wc-textarea-"+i).trigger("focus")},j),e("#wpd-secondary-form-wrapper-"+i).slideToggle(j)):function(a){var o=X(a,0);e("#wpdiscuz_form_anchor-"+o).before(function(t){return e("#wpdiscuz_hidden_secondary_form").html().replace(/wpdiscuzuniqueid/g,t)}(o));var n=e("#wpd-secondary-form-wrapper-"+o);if(!t){var i={comment_author:Cookies.get("comment_author_"+g),comment_author_email:Cookies.get("comment_author_email_"+g),comment_author_url:Cookies.get("comment_author_url_"+g)};U(i)}wpdiscuzLoadRichEditor?setTimeout(function(){wpDiscuzEditor.createEditor("#wpd-editor-"+o).focus()},j):setTimeout(function(){e("#wc-textarea-"+o).trigger("focus")},j);n.slideToggle(j,function(){a.addClass("wpdiscuz-clonned")})}(e(this)),function(t){if((a||o)&&"2.0"===n){var i=Y(t);setTimeout(function(){if(!F[i])try{F[i]=grecaptcha.render("wpdiscuz-recaptcha-"+t,{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(a){e("#wpdiscuz-recaptcha-field-"+t).val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-"+t).val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3)}}(i)}),e(document).on("click","#wpdcom .wpd-comment-link [data-comment-url]",function(){var t=e(this).data("comment-url"),a=e("<input/>");a.appendTo("body").css({position:"absolute",top:"-10000000px"}).val(t),a.trigger("select"),document.execCommand("copy"),a.remove(),wpdiscuzAjaxObj.setCommentMessage(t+"<br/>"+wpdiscuzAjaxObj.wc_copied_to_clipboard,"success",5e3)}),e(document).on("click",".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wpd-load-more-submit",function(e){e.preventDefault()}),e(document).on("click",".wpd-toggle.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked");var a=X(e(this),0),o=e(this),n=e(".fas",o);!o.parents(".wpd-comment:not(.wpd-reply)").children(".wpd-reply").length&&z?function(t,a){var o=Y(t),n=new FormData;n.append("action","wpdShowReplies"),n.append("commentId",o),fe(v,!0,n).done(function(o){a.addClass("wpd_not_clicked"),"object"==typeof o&&o.success&&(e("#wpd-comm-"+t).replaceWith(o.data.comment_list),e("#wpd-comm-"+t+" .wpd-toggle .fas").removeClass("fa-chevron-down").addClass("fa-chevron-up"),e("#wpd-comm-"+t+" .wpd-toggle .wpd-view-replies .wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),e("#wpd-comm-"+t+" .wpd-toggle").attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text),ue(o)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,o,n){console.log(n),a.addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}(a,t):e("#wpd-comm-"+a+"> .wpd-reply").slideToggle(700,function(){e(this).is(":hidden")?(n.removeClass("fa-chevron-up"),n.addClass("fa-chevron-down"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_show_replies_text),o.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_show_replies_text)):(n.removeClass("fa-chevron-down"),n.addClass("fa-chevron-up"),o.find(".wpd-view-replies-text").text(wpdiscuzAjaxObj.wc_hide_replies_text),o.attr("wpd-tooltip",wpdiscuzAjaxObj.wc_hide_replies_text)),t.addClass("wpd_not_clicked")})}),e(document).on("mouseenter",".wpd-new-loaded-comment",function(){e(this).removeClass("wpd-new-loaded-comment")}),e(document).on("click",".wpd-sbs-toggle",function(){e(".wpdiscuz-subscribe-bar").slideToggle(j)}),parseInt(wpdiscuzAjaxObj.wpDiscuzIsShowOnSubscribeForm)&&!t&&wpdiscuzAjaxObj.wpDiscuzReCaptchaSK&&e("#wpdiscuz-subscribe-form").length&&("2.0"===n?(setTimeout(function(){try{grecaptcha.render("wpdiscuz-recaptcha-subscribe-form",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val("key")},"expired-callback":function(){e("#wpdiscuz-recaptcha-field-subscribe-form").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}},1e3),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){e("#wpdiscuz-recaptcha-field-subscribe-form").val()?e(".wpdiscuz-recaptcha",e(this)).css("border","none"):(e(".wpdiscuz-recaptcha",e(this)).css("border","1px solid red"),t.preventDefault())})):"3.0"===n&&e(document).on("click","#wpdiscuz_subscription_button",function(t){var a=e(this).parents("#wpdiscuz-subscribe-form");t.preventDefault();try{grecaptcha.ready(function(){grecaptcha.execute(wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,{action:"wpdiscuz/wpdAddSubscription"}).then(function(e){console.log(5555),document.getElementById("wpdiscuz-recaptcha-field-subscribe-form").value=e,a.trigger("submit")},function(e){wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error","error"),console.log(e)})})}catch(t){console.log(t),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+t.message,"error")}})),(a||o)&&"2.0"===n){var P=e(window).width(),q=e("#wpdcom").width();q>=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%"})),q>=940&&q<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%"})),q>=810&&q<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%"})),q>=730&&q<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%"})),q>=610&&q<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%"})),P>650&&(q>=510&&q<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"})),q>=470&&q<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"})),q<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,a,o){fe(v||h,!1,a).done(function(a){if(e(o).addClass("wpd_not_clicked"),"object"==typeof a)if(a.success){"collapsed"===wpdiscuzAjaxObj.commentFormView&&e(".wpd-form-foot",t).slideUp(j),a.data.wc_all_comments_count_new=parseInt(a.data.wc_all_comments_count_new),e(".wpd-thread-info").html(a.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(a.data.wc_all_comments_count_bubble_html);var n=j;a.data.is_main?ne(a.data.message):(n=j+700,e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).slideToggle(700),1==a.data.is_in_same_container?e("#wpd-secondary-form-wrapper-"+a.data.uniqueid).after(a.data.message):e("#wpd-comm-"+a.data.uniqueid).after(a.data.message)),function(e){if(!e.data.held_moderate){var t=new FormData;t.append("action","wpdCheckNotificationType"),t.append("comment_id",e.data.new_comment_id),t.append("email",e.data.comment_author_email),t.append("isParent",e.data.is_main),fe(v,!0,t)}}(a),function(e){if(e.data.redirect>0&&e.data.new_comment_id){var t=new FormData;t.append("action","wpdRedirect"),t.append("commentId",e.data.new_comment_id),fe(v,!0,t).done(function(e){"object"==typeof e&&e.success&&setTimeout(function(){location.href=e.data},2e3)}).fail(function(e,t,a){console.log(a)})}}(a),b&&_?function(t){var a=t.comment_author_email,o=t.comment_author,n=t.comment_author_url;null==f?(Cookies.set("comment_author_email_"+g,a),Cookies.set("comment_author_"+g,o),n.length&&Cookies.set("comment_author_url_"+g,n)):(f=parseInt(f),Cookies.set("comment_author_email_"+g,a,{expires:f,path:"/"}),Cookies.set("comment_author_"+g,o,{expires:f,path:"/"}),n.length&&Cookies.set("comment_author_url_"+g,n,{expires:f,path:"/"}));e(".wpd-cookies-checkbox").length&&e(".wpd-cookies-checkbox").prop("checked",!0)}(a.data):_||e(".wpd-cookies-checkbox").prop("checked",!1),t.get(0).reset(),wpdiscuzLoadRichEditor?wpDiscuzEditor.createEditor("#wpd-editor-"+e(".wpdiscuz_unique_id",t).val()).setContents([{insert:"\n"}]):we(t.find(".wc_comment")),U(a.data),e(".wmu-preview-wrap",t).remove(),D.length&&(D.forEach(function(e){e.parents(".wpd-field-checkbox").remove()}),D=[]),parseInt(wpdiscuzAjaxObj.scrollToComment)&&setTimeout(function(){ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.new_comment_id).offset().top-T},1e3,oe)},n),ue(a,t)}else a.data&&(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"),ue(a,t));else wpdiscuzAjaxObj.setCommentMessage(a,"error");e("#wpdiscuz-loading-bar").fadeOut(250),M=!1}).fail(function(t,a,n){console.log(n),e(o).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}function U(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 W(t,a){e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").show(),e("#wpd-comm-"+t+" .wpdiscuz-edit-form-wrap").replaceWith(a),e("#wpd-comm-"+t+" > .wpd-comment-wrap .wpd-comment-last-edited").show()}e(document).on("click",".wc_comm_submit.wpd_not_clicked",function(){var i=e(this),s=1,d=e(this).parents("form");if(d.hasClass("wpd_main_comm_form")||(s=function(t){var a=t.attr("class").split(" "),o="";return e.each(a,function(e,t){"wpd_comment_level"===J(t,!1)&&(o=J(t,!0))}),parseInt(o)+1}(e(this).parents(".wpd-comment"))),te(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)){M=!0,function(t){e(".wpd-agreement-checkbox",t).each(function(){e(this).hasClass("wpd_agreement_hide")&&b&&e(this).prop("checked")&&(Cookies.set(e(this).attr("name")+"_"+g,1,{expires:30,path:"/"}),e("input[name="+e(this).attr("name")+"]").each(function(){D.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")||(_=!1):t&&(_=!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((a||o)&&"2.0"===n){var t=Y(e);grecaptcha.reset(F[t])}}(e(".wpdiscuz_unique_id",d).val()),e(".wpdiscuz_reset").val("")}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj.wc_msg_required_fields,"wc_msg_required_fields",d),"error")}),e(document).on("click",".wpd_editable_comment",function(){w&&e(".wpdiscuz-edit-form-wrap").length&&W(X(e(".wpdiscuz-edit-form-wrap"),0),w);var t=e(this),a=X(t,0),o=Y(a),n=new FormData;n.append("action","wpdEditComment"),n.append("commentId",o),w=e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-text").get(0),fe(v,!0,n).done(function(o){if("object"==typeof o)if(o.success){if(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text").replaceWith(o.data.html),wpdiscuzLoadRichEditor){var n=wpDiscuzEditor.createEditor("#wpd-editor-edit_"+a);n.clipboard.dangerouslyPasteHTML(0,o.data.content),n.update(),e(".wpd-toolbar-hidden").prev("[id^=wpd-editor-]").css("border-bottom","1px solid #dddddd")}else e("#wc-textarea-edit_"+a).val(o.data.content),we(e("#wc-textarea-edit_"+a));e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd_editable_comment").hide(),e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").hide()}else wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[o.data],o.data,t),"error");else console.log(o);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wc_save_edited_comment",function(){var t=e(this),a=X(t),o=Y(a),n=e("#wpd-comm-"+a+" #wpdiscuz-edit-form");if(te(n,"#wpd-editor-edit_"+a),n.on("submit",function(e){e.preventDefault()}),n[0].checkValidity()){var i=new FormData;i.append("action","wpdSaveEditedComment"),i.append("commentId",o),e(":input",n).each(function(){""!==this.name&&"checkbox"!==this.type&&"radio"!==this.type&&i.append(this.name+"",e(this).val()),"checkbox"!==this.type&&"radio"!==this.type||e(this).is(":checked")&&i.append(this.name+"",e(this).val())}),fe(v,!0,i).done(function(n){"object"==typeof n?(n.success?(W(a,n.data.message),n.data.lastEdited&&(e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-last-edited").remove(),e(n.data.lastEdited).insertAfter("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-right .wpd-comment-text")),n.data.twitterShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_tw").attr("href",n.data.twitterShareLink),n.data.whatsappShareLink&&e("#wpd-comm-"+a+" > .wpd-comment-wrap .wpd-comment-share .wpd-tooltip-content .wc_whatsapp").attr("href",n.data.whatsappShareLink),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error"),ue(n,o)):console.log(n),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wc_cancel_edit",function(){var t=X(e(this));W(t,w),wpdiscuzLoadRichEditor&&wpDiscuzEditor.removeEditor("#wpd-editor-edit_"+t)}),!u&&m&&(L=0,1==m?setTimeout(function(){B(!0)},500):e(document).on("click",".wpd-load-comments",function(){e(this).parent(".wpd-load-more-submit-wrap").remove(),B(!0)})),e(document).on("click",".wpd-load-more-submit",function(){var t=e(this);t.hasClass("wpd-loaded")&&B(!1,t,"wpd-loaded","wpd-loading")});var N=!1;function V(){var t=e("#wpdiscuzHasMoreComments").val(),a=e(document).height(),o=e(window).height()+e(window).scrollTop();a&&o&&(100*o/a>=80&&!1===N&&1==t&&(N=!0,B(!1,e(".wpd-load-more-submit"))))}function B(t,a,o,n){a&&(a.toggleClass(o),a.toggleClass(n));var s=new FormData;s.append("action","wpdLoadMoreComments");var d=e(".wpdiscuz-sort-button-active").attr("data-sorting");d&&s.append("sorting",d),s.append("offset",L),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||""),fe(v,!t||1!=m,s).done(function(s){"object"==typeof s&&s.success&&(L++,t&&e(".wpd-comment").remove(),e(".wpdiscuz_single").remove(),e(".wpdiscuz-comment-pagination").before(s.data.comment_list),K(s,t&&2!==i),N=!1,s.data.loadLastCommentId&&(r=s.data.loadLastCommentId),ue(s),t&&Q(!1)),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))}).fail(function(t,i,s){console.log(s),e("#wpdiscuz-loading-bar").fadeOut(250),e(".wpd-load-more-submit").blur(),a&&(a.toggleClass(o),a.toggleClass(n))})}function K(t,a){var o;0==t.data.is_show_load_more?(e("#wpdiscuzHasMoreComments").val(0),e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()):(o=t.data.last_parent_id,e(".wpd-load-more-submit").attr("data-lastparentid",o),2!==i&&e(".wpdiscuz-comment-pagination").show(),e("#wpdiscuzHasMoreComments").val(1),a&&e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").show()),ue(t)}function Q(t){var a=location.href.match(/#comment\-(\d+)/);if(null!==a){var o=a[1];if(e("#comment-"+o).length)setTimeout(function(){ae(),e("html, body").animate({scrollTop:e("#comment-"+o).parents("[id^=wpd-comm-]").offset().top-T},1e3,oe),t&&G(o)},500);else{var n=new FormData;n.append("action","wpdGetSingleComment"),n.append("commentId",o),fe(v,!0,n).done(function(a){if("object"==typeof a&&a.success){var n="#comment-"+o;e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e(n).offset().top-T},1e3,oe),t&&G(o)}e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}}function G(t){setTimeout(function(){e("#comment-"+t).siblings(".wpd-secondary-form-wrapper").is(":visible")||e("#comment-"+t).find(".wpd-reply-button").trigger("click")},1100)}function $(e){if(void 0!==e.data.message)for(var t,a=e.data.message,o=0;o<a.length;o++)Z((t=a[o]).comment_parent,t.comment_html)}function X(e,t){var a="";return(a=t?e.parents(".wpd-main-form-wrapper").attr("id"):e.parents(".wpd-comment").attr("id")).substring(a.lastIndexOf("-")+1)}function Y(e){return e.substring(0,e.indexOf("_"))}function J(e,t){return t?e.substring(e.indexOf("-")+1):e.substring(0,e.indexOf("-"))}function Z(t,a){if(0==t)ne(a);else{var o=X(e("#comment-"+t),0);e("#wpdiscuz_form_anchor-"+o).after(a)}}function ee(){var t=[];return e(".wpd-comment-right").each(function(){t.push(Y(X(e(this),0)))}),t.join(",")}function te(t,a){var o=t.find(".wpd-required-group");wpdiscuzLoadRichEditor&&t.find(".wc_comment").val(e(a+">.ql-editor").html()),function(e){var t=e.find(".wc_comment"),a=t.val().trim().replace(/<p><br><\/p>/g,"\n").replace(/<p>(.*?)<\/p>/g,"$1\n");a=(a=(a=(a=a.replace(/<img src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img[^>]+alt=["|']([^"|']+)["|'][^>]+src=["|']https\:\/\/s\.w\.org\/images\/core\/emoji\/([^"|']+)["|'][^>]?>/g," $1 ")).replace(/<img\s+([^>]*)class=["|']wpdem\-sticker["|'](.*?)alt=["|']([^"|']+)["|'](.*?)[^>]*>/g," $3 ")).replace(/<img\s+([^>]*)src=["|']([^"|']+)["|'](.*?)[^>]*>/g," $2 "),t.val(a)}(t),e.each(o,function(){e("input",this).prop("required",!1),0===e("input:checked",this).length?e("input",e(this)).prop("required",!0):e(".wpd-field-invalid",this).remove()})}function ae(){e("html, body").css("scroll-behavior","unset")}function oe(){e("html").css("scroll-behavior",R),e("body").css("scroll-behavior",S)}function ne(t){e(".wpd-sticky-comment").last()[0]?e(t).insertAfter(e(".wpd-sticky-comment").last()[0]):e(".wpd-thread-list").prepend(t)}function ie(t){t?t.prop("required")||(t.val()?t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):t.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none")):e.each(e(".wc_email"),function(t,a){var o=e(a);o.prop("required")||(o.val()?o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","inline-block"):o.parents("form").find("[name=wpdiscuz_notification_type]").parent().css("display","none"))})}if(2!==i||u||(e(".wpd-load-more-submit").parents(".wpdiscuz-comment-pagination").hide(),V(),e(window).scroll(function(){V()})),wpdiscuzAjaxObj.setLoadMoreVisibility=K,e(document).on("click",".wpd-vote-up.wpd_not_clicked, .wpd-vote-down.wpd_not_clicked",function(){var t=e(this);e(t).removeClass("wpd_not_clicked");var a,o=Y(X(t));a=e(this).hasClass("wpd-vote-up")?1:-1;var n=new FormData;n.append("action","wpdVoteOnComment"),n.append("commentId",o),n.append("voteType",a),fe(v,!0,n).done(function(n){if(e(t).addClass("wpd_not_clicked"),"object"==typeof n){if(n.success){if("total"===n.data.buttonsStyle){var i=e(".wpd-comment-footer .wpd-vote-result",e("#comment-"+o)),s=n.data.votes;i.text(n.data.votesHumanReadable),i.attr("title",s),i.removeClass("wpd-up wpd-down"),s>0&&i.addClass("wpd-up"),s<0&&i.addClass("wpd-down")}else{var d=e(".wpd-comment-footer .wpd-vote-result-like",e("#comment-"+o)),c=e(".wpd-comment-footer .wpd-vote-result-dislike",e("#comment-"+o));d.text(n.data.likeCountHumanReadable),d.attr("title",n.data.likeCount),c.text(n.data.dislikeCountHumanReadable),c.attr("title",n.data.dislikeCount),parseInt(n.data.likeCount)>0?d.addClass("wpd-up"):d.removeClass("wpd-up"),parseInt(n.data.dislikeCount)<0?c.addClass("wpd-down"):c.removeClass("wpd-down")}var p=e(".wpd-comment-footer .wpd-vote-up",e("#comment-"+o)),r=e(".wpd-comment-footer .wpd-vote-down",e("#comment-"+o));p.removeClass("wpd-up"),r.removeClass("wpd-down"),n.data.curUserReaction>0?p.addClass("wpd-up"):n.data.curUserReaction<0&&r.addClass("wpd-down")}else n.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[n.data],n.data,t),"error");ue(n,o,a)}else console.log(n);e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,o,n){console.log(n),e(t).addClass("wpd_not_clicked"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click","body",function(t){var a=e(".wpdiscuz-sort-buttons");e(t.target).hasClass("wpdf-sorting")||e(t.target).parent().hasClass("wpdf-sorting")?a.css({display:a.is(":visible")?"none":"flex"}):a.hide()}),e(document).on("click",".wpdiscuz-sort-button:not(.wpdiscuz-sort-button-active)",function(){var t=e(this),a=e(this).attr("data-sorting");if(a){e(".wpdiscuz-sort-button.wpdiscuz-sort-button-active").removeClass("wpdiscuz-sort-button-active").appendTo(".wpdiscuz-sort-buttons"),t.addClass("wpdiscuz-sort-button-active").prependTo(".wpdf-sorting");var o=new FormData;o.append("action","wpdSorting"),o.append("sorting",a);var n=e(".wpdf-active").attr("data-filter-type");o.append("wpdType",n||""),fe(v,!0,o).done(function(t){"object"==typeof t&&t.success&&(e("#wpdcom .wpd-comment").remove(),e("#wpdcom .wpd-thread-list").prepend(t.data.message),K(t,!1),L=1),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),window.onhashchange=function(){Q(!1)},1!=m&&Q(!1),e(document).on("click",".wpdiscuz-readmore",function(){var t=X(e(this)),a=Y(t),o=new FormData;o.append("action","wpdReadMore"),o.append("commentId",a),fe(v,!0,o).done(function(o){"object"==typeof o?(o.success?(e("#comment-"+a+" .wpd-comment-text").replaceWith(" "+o.data.message),e("#wpdiscuz-readmore-"+t).remove()):console.log(o.data),ue(o)):console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("change",".wpd-required-group",function(){0!==e("input:checked",this).length?e("input",e(this)).prop("required",!1):e("input",e(this)).prop("required",!0)}),e(document).on("click",".wpdiscuz-spoiler",function(){e(this).next().slideToggle(),e(this).hasClass("wpdiscuz-spoiler-closed")?e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-plus").removeClass("fa-plus").addClass("fa-minus"):e(this).parents(".wpdiscuz-spoiler-wrap").find(".fa-minus").removeClass("fa-minus").addClass("fa-plus"),e(this).toggleClass("wpdiscuz-spoiler-closed")}),e(document).on("click",".wpd-tools i",function(){var t=e(this).siblings(".wpd-tools-actions");t.is(":visible")||e(this).parents(".wpd-comment-right").attr("id")!==e("[id^=comment-]","#wpdcom").last().attr("id")||e("#comments").css({paddingBottom:"160px"}),t.css({display:t.is(":visible")?"none":"flex"})}),e(document).on("mouseleave",".wpd-comment-right",function(){e(this).find(".wpd-tools-actions").hide(),e("#comments").css({paddingBottom:"0"})}),e(document).on("click",".wpd_stick_btn",function(){var t=Y(X(e(this),0)),a=new FormData;a.append("action","wpdStickComment"),a.append("commentId",t),fe(v,!0,a).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd_close_btn",function(){var t=Y(X(e(this),0)),a=new FormData;a.append("action","wpdCloseThread"),a.append("commentId",t),fe(v,!0,a).done(function(t){"object"==typeof t&&t.success&&location.reload(!0),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-filter.wpd_not_clicked[data-filter-type]",function(){var t=e(this),a=t.attr("data-filter-type");wpdiscuzAjaxObj.resetActiveFilters(".wpdf-"+a),t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var o=new FormData;o.append("action","wpdLoadMoreComments");var n=e(".wpdiscuz-sort-button-active").attr("data-sorting");n&&o.append("sorting",n),o.append("lastParentId",0),o.append("offset",0),L=1,o.append("wpdType",t.hasClass("wpdf-active")?"":a),o.append("isFirstLoad",1),e(this).hasClass("wpdf-inline")?e(this).hasClass("wpdf-active")?e(".wpd-comment-info-bar").hide():e(".wpd-comment-info-bar").css("display","flex"):e(".wpd-comment-info-bar").hide(),fe(v,!1,o).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(t.toggleClass("wpdf-active"),e(".wpd-load-comments").remove(),e(".wpd-comment").remove(),e(".wpd-thread-list").prepend(a.data.comment_list),K(a),r=a.data.loadLastCommentId,e(".wpd-load-more-submit").blur(),ue(a)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpdf-reacted.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdMostReactedComment"),fe(v,!1,a).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.parentCommentID).length?e("#comment-"+a.data.parentCommentID).parents("[id^=wpd-comm-"+a.data.parentCommentID+"]").replaceWith(a.data.message):e("#comment-"+a.data.commentId).length||e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-T},1e3,oe))}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")})}),e(document).on("click",".wpdf-hottest.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=new FormData;a.append("action","wpdHottestThread"),fe(v,!1,a).done(function(a){t.addClass("wpd_not_clicked"),e(".fas",t).removeClass("fa-pulse fa-spinner"),"object"==typeof a&&a.success&&(e("#comment-"+a.data.commentId).length?e("#comment-"+a.data.commentId).parents("[id^=wpd-comm-"+a.data.commentId+"]").replaceWith(a.data.message):e(".wpd-thread-list").prepend(a.data.message),ue(a),ae(),e("html, body").animate({scrollTop:e("#comment-"+a.data.commentId).offset().top-T},1e3,oe))}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner")})}),e(document).on("click",".wpd-filter-view-all",function(){e(".wpdf-inline.wpdf-active.wpd_not_clicked").trigger("click")}),e(document).on("click",".wpd-follow-link.wpd_not_clicked",function(){var t=e(this);t.removeClass("wpd_not_clicked"),e(".fas",t).addClass("fa-pulse fa-spinner");var a=Y(X(t,0)),o=new FormData;o.append("action","wpdFollowUser"),o.append("commentId",a),fe(v,!0,o).done(function(a){t.addClass("wpd_not_clicked"),"object"==typeof a?a.success?(wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data.code],a.data.code,t),"success"),t.removeClass("wpd-follow-active"),a.data.followTip&&t.attr("wpd-tooltip",a.data.followTip),a.data.followClass&&t.addClass(a.data.followClass),ue(a)):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(a,o,n){console.log(n),e(".fas",t).removeClass("fa-pulse fa-spinner"),e("#wpdiscuz-loading-bar").fadeOut(250)})}),ie(),e(document).on("keyup",".wc_email",function(){ie(e(this))}),x&&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*y)},1e3*k),"content_left"===A)if(e(".entry-content").length){var se=(de=Math.min(e(".entry-content").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".post-entry").length){se=(de=Math.min(e(".post-entry").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-content")}else if(e(".container").length){var de;se=(de=Math.min(e(".container").offset().left,e("#wpdcom").offset().left)-120)>25?de:25;e("#wpd-bubble-wrapper").css({left:se+"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"===A?(e("#wpd-bubble-wrapper").css({left:"25px"}),e("#wpd-bubble-wrapper").addClass("wpd-left-corner")):"right_corner"===A&&(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(){ae(),e("#tab-title-reviews").length&&e("#tab-title-reviews a").trigger("click"),e("html, body").animate({scrollTop:e("#wpdcom").offset().top-(T+28)},1e3,function(){oe(),e("#wpd-bubble-wrapper").removeClass("wpd-bubble-hover"),wpdiscuzLoadRichEditor?e("#wpd-editor-0_0").length&&wpDiscuzEditor.createEditor("#wpd-editor-0_0").focus():e("#wc-textarea-0_0").length&&e("#wc-textarea-0_0").trigger("focus")})}),e(document).on("click","#wpd-bubble-comment-close",function(t){t.preventDefault(),e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")}),e(document).on("click","#wpd-bubble-comment-reply-link a",function(){var t=e(this).attr("href");setTimeout(function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),Q(!0);var a=t.match(/#comment\-(\d+)/);E=E.filter(function(e){return e!=a[1]}),e("#wpd-bubble-count .wpd-new-comments-count").text(E.length),0==E.length&&e("#wpd-bubble-count").removeClass("wpd-new-comments")},100)}),e(document).on("click","#wpd-bubble-count",function(){if(E.length){var t=new FormData;t.append("action","wpdBubbleUpdate"),t.append("newCommentIds",E.join()),fe(v,!0,t).done(function(t){"object"==typeof t&&t.success&&(t.data.message=t.data.message.filter(function(t){if(!e("#comment-"+t.comment_id).length)return t}),$(t),e("#wpd-bubble-count").removeClass("wpd-new-comments"),e("#wpd-bubble-count .wpd-new-comments-count").text("0"),E=[],e(".wpd-new-loaded-comment").length&&(ae(),e("html, body").animate({scrollTop:e(e(".wpd-new-loaded-comment")[0]).offset().top-(T+28)},1e3,oe)),ue(t)),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(e,t,a){console.log(a)})}})}if((x&&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:ee()}}).done(function(a){if(!M)if("object"==typeof a){if(a.commentIDsToRemove.forEach(function(t){e("[id^=wpd-comm-"+t+"]").remove()}),a.ids.length){d&&((i=new FormData).append("action","wpdUpdateAutomatically"),i.append("loadLastCommentId",r),i.append("visibleCommentIds",ee()),fe(v,!1,i).done(function(t){M||"object"==typeof t&&t.success&&($(t),t.data.wc_all_comments_count_new=parseInt(t.data.wc_all_comments_count_new),e(".wpd-thread-info").html(t.data.wc_all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",t.data.wc_all_comments_count_new),e("#wpd-bubble-all-comments-count").replaceWith(t.data.wc_all_comments_count_bubble_html),r=t.data.loadLastCommentId)}).fail(function(e,t,a){console.log(a)})),a.ids=a.ids.filter(function(t){if(!e("#comment-"+t).length)return t});var o=5e3;l=parseInt(a.ids[a.ids.length-1]),E=E.concat(a.ids),O&&a.commentText&&(e("#wpd-bubble-author-avatar").html(a.avatar),e("#wpd-bubble-author-name").html(a.authorName),e("#wpd-bubble-comment-date span").html(a.commentDate),e("#wpd-bubble-comment-text").html(a.commentText),e("#wpd-bubble-comment-reply-link a").attr("href",a.commentLink),e("#wpd-bubble-notification-message").show(),o=1e4);var n=parseInt(e(".wpd-new-comments-count").text());n+=a.ids.length,e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added"),e("#wpd-bubble-wrapper").addClass("wpd-new-comment-added"),setTimeout(function(){e("#wpd-bubble-notification-message").hide(),e("#wpd-bubble-wrapper").removeClass("wpd-new-comment-added")},o),e(".wpd-new-comments-count").text(n),e("#wpd-bubble-count").addClass("wpd-new-comments")}a.all_comments_count=parseInt(a.all_comments_count),e("#wpd-bubble-all-comments-count").replaceWith(a.all_comments_count_bubble_html),e(".wpd-thread-info").html(a.all_comments_count_before_threads_html),e(".wpd-thread-info").attr("data-comments-count",a.all_comments_count)}else console.log(a);var i;setTimeout(t,c)}).fail(function(e,a,o){console.log(o),setTimeout(t,c)})},c),e(".wpd-inline-form-wrapper").length){var ce=new FormData;ce.append("action","wpdGetInlineCommentForm"),fe(v,!1,ce).done(function(t){"object"==typeof t?t.success?(e(".wpd-inline-form-wrapper").append(t.data),e.each(e("[name=_wpd_inline_nonce]"),function(){var t=e(this).attr("id"),a=e(this).parents(".wpd-inline-shortcode").attr("id");e(this).attr("id",t+"-"+a.substring(a.lastIndexOf("-")+1))}),e(".wpd-inline-opened").addClass("wpd-active"),e(".wpd-inline-opened").find(".wpd-inline-form-wrapper").show(),e(".wpd-inline-opened").find(".wpd-inline-icon").addClass("wpd-open"),e(".wpd-inline-opened").find(".wpd-inline-icon").removeClass("wpd-ignored"),me()):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data]),t.data,"error"):console.log(t)}).fail(function(e,t,a){console.log(a)})}function pe(t){if(e(t).hasClass("wpd-inline-shortcode"))var a=e(t).attr("id");else a=e(t).parents(".wpd-inline-shortcode").attr("id");return a.substring(a.lastIndexOf("-")+1)}function re(){e(".wpd-inline-form-wrapper").hide(),e(".wpd-inline-shortcode").removeClass("wpd-active"),e(".wpd-inline-icon").removeClass("wpd-open")}function le(){e.each(e(".wpd-inline-shortcode:not(.wpd-inline-opened) .wpd-inline-icon"),function(){var t=e(this),a=t.offset().top-window.pageYOffset;t.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&a>0&&a<300&&("blink"===I?(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"),me(t.siblings(".wpd-inline-form-wrapper"))))})}function me(t){if(t){if(t.offset().left<=10)t.css("left",Math.ceil(parseInt(t.css("left"))-t.offset().left+10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))<3&&(a=3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;");else if(t.offset().left+t.width()>document.body.clientWidth-10){var a;t.css("left",Math.ceil(parseInt(t.css("left"))+(document.body.clientWidth-(t.offset().left+t.width()))-10)),(a=Math.ceil(t.siblings(".wpd-inline-icon.wpd-open").offset().left-t.offset().left+2))>t.width()-3&&(a=t.width()-3),document.styleSheets[0].addRule("#"+t.parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+a+"px;")}}else e.each(e(".wpd-inline-form-wrapper:visible"),function(){if(e(this).offset().left<=10)e(this).css("left",Math.ceil(parseInt(e(this).css("left"))-e(this).offset().left+10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))<3&&(t=3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;");else if(e(this).offset().left+e(this).width()>document.body.clientWidth-10){var t;e(this).css("left",Math.ceil(parseInt(e(this).css("left"))+(document.body.clientWidth-(e(this).offset().left+e(this).width()))-10)),(t=Math.ceil(e(this).siblings(".wpd-inline-icon.wpd-open").offset().left-e(this).offset().left+2))>e(this).width()-3&&(t=e(this).width()-3),document.styleSheets[0].addRule("#"+e(this).parents(".wpd-inline-shortcode").attr("id")+" .wpd-inline-form-wrapper::before","left: "+t+"px;")}})}function we(t){var a,o=0;if(t.parents(".wpd_main_comm_form").length)o=parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents(".wpd_main_comm_form");else if(t.parents(".wpd-secondary-form-wrapper").length)o=parseInt(wpdiscuzAjaxObj.replyTextMaxLength),a=t.parents(".wpd-secondary-form-wrapper");else if(t.parents("#wpdiscuz-edit-form").length){var n=X(t);o=parseInt(n.substring(n.lastIndexOf("_")+1))?parseInt(wpdiscuzAjaxObj.replyTextMaxLength):parseInt(wpdiscuzAjaxObj.commentTextMaxLength),a=t.parents("#wpdiscuz-edit-form")}if(o&&a){var i=t.val().length,s=e(".wpd-editor-char-counter",a),d=o-i;s.html(d),d<=10?s.addClass("error"):s.removeClass("error")}}function ue(t,a,o,n){t.data.callbackFunctions&&e.each(t.data.callbackFunctions,function(e){"function"==typeof wpdiscuzAjaxObj[t.data.callbackFunctions[e]]?wpdiscuzAjaxObj[t.data.callbackFunctions[e]](t,a,o,n):"function"==typeof window[t.data.callbackFunctions[e]]?window[t.data.callbackFunctions[e]](t,a,o,n):console.log(t.data.callbackFunctions[e]+" is not a function")})}function fe(t,a,o){a&&e("#wpdiscuz-loading-bar").show(),o.append("postId",s),o.append("wpdiscuz_nonce",wpdiscuzAjaxObj.wpdiscuz_nonce);var n=o.get("action");wpdiscuzAjaxObj.dataFilterCallbacks&&wpdiscuzAjaxObj.dataFilterCallbacks[n]&&e.each(wpdiscuzAjaxObj.dataFilterCallbacks[n],function(e){"function"==typeof wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]]&&(o=wpdiscuzAjaxObj[wpdiscuzAjaxObj.dataFilterCallbacks[n][e]](o,t,a))});var i=t?wpdiscuzAjaxObj.url:wpdiscuzAjaxObj.customAjaxUrl;return e.ajax({type:"POST",url:i,data:o,contentType:!1,processData:!1})}function he(){var e=new FormData;e.append("action","wpdGetNonce"),e.append("key",wpdiscuzAjaxObj.wpdiscuz_nonce_key),fe(v,!1,e).done(function(e){"object"==typeof e?e.success?wpdiscuzAjaxObj.wpdiscuz_nonce=e.data:wpdiscuzAjaxObj.setCommentMessage(e.data,"error"):console.log(e)}).fail(function(e,t,a){console.log(a)})}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){re();var a="";e(t.target).hasClass("wpd-inline-icon")?a=e(t.target):e(t.target).parents(".wpd-inline-icon").length&&(a=e(t.target).parents(".wpd-inline-icon")),a.length&&a.parents(".wpd-inline-shortcode").find(".wpd-inline-form").length&&(a.parents(".wpd-inline-shortcode").addClass("wpd-active"),a.siblings(".wpd-inline-form-wrapper").show(),a.addClass("wpd-open"),a.removeClass("wpd-ignored"),me(a.siblings(".wpd-inline-form-wrapper")))}(!e(t.target).hasClass("wpd-last-inline-comments-wrapper")&&!e(t.target).parents(".wpd-last-inline-comments-wrapper").length||e(t.target).parents(".wpd-last-inline-comments-wrapper").length&&e(t.target).hasClass("wpd-load-inline-comment"))&&e(".wpd-last-inline-comments-wrapper").remove()}),e(document).on("click",".wpd-inline-submit.wpd_not_clicked",function(t){t.preventDefault();var a=e(this),o=e(this).parents(".wpd_inline_comm_form");if(o[0].checkValidity()){e(this).removeClass("wpd_not_clicked");var n=new FormData;n.append("action","wpdAddInlineComment"),n.append("inline_form_id",pe(o)),e.each(e("input, textarea",o),function(t,a){"checkbox"===this.type?e(this).is(":checked")&&n.append(e(a).attr("name"),e(a).val()):n.append(e(a).attr("name"),e(a).val())}),fe(v,!0,n).done(function(t){if(a.addClass("wpd_not_clicked"),"object"==typeof t)if(t.success){o[0].reset(),re();var n=parseInt(t.data.newCount),i=a.parents(".wpd-inline-icon-wrapper").find(".wpd-inline-icon-count");i.text(n),n?i.addClass("wpd-has-comments"):i.removeClass("wpd-has-comments"),t.data.allCommentsCountNew=parseInt(t.data.allCommentsCountNew),e(".wpd-thread-info").html(t.data.allCommentsCountBeforeThreadsHtml),e(".wpd-thread-info").attr("data-comments-count",t.data.allCommentsCountNew),e("#wpd-bubble-all-comments-count").replaceWith(t.data.allCommentsCountBubbleHtml),t.data.message&&ne(t.data.message),wpdiscuzAjaxObj.setCommentMessage(t.data.notification,"success")}else t.data&&wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data,a),"error");else wpdiscuzAjaxObj.setCommentMessage(t,"error");e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("keydown",".wpd-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_comm_submit").trigger("click")}),e(document).on("keydown","#wpdiscuz-edit-form",function(t){t.ctrlKey&&13==t.keyCode&&e(this).find(".wc_save_edited_comment").trigger("click")}),e(document).on("keydown",".wpd-inline-comment-content",function(t){t.ctrlKey&&13==t.keyCode&&e(this).parents(".wpd_inline_comm_form").find(".wpd-inline-submit.wpd_not_clicked").trigger("click")}),e(document).on("click",".wpd-inline-icon-count.wpd-has-comments",function(){var t=e(this),a=new FormData;a.append("action","wpdGetLastInlineComments"),a.append("inline_form_id",pe(t)),fe(v,!0,a).done(function(a){"object"==typeof a?a.success?e(a.data).insertAfter(t):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[a.data],a.data,t),"error"):console.log(a),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),e(document).on("click",".wpd-view-all-inline-comments",function(t){t.preventDefault(),e(this).parents(".wpd-last-inline-comments-wrapper").remove(),e(".wpdf-inline").hasClass("wpdf-active")||e(".wpdf-inline").trigger("click"),ae(),e("html, body").animate({scrollTop:e(".wpdf-inline").offset().top-T},1e3,oe)}),e(document).on("click",".wpd-feedback-content-link",function(t){t.preventDefault();var a=e(this).data("feedback-content-id");ae(),e("html, body").animate({scrollTop:e("#wpd-inline-"+a).offset().top-(T+6)},1e3,function(){oe(),e("#wpd-inline-"+a).addClass("wpd-active")})}),"scroll_open"!==I&&"blink"!==I||(le(),e(window).on("scroll",le)),e(document).on("click","#wpd-post-rating.wpd-not-rated .wpd-rate-starts svg",function(){var t=new FormData,a=e(this).index();a>=0&&a<5&&(t.append("action","wpdUserRate"),t.append("rating",a+1),fe(v,!0,t).done(function(t){"object"==typeof t?(t.success?location.reload(!0):wpdiscuzAjaxObj.setCommentMessage(wpdiscuzAjaxObj.applyFilterOnPhrase(wpdiscuzAjaxObj[t.data],t.data),"error"),ue(t)):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250)}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)}))}),e(document).on("submit","#wpdiscuz-subscribe-form",function(t){t.preventDefault();var a,o,i=e(this);if(i[0].checkValidity()&&(a=i,o=!0,"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&!e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).val().length?(o=!1,e(".wpdiscuz-recaptcha",a).css("border","1px solid red")):"2.0"===n&&e("input[name=wpdiscuz_recaptcha_subscribe_form]",a).length&&e(".wpdiscuz-recaptcha",a).css("border","none"),o)){var s=new FormData;s.append("action","wpdAddSubscription"),e("*",i).each(function(){""!=this.name&&"checkbox"!=this.type&&"radio"!=this.type&&s.append(this.name+"",e(this).val()),"checkbox"!=this.type&&"radio"!=this.type||e(this).is(":checked")&&s.append(this.name+"",e(this).val())}),fe(v,!0,s).done(function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):wpdiscuzAjaxObj.setCommentMessage(t,"error"),e("#wpdiscuz-loading-bar").fadeOut(250),M=!1}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}}),e(document).on("click",".wpd-unsubscribe",function(t){t.preventDefault();var a=new FormData;a.append("action","wpdUnsubscribe"),a.append("sid",e(this).data("sid")),a.append("skey",e(this).data("skey")),fe(v,!0,a).done(function(t){"object"==typeof t?t.success?(wpdiscuzAjaxObj.setCommentMessage(t.data,"success"),setTimeout(function(){location.reload(!0)},3e3)):wpdiscuzAjaxObj.setCommentMessage(t.data,"error"):console.log(t),e("#wpdiscuz-loading-bar").fadeOut(250),M=!1}).fail(function(t,a,o){console.log(o),e("#wpdiscuz-loading-bar").fadeOut(250)})}),wpdiscuzAjaxObj.resetActiveFilters=function(t){e(".wpd-filter.wpdf-active"+(t?":not("+t+")":"")).removeClass("wpdf-active")},wpdiscuzAjaxObj.getAjaxObj=fe,wpdiscuzAjaxObj.initNonce=he,he()});var onloadCallback=function(){if(document.getElementById("wpdiscuz-recaptcha-0_0")&&"2.0"===wpdiscuzAjaxObj.wpDiscuzReCaptchaVersion&&(1==wpdiscuzAjaxObj.wc_captcha_show_for_guest&&!wpdiscuzAjaxObj.is_user_logged_in||1==wpdiscuzAjaxObj.wc_captcha_show_for_members&&wpdiscuzAjaxObj.is_user_logged_in))try{grecaptcha.render("wpdiscuz-recaptcha-0_0",{sitekey:wpdiscuzAjaxObj.wpDiscuzReCaptchaSK,theme:wpdiscuzAjaxObj.wpDiscuzReCaptchaTheme,callback:function(e){jQuery("#wpdiscuz-recaptcha-field-0_0").val("key")},"expired-callback":function(){jQuery("#wpdiscuz-recaptcha-field-0_0").val("")}})}catch(e){console.log(e),wpdiscuzAjaxObj.setCommentMessage("reCaptcha Error: "+e.message,"error")}};
class.WpdiscuzCore.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  * Plugin Name: wpDiscuz
4
  * Description: #1 WordPress Comment Plugin. Innovative, modern and feature-rich comment system to supercharge your website comment section.
5
- * Version: 7.3.4
6
  * Author: gVectors Team
7
  * Author URI: https://gvectors.com/
8
  * Plugin URI: https://wpdiscuz.com/
@@ -258,7 +258,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
258
  $response = [];
259
  $response["loadLastCommentId"] = $lastCommentId;
260
  $commentListArgs["new_loaded_class"] = "wpd-new-loaded-comment";
261
- $sentEmail = isset($_COOKIE["comment_author_email_" . COOKIEHASH]) ? trim($_COOKIE["comment_author_email_" . COOKIEHASH]) : "";
262
  $email = !empty($commentListArgs["current_user"]->ID) ? $commentListArgs["current_user"]->user_email : $sentEmail;
263
  $newCommentIds = $this->dbManager->getNewCommentIds($this->commentsArgs, $loadLastCommentId, $email, $visibleCommentIds);
264
  $newCommentIds = apply_filters("wpdiscuz_live_update_new_comment_ids", $newCommentIds, $postId, $commentListArgs["current_user"]);
@@ -1035,17 +1035,15 @@ class WpdiscuzCore implements WpDiscuzConstants {
1035
  ]);
1036
  wp_register_style("wpdiscuz-font-awesome", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/font-awesome-5.13.0/css/fontawesome-all.min.css"), null, $this->version);
1037
 
1038
- if ((isset($_GET["page"]) && in_array($_GET["page"], $wpdiscuzPages) && in_array($pagenow, $wpdiscuzWpPages)) || ($typenow === "wpdiscuz_form") || ($pagenow === self::PAGE_COMMENTS)) {
1039
- $nonceKey = ($key = get_home_url()) ? md5($key) : "wpdiscuz-media-uploader-nonce";
1040
  $args = [
1041
  "msgConfirmResetOptions" => esc_html__("Do you really want to reset all options?", "wpdiscuz"),
1042
  "msgConfirmResetTabOptions" => esc_html__("Do you really want to reset tab options?", "wpdiscuz"),
1043
  "msgConfirmRemoveVotes" => esc_html__("Do you really want to remove voting data?", "wpdiscuz"),
1044
  "msgConfirmResetPhrases" => esc_html__("Do you really want to reset phrases?", "wpdiscuz"),
1045
  "wmuMsgConfirmAttachmentDelete" => esc_html__("Do you really want to delet this attachment?", "wpdiscuz"),
1046
- "msgConfirmPurgeCache" => esc_html__("Do you really want to delete comments and users cache?", "wpdiscuz"),
1047
- "wmuSecurity" => wp_create_nonce($nonceKey),
1048
- WpDiscuzConstants::GLOBAL_NONCE_NAME => $this->helper->generateNonce()
1049
  ];
1050
  // Media Upload Lightbox
1051
  wp_register_style("wmu-colorbox-css", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/colorbox/colorbox.css"));
@@ -1153,7 +1151,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
1153
  $this->wpdiscuzOptionsJs["wc_post_id"] = $post->ID;
1154
  $this->wpdiscuzOptionsJs["isCookiesEnabled"] = has_action("set_comment_cookies");
1155
  $this->wpdiscuzOptionsJs["loadLastCommentId"] = 0;
1156
- $this->wpdiscuzOptionsJs[WpDiscuzConstants::GLOBAL_NONCE_NAME] = $this->helper->generateNonce();
1157
 
1158
  if ($this->options->live["commentListUpdateType"] || ($this->options->live["enableBubble"] && $this->options->live["bubbleLiveUpdate"])) {
1159
  $cArgs = $this->getDefaultCommentsArgs($post->ID);
2
  /*
3
  * Plugin Name: wpDiscuz
4
  * Description: #1 WordPress Comment Plugin. Innovative, modern and feature-rich comment system to supercharge your website comment section.
5
+ * Version: 7.3.5
6
  * Author: gVectors Team
7
  * Author URI: https://gvectors.com/
8
  * Plugin URI: https://wpdiscuz.com/
258
  $response = [];
259
  $response["loadLastCommentId"] = $lastCommentId;
260
  $commentListArgs["new_loaded_class"] = "wpd-new-loaded-comment";
261
+ $sentEmail = isset($_COOKIE["comment_author_email_" . COOKIEHASH]) ? trim(sanitize_email($_COOKIE["comment_author_email_" . COOKIEHASH])) : "";
262
  $email = !empty($commentListArgs["current_user"]->ID) ? $commentListArgs["current_user"]->user_email : $sentEmail;
263
  $newCommentIds = $this->dbManager->getNewCommentIds($this->commentsArgs, $loadLastCommentId, $email, $visibleCommentIds);
264
  $newCommentIds = apply_filters("wpdiscuz_live_update_new_comment_ids", $newCommentIds, $postId, $commentListArgs["current_user"]);
1035
  ]);
1036
  wp_register_style("wpdiscuz-font-awesome", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/font-awesome-5.13.0/css/fontawesome-all.min.css"), null, $this->version);
1037
 
1038
+ if ((isset($_GET["page"]) && in_array($_GET["page"], $wpdiscuzPages) && in_array($pagenow, $wpdiscuzWpPages)) || ($typenow === "wpdiscuz_form") || ($pagenow === self::PAGE_COMMENTS)) {
 
1039
  $args = [
1040
  "msgConfirmResetOptions" => esc_html__("Do you really want to reset all options?", "wpdiscuz"),
1041
  "msgConfirmResetTabOptions" => esc_html__("Do you really want to reset tab options?", "wpdiscuz"),
1042
  "msgConfirmRemoveVotes" => esc_html__("Do you really want to remove voting data?", "wpdiscuz"),
1043
  "msgConfirmResetPhrases" => esc_html__("Do you really want to reset phrases?", "wpdiscuz"),
1044
  "wmuMsgConfirmAttachmentDelete" => esc_html__("Do you really want to delet this attachment?", "wpdiscuz"),
1045
+ "msgConfirmPurgeCache" => esc_html__("Do you really want to delete comments and users cache?", "wpdiscuz"),
1046
+ "wpdiscuz_nonce" => $this->helper->generateNonce(),
 
1047
  ];
1048
  // Media Upload Lightbox
1049
  wp_register_style("wmu-colorbox-css", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/colorbox/colorbox.css"));
1151
  $this->wpdiscuzOptionsJs["wc_post_id"] = $post->ID;
1152
  $this->wpdiscuzOptionsJs["isCookiesEnabled"] = has_action("set_comment_cookies");
1153
  $this->wpdiscuzOptionsJs["loadLastCommentId"] = 0;
1154
+ $this->wpdiscuzOptionsJs[WpDiscuzConstants::GLOBAL_NONCE_KEY] = md5($this->helper->generateNonceKey());
1155
 
1156
  if ($this->options->live["commentListUpdateType"] || ($this->options->live["enableBubble"] && $this->options->live["bubbleLiveUpdate"])) {
1157
  $cArgs = $this->getDefaultCommentsArgs($post->ID);
includes/interface.WpDiscuzConstants.php CHANGED
@@ -100,4 +100,5 @@ interface WpDiscuzConstants {
100
 
101
  /* === NONCE */
102
  const GLOBAL_NONCE_NAME = "wpdiscuz_nonce";
 
103
  }
100
 
101
  /* === NONCE */
102
  const GLOBAL_NONCE_NAME = "wpdiscuz_nonce";
103
+ const GLOBAL_NONCE_KEY = "wpdiscuz_nonce_key";
104
  }
options/class.WpdiscuzOptions.php CHANGED
@@ -1161,9 +1161,7 @@ class WpdiscuzOptions implements WpDiscuzConstants {
1161
  $jsArgs["msgEmptyFile"] = esc_html__("File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.");
1162
  $jsArgs["msgPostIdNotExists"] = esc_html__("Post ID not exists", "wpdiscuz");
1163
  $jsArgs["msgUploadingNotAllowed"] = esc_html__("Sorry, uploading not allowed for this post", "wpdiscuz");
1164
- $jsArgs["msgPermissionDenied"] = esc_html__("You do not have sufficient permissions to perform this action", "wpdiscuz");
1165
- $nonceKey = ($key = get_home_url()) ? md5($key) : "wmu-nonce";
1166
- $jsArgs["wmuSecurity"] = wp_create_nonce($nonceKey);
1167
  $jsArgs["wmuKeyImages"] = self::KEY_IMAGES;
1168
  $jsArgs["wmuSingleImageWidth"] = $this->content["wmuSingleImageWidth"];
1169
  $jsArgs["wmuSingleImageHeight"] = $this->content["wmuSingleImageHeight"];
@@ -1449,7 +1447,7 @@ class WpdiscuzOptions implements WpDiscuzConstants {
1449
  $this->labels["blogRoleLabels"] = isset($_POST[self::TAB_LABELS]["blogRoleLabels"]) ? wp_parse_args($_POST[self::TAB_LABELS]["blogRoleLabels"], $emptyRolesArray) : $emptyRolesArray;
1450
  $this->labels["blogRoles"] = isset($_POST[self::TAB_LABELS]["blogRoles"]) ? wp_parse_args($_POST[self::TAB_LABELS]["blogRoles"], $this->labels["blogRoles"]) : $this->labels["blogRoles"];
1451
  } else if (self::TAB_MODERATION === $_POST["wpd_tab"]) {
1452
- $this->moderation["commentEditableTime"] = isset($_POST[self::TAB_MODERATION]["commentEditableTime"]) ? absint($_POST[self::TAB_MODERATION]["commentEditableTime"]) : 900;
1453
  $this->moderation["enableEditingWhenHaveReplies"] = isset($_POST[self::TAB_MODERATION]["enableEditingWhenHaveReplies"]) ? absint($_POST[self::TAB_MODERATION]["enableEditingWhenHaveReplies"]) : 0;
1454
  $this->moderation["displayEditingInfo"] = isset($_POST[self::TAB_MODERATION]["displayEditingInfo"]) ? absint($_POST[self::TAB_MODERATION]["displayEditingInfo"]) : 0;
1455
  $this->moderation["enableStickButton"] = isset($_POST[self::TAB_MODERATION]["enableStickButton"]) ? absint($_POST[self::TAB_MODERATION]["enableStickButton"]) : 0;
1161
  $jsArgs["msgEmptyFile"] = esc_html__("File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.");
1162
  $jsArgs["msgPostIdNotExists"] = esc_html__("Post ID not exists", "wpdiscuz");
1163
  $jsArgs["msgUploadingNotAllowed"] = esc_html__("Sorry, uploading not allowed for this post", "wpdiscuz");
1164
+ $jsArgs["msgPermissionDenied"] = esc_html__("You do not have sufficient permissions to perform this action", "wpdiscuz");
 
 
1165
  $jsArgs["wmuKeyImages"] = self::KEY_IMAGES;
1166
  $jsArgs["wmuSingleImageWidth"] = $this->content["wmuSingleImageWidth"];
1167
  $jsArgs["wmuSingleImageHeight"] = $this->content["wmuSingleImageHeight"];
1447
  $this->labels["blogRoleLabels"] = isset($_POST[self::TAB_LABELS]["blogRoleLabels"]) ? wp_parse_args($_POST[self::TAB_LABELS]["blogRoleLabels"], $emptyRolesArray) : $emptyRolesArray;
1448
  $this->labels["blogRoles"] = isset($_POST[self::TAB_LABELS]["blogRoles"]) ? wp_parse_args($_POST[self::TAB_LABELS]["blogRoles"], $this->labels["blogRoles"]) : $this->labels["blogRoles"];
1449
  } else if (self::TAB_MODERATION === $_POST["wpd_tab"]) {
1450
+ $this->moderation["commentEditableTime"] = isset($_POST[self::TAB_MODERATION]["commentEditableTime"]) ? sanitize_text_field($_POST[self::TAB_MODERATION]["commentEditableTime"]) : 900;
1451
  $this->moderation["enableEditingWhenHaveReplies"] = isset($_POST[self::TAB_MODERATION]["enableEditingWhenHaveReplies"]) ? absint($_POST[self::TAB_MODERATION]["enableEditingWhenHaveReplies"]) : 0;
1452
  $this->moderation["displayEditingInfo"] = isset($_POST[self::TAB_MODERATION]["displayEditingInfo"]) ? absint($_POST[self::TAB_MODERATION]["displayEditingInfo"]) : 0;
1453
  $this->moderation["enableStickButton"] = isset($_POST[self::TAB_MODERATION]["enableStickButton"]) ? absint($_POST[self::TAB_MODERATION]["enableStickButton"]) : 0;
options/options-layouts/html-content.php CHANGED
@@ -19,7 +19,7 @@ if (!defined("ABSPATH")) {
19
  <div class="wpd-opt-row" data-wpd-opt="commentTextLength">
20
  <div class="wpd-opt-name">
21
  <label for="commentTextLength"><?php echo esc_html($setting["options"]["commentTextLength"]["label"]); ?></label>
22
- <p class="wpd-desc"><?php echo $setting["options"]["commentTextLength"]["description"] ?></p>
23
  </div>
24
  <div class="wpd-opt-input">
25
  <span for="commentTextMinLength"><input type="number" value="<?php echo esc_attr($this->content["commentTextMinLength"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_CONTENT); ?>[commentTextMinLength]" id="commentTextMinLength" style="width:70px;"> <?php esc_html_e("Min", "wpdiscuz") ?> </span>
@@ -35,7 +35,7 @@ if (!defined("ABSPATH")) {
35
  <div class="wpd-opt-row" data-wpd-opt="replyTextLength">
36
  <div class="wpd-opt-name">
37
  <label for="replyTextLength"><?php echo esc_html($setting["options"]["replyTextLength"]["label"]); ?></label>
38
- <p class="wpd-desc"><?php echo $setting["options"]["replyTextLength"]["description"] ?></p>
39
  </div>
40
  <div class="wpd-opt-input">
41
  <span for="replyTextMinLength"><input type="number" value="<?php echo esc_attr($this->content["replyTextMinLength"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_CONTENT); ?>[replyTextMinLength]" id="replyTextMinLength" style="width:70px;"> <?php esc_html_e("Min", "wpdiscuz") ?> </span>
@@ -51,7 +51,7 @@ if (!defined("ABSPATH")) {
51
  <div class="wpd-opt-row" data-wpd-opt="enableImageConversion">
52
  <div class="wpd-opt-name">
53
  <label for="enableImageConversion"><?php echo esc_html($setting["options"]["enableImageConversion"]["label"]); ?></label>
54
- <p class="wpd-desc"><?php echo $setting["options"]["enableImageConversion"]["description"] ?></p>
55
  </div>
56
  <div class="wpd-opt-input">
57
  <div class="wpd-switcher">
@@ -69,7 +69,7 @@ if (!defined("ABSPATH")) {
69
  <div class="wpd-opt-row" data-wpd-opt="enableShortcodes">
70
  <div class="wpd-opt-name">
71
  <label for="enableShortcodes"><?php echo esc_html($setting["options"]["enableShortcodes"]["label"]); ?></label>
72
- <p class="wpd-desc"><?php echo $setting["options"]["enableShortcodes"]["description"] ?></p>
73
  </div>
74
  <div class="wpd-opt-input">
75
  <div class="wpd-switcher">
@@ -87,7 +87,7 @@ if (!defined("ABSPATH")) {
87
  <div class="wpd-opt-row" data-wpd-opt="commentReadMoreLimit">
88
  <div class="wpd-opt-name">
89
  <label for="commentReadMoreLimit"><?php echo esc_html($setting["options"]["commentReadMoreLimit"]["label"]) ?></label>
90
- <p class="wpd-desc"><?php echo $setting["options"]["commentReadMoreLimit"]["description"] ?></p>
91
  </div>
92
  <div class="wpd-opt-input">
93
  <input type="number" value="<?php echo esc_attr($this->content["commentReadMoreLimit"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_CONTENT); ?>[commentReadMoreLimit]" id="commentReadMoreLimit" style="width:100px;" />
@@ -106,7 +106,7 @@ if (!defined("ABSPATH")) {
106
  <div class="wpd-opt-row" data-wpd-opt="wmuIsEnabled">
107
  <div class="wpd-opt-name">
108
  <label for="wmuIsEnabled"><?php echo esc_html($setting["options"]["wmuIsEnabled"]["label"]) ?></label>
109
- <p class="wpd-desc"><?php echo $setting["options"]["wmuIsEnabled"]["description"] ?></p>
110
  </div>
111
  <div class="wpd-opt-input">
112
  <div class="wpd-switcher">
@@ -124,7 +124,7 @@ if (!defined("ABSPATH")) {
124
  <div class="wpd-opt-row" data-wpd-opt="wmuIsGuestAllowed">
125
  <div class="wpd-opt-name">
126
  <label for="wmuIsGuestAllowed"><?php echo esc_html($setting["options"]["wmuIsGuestAllowed"]["label"]) ?></label>
127
- <p class="wpd-desc"><?php echo $setting["options"]["wmuIsGuestAllowed"]["description"] ?></p>
128
  </div>
129
  <div class="wpd-opt-input">
130
  <div class="wpd-switcher">
@@ -142,7 +142,7 @@ if (!defined("ABSPATH")) {
142
  <div class="wpd-opt-row" data-wpd-opt="wmuIsLightbox">
143
  <div class="wpd-opt-name">
144
  <label for="wmuIsLightbox"><?php echo esc_html($setting["options"]["wmuIsLightbox"]["label"]) ?></label>
145
- <p class="wpd-desc"><?php echo $setting["options"]["wmuIsLightbox"]["description"] ?></p>
146
  </div>
147
  <div class="wpd-opt-input">
148
  <div class="wpd-switcher">
@@ -161,7 +161,7 @@ if (!defined("ABSPATH")) {
161
  <div class="wpd-opt-name" style="width: 100%;">
162
  <div style="float: left;">
163
  <label for="wmuMimeTypes"><?php echo esc_html($setting["options"]["wmuMimeTypes"]["label"]) ?></label>
164
- <p class="wpd-desc"><?php echo $setting["options"]["wmuMimeTypes"]["description"] ?></p>
165
  </div>
166
  <div class="wpd-opt-doc" style="float: right;">
167
  <?php $this->printDocLink($setting["options"]["wmuMimeTypes"]["docurl"]) ?>
@@ -196,7 +196,7 @@ if (!defined("ABSPATH")) {
196
  <div class="wpd-opt-row" data-wpd-opt="wmuMaxFileSize">
197
  <div class="wpd-opt-name">
198
  <label for="wmuMaxFileSize"><?php echo esc_html($setting["options"]["wmuMaxFileSize"]["label"]) ?></label>
199
- <p class="wpd-desc"><?php echo $setting["options"]["wmuMaxFileSize"]["description"] ?></p>
200
  </div>
201
  <div class="wpd-opt-input">
202
  <input step="any" type="number" value="<?php echo esc_attr($this->content["wmuMaxFileSize"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_CONTENT); ?>[wmuMaxFileSize]" id="wmuMaxFileSize" class="wmu-number" style="width: 80px;"/> <span style="vertical-align:middle;">MB</span>
@@ -221,7 +221,7 @@ if (!defined("ABSPATH")) {
221
  <div class="wpd-opt-row" data-wpd-opt="wmuIsShowFilesDashboard">
222
  <div class="wpd-opt-name">
223
  <label for="wmuIsShowFilesDashboard"><?php echo esc_html($setting["options"]["wmuIsShowFilesDashboard"]["label"]) ?></label>
224
- <p class="wpd-desc"><?php echo $setting["options"]["wmuIsShowFilesDashboard"]["description"] ?></p>
225
  </div>
226
  <div class="wpd-opt-input">
227
  <div class="wpd-switcher">
@@ -239,7 +239,7 @@ if (!defined("ABSPATH")) {
239
  <div class="wpd-opt-row" data-wpd-opt="wmuSingleImageSize">
240
  <div class="wpd-opt-name">
241
  <label for="wmuSingleImageSize"><?php echo esc_html($setting["options"]["wmuSingleImageSize"]["label"]) ?></label>
242
- <p class="wpd-desc"><?php echo $setting["options"]["wmuSingleImageSize"]["description"] ?></p>
243
  </div>
244
  <div class="wpd-opt-input">
245
  <input type="text" value="<?php echo esc_attr($this->content["wmuSingleImageWidth"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_CONTENT); ?>[wmuSingleImageWidth]" id="wmuSingleImageWidth" class="wmu-number wmu-image-dimension wmu-image-width" style="width: 80px;" /><span> <?php esc_html_e("Width (px)", "wpdiscuz"); ?> </span><br>
@@ -255,7 +255,7 @@ if (!defined("ABSPATH")) {
255
  <div class="wpd-opt-row" data-wpd-opt="wmuImageSizes">
256
  <div class="wpd-opt-name">
257
  <label for="wmuImageSizes"><?php echo esc_html($setting["options"]["wmuImageSizes"]["label"]) ?></label>
258
- <p class="wpd-desc"><?php echo $setting["options"]["wmuImageSizes"]["description"] ?></p>
259
  </div>
260
  <div class="wpd-opt-input">
261
  <?php
19
  <div class="wpd-opt-row" data-wpd-opt="commentTextLength">
20
  <div class="wpd-opt-name">
21
  <label for="commentTextLength"><?php echo esc_html($setting["options"]["commentTextLength"]["label"]); ?></label>
22
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["commentTextLength"]["description"]) ?></p>
23
  </div>
24
  <div class="wpd-opt-input">
25
  <span for="commentTextMinLength"><input type="number" value="<?php echo esc_attr($this->content["commentTextMinLength"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_CONTENT); ?>[commentTextMinLength]" id="commentTextMinLength" style="width:70px;"> <?php esc_html_e("Min", "wpdiscuz") ?> </span>
35
  <div class="wpd-opt-row" data-wpd-opt="replyTextLength">
36
  <div class="wpd-opt-name">
37
  <label for="replyTextLength"><?php echo esc_html($setting["options"]["replyTextLength"]["label"]); ?></label>
38
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["replyTextLength"]["description"]) ?></p>
39
  </div>
40
  <div class="wpd-opt-input">
41
  <span for="replyTextMinLength"><input type="number" value="<?php echo esc_attr($this->content["replyTextMinLength"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_CONTENT); ?>[replyTextMinLength]" id="replyTextMinLength" style="width:70px;"> <?php esc_html_e("Min", "wpdiscuz") ?> </span>
51
  <div class="wpd-opt-row" data-wpd-opt="enableImageConversion">
52
  <div class="wpd-opt-name">
53
  <label for="enableImageConversion"><?php echo esc_html($setting["options"]["enableImageConversion"]["label"]); ?></label>
54
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableImageConversion"]["description"]) ?></p>
55
  </div>
56
  <div class="wpd-opt-input">
57
  <div class="wpd-switcher">
69
  <div class="wpd-opt-row" data-wpd-opt="enableShortcodes">
70
  <div class="wpd-opt-name">
71
  <label for="enableShortcodes"><?php echo esc_html($setting["options"]["enableShortcodes"]["label"]); ?></label>
72
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableShortcodes"]["description"]) ?></p>
73
  </div>
74
  <div class="wpd-opt-input">
75
  <div class="wpd-switcher">
87
  <div class="wpd-opt-row" data-wpd-opt="commentReadMoreLimit">
88
  <div class="wpd-opt-name">
89
  <label for="commentReadMoreLimit"><?php echo esc_html($setting["options"]["commentReadMoreLimit"]["label"]) ?></label>
90
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["commentReadMoreLimit"]["description"]) ?></p>
91
  </div>
92
  <div class="wpd-opt-input">
93
  <input type="number" value="<?php echo esc_attr($this->content["commentReadMoreLimit"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_CONTENT); ?>[commentReadMoreLimit]" id="commentReadMoreLimit" style="width:100px;" />
106
  <div class="wpd-opt-row" data-wpd-opt="wmuIsEnabled">
107
  <div class="wpd-opt-name">
108
  <label for="wmuIsEnabled"><?php echo esc_html($setting["options"]["wmuIsEnabled"]["label"]) ?></label>
109
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["wmuIsEnabled"]["description"]) ?></p>
110
  </div>
111
  <div class="wpd-opt-input">
112
  <div class="wpd-switcher">
124
  <div class="wpd-opt-row" data-wpd-opt="wmuIsGuestAllowed">
125
  <div class="wpd-opt-name">
126
  <label for="wmuIsGuestAllowed"><?php echo esc_html($setting["options"]["wmuIsGuestAllowed"]["label"]) ?></label>
127
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["wmuIsGuestAllowed"]["description"]) ?></p>
128
  </div>
129
  <div class="wpd-opt-input">
130
  <div class="wpd-switcher">
142
  <div class="wpd-opt-row" data-wpd-opt="wmuIsLightbox">
143
  <div class="wpd-opt-name">
144
  <label for="wmuIsLightbox"><?php echo esc_html($setting["options"]["wmuIsLightbox"]["label"]) ?></label>
145
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["wmuIsLightbox"]["description"]) ?></p>
146
  </div>
147
  <div class="wpd-opt-input">
148
  <div class="wpd-switcher">
161
  <div class="wpd-opt-name" style="width: 100%;">
162
  <div style="float: left;">
163
  <label for="wmuMimeTypes"><?php echo esc_html($setting["options"]["wmuMimeTypes"]["label"]) ?></label>
164
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["wmuMimeTypes"]["description"]) ?></p>
165
  </div>
166
  <div class="wpd-opt-doc" style="float: right;">
167
  <?php $this->printDocLink($setting["options"]["wmuMimeTypes"]["docurl"]) ?>
196
  <div class="wpd-opt-row" data-wpd-opt="wmuMaxFileSize">
197
  <div class="wpd-opt-name">
198
  <label for="wmuMaxFileSize"><?php echo esc_html($setting["options"]["wmuMaxFileSize"]["label"]) ?></label>
199
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["wmuMaxFileSize"]["description"]) ?></p>
200
  </div>
201
  <div class="wpd-opt-input">
202
  <input step="any" type="number" value="<?php echo esc_attr($this->content["wmuMaxFileSize"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_CONTENT); ?>[wmuMaxFileSize]" id="wmuMaxFileSize" class="wmu-number" style="width: 80px;"/> <span style="vertical-align:middle;">MB</span>
221
  <div class="wpd-opt-row" data-wpd-opt="wmuIsShowFilesDashboard">
222
  <div class="wpd-opt-name">
223
  <label for="wmuIsShowFilesDashboard"><?php echo esc_html($setting["options"]["wmuIsShowFilesDashboard"]["label"]) ?></label>
224
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["wmuIsShowFilesDashboard"]["description"]) ?></p>
225
  </div>
226
  <div class="wpd-opt-input">
227
  <div class="wpd-switcher">
239
  <div class="wpd-opt-row" data-wpd-opt="wmuSingleImageSize">
240
  <div class="wpd-opt-name">
241
  <label for="wmuSingleImageSize"><?php echo esc_html($setting["options"]["wmuSingleImageSize"]["label"]) ?></label>
242
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["wmuSingleImageSize"]["description"]) ?></p>
243
  </div>
244
  <div class="wpd-opt-input">
245
  <input type="text" value="<?php echo esc_attr($this->content["wmuSingleImageWidth"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_CONTENT); ?>[wmuSingleImageWidth]" id="wmuSingleImageWidth" class="wmu-number wmu-image-dimension wmu-image-width" style="width: 80px;" /><span> <?php esc_html_e("Width (px)", "wpdiscuz"); ?> </span><br>
255
  <div class="wpd-opt-row" data-wpd-opt="wmuImageSizes">
256
  <div class="wpd-opt-name">
257
  <label for="wmuImageSizes"><?php echo esc_html($setting["options"]["wmuImageSizes"]["label"]) ?></label>
258
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["wmuImageSizes"]["description"]) ?></p>
259
  </div>
260
  <div class="wpd-opt-input">
261
  <?php
options/options-layouts/html-form.php CHANGED
@@ -19,7 +19,7 @@ if (!defined("ABSPATH")) {
19
  <div class="wpd-opt-row" data-wpd-opt="commentFormView">
20
  <div class="wpd-opt-name">
21
  <label for="commentFormView"><?php echo esc_html($setting["options"]["commentFormView"]["label"]) ?></label>
22
- <p class="wpd-desc"><?php echo $setting["options"]["commentFormView"]["description"] ?></p>
23
  </div>
24
  <div class="wpd-opt-input">
25
  <div class="wpd-switch-field">
@@ -39,7 +39,7 @@ if (!defined("ABSPATH")) {
39
  <div class="wpd-opt-row" data-wpd-opt="enableDropAnimation">
40
  <div class="wpd-opt-name">
41
  <label for="enableDropAnimation"><?php echo esc_html($setting["options"]["enableDropAnimation"]["label"]) ?></label>
42
- <p class="wpd-desc"><?php echo $setting["options"]["enableDropAnimation"]["description"] ?></p>
43
  </div>
44
  <div class="wpd-opt-input">
45
  <div class="wpd-switcher">
@@ -57,7 +57,7 @@ if (!defined("ABSPATH")) {
57
  <div class="wpd-opt-row" data-wpd-opt="richEditor">
58
  <div class="wpd-opt-name">
59
  <label for="richEditor"><?php echo esc_html($setting["options"]["richEditor"]["label"]) ?></label>
60
- <p class="wpd-desc"><?php echo $setting["options"]["richEditor"]["description"] ?></p>
61
  </div>
62
  <div class="wpd-opt-input">
63
  <div class="wpd-radio">
@@ -86,7 +86,7 @@ if (!defined("ABSPATH")) {
86
  <div class="wpd-opt-row" data-wpd-opt="editorToolbar">
87
  <div class="wpd-opt-name" style="width: 100%;">
88
  <label for="editorToolbar"><?php echo esc_html($setting["options"]["editorToolbar"]["label"]) ?></label>
89
- <p class="wpd-desc"><?php echo $setting["options"]["editorToolbar"]["description"] ?></p>
90
  <div class="wpd-editor-toolbar">
91
  <div id="wpdeb_b" title="<?php esc_attr_e("Bold", "wpdiscuz"); ?>" class="<?php echo $this->form["boldButton"] ? "wpd-enabled" : "wpd-disabled"; ?> wpd-editor-button" style="background-position: 1px 0;"></div>
92
  <input type="hidden" id="wpdeb_b-button" value="<?php echo esc_attr($this->form["boldButton"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_FORM); ?>[boldButton]" />
@@ -128,7 +128,7 @@ if (!defined("ABSPATH")) {
128
  <div class="wpd-opt-row" data-wpd-opt="enableQuickTags">
129
  <div class="wpd-opt-name">
130
  <label for="enableQuickTags"><?php echo esc_html($setting["options"]["enableQuickTags"]["label"]) ?></label>
131
- <p class="wpd-desc"><?php echo $setting["options"]["enableQuickTags"]["description"] ?></p>
132
  </div>
133
  <div class="wpd-opt-input">
134
  <div class="wpd-switcher">
@@ -146,7 +146,7 @@ if (!defined("ABSPATH")) {
146
  <div class="wpd-opt-row" data-wpd-opt="commenterNameLength">
147
  <div class="wpd-opt-name">
148
  <label for="commenterNameLength"><?php echo esc_html($setting["options"]["commenterNameLength"]["label"]) ?></label>
149
- <p class="wpd-desc"><?php echo $setting["options"]["commenterNameLength"]["description"] ?></p>
150
  </div>
151
  <div class="wpd-opt-input">
152
  <span><input type="number" value="<?php echo esc_attr($this->form["commenterNameMinLength"]); ?>" min="1" name="<?php echo esc_attr(WpdiscuzCore::TAB_FORM); ?>[commenterNameMinLength]" id="commenterNameMinLength" style="width:70px;"> <?php esc_html_e("Min", "wpdiscuz") ?> </span>
@@ -162,7 +162,7 @@ if (!defined("ABSPATH")) {
162
  <div class="wpd-opt-row" data-wpd-opt="storeCommenterData">
163
  <div class="wpd-opt-name">
164
  <label for="storeCommenterData"><?php echo esc_html($setting["options"]["storeCommenterData"]["label"]) ?></label>
165
- <p class="wpd-desc"><?php echo $setting["options"]["storeCommenterData"]["description"] ?></p>
166
  </div>
167
  <div class="wpd-opt-input">
168
  <input type="number" value="<?php echo esc_attr($this->form["storeCommenterData"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_FORM); ?>[storeCommenterData]" id="storeCommenterData" style="width:100px;">
19
  <div class="wpd-opt-row" data-wpd-opt="commentFormView">
20
  <div class="wpd-opt-name">
21
  <label for="commentFormView"><?php echo esc_html($setting["options"]["commentFormView"]["label"]) ?></label>
22
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["commentFormView"]["description"]) ?></p>
23
  </div>
24
  <div class="wpd-opt-input">
25
  <div class="wpd-switch-field">
39
  <div class="wpd-opt-row" data-wpd-opt="enableDropAnimation">
40
  <div class="wpd-opt-name">
41
  <label for="enableDropAnimation"><?php echo esc_html($setting["options"]["enableDropAnimation"]["label"]) ?></label>
42
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableDropAnimation"]["description"]) ?></p>
43
  </div>
44
  <div class="wpd-opt-input">
45
  <div class="wpd-switcher">
57
  <div class="wpd-opt-row" data-wpd-opt="richEditor">
58
  <div class="wpd-opt-name">
59
  <label for="richEditor"><?php echo esc_html($setting["options"]["richEditor"]["label"]) ?></label>
60
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["richEditor"]["description"]) ?></p>
61
  </div>
62
  <div class="wpd-opt-input">
63
  <div class="wpd-radio">
86
  <div class="wpd-opt-row" data-wpd-opt="editorToolbar">
87
  <div class="wpd-opt-name" style="width: 100%;">
88
  <label for="editorToolbar"><?php echo esc_html($setting["options"]["editorToolbar"]["label"]) ?></label>
89
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["editorToolbar"]["description"]) ?></p>
90
  <div class="wpd-editor-toolbar">
91
  <div id="wpdeb_b" title="<?php esc_attr_e("Bold", "wpdiscuz"); ?>" class="<?php echo $this->form["boldButton"] ? "wpd-enabled" : "wpd-disabled"; ?> wpd-editor-button" style="background-position: 1px 0;"></div>
92
  <input type="hidden" id="wpdeb_b-button" value="<?php echo esc_attr($this->form["boldButton"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_FORM); ?>[boldButton]" />
128
  <div class="wpd-opt-row" data-wpd-opt="enableQuickTags">
129
  <div class="wpd-opt-name">
130
  <label for="enableQuickTags"><?php echo esc_html($setting["options"]["enableQuickTags"]["label"]) ?></label>
131
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableQuickTags"]["description"]) ?></p>
132
  </div>
133
  <div class="wpd-opt-input">
134
  <div class="wpd-switcher">
146
  <div class="wpd-opt-row" data-wpd-opt="commenterNameLength">
147
  <div class="wpd-opt-name">
148
  <label for="commenterNameLength"><?php echo esc_html($setting["options"]["commenterNameLength"]["label"]) ?></label>
149
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["commenterNameLength"]["description"]) ?></p>
150
  </div>
151
  <div class="wpd-opt-input">
152
  <span><input type="number" value="<?php echo esc_attr($this->form["commenterNameMinLength"]); ?>" min="1" name="<?php echo esc_attr(WpdiscuzCore::TAB_FORM); ?>[commenterNameMinLength]" id="commenterNameMinLength" style="width:70px;"> <?php esc_html_e("Min", "wpdiscuz") ?> </span>
162
  <div class="wpd-opt-row" data-wpd-opt="storeCommenterData">
163
  <div class="wpd-opt-name">
164
  <label for="storeCommenterData"><?php echo esc_html($setting["options"]["storeCommenterData"]["label"]) ?></label>
165
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["storeCommenterData"]["description"]) ?></p>
166
  </div>
167
  <div class="wpd-opt-input">
168
  <input type="number" value="<?php echo esc_attr($this->form["storeCommenterData"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_FORM); ?>[storeCommenterData]" id="storeCommenterData" style="width:100px;">
options/options-layouts/html-general.php CHANGED
@@ -8,7 +8,7 @@ if (!defined("ABSPATH")) {
8
  <div class="wpd-opt-row" data-wpd-opt="isEnableOnHome">
9
  <div class="wpd-opt-name">
10
  <label for="isEnableOnHome"><?php echo esc_html($setting["options"]["isEnableOnHome"]["label"]) ?></label>
11
- <p class="wpd-desc"><?php echo $setting["options"]["isEnableOnHome"]["description"] ?></p>
12
  </div>
13
  <div class="wpd-opt-input">
14
  <div class="wpd-switcher">
@@ -26,7 +26,7 @@ if (!defined("ABSPATH")) {
26
  <div class="wpd-opt-row" data-wpd-opt="isNativeAjaxEnabled">
27
  <div class="wpd-opt-name">
28
  <label for="isNativeAjaxEnabled"><?php echo esc_html($setting["options"]["isNativeAjaxEnabled"]["label"]) ?></label>
29
- <p class="wpd-desc"><?php echo $setting["options"]["isNativeAjaxEnabled"]["description"] ?></p>
30
  </div>
31
  <div class="wpd-opt-input">
32
  <div class="wpd-switcher">
@@ -43,7 +43,7 @@ if (!defined("ABSPATH")) {
43
  <div class="wpd-opt-row" data-wpd-opt="loadComboVersion">
44
  <div class="wpd-opt-name">
45
  <label for="loadComboVersion"><?php echo esc_html($setting["options"]["loadComboVersion"]["label"]) ?></label>
46
- <p class="wpd-desc"><?php echo $setting["options"]["loadComboVersion"]["description"] ?></p>
47
  </div>
48
  <div class="wpd-opt-input">
49
  <div class="wpd-switcher">
@@ -60,7 +60,7 @@ if (!defined("ABSPATH")) {
60
  <div class="wpd-opt-row" data-wpd-opt="loadMinVersion">
61
  <div class="wpd-opt-name">
62
  <label for="loadMinVersion"><?php echo esc_html($setting["options"]["loadMinVersion"]["label"]) ?></label>
63
- <p class="wpd-desc"><?php echo $setting["options"]["loadMinVersion"]["description"] ?></p>
64
  </div>
65
  <div class="wpd-opt-input">
66
  <div class="wpd-switcher">
@@ -78,7 +78,7 @@ if (!defined("ABSPATH")) {
78
  <div class="wpd-opt-row" data-wpd-opt="commentLinkFilter">
79
  <div class="wpd-opt-name">
80
  <label><?php echo esc_html($setting["options"]["commentLinkFilter"]["label"]) ?></label>
81
- <p class="wpd-desc"><?php echo $setting["options"]["commentLinkFilter"]["description"] ?></p>
82
  </div>
83
  <div class="wpd-opt-input">
84
  <div class="wpd-radio">
@@ -107,7 +107,7 @@ if (!defined("ABSPATH")) {
107
  <div class="wpd-opt-row" data-wpd-opt="redirectPage">
108
  <div class="wpd-opt-name">
109
  <label for="redirectPage"><?php echo esc_html($setting["options"]["redirectPage"]["label"]) ?></label>
110
- <p class="wpd-desc"><?php echo $setting["options"]["redirectPage"]["description"] ?></p>
111
  </div>
112
  <div class="wpd-opt-input">
113
  <?php
@@ -129,7 +129,7 @@ if (!defined("ABSPATH")) {
129
  <div class="wpd-opt-row" data-wpd-opt="simpleCommentDate">
130
  <div class="wpd-opt-name">
131
  <label for="simpleCommentDate"><?php echo esc_html($setting["options"]["simpleCommentDate"]["label"]) ?></label>
132
- <p class="wpd-desc"><?php echo $setting["options"]["simpleCommentDate"]["description"] ?></p>
133
  </div>
134
  <div class="wpd-opt-input">
135
  <div class="wpd-switcher" style="margin-bottom: 5px;">
@@ -151,7 +151,7 @@ if (!defined("ABSPATH")) {
151
  <div class="wpd-opt-row" data-wpd-opt="dateDiffFormat">
152
  <div class="wpd-opt-name">
153
  <label for="dateDiffFormat"><?php echo esc_html($setting["options"]["dateDiffFormat"]["label"]) ?></label>
154
- <p class="wpd-desc"><?php echo $setting["options"]["dateDiffFormat"]["description"] ?></p>
155
  </div>
156
  <div class="wpd-opt-input">
157
  <input type="text" value="<?php echo esc_attr($this->general["dateDiffFormat"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_GENERAL); ?>[dateDiffFormat]" id="dateDiffFormat" />
@@ -166,7 +166,7 @@ if (!defined("ABSPATH")) {
166
  <div class="wpd-opt-row" data-wpd-opt="isUsePoMo">
167
  <div class="wpd-opt-name">
168
  <label for="isUsePoMo"><?php echo esc_html($setting["options"]["isUsePoMo"]["label"]) ?></label>
169
- <p class="wpd-desc"><?php echo $setting["options"]["isUsePoMo"]["description"] ?></p>
170
  </div>
171
  <div class="wpd-opt-input">
172
  <div class="wpd-switcher">
@@ -184,7 +184,7 @@ if (!defined("ABSPATH")) {
184
  <div class="wpd-opt-row" data-wpd-opt="showPluginPoweredByLink" style="border-bottom: none;">
185
  <div class="wpd-opt-name">
186
  <label for="showPluginPoweredByLink" style="padding-right: 20px;"><?php echo esc_html($setting["options"]["showPluginPoweredByLink"]["label"]) ?></label>
187
- <p class="wpd-desc"><?php echo $setting["options"]["showPluginPoweredByLink"]["description"] ?></p>
188
  </div>
189
  <div class="wpd-opt-input">
190
  <label for="showPluginPoweredByLink">
@@ -206,7 +206,7 @@ if (!defined("ABSPATH")) {
206
  <div class="wpd-opt-row" data-wpd-opt="isCacheEnabled">
207
  <div class="wpd-opt-name">
208
  <label for="isCacheEnabled"><?php echo esc_html($setting["options"]["isCacheEnabled"]["label"]) ?></label>
209
- <p class="wpd-desc"><?php echo $setting["options"]["isCacheEnabled"]["description"] ?></p>
210
  </div>
211
  <div class="wpd-opt-input">
212
  <div class="wpd-switcher">
@@ -224,7 +224,7 @@ if (!defined("ABSPATH")) {
224
  <div class="wpd-opt-row" data-wpd-opt="cacheTimeout" style="border-bottom: none;">
225
  <div class="wpd-opt-name">
226
  <label for="cacheTimeout"><?php echo esc_html($setting["options"]["cacheTimeout"]["label"]) ?></label>
227
- <p class="wpd-desc"><?php echo $setting["options"]["cacheTimeout"]["description"] ?></p>
228
  </div>
229
  <div class="wpd-opt-input">
230
  <?php $cacheTimeout = isset($this->general["cacheTimeout"]) && ($days = absint($this->general["cacheTimeout"])) ? $days : 10; ?>
@@ -244,7 +244,7 @@ if (!defined("ABSPATH")) {
244
  <div class="wpd-opt-row" data-wpd-opt="removeVoteData">
245
  <div class="wpd-opt-name">
246
  <label for="removeVoteData"><?php echo esc_html($setting["options"]["removeVoteData"]["label"]) ?></label>
247
- <p class="wpd-desc"><?php echo $setting["options"]["removeVoteData"]["description"] ?></p>
248
  </div>
249
  <div class="wpd-opt-input">
250
  <?php $voteUrl = admin_url("admin-post.php?action=removeVoteData"); ?>
@@ -260,7 +260,7 @@ if (!defined("ABSPATH")) {
260
  <div class="wpd-opt-row" data-wpd-opt="purgeAllCaches">
261
  <div class="wpd-opt-name">
262
  <label for="purgeAllCaches"><?php echo esc_html($setting["options"]["purgeAllCaches"]["label"]) ?></label>
263
- <p class="wpd-desc"><?php echo $setting["options"]["purgeAllCaches"]["description"] ?></p>
264
  </div>
265
  <div class="wpd-opt-input">
266
  <?php $allCacheUrl = admin_url("admin-post.php?action=purgeAllCaches"); ?>
8
  <div class="wpd-opt-row" data-wpd-opt="isEnableOnHome">
9
  <div class="wpd-opt-name">
10
  <label for="isEnableOnHome"><?php echo esc_html($setting["options"]["isEnableOnHome"]["label"]) ?></label>
11
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["isEnableOnHome"]["description"]) ?></p>
12
  </div>
13
  <div class="wpd-opt-input">
14
  <div class="wpd-switcher">
26
  <div class="wpd-opt-row" data-wpd-opt="isNativeAjaxEnabled">
27
  <div class="wpd-opt-name">
28
  <label for="isNativeAjaxEnabled"><?php echo esc_html($setting["options"]["isNativeAjaxEnabled"]["label"]) ?></label>
29
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["isNativeAjaxEnabled"]["description"]) ?></p>
30
  </div>
31
  <div class="wpd-opt-input">
32
  <div class="wpd-switcher">
43
  <div class="wpd-opt-row" data-wpd-opt="loadComboVersion">
44
  <div class="wpd-opt-name">
45
  <label for="loadComboVersion"><?php echo esc_html($setting["options"]["loadComboVersion"]["label"]) ?></label>
46
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["loadComboVersion"]["description"]) ?></p>
47
  </div>
48
  <div class="wpd-opt-input">
49
  <div class="wpd-switcher">
60
  <div class="wpd-opt-row" data-wpd-opt="loadMinVersion">
61
  <div class="wpd-opt-name">
62
  <label for="loadMinVersion"><?php echo esc_html($setting["options"]["loadMinVersion"]["label"]) ?></label>
63
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["loadMinVersion"]["description"]) ?></p>
64
  </div>
65
  <div class="wpd-opt-input">
66
  <div class="wpd-switcher">
78
  <div class="wpd-opt-row" data-wpd-opt="commentLinkFilter">
79
  <div class="wpd-opt-name">
80
  <label><?php echo esc_html($setting["options"]["commentLinkFilter"]["label"]) ?></label>
81
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["commentLinkFilter"]["description"]) ?></p>
82
  </div>
83
  <div class="wpd-opt-input">
84
  <div class="wpd-radio">
107
  <div class="wpd-opt-row" data-wpd-opt="redirectPage">
108
  <div class="wpd-opt-name">
109
  <label for="redirectPage"><?php echo esc_html($setting["options"]["redirectPage"]["label"]) ?></label>
110
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["redirectPage"]["description"]) ?></p>
111
  </div>
112
  <div class="wpd-opt-input">
113
  <?php
129
  <div class="wpd-opt-row" data-wpd-opt="simpleCommentDate">
130
  <div class="wpd-opt-name">
131
  <label for="simpleCommentDate"><?php echo esc_html($setting["options"]["simpleCommentDate"]["label"]) ?></label>
132
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["simpleCommentDate"]["description"]) ?></p>
133
  </div>
134
  <div class="wpd-opt-input">
135
  <div class="wpd-switcher" style="margin-bottom: 5px;">
151
  <div class="wpd-opt-row" data-wpd-opt="dateDiffFormat">
152
  <div class="wpd-opt-name">
153
  <label for="dateDiffFormat"><?php echo esc_html($setting["options"]["dateDiffFormat"]["label"]) ?></label>
154
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["dateDiffFormat"]["description"]) ?></p>
155
  </div>
156
  <div class="wpd-opt-input">
157
  <input type="text" value="<?php echo esc_attr($this->general["dateDiffFormat"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_GENERAL); ?>[dateDiffFormat]" id="dateDiffFormat" />
166
  <div class="wpd-opt-row" data-wpd-opt="isUsePoMo">
167
  <div class="wpd-opt-name">
168
  <label for="isUsePoMo"><?php echo esc_html($setting["options"]["isUsePoMo"]["label"]) ?></label>
169
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["isUsePoMo"]["description"]) ?></p>
170
  </div>
171
  <div class="wpd-opt-input">
172
  <div class="wpd-switcher">
184
  <div class="wpd-opt-row" data-wpd-opt="showPluginPoweredByLink" style="border-bottom: none;">
185
  <div class="wpd-opt-name">
186
  <label for="showPluginPoweredByLink" style="padding-right: 20px;"><?php echo esc_html($setting["options"]["showPluginPoweredByLink"]["label"]) ?></label>
187
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["showPluginPoweredByLink"]["description"]) ?></p>
188
  </div>
189
  <div class="wpd-opt-input">
190
  <label for="showPluginPoweredByLink">
206
  <div class="wpd-opt-row" data-wpd-opt="isCacheEnabled">
207
  <div class="wpd-opt-name">
208
  <label for="isCacheEnabled"><?php echo esc_html($setting["options"]["isCacheEnabled"]["label"]) ?></label>
209
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["isCacheEnabled"]["description"]) ?></p>
210
  </div>
211
  <div class="wpd-opt-input">
212
  <div class="wpd-switcher">
224
  <div class="wpd-opt-row" data-wpd-opt="cacheTimeout" style="border-bottom: none;">
225
  <div class="wpd-opt-name">
226
  <label for="cacheTimeout"><?php echo esc_html($setting["options"]["cacheTimeout"]["label"]) ?></label>
227
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["cacheTimeout"]["description"]) ?></p>
228
  </div>
229
  <div class="wpd-opt-input">
230
  <?php $cacheTimeout = isset($this->general["cacheTimeout"]) && ($days = absint($this->general["cacheTimeout"])) ? $days : 10; ?>
244
  <div class="wpd-opt-row" data-wpd-opt="removeVoteData">
245
  <div class="wpd-opt-name">
246
  <label for="removeVoteData"><?php echo esc_html($setting["options"]["removeVoteData"]["label"]) ?></label>
247
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["removeVoteData"]["description"]) ?></p>
248
  </div>
249
  <div class="wpd-opt-input">
250
  <?php $voteUrl = admin_url("admin-post.php?action=removeVoteData"); ?>
260
  <div class="wpd-opt-row" data-wpd-opt="purgeAllCaches">
261
  <div class="wpd-opt-name">
262
  <label for="purgeAllCaches"><?php echo esc_html($setting["options"]["purgeAllCaches"]["label"]) ?></label>
263
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["purgeAllCaches"]["description"]) ?></p>
264
  </div>
265
  <div class="wpd-opt-input">
266
  <?php $allCacheUrl = admin_url("admin-post.php?action=purgeAllCaches"); ?>
options/options-layouts/html-inline.php CHANGED
@@ -27,7 +27,7 @@ if (!defined("ABSPATH")) {
27
  <div class="wpd-opt-row" data-wpd-opt="showInlineFilterButton">
28
  <div class="wpd-opt-name">
29
  <label for="showInlineFilterButton"><?php echo esc_html($setting["options"]["showInlineFilterButton"]["label"]) ?></label>
30
- <p class="wpd-desc"><?php echo $setting["options"]["showInlineFilterButton"]["description"] ?></p>
31
  </div>
32
  <div class="wpd-opt-input">
33
  <div class="wpd-switcher">
@@ -46,7 +46,7 @@ if (!defined("ABSPATH")) {
46
  <div class="wpd-opt-row" data-wpd-opt="inlineFeedbackAttractionType">
47
  <div class="wpd-opt-name">
48
  <label><?php echo esc_html($setting["options"]["inlineFeedbackAttractionType"]["label"]) ?></label>
49
- <p class="wpd-desc"><?php echo $setting["options"]["inlineFeedbackAttractionType"]["description"] ?></p>
50
  </div>
51
  <div class="wpd-opt-input">
52
  <div class="wpd-radio">
27
  <div class="wpd-opt-row" data-wpd-opt="showInlineFilterButton">
28
  <div class="wpd-opt-name">
29
  <label for="showInlineFilterButton"><?php echo esc_html($setting["options"]["showInlineFilterButton"]["label"]) ?></label>
30
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["showInlineFilterButton"]["description"]) ?></p>
31
  </div>
32
  <div class="wpd-opt-input">
33
  <div class="wpd-switcher">
46
  <div class="wpd-opt-row" data-wpd-opt="inlineFeedbackAttractionType">
47
  <div class="wpd-opt-name">
48
  <label><?php echo esc_html($setting["options"]["inlineFeedbackAttractionType"]["label"]) ?></label>
49
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["inlineFeedbackAttractionType"]["description"]) ?></p>
50
  </div>
51
  <div class="wpd-opt-input">
52
  <div class="wpd-radio">
options/options-layouts/html-labels.php CHANGED
@@ -19,7 +19,7 @@ if (!defined("ABSPATH")) {
19
  <div class="wpd-opt-row" data-wpd-opt="blogRoleLabels" style="border-bottom: none;">
20
  <div class="wpd-opt-input" style="width: calc(100% - 40px);">
21
  <h2 style="margin-bottom: 0px;font-size: 15px; color: #555;"><?php echo esc_html($setting["options"]["blogRoleLabels"]["label"]) ?></h2>
22
- <p class="wpd-desc"><?php echo $setting["options"]["blogRoleLabels"]["description"] ?></p>
23
  <hr />
24
  <div class="wpd-multi-check" style="padding-top: 10px; padding-left: 10px;">
25
  <?php
@@ -45,7 +45,7 @@ if (!defined("ABSPATH")) {
45
  <div class="wpd-opt-row" data-wpd-opt="commenterLabelColors">
46
  <div class="wpd-opt-input" style="width: calc(100% - 40px);">
47
  <h2 style="margin-bottom: 0px;font-size: 15px; color: #555;"><?php echo esc_html($setting["options"]["commenterLabelColors"]["label"]) ?></h2>
48
- <p class="wpd-desc"><?php echo $setting["options"]["commenterLabelColors"]["description"] ?></p>
49
  <hr />
50
  <?php
51
  foreach ($this->labels["blogRoles"] as $roleName => $color) {
19
  <div class="wpd-opt-row" data-wpd-opt="blogRoleLabels" style="border-bottom: none;">
20
  <div class="wpd-opt-input" style="width: calc(100% - 40px);">
21
  <h2 style="margin-bottom: 0px;font-size: 15px; color: #555;"><?php echo esc_html($setting["options"]["blogRoleLabels"]["label"]) ?></h2>
22
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["blogRoleLabels"]["description"]) ?></p>
23
  <hr />
24
  <div class="wpd-multi-check" style="padding-top: 10px; padding-left: 10px;">
25
  <?php
45
  <div class="wpd-opt-row" data-wpd-opt="commenterLabelColors">
46
  <div class="wpd-opt-input" style="width: calc(100% - 40px);">
47
  <h2 style="margin-bottom: 0px;font-size: 15px; color: #555;"><?php echo esc_html($setting["options"]["commenterLabelColors"]["label"]) ?></h2>
48
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["commenterLabelColors"]["description"]) ?></p>
49
  <hr />
50
  <?php
51
  foreach ($this->labels["blogRoles"] as $roleName => $color) {
options/options-layouts/html-live.php CHANGED
@@ -41,7 +41,7 @@ if (!defined("ABSPATH")) {
41
  <div class="wpd-opt-row" data-wpd-opt="bubbleLocation">
42
  <div class="wpd-opt-name">
43
  <label for="bubbleLocation"><?php echo esc_html($setting["options"]["bubbleLocation"]["label"]) ?></label>
44
- <p class="wpd-desc"><?php echo $setting["options"]["bubbleLocation"]["description"] ?></p>
45
  </div>
46
  <div class="wpd-opt-input">
47
  <div class="wpd-switch-field">
@@ -63,7 +63,7 @@ if (!defined("ABSPATH")) {
63
  <div class="wpd-opt-row" data-wpd-opt="bubbleLiveUpdate">
64
  <div class="wpd-opt-name">
65
  <label><?php echo esc_html($setting["options"]["bubbleLiveUpdate"]["label"]) ?></label>
66
- <p class="wpd-desc"><?php echo $setting["options"]["bubbleLiveUpdate"]["description"] ?></p>
67
  </div>
68
  <div class="wpd-opt-input">
69
  <div class="wpd-switch-field">
@@ -84,7 +84,7 @@ if (!defined("ABSPATH")) {
84
  <div class="wpd-opt-name">
85
  <label><?php echo esc_html($setting["options"]["bubbleShowNewCommentMessage"]["label"]) ?></label>
86
  <div style="width: 76%; margin-top: 5px;"><img src="<?php echo esc_url_raw(plugins_url(WPDISCUZ_DIR_NAME . "/assets/img/dashboard/bubble-new-comment-info.png")); ?>" style="width: 100%;"/></div>
87
- <p class="wpd-desc"><?php echo $setting["options"]["bubbleShowNewCommentMessage"]["description"] ?></p>
88
  </div>
89
  <div class="wpd-opt-input">
90
  <div class="wpd-switch-field">
@@ -105,7 +105,7 @@ if (!defined("ABSPATH")) {
105
  <div class="wpd-opt-name">
106
  <label for="bubbleHintTimeout"><?php echo esc_html($setting["options"]["bubbleHintTimeout"]["label"]) ?></label>
107
  <div style="width: 77%; margin-top: 5px;"><img src="<?php echo esc_url_raw(plugins_url(WPDISCUZ_DIR_NAME . "/assets/img/dashboard/bubble-invite-to-comment.png")); ?>" style="width: 100%"/></div>
108
- <p class="wpd-desc"><?php echo $setting["options"]["bubbleHintTimeout"]["description"] ?></p>
109
  </div>
110
  <div class="wpd-opt-input">
111
  <span><input type="number" value="<?php echo esc_attr($this->live["bubbleHintTimeout"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_LIVE); ?>[bubbleHintTimeout]" id="bubbleHintTimeout" style="width:70px;"> <?php esc_html_e("seconds", "wpdiscuz") ?></span>
@@ -120,7 +120,7 @@ if (!defined("ABSPATH")) {
120
  <div class="wpd-opt-row" data-wpd-opt="bubbleHintHideTimeout">
121
  <div class="wpd-opt-name">
122
  <label for="bubbleHintHideTimeout"><?php echo esc_html($setting["options"]["bubbleHintHideTimeout"]["label"]) ?></label>
123
- <p class="wpd-desc"><?php echo $setting["options"]["bubbleHintHideTimeout"]["description"] ?></p>
124
  </div>
125
  <div class="wpd-opt-input">
126
  <span><input type="number" value="<?php echo esc_attr($this->live["bubbleHintHideTimeout"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_LIVE); ?>[bubbleHintHideTimeout]" id="bubbleHintHideTimeout" style="width:70px;"> <?php esc_html_e("seconds", "wpdiscuz") ?></span>
@@ -135,7 +135,7 @@ if (!defined("ABSPATH")) {
135
  <div class="wpd-opt-row" data-wpd-opt="commentListUpdateType">
136
  <div class="wpd-opt-name">
137
  <label for="commentListUpdateType"><?php echo esc_html($setting["options"]["commentListUpdateType"]["label"]) ?></label>
138
- <p class="wpd-desc"><?php echo $setting["options"]["commentListUpdateType"]["description"] ?></p>
139
  </div>
140
  <div class="wpd-opt-input">
141
  <div class="wpd-switch-field">
@@ -155,7 +155,7 @@ if (!defined("ABSPATH")) {
155
  <div class="wpd-opt-row" data-wpd-opt="liveUpdateGuests">
156
  <div class="wpd-opt-name">
157
  <label for="liveUpdateGuests"><?php echo esc_html($setting["options"]["liveUpdateGuests"]["label"]) ?></label>
158
- <p class="wpd-desc"><?php echo $setting["options"]["liveUpdateGuests"]["description"] ?></p>
159
  </div>
160
  <div class="wpd-opt-input">
161
  <div class="wpd-switcher">
@@ -173,7 +173,7 @@ if (!defined("ABSPATH")) {
173
  <div class="wpd-opt-row" data-wpd-opt="commentListUpdateTimer">
174
  <div class="wpd-opt-name">
175
  <label for="commentListUpdateTimer"><?php echo esc_html($setting["options"]["commentListUpdateTimer"]["label"]) ?></label>
176
- <p class="wpd-desc"><?php echo $setting["options"]["commentListUpdateTimer"]["description"] ?></p>
177
  </div>
178
  <div class="wpd-opt-input">
179
  <select id="commentListUpdateTimer" name="<?php echo esc_attr(WpdiscuzCore::TAB_LIVE); ?>[commentListUpdateTimer]">
41
  <div class="wpd-opt-row" data-wpd-opt="bubbleLocation">
42
  <div class="wpd-opt-name">
43
  <label for="bubbleLocation"><?php echo esc_html($setting["options"]["bubbleLocation"]["label"]) ?></label>
44
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["bubbleLocation"]["description"]) ?></p>
45
  </div>
46
  <div class="wpd-opt-input">
47
  <div class="wpd-switch-field">
63
  <div class="wpd-opt-row" data-wpd-opt="bubbleLiveUpdate">
64
  <div class="wpd-opt-name">
65
  <label><?php echo esc_html($setting["options"]["bubbleLiveUpdate"]["label"]) ?></label>
66
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["bubbleLiveUpdate"]["description"]) ?></p>
67
  </div>
68
  <div class="wpd-opt-input">
69
  <div class="wpd-switch-field">
84
  <div class="wpd-opt-name">
85
  <label><?php echo esc_html($setting["options"]["bubbleShowNewCommentMessage"]["label"]) ?></label>
86
  <div style="width: 76%; margin-top: 5px;"><img src="<?php echo esc_url_raw(plugins_url(WPDISCUZ_DIR_NAME . "/assets/img/dashboard/bubble-new-comment-info.png")); ?>" style="width: 100%;"/></div>
87
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["bubbleShowNewCommentMessage"]["description"]) ?></p>
88
  </div>
89
  <div class="wpd-opt-input">
90
  <div class="wpd-switch-field">
105
  <div class="wpd-opt-name">
106
  <label for="bubbleHintTimeout"><?php echo esc_html($setting["options"]["bubbleHintTimeout"]["label"]) ?></label>
107
  <div style="width: 77%; margin-top: 5px;"><img src="<?php echo esc_url_raw(plugins_url(WPDISCUZ_DIR_NAME . "/assets/img/dashboard/bubble-invite-to-comment.png")); ?>" style="width: 100%"/></div>
108
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["bubbleHintTimeout"]["description"]) ?></p>
109
  </div>
110
  <div class="wpd-opt-input">
111
  <span><input type="number" value="<?php echo esc_attr($this->live["bubbleHintTimeout"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_LIVE); ?>[bubbleHintTimeout]" id="bubbleHintTimeout" style="width:70px;"> <?php esc_html_e("seconds", "wpdiscuz") ?></span>
120
  <div class="wpd-opt-row" data-wpd-opt="bubbleHintHideTimeout">
121
  <div class="wpd-opt-name">
122
  <label for="bubbleHintHideTimeout"><?php echo esc_html($setting["options"]["bubbleHintHideTimeout"]["label"]) ?></label>
123
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["bubbleHintHideTimeout"]["description"]) ?></p>
124
  </div>
125
  <div class="wpd-opt-input">
126
  <span><input type="number" value="<?php echo esc_attr($this->live["bubbleHintHideTimeout"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_LIVE); ?>[bubbleHintHideTimeout]" id="bubbleHintHideTimeout" style="width:70px;"> <?php esc_html_e("seconds", "wpdiscuz") ?></span>
135
  <div class="wpd-opt-row" data-wpd-opt="commentListUpdateType">
136
  <div class="wpd-opt-name">
137
  <label for="commentListUpdateType"><?php echo esc_html($setting["options"]["commentListUpdateType"]["label"]) ?></label>
138
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["commentListUpdateType"]["description"]) ?></p>
139
  </div>
140
  <div class="wpd-opt-input">
141
  <div class="wpd-switch-field">
155
  <div class="wpd-opt-row" data-wpd-opt="liveUpdateGuests">
156
  <div class="wpd-opt-name">
157
  <label for="liveUpdateGuests"><?php echo esc_html($setting["options"]["liveUpdateGuests"]["label"]) ?></label>
158
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["liveUpdateGuests"]["description"]) ?></p>
159
  </div>
160
  <div class="wpd-opt-input">
161
  <div class="wpd-switcher">
173
  <div class="wpd-opt-row" data-wpd-opt="commentListUpdateTimer">
174
  <div class="wpd-opt-name">
175
  <label for="commentListUpdateTimer"><?php echo esc_html($setting["options"]["commentListUpdateTimer"]["label"]) ?></label>
176
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["commentListUpdateTimer"]["description"]) ?></p>
177
  </div>
178
  <div class="wpd-opt-input">
179
  <select id="commentListUpdateTimer" name="<?php echo esc_attr(WpdiscuzCore::TAB_LIVE); ?>[commentListUpdateTimer]">
options/options-layouts/html-login.php CHANGED
@@ -19,7 +19,7 @@ if (!defined("ABSPATH")) {
19
  <div class="wpd-opt-row" data-wpd-opt="showLoggedInUsername">
20
  <div class="wpd-opt-name">
21
  <label for="showLoggedInUsername"><?php echo esc_html($setting["options"]["showLoggedInUsername"]["label"]) ?></label>
22
- <p class="wpd-desc"><?php echo $setting["options"]["showLoggedInUsername"]["description"] ?></p>
23
  </div>
24
  <div class="wpd-opt-input">
25
  <div class="wpd-switcher">
@@ -37,7 +37,7 @@ if (!defined("ABSPATH")) {
37
  <div class="wpd-opt-row" data-wpd-opt="showLoginLinkForGuests">
38
  <div class="wpd-opt-name">
39
  <label for="showLoginLinkForGuests"><?php echo esc_html($setting["options"]["showLoginLinkForGuests"]["label"]) ?></label>
40
- <p class="wpd-desc"><?php echo $setting["options"]["showLoginLinkForGuests"]["description"] ?></p>
41
  </div>
42
  <div class="wpd-opt-input">
43
  <div class="wpd-switcher">
@@ -55,7 +55,7 @@ if (!defined("ABSPATH")) {
55
  <div class="wpd-opt-row" data-wpd-opt="loginUrl">
56
  <div class="wpd-opt-name">
57
  <label for="loginUrl"><?php echo esc_html($setting["options"]["loginUrl"]["label"]) ?></label>
58
- <p class="wpd-desc"><?php echo $setting["options"]["loginUrl"]["description"] ?></p>
59
  </div>
60
  <div class="wpd-opt-input">
61
  <input type="url" value="<?php echo esc_attr($this->login["loginUrl"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_LOGIN); ?>[loginUrl]" id="loginUrl" placeholder="<?php echo esc_url_raw(home_url("/my-login-page/")) ?>" />
@@ -70,7 +70,7 @@ if (!defined("ABSPATH")) {
70
  <div class="wpd-opt-row" data-wpd-opt="myContentSettings">
71
  <div class="wpd-opt-name">
72
  <?php echo esc_html($setting["options"]["myContentSettings"]["label"]) ?>
73
- <p class="wpd-desc"><?php echo $setting["options"]["myContentSettings"]["description"] ?></p>
74
  </div>
75
  <div class="wpd-opt-input">
76
  <div class="wpd-optset">
@@ -120,7 +120,7 @@ if (!defined("ABSPATH")) {
120
  <div class="wpd-opt-row" data-wpd-opt="enableProfileURLs">
121
  <div class="wpd-opt-name">
122
  <label for="enableProfileURLs"><?php echo esc_html($setting["options"]["enableProfileURLs"]["label"]) ?></label>
123
- <p class="wpd-desc"><?php echo $setting["options"]["enableProfileURLs"]["description"] ?></p>
124
  </div>
125
  <div class="wpd-opt-input">
126
  <div class="wpd-switcher">
@@ -138,7 +138,7 @@ if (!defined("ABSPATH")) {
138
  <div class="wpd-opt-row" data-wpd-opt="websiteAsProfileUrl">
139
  <div class="wpd-opt-name">
140
  <label for="websiteAsProfileUrl"><?php echo esc_html($setting["options"]["websiteAsProfileUrl"]["label"]) ?></label>
141
- <p class="wpd-desc"><?php echo $setting["options"]["websiteAsProfileUrl"]["description"] ?></p>
142
  </div>
143
  <div class="wpd-opt-input">
144
  <div class="wpd-switcher">
@@ -156,7 +156,7 @@ if (!defined("ABSPATH")) {
156
  <div class="wpd-opt-row" data-wpd-opt="isUserByEmail">
157
  <div class="wpd-opt-name">
158
  <label for="isUserByEmail"><?php echo esc_html($setting["options"]["isUserByEmail"]["label"]) ?></label>
159
- <p class="wpd-desc"><?php echo $setting["options"]["isUserByEmail"]["description"] ?></p>
160
  </div>
161
  <div class="wpd-opt-input">
162
  <div class="wpd-switcher">
19
  <div class="wpd-opt-row" data-wpd-opt="showLoggedInUsername">
20
  <div class="wpd-opt-name">
21
  <label for="showLoggedInUsername"><?php echo esc_html($setting["options"]["showLoggedInUsername"]["label"]) ?></label>
22
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["showLoggedInUsername"]["description"]) ?></p>
23
  </div>
24
  <div class="wpd-opt-input">
25
  <div class="wpd-switcher">
37
  <div class="wpd-opt-row" data-wpd-opt="showLoginLinkForGuests">
38
  <div class="wpd-opt-name">
39
  <label for="showLoginLinkForGuests"><?php echo esc_html($setting["options"]["showLoginLinkForGuests"]["label"]) ?></label>
40
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["showLoginLinkForGuests"]["description"]) ?></p>
41
  </div>
42
  <div class="wpd-opt-input">
43
  <div class="wpd-switcher">
55
  <div class="wpd-opt-row" data-wpd-opt="loginUrl">
56
  <div class="wpd-opt-name">
57
  <label for="loginUrl"><?php echo esc_html($setting["options"]["loginUrl"]["label"]) ?></label>
58
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["loginUrl"]["description"]) ?></p>
59
  </div>
60
  <div class="wpd-opt-input">
61
  <input type="url" value="<?php echo esc_attr($this->login["loginUrl"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_LOGIN); ?>[loginUrl]" id="loginUrl" placeholder="<?php echo esc_url_raw(home_url("/my-login-page/")) ?>" />
70
  <div class="wpd-opt-row" data-wpd-opt="myContentSettings">
71
  <div class="wpd-opt-name">
72
  <?php echo esc_html($setting["options"]["myContentSettings"]["label"]) ?>
73
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["myContentSettings"]["description"]) ?></p>
74
  </div>
75
  <div class="wpd-opt-input">
76
  <div class="wpd-optset">
120
  <div class="wpd-opt-row" data-wpd-opt="enableProfileURLs">
121
  <div class="wpd-opt-name">
122
  <label for="enableProfileURLs"><?php echo esc_html($setting["options"]["enableProfileURLs"]["label"]) ?></label>
123
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableProfileURLs"]["description"]) ?></p>
124
  </div>
125
  <div class="wpd-opt-input">
126
  <div class="wpd-switcher">
138
  <div class="wpd-opt-row" data-wpd-opt="websiteAsProfileUrl">
139
  <div class="wpd-opt-name">
140
  <label for="websiteAsProfileUrl"><?php echo esc_html($setting["options"]["websiteAsProfileUrl"]["label"]) ?></label>
141
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["websiteAsProfileUrl"]["description"]) ?></p>
142
  </div>
143
  <div class="wpd-opt-input">
144
  <div class="wpd-switcher">
156
  <div class="wpd-opt-row" data-wpd-opt="isUserByEmail">
157
  <div class="wpd-opt-name">
158
  <label for="isUserByEmail"><?php echo esc_html($setting["options"]["isUserByEmail"]["label"]) ?></label>
159
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["isUserByEmail"]["description"]) ?></p>
160
  </div>
161
  <div class="wpd-opt-input">
162
  <div class="wpd-switcher">
options/options-layouts/html-moderation.php CHANGED
@@ -19,7 +19,7 @@ if (!defined("ABSPATH")) {
19
  <div class="wpd-opt-row" data-wpd-opt="commentEditableTime">
20
  <div class="wpd-opt-name">
21
  <label for="commentEditableTime"><?php echo esc_html($setting["options"]["commentEditableTime"]["label"]) ?></label>
22
- <p class="wpd-desc"><?php echo $setting["options"]["commentEditableTime"]["description"] ?></p>
23
  </div>
24
  <div class="wpd-opt-input">
25
  <select id="commentEditableTime" name="<?php echo esc_attr(WpdiscuzCore::TAB_MODERATION); ?>[commentEditableTime]">
@@ -42,7 +42,7 @@ if (!defined("ABSPATH")) {
42
  <div class="wpd-opt-row" data-wpd-opt="enableEditingWhenHaveReplies">
43
  <div class="wpd-opt-name">
44
  <label for="enableEditingWhenHaveReplies"><?php echo esc_html($setting["options"]["enableEditingWhenHaveReplies"]["label"]) ?></label>
45
- <p class="wpd-desc"><?php echo $setting["options"]["enableEditingWhenHaveReplies"]["description"] ?></p>
46
  </div>
47
  <div class="wpd-opt-input">
48
  <div class="wpd-switcher">
@@ -60,7 +60,7 @@ if (!defined("ABSPATH")) {
60
  <div class="wpd-opt-row" data-wpd-opt="displayEditingInfo">
61
  <div class="wpd-opt-name">
62
  <label for="displayEditingInfo"><?php echo esc_html($setting["options"]["displayEditingInfo"]["label"]) ?></label>
63
- <p class="wpd-desc"><?php echo $setting["options"]["displayEditingInfo"]["description"] ?></p>
64
  </div>
65
  <div class="wpd-opt-input">
66
  <div class="wpd-switcher">
@@ -78,7 +78,7 @@ if (!defined("ABSPATH")) {
78
  <div class="wpd-opt-row" data-wpd-opt="enableStickButton">
79
  <div class="wpd-opt-name">
80
  <label for="enableStickButton"><?php echo esc_html($setting["options"]["enableStickButton"]["label"]) ?></label>
81
- <p class="wpd-desc"><?php echo $setting["options"]["enableStickButton"]["description"] ?></p>
82
  </div>
83
  <div class="wpd-opt-input">
84
  <div class="wpd-switcher">
@@ -96,7 +96,7 @@ if (!defined("ABSPATH")) {
96
  <div class="wpd-opt-row" data-wpd-opt="enableCloseButton">
97
  <div class="wpd-opt-name">
98
  <label for="enableCloseButton"><?php echo esc_html($setting["options"]["enableCloseButton"]["label"]) ?></label>
99
- <p class="wpd-desc"><?php echo $setting["options"]["enableCloseButton"]["description"] ?></p>
100
  </div>
101
  <div class="wpd-opt-input">
102
  <div class="wpd-switcher">
@@ -114,7 +114,7 @@ if (!defined("ABSPATH")) {
114
  <div class="wpd-opt-row" data-wpd-opt="userCommentsLimit">
115
  <div class="wpd-opt-name">
116
  <label for="userCommentsLimit"><?php echo esc_html($setting["options"]["userCommentsLimit"]["label"]) ?></label>
117
- <p class="wpd-desc"><?php echo $setting["options"]["userCommentsLimit"]["description"] ?></p>
118
  </div>
119
  <div class="wpd-opt-input">
120
  <div class="wpd-switch-field">
19
  <div class="wpd-opt-row" data-wpd-opt="commentEditableTime">
20
  <div class="wpd-opt-name">
21
  <label for="commentEditableTime"><?php echo esc_html($setting["options"]["commentEditableTime"]["label"]) ?></label>
22
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["commentEditableTime"]["description"]) ?></p>
23
  </div>
24
  <div class="wpd-opt-input">
25
  <select id="commentEditableTime" name="<?php echo esc_attr(WpdiscuzCore::TAB_MODERATION); ?>[commentEditableTime]">
42
  <div class="wpd-opt-row" data-wpd-opt="enableEditingWhenHaveReplies">
43
  <div class="wpd-opt-name">
44
  <label for="enableEditingWhenHaveReplies"><?php echo esc_html($setting["options"]["enableEditingWhenHaveReplies"]["label"]) ?></label>
45
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableEditingWhenHaveReplies"]["description"]) ?></p>
46
  </div>
47
  <div class="wpd-opt-input">
48
  <div class="wpd-switcher">
60
  <div class="wpd-opt-row" data-wpd-opt="displayEditingInfo">
61
  <div class="wpd-opt-name">
62
  <label for="displayEditingInfo"><?php echo esc_html($setting["options"]["displayEditingInfo"]["label"]) ?></label>
63
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["displayEditingInfo"]["description"]) ?></p>
64
  </div>
65
  <div class="wpd-opt-input">
66
  <div class="wpd-switcher">
78
  <div class="wpd-opt-row" data-wpd-opt="enableStickButton">
79
  <div class="wpd-opt-name">
80
  <label for="enableStickButton"><?php echo esc_html($setting["options"]["enableStickButton"]["label"]) ?></label>
81
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableStickButton"]["description"]) ?></p>
82
  </div>
83
  <div class="wpd-opt-input">
84
  <div class="wpd-switcher">
96
  <div class="wpd-opt-row" data-wpd-opt="enableCloseButton">
97
  <div class="wpd-opt-name">
98
  <label for="enableCloseButton"><?php echo esc_html($setting["options"]["enableCloseButton"]["label"]) ?></label>
99
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableCloseButton"]["description"]) ?></p>
100
  </div>
101
  <div class="wpd-opt-input">
102
  <div class="wpd-switcher">
114
  <div class="wpd-opt-row" data-wpd-opt="userCommentsLimit">
115
  <div class="wpd-opt-name">
116
  <label for="userCommentsLimit"><?php echo esc_html($setting["options"]["userCommentsLimit"]["label"]) ?></label>
117
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["userCommentsLimit"]["description"]) ?></p>
118
  </div>
119
  <div class="wpd-opt-input">
120
  <div class="wpd-switch-field">
options/options-layouts/html-rating.php CHANGED
@@ -19,7 +19,7 @@ if (!defined("ABSPATH")) {
19
  <div class="wpd-opt-row" data-wpd-opt="enablePostRatingSchema">
20
  <div class="wpd-opt-name">
21
  <label for="enablePostRatingSchema"><?php echo esc_html($setting["options"]["enablePostRatingSchema"]["label"]) ?></label>
22
- <p class="wpd-desc"><?php echo $setting["options"]["enablePostRatingSchema"]["description"] ?></p>
23
  </div>
24
  <div class="wpd-opt-input">
25
  <div class="wpd-switcher">
@@ -37,7 +37,7 @@ if (!defined("ABSPATH")) {
37
  <div class="wpd-opt-row" data-wpd-opt="displayRatingOnPost">
38
  <div class="wpd-opt-name">
39
  <label for="displayRatingOnPost"><?php echo esc_html($setting["options"]["displayRatingOnPost"]["label"]) ?></label>
40
- <p class="wpd-desc"><?php echo $setting["options"]["displayRatingOnPost"]["description"] ?></p>
41
  </div>
42
  <div class="wpd-opt-input">
43
  <div>
@@ -67,7 +67,7 @@ if (!defined("ABSPATH")) {
67
  <div class="wpd-opt-row" data-wpd-opt="ratingStarColors">
68
  <div class="wpd-opt-input" style="width: calc(100% - 40px);">
69
  <h2 style="margin-bottom: 0px;font-size: 15px; color: #555;"><?php echo esc_html($setting["options"]["ratingStarColors"]["label"]) ?></h2>
70
- <p class="wpd-desc"><?php echo $setting["options"]["ratingStarColors"]["description"] ?></p>
71
  <hr />
72
  <div class="wpd-color-wrap">
73
  <input type="text" class="wpdiscuz-color-picker regular-text" value="<?php echo esc_attr($this->rating["ratingHoverColor"]); ?>" id="ratingHovratingHoverColorerColor" name="<?php echo esc_attr(WpdiscuzCore::TAB_RATING); ?>[ratingHoverColor]" placeholder="<?php esc_attr_e("Example: #00FF00", "wpdiscuz"); ?>"/>
19
  <div class="wpd-opt-row" data-wpd-opt="enablePostRatingSchema">
20
  <div class="wpd-opt-name">
21
  <label for="enablePostRatingSchema"><?php echo esc_html($setting["options"]["enablePostRatingSchema"]["label"]) ?></label>
22
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enablePostRatingSchema"]["description"]) ?></p>
23
  </div>
24
  <div class="wpd-opt-input">
25
  <div class="wpd-switcher">
37
  <div class="wpd-opt-row" data-wpd-opt="displayRatingOnPost">
38
  <div class="wpd-opt-name">
39
  <label for="displayRatingOnPost"><?php echo esc_html($setting["options"]["displayRatingOnPost"]["label"]) ?></label>
40
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["displayRatingOnPost"]["description"]) ?></p>
41
  </div>
42
  <div class="wpd-opt-input">
43
  <div>
67
  <div class="wpd-opt-row" data-wpd-opt="ratingStarColors">
68
  <div class="wpd-opt-input" style="width: calc(100% - 40px);">
69
  <h2 style="margin-bottom: 0px;font-size: 15px; color: #555;"><?php echo esc_html($setting["options"]["ratingStarColors"]["label"]) ?></h2>
70
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["ratingStarColors"]["description"]) ?></p>
71
  <hr />
72
  <div class="wpd-color-wrap">
73
  <input type="text" class="wpdiscuz-color-picker regular-text" value="<?php echo esc_attr($this->rating["ratingHoverColor"]); ?>" id="ratingHovratingHoverColorerColor" name="<?php echo esc_attr(WpdiscuzCore::TAB_RATING); ?>[ratingHoverColor]" placeholder="<?php esc_attr_e("Example: #00FF00", "wpdiscuz"); ?>"/>
options/options-layouts/html-recaptcha.php CHANGED
@@ -24,7 +24,7 @@ if (!defined("ABSPATH")) {
24
  <div class="wpd-opt-row" data-wpd-opt="requestMethod">
25
  <div class="wpd-opt-name">
26
  <label for="requestMethod"><?php echo esc_html($setting["options"]["requestMethod"]["label"]) ?></label>
27
- <p class="wpd-desc"><?php echo $setting["options"]["requestMethod"]["description"] ?></p>
28
  </div>
29
  <div class="wpd-opt-input">
30
  <select id="requestMethod" name="<?php echo esc_attr(WpdiscuzCore::TAB_RECAPTCHA); ?>[requestMethod]">
@@ -44,7 +44,7 @@ if (!defined("ABSPATH")) {
44
  <div class="wpd-opt-row" data-wpd-opt="showForGuests">
45
  <div class="wpd-opt-name">
46
  <label for="showForGuests"><?php echo esc_html($setting["options"]["showForGuests"]["label"]) ?></label>
47
- <p class="wpd-desc"><?php echo $setting["options"]["showForGuests"]["description"] ?></p>
48
  </div>
49
  <div class="wpd-opt-input">
50
  <div class="wpd-switcher">
@@ -62,7 +62,7 @@ if (!defined("ABSPATH")) {
62
  <div class="wpd-opt-row" data-wpd-opt="showForUsers">
63
  <div class="wpd-opt-name">
64
  <label for="showForUsers"><?php echo esc_html($setting["options"]["showForUsers"]["label"]) ?></label>
65
- <p class="wpd-desc"><?php echo $setting["options"]["showForUsers"]["description"] ?></p>
66
  </div>
67
  <div class="wpd-opt-input">
68
  <div class="wpd-switcher">
@@ -80,7 +80,7 @@ if (!defined("ABSPATH")) {
80
  <div class="wpd-opt-row" data-wpd-opt="isShowOnSubscribeForm">
81
  <div class="wpd-opt-name">
82
  <label for="isShowOnSubscribeForm"><?php echo esc_html($setting["options"]["isShowOnSubscribeForm"]["label"]) ?></label>
83
- <p class="wpd-desc"><?php echo $setting["options"]["isShowOnSubscribeForm"]["description"] ?></p>
84
  </div>
85
  <div class="wpd-opt-input">
86
  <div class="wpd-switcher">
@@ -102,7 +102,7 @@ if (!defined("ABSPATH")) {
102
  <div class="wpd-opt-row" data-wpd-opt="siteKey">
103
  <div class="wpd-opt-name">
104
  <label for="siteKey"><?php echo esc_html($setting["options"]["siteKey"]["label"]) ?></label>
105
- <p class="wpd-desc"><?php echo $setting["options"]["siteKey"]["description"] ?></p>
106
  </div>
107
  <div class="wpd-opt-input">
108
  <input id="siteKey" type="text" name="<?php echo esc_attr(WpdiscuzCore::TAB_RECAPTCHA); ?>[siteKey]" placeholder="<?php esc_html_e("reCAPTCHA V2 Site Key", "wpdiscuz"); ?>" value="<?php echo esc_attr($this->recaptcha["siteKey"]); ?>" style="margin:1px;padding:3px 5px; width:90%;"/>
@@ -117,7 +117,7 @@ if (!defined("ABSPATH")) {
117
  <div class="wpd-opt-row" data-wpd-opt="secretKey">
118
  <div class="wpd-opt-name">
119
  <label for="secretKey"><?php echo esc_html($setting["options"]["secretKey"]["label"]) ?></label>
120
- <p class="wpd-desc"><?php echo $setting["options"]["secretKey"]["description"] ?></p>
121
  </div>
122
  <div class="wpd-opt-input">
123
  <input id="secretKey" type="text" name="<?php echo esc_attr(WpdiscuzCore::TAB_RECAPTCHA); ?>[secretKey]" placeholder="<?php esc_html_e("reCAPTCHA V2 Secret Key", "wpdiscuz"); ?>" value="<?php echo esc_attr($this->recaptcha["secretKey"]); ?>" style="margin: 1px;padding:3px 5px; width:90%;"/>
@@ -132,7 +132,7 @@ if (!defined("ABSPATH")) {
132
  <div class="wpd-opt-row" data-wpd-opt="theme">
133
  <div class="wpd-opt-name">
134
  <label for="theme"><?php echo esc_html($setting["options"]["theme"]["label"]) ?></label>
135
- <p class="wpd-desc"><?php echo $setting["options"]["theme"]["description"] ?></p>
136
  </div>
137
  <div class="wpd-opt-input">
138
  <select id="theme" name="<?php echo esc_attr(WpdiscuzCore::TAB_RECAPTCHA); ?>[theme]">
@@ -150,7 +150,7 @@ if (!defined("ABSPATH")) {
150
  <div class="wpd-opt-row" data-wpd-opt="lang">
151
  <div class="wpd-opt-name">
152
  <label for="lang"><?php echo esc_html($setting["options"]["lang"]["label"]) ?></label>
153
- <p class="wpd-desc"><?php echo $setting["options"]["lang"]["description"] ?></p>
154
  </div>
155
  <div class="wpd-opt-input">
156
  <input id="lang" type="text" name="<?php echo esc_attr(WpdiscuzCore::TAB_RECAPTCHA); ?>[lang]" value="<?php echo esc_attr($this->recaptcha["lang"]); ?>" placeholder="<?php esc_attr_e("Example en", "wpdiscuz"); ?>" style="margin: 1px;padding:3px 5px; width:120px;"/><br />
24
  <div class="wpd-opt-row" data-wpd-opt="requestMethod">
25
  <div class="wpd-opt-name">
26
  <label for="requestMethod"><?php echo esc_html($setting["options"]["requestMethod"]["label"]) ?></label>
27
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["requestMethod"]["description"]) ?></p>
28
  </div>
29
  <div class="wpd-opt-input">
30
  <select id="requestMethod" name="<?php echo esc_attr(WpdiscuzCore::TAB_RECAPTCHA); ?>[requestMethod]">
44
  <div class="wpd-opt-row" data-wpd-opt="showForGuests">
45
  <div class="wpd-opt-name">
46
  <label for="showForGuests"><?php echo esc_html($setting["options"]["showForGuests"]["label"]) ?></label>
47
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["showForGuests"]["description"]) ?></p>
48
  </div>
49
  <div class="wpd-opt-input">
50
  <div class="wpd-switcher">
62
  <div class="wpd-opt-row" data-wpd-opt="showForUsers">
63
  <div class="wpd-opt-name">
64
  <label for="showForUsers"><?php echo esc_html($setting["options"]["showForUsers"]["label"]) ?></label>
65
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["showForUsers"]["description"]) ?></p>
66
  </div>
67
  <div class="wpd-opt-input">
68
  <div class="wpd-switcher">
80
  <div class="wpd-opt-row" data-wpd-opt="isShowOnSubscribeForm">
81
  <div class="wpd-opt-name">
82
  <label for="isShowOnSubscribeForm"><?php echo esc_html($setting["options"]["isShowOnSubscribeForm"]["label"]) ?></label>
83
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["isShowOnSubscribeForm"]["description"]) ?></p>
84
  </div>
85
  <div class="wpd-opt-input">
86
  <div class="wpd-switcher">
102
  <div class="wpd-opt-row" data-wpd-opt="siteKey">
103
  <div class="wpd-opt-name">
104
  <label for="siteKey"><?php echo esc_html($setting["options"]["siteKey"]["label"]) ?></label>
105
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["siteKey"]["description"]) ?></p>
106
  </div>
107
  <div class="wpd-opt-input">
108
  <input id="siteKey" type="text" name="<?php echo esc_attr(WpdiscuzCore::TAB_RECAPTCHA); ?>[siteKey]" placeholder="<?php esc_html_e("reCAPTCHA V2 Site Key", "wpdiscuz"); ?>" value="<?php echo esc_attr($this->recaptcha["siteKey"]); ?>" style="margin:1px;padding:3px 5px; width:90%;"/>
117
  <div class="wpd-opt-row" data-wpd-opt="secretKey">
118
  <div class="wpd-opt-name">
119
  <label for="secretKey"><?php echo esc_html($setting["options"]["secretKey"]["label"]) ?></label>
120
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["secretKey"]["description"]) ?></p>
121
  </div>
122
  <div class="wpd-opt-input">
123
  <input id="secretKey" type="text" name="<?php echo esc_attr(WpdiscuzCore::TAB_RECAPTCHA); ?>[secretKey]" placeholder="<?php esc_html_e("reCAPTCHA V2 Secret Key", "wpdiscuz"); ?>" value="<?php echo esc_attr($this->recaptcha["secretKey"]); ?>" style="margin: 1px;padding:3px 5px; width:90%;"/>
132
  <div class="wpd-opt-row" data-wpd-opt="theme">
133
  <div class="wpd-opt-name">
134
  <label for="theme"><?php echo esc_html($setting["options"]["theme"]["label"]) ?></label>
135
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["theme"]["description"]) ?></p>
136
  </div>
137
  <div class="wpd-opt-input">
138
  <select id="theme" name="<?php echo esc_attr(WpdiscuzCore::TAB_RECAPTCHA); ?>[theme]">
150
  <div class="wpd-opt-row" data-wpd-opt="lang">
151
  <div class="wpd-opt-name">
152
  <label for="lang"><?php echo esc_html($setting["options"]["lang"]["label"]) ?></label>
153
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["lang"]["description"]) ?></p>
154
  </div>
155
  <div class="wpd-opt-input">
156
  <input id="lang" type="text" name="<?php echo esc_attr(WpdiscuzCore::TAB_RECAPTCHA); ?>[lang]" value="<?php echo esc_attr($this->recaptcha["lang"]); ?>" placeholder="<?php esc_attr_e("Example en", "wpdiscuz"); ?>" style="margin: 1px;padding:3px 5px; width:120px;"/><br />
options/options-layouts/html-social.php CHANGED
@@ -37,7 +37,7 @@ if (!defined("ABSPATH")) {
37
  <div class="wpd-opt-row" data-wpd-opt="socialLoginInSecondaryForm">
38
  <div class="wpd-opt-name">
39
  <label for="socialLoginInSecondaryForm"><?php echo esc_html($setting["options"]["socialLoginInSecondaryForm"]["label"]) ?></label>
40
- <p class="wpd-desc"><?php echo $setting["options"]["socialLoginInSecondaryForm"]["description"] ?></p>
41
  </div>
42
  <div class="wpd-opt-input">
43
  <div class="wpd-switcher">
@@ -55,7 +55,7 @@ if (!defined("ABSPATH")) {
55
  <div class="wpd-opt-row" data-wpd-opt="displayIconOnAvatar">
56
  <div class="wpd-opt-name">
57
  <label for="displayIconOnAvatar"><?php echo esc_html($setting["options"]["displayIconOnAvatar"]["label"]) ?></label>
58
- <p class="wpd-desc"><?php echo $setting["options"]["displayIconOnAvatar"]["description"] ?></p>
59
  </div>
60
  <div class="wpd-opt-input">
61
  <div class="wpd-switcher">
@@ -73,7 +73,7 @@ if (!defined("ABSPATH")) {
73
  <div class="wpd-opt-row" data-wpd-opt="rememberLoggedinUser">
74
  <div class="wpd-opt-name">
75
  <label for="rememberLoggedinUser"><?php echo esc_html($setting["options"]["rememberLoggedinUser"]["label"]) ?></label>
76
- <p class="wpd-desc"><?php echo $setting["options"]["rememberLoggedinUser"]["description"] ?></p>
77
  </div>
78
  <div class="wpd-opt-input">
79
  <div class="wpd-switcher">
@@ -99,7 +99,7 @@ if (!defined("ABSPATH")) {
99
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableFbLogin">
100
  <div class="wpd-opt-name">
101
  <label for="enableFbLogin"><?php echo esc_html($setting["options"]["enableFbLogin"]["label"]) ?></label>
102
- <p class="wpd-desc"><?php echo $setting["options"]["enableFbLogin"]["description"] ?></p>
103
  </div>
104
  <div class="wpd-opt-input">
105
  <div class="wpd-switcher">
@@ -118,7 +118,7 @@ if (!defined("ABSPATH")) {
118
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="fbUseOAuth2">
119
  <div class="wpd-opt-name">
120
  <label for="fbUseOAuth2"><?php echo esc_html($setting["options"]["fbUseOAuth2"]["label"]) ?></label>
121
- <p class="wpd-desc"><?php echo $setting["options"]["fbUseOAuth2"]["description"] ?></p>
122
  </div>
123
  <div class="wpd-opt-input">
124
  <div class="wpd-switcher">
@@ -137,7 +137,7 @@ if (!defined("ABSPATH")) {
137
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableFbShare">
138
  <div class="wpd-opt-name">
139
  <label for="enableFbShare"><?php echo esc_html($setting["options"]["enableFbShare"]["label"]) ?></label>
140
- <p class="wpd-desc"><?php echo $setting["options"]["enableFbShare"]["description"] ?></p>
141
  </div>
142
  <div class="wpd-opt-input">
143
  <div class="wpd-switcher">
@@ -155,7 +155,7 @@ if (!defined("ABSPATH")) {
155
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="fbAppID">
156
  <div class="wpd-opt-name">
157
  <label for="fbAppID"><?php echo esc_html($setting["options"]["fbAppID"]["label"]) ?></label>
158
- <p class="wpd-desc"><?php echo $setting["options"]["fbAppID"]["description"] ?></p>
159
  </div>
160
  <div class="wpd-opt-input">
161
  <input placeholder="<?php esc_attr_e("Application ID", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["fbAppID"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[fbAppID]" id="wpd-fb-app-id" />
@@ -170,7 +170,7 @@ if (!defined("ABSPATH")) {
170
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="fbAppSecret">
171
  <div class="wpd-opt-name">
172
  <label for="fbAppSecret"><?php echo esc_html($setting["options"]["fbAppSecret"]["label"]) ?></label>
173
- <p class="wpd-desc"><?php echo $setting["options"]["fbAppSecret"]["description"] ?></p>
174
  </div>
175
  <div class="wpd-opt-input">
176
  <input placeholder="<?php esc_attr_e("Application Secret", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["fbAppSecret"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[fbAppSecret]" id="wpd-fb-app-secret" />
@@ -195,7 +195,7 @@ if (!defined("ABSPATH")) {
195
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableTwitterLogin">
196
  <div class="wpd-opt-name">
197
  <label for="enableTwitterLogin"><?php echo esc_html($setting["options"]["enableTwitterLogin"]["label"]) ?></label>
198
- <p class="wpd-desc"><?php echo $setting["options"]["enableTwitterLogin"]["description"] ?></p>
199
  </div>
200
  <div class="wpd-opt-input">
201
  <div class="wpd-switcher">
@@ -213,7 +213,7 @@ if (!defined("ABSPATH")) {
213
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableTwitterShare">
214
  <div class="wpd-opt-name">
215
  <label for="enableTwitterShare"><?php echo esc_html($setting["options"]["enableTwitterShare"]["label"]) ?></label>
216
- <p class="wpd-desc"><?php echo $setting["options"]["enableTwitterShare"]["description"] ?></p>
217
  </div>
218
  <div class="wpd-opt-input">
219
  <div class="wpd-switcher">
@@ -231,7 +231,7 @@ if (!defined("ABSPATH")) {
231
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="twitterAppID">
232
  <div class="wpd-opt-name">
233
  <label for="twitterAppID"><?php echo esc_html($setting["options"]["twitterAppID"]["label"]) ?></label>
234
- <p class="wpd-desc"><?php echo $setting["options"]["twitterAppID"]["description"] ?></p>
235
  </div>
236
  <div class="wpd-opt-input">
237
  <input placeholder="<?php esc_attr_e("Consumer Key (API Key)", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["twitterAppID"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[twitterAppID]" id="wpd-twitter-app-id" />
@@ -246,7 +246,7 @@ if (!defined("ABSPATH")) {
246
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="twitterAppSecret">
247
  <div class="wpd-opt-name">
248
  <label for="twitterAppSecret"><?php echo esc_html($setting["options"]["twitterAppSecret"]["label"]) ?></label>
249
- <p class="wpd-desc"><?php echo $setting["options"]["twitterAppSecret"]["description"] ?></p>
250
  </div>
251
  <div class="wpd-opt-input">
252
  <input placeholder="<?php esc_attr_e("Consumer Secret (API Secret)", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["twitterAppSecret"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[twitterAppSecret]" id="wpd-twitter-app-secret" />
@@ -270,7 +270,7 @@ if (!defined("ABSPATH")) {
270
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableGoogleLogin">
271
  <div class="wpd-opt-name">
272
  <label for="enableGoogleLogin"><?php echo esc_html($setting["options"]["enableGoogleLogin"]["label"]) ?></label>
273
- <p class="wpd-desc"><?php echo $setting["options"]["enableGoogleLogin"]["description"] ?></p>
274
  </div>
275
  <div class="wpd-opt-input">
276
  <div class="wpd-switcher">
@@ -288,7 +288,7 @@ if (!defined("ABSPATH")) {
288
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="googleClientID">
289
  <div class="wpd-opt-name">
290
  <label for="googleClientID"><?php echo esc_html($setting["options"]["googleClientID"]["label"]) ?></label>
291
- <p class="wpd-desc"><?php echo $setting["options"]["googleClientID"]["description"] ?></p>
292
  </div>
293
  <div class="wpd-opt-input">
294
  <input placeholder="<?php esc_attr_e("Client ID", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["googleClientID"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[googleClientID]" id="wpd-google-client-id" />
@@ -303,7 +303,7 @@ if (!defined("ABSPATH")) {
303
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="googleClientSecret">
304
  <div class="wpd-opt-name">
305
  <label for="googleClientSecret"><?php echo esc_html($setting["options"]["googleClientSecret"]["label"]) ?></label>
306
- <p class="wpd-desc"><?php echo $setting["options"]["googleClientSecret"]["description"] ?></p>
307
  </div>
308
  <div class="wpd-opt-input">
309
  <input placeholder="<?php esc_attr_e("Client Secret", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["googleClientSecret"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[googleClientSecret]" id="wpd-google-client-secret" />
@@ -328,7 +328,7 @@ if (!defined("ABSPATH")) {
328
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableDisqusLogin">
329
  <div class="wpd-opt-name">
330
  <label for="enableDisqusLogin"><?php echo esc_html($setting["options"]["enableDisqusLogin"]["label"]) ?></label>
331
- <p class="wpd-desc"><?php echo $setting["options"]["enableDisqusLogin"]["description"] ?></p>
332
  </div>
333
  <div class="wpd-opt-input">
334
  <div class="wpd-switcher">
@@ -346,7 +346,7 @@ if (!defined("ABSPATH")) {
346
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="disqusPublicKey">
347
  <div class="wpd-opt-name">
348
  <label for="disqusPublicKey"><?php echo esc_html($setting["options"]["disqusPublicKey"]["label"]) ?></label>
349
- <p class="wpd-desc"><?php echo $setting["options"]["disqusPublicKey"]["description"] ?></p>
350
  </div>
351
  <div class="wpd-opt-input">
352
  <input placeholder="<?php esc_attr_e("Public Key", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["disqusPublicKey"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[disqusPublicKey]" id="wpd-disqus-public-key" />
@@ -361,7 +361,7 @@ if (!defined("ABSPATH")) {
361
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="disqusSecretKey">
362
  <div class="wpd-opt-name">
363
  <label for="disqusSecretKey"><?php echo esc_html($setting["options"]["disqusSecretKey"]["label"]) ?></label>
364
- <p class="wpd-desc"><?php echo $setting["options"]["disqusSecretKey"]["description"] ?></p>
365
  </div>
366
  <div class="wpd-opt-input">
367
  <input placeholder="<?php esc_attr_e("Secure Key", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["disqusSecretKey"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[disqusSecretKey]" id="wpd-disqus-secret-key" />
@@ -385,7 +385,7 @@ if (!defined("ABSPATH")) {
385
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableWordpressLogin">
386
  <div class="wpd-opt-name">
387
  <label for="enableWordpressLogin"><?php echo esc_html($setting["options"]["enableWordpressLogin"]["label"]) ?></label>
388
- <p class="wpd-desc"><?php echo $setting["options"]["enableWordpressLogin"]["description"] ?></p>
389
  </div>
390
  <div class="wpd-opt-input">
391
  <div class="wpd-switcher">
@@ -403,7 +403,7 @@ if (!defined("ABSPATH")) {
403
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="wordpressClientID">
404
  <div class="wpd-opt-name">
405
  <label for="wordpressClientID"><?php echo esc_html($setting["options"]["wordpressClientID"]["label"]) ?></label>
406
- <p class="wpd-desc"><?php echo $setting["options"]["wordpressClientID"]["description"] ?></p>
407
  </div>
408
  <div class="wpd-opt-input">
409
  <input placeholder="<?php esc_attr_e("Client ID", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["wordpressClientID"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[wordpressClientID]" id="wpd-wordpress-client-id" />
@@ -418,7 +418,7 @@ if (!defined("ABSPATH")) {
418
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="wordpressClientSecret">
419
  <div class="wpd-opt-name">
420
  <label for="wordpressClientSecret"><?php echo esc_html($setting["options"]["wordpressClientSecret"]["label"]) ?></label>
421
- <p class="wpd-desc"><?php echo $setting["options"]["wordpressClientSecret"]["description"] ?></p>
422
  </div>
423
  <div class="wpd-opt-input">
424
  <input placeholder="<?php esc_attr_e("Client Secret", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["wordpressClientSecret"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[wordpressClientSecret]" id="wpd-wordpress-client-secret" />
@@ -440,7 +440,7 @@ if (!defined("ABSPATH")) {
440
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableInstagramLogin">
441
  <div class="wpd-opt-name">
442
  <label for="enableInstagramLogin"><?php echo esc_html($setting["options"]["enableInstagramLogin"]["label"]) ?></label>
443
- <p class="wpd-desc"><?php echo $setting["options"]["enableInstagramLogin"]["description"] ?></p>
444
  </div>
445
  <div class="wpd-opt-input">
446
  <div class="wpd-switcher">
@@ -458,7 +458,7 @@ if (!defined("ABSPATH")) {
458
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="instagramAppID">
459
  <div class="wpd-opt-name">
460
  <label for="instagramAppID"><?php echo esc_html($setting["options"]["instagramAppID"]["label"]) ?></label>
461
- <p class="wpd-desc"><?php echo $setting["options"]["instagramAppID"]["description"] ?></p>
462
  </div>
463
  <div class="wpd-opt-input">
464
  <input placeholder="<?php esc_attr_e("App ID", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["instagramAppID"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[instagramAppID]" id="wpd-google-client-id" />
@@ -473,7 +473,7 @@ if (!defined("ABSPATH")) {
473
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="instagramAppSecret">
474
  <div class="wpd-opt-name">
475
  <label for="instagramAppSecret"><?php echo esc_html($setting["options"]["instagramAppSecret"]["label"]) ?></label>
476
- <p class="wpd-desc"><?php echo $setting["options"]["instagramAppSecret"]["description"] ?></p>
477
  </div>
478
  <div class="wpd-opt-input">
479
  <input placeholder="<?php esc_attr_e("App Secret", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["instagramAppSecret"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[instagramAppSecret]" id="wpd-google-client-secret" />
@@ -496,7 +496,7 @@ if (!defined("ABSPATH")) {
496
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableLinkedinLogin">
497
  <div class="wpd-opt-name">
498
  <label for="enableLinkedinLogin"><?php echo esc_html($setting["options"]["enableLinkedinLogin"]["label"]) ?></label>
499
- <p class="wpd-desc"><?php echo $setting["options"]["enableLinkedinLogin"]["description"] ?></p>
500
  </div>
501
  <div class="wpd-opt-input">
502
  <div class="wpd-switcher">
@@ -514,7 +514,7 @@ if (!defined("ABSPATH")) {
514
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="linkedinClientID">
515
  <div class="wpd-opt-name">
516
  <label for="linkedinClientID"><?php echo esc_html($setting["options"]["linkedinClientID"]["label"]) ?></label>
517
- <p class="wpd-desc"><?php echo $setting["options"]["linkedinClientID"]["description"] ?></p>
518
  </div>
519
  <div class="wpd-opt-input">
520
  <input placeholder="<?php esc_attr_e("Client ID", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["linkedinClientID"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[linkedinClientID]" id="wpd-google-client-id" />
@@ -529,7 +529,7 @@ if (!defined("ABSPATH")) {
529
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="linkedinClientSecret">
530
  <div class="wpd-opt-name">
531
  <label for="linkedinClientSecret"><?php echo esc_html($setting["options"]["linkedinClientSecret"]["label"]) ?></label>
532
- <p class="wpd-desc"><?php echo $setting["options"]["linkedinClientSecret"]["description"] ?></p>
533
  </div>
534
  <div class="wpd-opt-input">
535
  <input placeholder="<?php esc_attr_e("Client Secret", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["linkedinClientSecret"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[linkedinClientSecret]" id="wpd-google-client-secret" />
@@ -548,7 +548,7 @@ if (!defined("ABSPATH")) {
548
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableWhatsappShare">
549
  <div class="wpd-opt-name">
550
  <label for="enableWhatsappShare"><?php echo esc_html($setting["options"]["enableWhatsappShare"]["label"]) ?></label>
551
- <p class="wpd-desc"><?php echo $setting["options"]["enableWhatsappShare"]["description"] ?></p>
552
  </div>
553
  <div class="wpd-opt-input">
554
  <div class="wpd-switcher">
@@ -574,7 +574,7 @@ if (!defined("ABSPATH")) {
574
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableYandexLogin">
575
  <div class="wpd-opt-name">
576
  <label for="enableYandexLogin"><?php echo esc_html($setting["options"]["enableYandexLogin"]["label"]) ?></label>
577
- <p class="wpd-desc"><?php echo $setting["options"]["enableYandexLogin"]["description"] ?></p>
578
  </div>
579
  <div class="wpd-opt-input">
580
  <div class="wpd-switcher">
@@ -592,7 +592,7 @@ if (!defined("ABSPATH")) {
592
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="yandexID">
593
  <div class="wpd-opt-name">
594
  <label for="yandexID"><?php echo esc_html($setting["options"]["yandexID"]["label"]) ?></label>
595
- <p class="wpd-desc"><?php echo $setting["options"]["yandexID"]["description"] ?></p>
596
  </div>
597
  <div class="wpd-opt-input">
598
  <input placeholder="<?php esc_attr_e("ID", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["yandexID"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[yandexID]" id="wpd-google-client-id" />
@@ -607,7 +607,7 @@ if (!defined("ABSPATH")) {
607
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="yandexPassword">
608
  <div class="wpd-opt-name">
609
  <label for="yandexPassword"><?php echo esc_html($setting["options"]["yandexPassword"]["label"]) ?></label>
610
- <p class="wpd-desc"><?php echo $setting["options"]["yandexPassword"]["description"] ?></p>
611
  </div>
612
  <div class="wpd-opt-input">
613
  <input placeholder="<?php esc_attr_e("Password", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["yandexPassword"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[yandexPassword]" id="wpd-google-client-secret" />
@@ -631,7 +631,7 @@ if (!defined("ABSPATH")) {
631
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableVkLogin">
632
  <div class="wpd-opt-name">
633
  <label for="enableVkLogin"><?php echo esc_html($setting["options"]["enableVkLogin"]["label"]) ?></label>
634
- <p class="wpd-desc"><?php echo $setting["options"]["enableVkLogin"]["description"] ?></p>
635
  </div>
636
  <div class="wpd-opt-input">
637
  <div class="wpd-switcher">
@@ -649,7 +649,7 @@ if (!defined("ABSPATH")) {
649
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableVkShare">
650
  <div class="wpd-opt-name">
651
  <label for="enableVkShare"><?php echo esc_html($setting["options"]["enableVkShare"]["label"]) ?></label>
652
- <p class="wpd-desc"><?php echo $setting["options"]["enableVkShare"]["description"] ?></p>
653
  </div>
654
  <div class="wpd-opt-input">
655
  <div class="wpd-switcher">
@@ -667,7 +667,7 @@ if (!defined("ABSPATH")) {
667
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="vkAppID">
668
  <div class="wpd-opt-name">
669
  <label for="vkAppID"><?php echo esc_html($setting["options"]["vkAppID"]["label"]) ?></label>
670
- <p class="wpd-desc"><?php echo $setting["options"]["vkAppID"]["description"] ?></p>
671
  </div>
672
  <div class="wpd-opt-input">
673
  <input placeholder="<?php esc_attr_e("Application ID", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["vkAppID"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[vkAppID]" id="wpd-vk-app-id" />
@@ -682,7 +682,7 @@ if (!defined("ABSPATH")) {
682
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="vkAppSecret">
683
  <div class="wpd-opt-name">
684
  <label for="vkAppSecret"><?php echo esc_html($setting["options"]["vkAppSecret"]["label"]) ?></label>
685
- <p class="wpd-desc"><?php echo $setting["options"]["vkAppSecret"]["description"] ?></p>
686
  </div>
687
  <div class="wpd-opt-input">
688
  <input placeholder="<?php esc_attr_e("Secure Key", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["vkAppSecret"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[vkAppSecret]" id="wpd-vk-app-secret" />
@@ -705,7 +705,7 @@ if (!defined("ABSPATH")) {
705
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableMailruLogin">
706
  <div class="wpd-opt-name">
707
  <label for="enableMailruLogin"><?php echo esc_html($setting["options"]["enableMailruLogin"]["label"]) ?></label>
708
- <p class="wpd-desc"><?php echo $setting["options"]["enableMailruLogin"]["description"] ?></p>
709
  </div>
710
  <div class="wpd-opt-input">
711
  <div class="wpd-switcher">
@@ -723,7 +723,7 @@ if (!defined("ABSPATH")) {
723
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="mailruClientID">
724
  <div class="wpd-opt-name">
725
  <label for="mailruClientID"><?php echo esc_html($setting["options"]["mailruClientID"]["label"]) ?></label>
726
- <p class="wpd-desc"><?php echo $setting["options"]["mailruClientID"]["description"] ?></p>
727
  </div>
728
  <div class="wpd-opt-input">
729
  <input placeholder="<?php esc_attr_e("ID", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["mailruClientID"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[mailruClientID]" id="wpd-google-client-id" />
@@ -738,7 +738,7 @@ if (!defined("ABSPATH")) {
738
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="mailruClientSecret">
739
  <div class="wpd-opt-name">
740
  <label for="mailruClientSecret"><?php echo esc_html($setting["options"]["mailruClientSecret"]["label"]) ?></label>
741
- <p class="wpd-desc"><?php echo $setting["options"]["mailruClientSecret"]["description"] ?></p>
742
  </div>
743
  <div class="wpd-opt-input">
744
  <input placeholder="<?php esc_attr_e("Secret Key", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["mailruClientSecret"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[mailruClientSecret]" id="wpd-google-client-secret" />
@@ -763,7 +763,7 @@ if (!defined("ABSPATH")) {
763
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableOkLogin">
764
  <div class="wpd-opt-name">
765
  <label for="enableOkLogin"><?php echo esc_html($setting["options"]["enableOkLogin"]["label"]) ?></label>
766
- <p class="wpd-desc"><?php echo $setting["options"]["enableOkLogin"]["description"] ?></p>
767
  </div>
768
  <div class="wpd-opt-input">
769
  <div class="wpd-switcher">
@@ -781,7 +781,7 @@ if (!defined("ABSPATH")) {
781
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableOkShare">
782
  <div class="wpd-opt-name">
783
  <label for="enableOkShare"><?php echo esc_html($setting["options"]["enableOkShare"]["label"]) ?></label>
784
- <p class="wpd-desc"><?php echo $setting["options"]["enableOkShare"]["description"] ?></p>
785
  </div>
786
  <div class="wpd-opt-input">
787
  <div class="wpd-switcher">
@@ -799,7 +799,7 @@ if (!defined("ABSPATH")) {
799
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="okAppID">
800
  <div class="wpd-opt-name">
801
  <label for="okAppID"><?php echo esc_html($setting["options"]["okAppID"]["label"]) ?></label>
802
- <p class="wpd-desc"><?php echo $setting["options"]["okAppID"]["description"] ?></p>
803
  </div>
804
  <div class="wpd-opt-input">
805
  <input placeholder="<?php esc_attr_e("Application ID", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["okAppID"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[okAppID]" id="wpd-ok-app-id" />
@@ -814,7 +814,7 @@ if (!defined("ABSPATH")) {
814
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="okAppKey">
815
  <div class="wpd-opt-name">
816
  <label for="okAppKey"><?php echo esc_html($setting["options"]["okAppKey"]["label"]) ?></label>
817
- <p class="wpd-desc"><?php echo $setting["options"]["okAppKey"]["description"] ?></p>
818
  </div>
819
  <div class="wpd-opt-input">
820
  <input placeholder="<?php esc_attr_e("Application Key", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["okAppKey"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[okAppKey]" id="wpd-ok-app-key" />
@@ -829,7 +829,7 @@ if (!defined("ABSPATH")) {
829
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="okAppSecret">
830
  <div class="wpd-opt-name">
831
  <label for="okAppSecret"><?php echo esc_html($setting["options"]["okAppSecret"]["label"]) ?></label>
832
- <p class="wpd-desc"><?php echo $setting["options"]["okAppSecret"]["description"] ?></p>
833
  </div>
834
  <div class="wpd-opt-input">
835
  <input placeholder="<?php esc_attr_e("Application Secret", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["okAppSecret"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[okAppSecret]" id="wpd-ok-app-secret" />
@@ -851,7 +851,7 @@ if (!defined("ABSPATH")) {
851
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableWechatLogin">
852
  <div class="wpd-opt-name">
853
  <label for="enableWechatLogin"><?php echo esc_html($setting["options"]["enableWechatLogin"]["label"]) ?></label>
854
- <p class="wpd-desc"><?php echo $setting["options"]["enableWechatLogin"]["description"] ?></p>
855
  </div>
856
  <div class="wpd-opt-input">
857
  <div class="wpd-switcher">
@@ -869,7 +869,7 @@ if (!defined("ABSPATH")) {
869
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="wechatAppID">
870
  <div class="wpd-opt-name">
871
  <label for="wechatAppID"><?php echo esc_html($setting["options"]["wechatAppID"]["label"]) ?></label>
872
- <p class="wpd-desc"><?php echo $setting["options"]["wechatAppID"]["description"] ?></p>
873
  </div>
874
  <div class="wpd-opt-input">
875
  <input placeholder="<?php esc_attr_e("App ID", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["wechatAppID"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[wechatAppID]" id="wpd-google-client-id" />
@@ -884,7 +884,7 @@ if (!defined("ABSPATH")) {
884
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="wechatSecret">
885
  <div class="wpd-opt-name">
886
  <label for="wechatSecret"><?php echo esc_html($setting["options"]["wechatSecret"]["label"]) ?></label>
887
- <p class="wpd-desc"><?php echo $setting["options"]["wechatSecret"]["description"] ?></p>
888
  </div>
889
  <div class="wpd-opt-input">
890
  <input placeholder="<?php esc_attr_e("Secret", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["wechatSecret"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[wechatSecret]" id="wpd-google-client-secret" />
@@ -907,7 +907,7 @@ if (!defined("ABSPATH")) {
907
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableWeiboLogin">
908
  <div class="wpd-opt-name">
909
  <label for="enableWeiboLogin"><?php echo esc_html($setting["options"]["enableWeiboLogin"]["label"]) ?></label>
910
- <p class="wpd-desc"><?php echo $setting["options"]["enableWeiboLogin"]["description"] ?></p>
911
  </div>
912
  <div class="wpd-opt-input">
913
  <div class="wpd-switcher">
@@ -925,7 +925,7 @@ if (!defined("ABSPATH")) {
925
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="weiboKey">
926
  <div class="wpd-opt-name">
927
  <label for="weiboKey"><?php echo esc_html($setting["options"]["weiboKey"]["label"]) ?></label>
928
- <p class="wpd-desc"><?php echo $setting["options"]["weiboKey"]["description"] ?></p>
929
  </div>
930
  <div class="wpd-opt-input">
931
  <input placeholder="<?php esc_attr_e("Key", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["weiboKey"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[weiboKey]" id="wpd-google-client-id" />
@@ -940,7 +940,7 @@ if (!defined("ABSPATH")) {
940
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="weiboSecret">
941
  <div class="wpd-opt-name">
942
  <label for="weiboSecret"><?php echo esc_html($setting["options"]["weiboSecret"]["label"]) ?></label>
943
- <p class="wpd-desc"><?php echo $setting["options"]["weiboSecret"]["description"] ?></p>
944
  </div>
945
  <div class="wpd-opt-input">
946
  <input placeholder="<?php esc_attr_e("Secret", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["weiboSecret"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[weiboSecret]" id="wpd-google-client-secret" />
@@ -963,7 +963,7 @@ if (!defined("ABSPATH")) {
963
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableQQLogin">
964
  <div class="wpd-opt-name">
965
  <label for="enableQQLogin"><?php echo esc_html($setting["options"]["enableQQLogin"]["label"]) ?></label>
966
- <p class="wpd-desc"><?php echo $setting["options"]["enableQQLogin"]["description"] ?></p>
967
  </div>
968
  <div class="wpd-opt-input">
969
  <div class="wpd-switcher">
@@ -981,7 +981,7 @@ if (!defined("ABSPATH")) {
981
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="qqAppID">
982
  <div class="wpd-opt-name">
983
  <label for="qqAppID"><?php echo esc_html($setting["options"]["qqAppID"]["label"]) ?></label>
984
- <p class="wpd-desc"><?php echo $setting["options"]["qqAppID"]["description"] ?></p>
985
  </div>
986
  <div class="wpd-opt-input">
987
  <input placeholder="<?php esc_attr_e("App ID", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["qqAppID"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[qqAppID]" id="wpd-google-client-id" />
@@ -996,7 +996,7 @@ if (!defined("ABSPATH")) {
996
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="qqSecret">
997
  <div class="wpd-opt-name">
998
  <label for="qqSecret"><?php echo esc_html($setting["options"]["qqSecret"]["label"]) ?></label>
999
- <p class="wpd-desc"><?php echo $setting["options"]["qqSecret"]["description"] ?></p>
1000
  </div>
1001
  <div class="wpd-opt-input">
1002
  <input placeholder="<?php esc_attr_e("Secret", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["qqSecret"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[qqSecret]" id="wpd-google-client-secret" />
@@ -1019,7 +1019,7 @@ if (!defined("ABSPATH")) {
1019
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableBaiduLogin">
1020
  <div class="wpd-opt-name">
1021
  <label for="enableBaiduLogin"><?php echo esc_html($setting["options"]["enableBaiduLogin"]["label"]) ?></label>
1022
- <p class="wpd-desc"><?php echo $setting["options"]["enableBaiduLogin"]["description"] ?></p>
1023
  </div>
1024
  <div class="wpd-opt-input">
1025
  <div class="wpd-switcher">
@@ -1037,7 +1037,7 @@ if (!defined("ABSPATH")) {
1037
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="baiduAppID">
1038
  <div class="wpd-opt-name">
1039
  <label for="baiduAppID"><?php echo esc_html($setting["options"]["baiduAppID"]["label"]) ?></label>
1040
- <p class="wpd-desc"><?php echo $setting["options"]["baiduAppID"]["description"] ?></p>
1041
  </div>
1042
  <div class="wpd-opt-input">
1043
  <input placeholder="<?php esc_attr_e("App ID", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["baiduAppID"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[baiduAppID]" id="wpd-google-client-id" />
@@ -1052,7 +1052,7 @@ if (!defined("ABSPATH")) {
1052
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="baiduSecret">
1053
  <div class="wpd-opt-name">
1054
  <label for="baiduSecret"><?php echo esc_html($setting["options"]["baiduSecret"]["label"]) ?></label>
1055
- <p class="wpd-desc"><?php echo $setting["options"]["baiduSecret"]["description"] ?></p>
1056
  </div>
1057
  <div class="wpd-opt-input">
1058
  <input placeholder="<?php esc_attr_e("Secret", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["baiduSecret"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[baiduSecret]" id="wpd-google-client-secret" />
37
  <div class="wpd-opt-row" data-wpd-opt="socialLoginInSecondaryForm">
38
  <div class="wpd-opt-name">
39
  <label for="socialLoginInSecondaryForm"><?php echo esc_html($setting["options"]["socialLoginInSecondaryForm"]["label"]) ?></label>
40
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["socialLoginInSecondaryForm"]["description"]) ?></p>
41
  </div>
42
  <div class="wpd-opt-input">
43
  <div class="wpd-switcher">
55
  <div class="wpd-opt-row" data-wpd-opt="displayIconOnAvatar">
56
  <div class="wpd-opt-name">
57
  <label for="displayIconOnAvatar"><?php echo esc_html($setting["options"]["displayIconOnAvatar"]["label"]) ?></label>
58
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["displayIconOnAvatar"]["description"]) ?></p>
59
  </div>
60
  <div class="wpd-opt-input">
61
  <div class="wpd-switcher">
73
  <div class="wpd-opt-row" data-wpd-opt="rememberLoggedinUser">
74
  <div class="wpd-opt-name">
75
  <label for="rememberLoggedinUser"><?php echo esc_html($setting["options"]["rememberLoggedinUser"]["label"]) ?></label>
76
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["rememberLoggedinUser"]["description"]) ?></p>
77
  </div>
78
  <div class="wpd-opt-input">
79
  <div class="wpd-switcher">
99
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableFbLogin">
100
  <div class="wpd-opt-name">
101
  <label for="enableFbLogin"><?php echo esc_html($setting["options"]["enableFbLogin"]["label"]) ?></label>
102
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableFbLogin"]["description"]) ?></p>
103
  </div>
104
  <div class="wpd-opt-input">
105
  <div class="wpd-switcher">
118
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="fbUseOAuth2">
119
  <div class="wpd-opt-name">
120
  <label for="fbUseOAuth2"><?php echo esc_html($setting["options"]["fbUseOAuth2"]["label"]) ?></label>
121
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["fbUseOAuth2"]["description"]) ?></p>
122
  </div>
123
  <div class="wpd-opt-input">
124
  <div class="wpd-switcher">
137
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableFbShare">
138
  <div class="wpd-opt-name">
139
  <label for="enableFbShare"><?php echo esc_html($setting["options"]["enableFbShare"]["label"]) ?></label>
140
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableFbShare"]["description"]) ?></p>
141
  </div>
142
  <div class="wpd-opt-input">
143
  <div class="wpd-switcher">
155
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="fbAppID">
156
  <div class="wpd-opt-name">
157
  <label for="fbAppID"><?php echo esc_html($setting["options"]["fbAppID"]["label"]) ?></label>
158
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["fbAppID"]["description"]) ?></p>
159
  </div>
160
  <div class="wpd-opt-input">
161
  <input placeholder="<?php esc_attr_e("Application ID", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["fbAppID"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[fbAppID]" id="wpd-fb-app-id" />
170
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="fbAppSecret">
171
  <div class="wpd-opt-name">
172
  <label for="fbAppSecret"><?php echo esc_html($setting["options"]["fbAppSecret"]["label"]) ?></label>
173
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["fbAppSecret"]["description"]) ?></p>
174
  </div>
175
  <div class="wpd-opt-input">
176
  <input placeholder="<?php esc_attr_e("Application Secret", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["fbAppSecret"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[fbAppSecret]" id="wpd-fb-app-secret" />
195
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableTwitterLogin">
196
  <div class="wpd-opt-name">
197
  <label for="enableTwitterLogin"><?php echo esc_html($setting["options"]["enableTwitterLogin"]["label"]) ?></label>
198
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableTwitterLogin"]["description"]) ?></p>
199
  </div>
200
  <div class="wpd-opt-input">
201
  <div class="wpd-switcher">
213
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableTwitterShare">
214
  <div class="wpd-opt-name">
215
  <label for="enableTwitterShare"><?php echo esc_html($setting["options"]["enableTwitterShare"]["label"]) ?></label>
216
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableTwitterShare"]["description"]) ?></p>
217
  </div>
218
  <div class="wpd-opt-input">
219
  <div class="wpd-switcher">
231
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="twitterAppID">
232
  <div class="wpd-opt-name">
233
  <label for="twitterAppID"><?php echo esc_html($setting["options"]["twitterAppID"]["label"]) ?></label>
234
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["twitterAppID"]["description"]) ?></p>
235
  </div>
236
  <div class="wpd-opt-input">
237
  <input placeholder="<?php esc_attr_e("Consumer Key (API Key)", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["twitterAppID"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[twitterAppID]" id="wpd-twitter-app-id" />
246
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="twitterAppSecret">
247
  <div class="wpd-opt-name">
248
  <label for="twitterAppSecret"><?php echo esc_html($setting["options"]["twitterAppSecret"]["label"]) ?></label>
249
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["twitterAppSecret"]["description"]) ?></p>
250
  </div>
251
  <div class="wpd-opt-input">
252
  <input placeholder="<?php esc_attr_e("Consumer Secret (API Secret)", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["twitterAppSecret"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[twitterAppSecret]" id="wpd-twitter-app-secret" />
270
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableGoogleLogin">
271
  <div class="wpd-opt-name">
272
  <label for="enableGoogleLogin"><?php echo esc_html($setting["options"]["enableGoogleLogin"]["label"]) ?></label>
273
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableGoogleLogin"]["description"]) ?></p>
274
  </div>
275
  <div class="wpd-opt-input">
276
  <div class="wpd-switcher">
288
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="googleClientID">
289
  <div class="wpd-opt-name">
290
  <label for="googleClientID"><?php echo esc_html($setting["options"]["googleClientID"]["label"]) ?></label>
291
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["googleClientID"]["description"]) ?></p>
292
  </div>
293
  <div class="wpd-opt-input">
294
  <input placeholder="<?php esc_attr_e("Client ID", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["googleClientID"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[googleClientID]" id="wpd-google-client-id" />
303
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="googleClientSecret">
304
  <div class="wpd-opt-name">
305
  <label for="googleClientSecret"><?php echo esc_html($setting["options"]["googleClientSecret"]["label"]) ?></label>
306
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["googleClientSecret"]["description"]) ?></p>
307
  </div>
308
  <div class="wpd-opt-input">
309
  <input placeholder="<?php esc_attr_e("Client Secret", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["googleClientSecret"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[googleClientSecret]" id="wpd-google-client-secret" />
328
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableDisqusLogin">
329
  <div class="wpd-opt-name">
330
  <label for="enableDisqusLogin"><?php echo esc_html($setting["options"]["enableDisqusLogin"]["label"]) ?></label>
331
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableDisqusLogin"]["description"]) ?></p>
332
  </div>
333
  <div class="wpd-opt-input">
334
  <div class="wpd-switcher">
346
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="disqusPublicKey">
347
  <div class="wpd-opt-name">
348
  <label for="disqusPublicKey"><?php echo esc_html($setting["options"]["disqusPublicKey"]["label"]) ?></label>
349
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["disqusPublicKey"]["description"]) ?></p>
350
  </div>
351
  <div class="wpd-opt-input">
352
  <input placeholder="<?php esc_attr_e("Public Key", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["disqusPublicKey"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[disqusPublicKey]" id="wpd-disqus-public-key" />
361
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="disqusSecretKey">
362
  <div class="wpd-opt-name">
363
  <label for="disqusSecretKey"><?php echo esc_html($setting["options"]["disqusSecretKey"]["label"]) ?></label>
364
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["disqusSecretKey"]["description"]) ?></p>
365
  </div>
366
  <div class="wpd-opt-input">
367
  <input placeholder="<?php esc_attr_e("Secure Key", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["disqusSecretKey"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[disqusSecretKey]" id="wpd-disqus-secret-key" />
385
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableWordpressLogin">
386
  <div class="wpd-opt-name">
387
  <label for="enableWordpressLogin"><?php echo esc_html($setting["options"]["enableWordpressLogin"]["label"]) ?></label>
388
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableWordpressLogin"]["description"]) ?></p>
389
  </div>
390
  <div class="wpd-opt-input">
391
  <div class="wpd-switcher">
403
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="wordpressClientID">
404
  <div class="wpd-opt-name">
405
  <label for="wordpressClientID"><?php echo esc_html($setting["options"]["wordpressClientID"]["label"]) ?></label>
406
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["wordpressClientID"]["description"]) ?></p>
407
  </div>
408
  <div class="wpd-opt-input">
409
  <input placeholder="<?php esc_attr_e("Client ID", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["wordpressClientID"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[wordpressClientID]" id="wpd-wordpress-client-id" />
418
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="wordpressClientSecret">
419
  <div class="wpd-opt-name">
420
  <label for="wordpressClientSecret"><?php echo esc_html($setting["options"]["wordpressClientSecret"]["label"]) ?></label>
421
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["wordpressClientSecret"]["description"]) ?></p>
422
  </div>
423
  <div class="wpd-opt-input">
424
  <input placeholder="<?php esc_attr_e("Client Secret", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["wordpressClientSecret"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[wordpressClientSecret]" id="wpd-wordpress-client-secret" />
440
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableInstagramLogin">
441
  <div class="wpd-opt-name">
442
  <label for="enableInstagramLogin"><?php echo esc_html($setting["options"]["enableInstagramLogin"]["label"]) ?></label>
443
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableInstagramLogin"]["description"]) ?></p>
444
  </div>
445
  <div class="wpd-opt-input">
446
  <div class="wpd-switcher">
458
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="instagramAppID">
459
  <div class="wpd-opt-name">
460
  <label for="instagramAppID"><?php echo esc_html($setting["options"]["instagramAppID"]["label"]) ?></label>
461
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["instagramAppID"]["description"]) ?></p>
462
  </div>
463
  <div class="wpd-opt-input">
464
  <input placeholder="<?php esc_attr_e("App ID", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["instagramAppID"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[instagramAppID]" id="wpd-google-client-id" />
473
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="instagramAppSecret">
474
  <div class="wpd-opt-name">
475
  <label for="instagramAppSecret"><?php echo esc_html($setting["options"]["instagramAppSecret"]["label"]) ?></label>
476
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["instagramAppSecret"]["description"]) ?></p>
477
  </div>
478
  <div class="wpd-opt-input">
479
  <input placeholder="<?php esc_attr_e("App Secret", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["instagramAppSecret"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[instagramAppSecret]" id="wpd-google-client-secret" />
496
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableLinkedinLogin">
497
  <div class="wpd-opt-name">
498
  <label for="enableLinkedinLogin"><?php echo esc_html($setting["options"]["enableLinkedinLogin"]["label"]) ?></label>
499
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableLinkedinLogin"]["description"]) ?></p>
500
  </div>
501
  <div class="wpd-opt-input">
502
  <div class="wpd-switcher">
514
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="linkedinClientID">
515
  <div class="wpd-opt-name">
516
  <label for="linkedinClientID"><?php echo esc_html($setting["options"]["linkedinClientID"]["label"]) ?></label>
517
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["linkedinClientID"]["description"]) ?></p>
518
  </div>
519
  <div class="wpd-opt-input">
520
  <input placeholder="<?php esc_attr_e("Client ID", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["linkedinClientID"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[linkedinClientID]" id="wpd-google-client-id" />
529
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="linkedinClientSecret">
530
  <div class="wpd-opt-name">
531
  <label for="linkedinClientSecret"><?php echo esc_html($setting["options"]["linkedinClientSecret"]["label"]) ?></label>
532
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["linkedinClientSecret"]["description"]) ?></p>
533
  </div>
534
  <div class="wpd-opt-input">
535
  <input placeholder="<?php esc_attr_e("Client Secret", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["linkedinClientSecret"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[linkedinClientSecret]" id="wpd-google-client-secret" />
548
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableWhatsappShare">
549
  <div class="wpd-opt-name">
550
  <label for="enableWhatsappShare"><?php echo esc_html($setting["options"]["enableWhatsappShare"]["label"]) ?></label>
551
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableWhatsappShare"]["description"]) ?></p>
552
  </div>
553
  <div class="wpd-opt-input">
554
  <div class="wpd-switcher">
574
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableYandexLogin">
575
  <div class="wpd-opt-name">
576
  <label for="enableYandexLogin"><?php echo esc_html($setting["options"]["enableYandexLogin"]["label"]) ?></label>
577
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableYandexLogin"]["description"]) ?></p>
578
  </div>
579
  <div class="wpd-opt-input">
580
  <div class="wpd-switcher">
592
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="yandexID">
593
  <div class="wpd-opt-name">
594
  <label for="yandexID"><?php echo esc_html($setting["options"]["yandexID"]["label"]) ?></label>
595
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["yandexID"]["description"]) ?></p>
596
  </div>
597
  <div class="wpd-opt-input">
598
  <input placeholder="<?php esc_attr_e("ID", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["yandexID"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[yandexID]" id="wpd-google-client-id" />
607
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="yandexPassword">
608
  <div class="wpd-opt-name">
609
  <label for="yandexPassword"><?php echo esc_html($setting["options"]["yandexPassword"]["label"]) ?></label>
610
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["yandexPassword"]["description"]) ?></p>
611
  </div>
612
  <div class="wpd-opt-input">
613
  <input placeholder="<?php esc_attr_e("Password", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["yandexPassword"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[yandexPassword]" id="wpd-google-client-secret" />
631
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableVkLogin">
632
  <div class="wpd-opt-name">
633
  <label for="enableVkLogin"><?php echo esc_html($setting["options"]["enableVkLogin"]["label"]) ?></label>
634
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableVkLogin"]["description"]) ?></p>
635
  </div>
636
  <div class="wpd-opt-input">
637
  <div class="wpd-switcher">
649
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableVkShare">
650
  <div class="wpd-opt-name">
651
  <label for="enableVkShare"><?php echo esc_html($setting["options"]["enableVkShare"]["label"]) ?></label>
652
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableVkShare"]["description"]) ?></p>
653
  </div>
654
  <div class="wpd-opt-input">
655
  <div class="wpd-switcher">
667
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="vkAppID">
668
  <div class="wpd-opt-name">
669
  <label for="vkAppID"><?php echo esc_html($setting["options"]["vkAppID"]["label"]) ?></label>
670
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["vkAppID"]["description"]) ?></p>
671
  </div>
672
  <div class="wpd-opt-input">
673
  <input placeholder="<?php esc_attr_e("Application ID", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["vkAppID"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[vkAppID]" id="wpd-vk-app-id" />
682
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="vkAppSecret">
683
  <div class="wpd-opt-name">
684
  <label for="vkAppSecret"><?php echo esc_html($setting["options"]["vkAppSecret"]["label"]) ?></label>
685
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["vkAppSecret"]["description"]) ?></p>
686
  </div>
687
  <div class="wpd-opt-input">
688
  <input placeholder="<?php esc_attr_e("Secure Key", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["vkAppSecret"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[vkAppSecret]" id="wpd-vk-app-secret" />
705
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableMailruLogin">
706
  <div class="wpd-opt-name">
707
  <label for="enableMailruLogin"><?php echo esc_html($setting["options"]["enableMailruLogin"]["label"]) ?></label>
708
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableMailruLogin"]["description"]) ?></p>
709
  </div>
710
  <div class="wpd-opt-input">
711
  <div class="wpd-switcher">
723
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="mailruClientID">
724
  <div class="wpd-opt-name">
725
  <label for="mailruClientID"><?php echo esc_html($setting["options"]["mailruClientID"]["label"]) ?></label>
726
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["mailruClientID"]["description"]) ?></p>
727
  </div>
728
  <div class="wpd-opt-input">
729
  <input placeholder="<?php esc_attr_e("ID", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["mailruClientID"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[mailruClientID]" id="wpd-google-client-id" />
738
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="mailruClientSecret">
739
  <div class="wpd-opt-name">
740
  <label for="mailruClientSecret"><?php echo esc_html($setting["options"]["mailruClientSecret"]["label"]) ?></label>
741
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["mailruClientSecret"]["description"]) ?></p>
742
  </div>
743
  <div class="wpd-opt-input">
744
  <input placeholder="<?php esc_attr_e("Secret Key", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["mailruClientSecret"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[mailruClientSecret]" id="wpd-google-client-secret" />
763
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableOkLogin">
764
  <div class="wpd-opt-name">
765
  <label for="enableOkLogin"><?php echo esc_html($setting["options"]["enableOkLogin"]["label"]) ?></label>
766
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableOkLogin"]["description"]) ?></p>
767
  </div>
768
  <div class="wpd-opt-input">
769
  <div class="wpd-switcher">
781
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableOkShare">
782
  <div class="wpd-opt-name">
783
  <label for="enableOkShare"><?php echo esc_html($setting["options"]["enableOkShare"]["label"]) ?></label>
784
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableOkShare"]["description"]) ?></p>
785
  </div>
786
  <div class="wpd-opt-input">
787
  <div class="wpd-switcher">
799
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="okAppID">
800
  <div class="wpd-opt-name">
801
  <label for="okAppID"><?php echo esc_html($setting["options"]["okAppID"]["label"]) ?></label>
802
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["okAppID"]["description"]) ?></p>
803
  </div>
804
  <div class="wpd-opt-input">
805
  <input placeholder="<?php esc_attr_e("Application ID", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["okAppID"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[okAppID]" id="wpd-ok-app-id" />
814
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="okAppKey">
815
  <div class="wpd-opt-name">
816
  <label for="okAppKey"><?php echo esc_html($setting["options"]["okAppKey"]["label"]) ?></label>
817
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["okAppKey"]["description"]) ?></p>
818
  </div>
819
  <div class="wpd-opt-input">
820
  <input placeholder="<?php esc_attr_e("Application Key", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["okAppKey"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[okAppKey]" id="wpd-ok-app-key" />
829
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="okAppSecret">
830
  <div class="wpd-opt-name">
831
  <label for="okAppSecret"><?php echo esc_html($setting["options"]["okAppSecret"]["label"]) ?></label>
832
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["okAppSecret"]["description"]) ?></p>
833
  </div>
834
  <div class="wpd-opt-input">
835
  <input placeholder="<?php esc_attr_e("Application Secret", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["okAppSecret"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[okAppSecret]" id="wpd-ok-app-secret" />
851
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableWechatLogin">
852
  <div class="wpd-opt-name">
853
  <label for="enableWechatLogin"><?php echo esc_html($setting["options"]["enableWechatLogin"]["label"]) ?></label>
854
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableWechatLogin"]["description"]) ?></p>
855
  </div>
856
  <div class="wpd-opt-input">
857
  <div class="wpd-switcher">
869
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="wechatAppID">
870
  <div class="wpd-opt-name">
871
  <label for="wechatAppID"><?php echo esc_html($setting["options"]["wechatAppID"]["label"]) ?></label>
872
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["wechatAppID"]["description"]) ?></p>
873
  </div>
874
  <div class="wpd-opt-input">
875
  <input placeholder="<?php esc_attr_e("App ID", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["wechatAppID"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[wechatAppID]" id="wpd-google-client-id" />
884
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="wechatSecret">
885
  <div class="wpd-opt-name">
886
  <label for="wechatSecret"><?php echo esc_html($setting["options"]["wechatSecret"]["label"]) ?></label>
887
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["wechatSecret"]["description"]) ?></p>
888
  </div>
889
  <div class="wpd-opt-input">
890
  <input placeholder="<?php esc_attr_e("Secret", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["wechatSecret"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[wechatSecret]" id="wpd-google-client-secret" />
907
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableWeiboLogin">
908
  <div class="wpd-opt-name">
909
  <label for="enableWeiboLogin"><?php echo esc_html($setting["options"]["enableWeiboLogin"]["label"]) ?></label>
910
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableWeiboLogin"]["description"]) ?></p>
911
  </div>
912
  <div class="wpd-opt-input">
913
  <div class="wpd-switcher">
925
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="weiboKey">
926
  <div class="wpd-opt-name">
927
  <label for="weiboKey"><?php echo esc_html($setting["options"]["weiboKey"]["label"]) ?></label>
928
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["weiboKey"]["description"]) ?></p>
929
  </div>
930
  <div class="wpd-opt-input">
931
  <input placeholder="<?php esc_attr_e("Key", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["weiboKey"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[weiboKey]" id="wpd-google-client-id" />
940
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="weiboSecret">
941
  <div class="wpd-opt-name">
942
  <label for="weiboSecret"><?php echo esc_html($setting["options"]["weiboSecret"]["label"]) ?></label>
943
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["weiboSecret"]["description"]) ?></p>
944
  </div>
945
  <div class="wpd-opt-input">
946
  <input placeholder="<?php esc_attr_e("Secret", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["weiboSecret"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[weiboSecret]" id="wpd-google-client-secret" />
963
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableQQLogin">
964
  <div class="wpd-opt-name">
965
  <label for="enableQQLogin"><?php echo esc_html($setting["options"]["enableQQLogin"]["label"]) ?></label>
966
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableQQLogin"]["description"]) ?></p>
967
  </div>
968
  <div class="wpd-opt-input">
969
  <div class="wpd-switcher">
981
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="qqAppID">
982
  <div class="wpd-opt-name">
983
  <label for="qqAppID"><?php echo esc_html($setting["options"]["qqAppID"]["label"]) ?></label>
984
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["qqAppID"]["description"]) ?></p>
985
  </div>
986
  <div class="wpd-opt-input">
987
  <input placeholder="<?php esc_attr_e("App ID", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["qqAppID"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[qqAppID]" id="wpd-google-client-id" />
996
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="qqSecret">
997
  <div class="wpd-opt-name">
998
  <label for="qqSecret"><?php echo esc_html($setting["options"]["qqSecret"]["label"]) ?></label>
999
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["qqSecret"]["description"]) ?></p>
1000
  </div>
1001
  <div class="wpd-opt-input">
1002
  <input placeholder="<?php esc_attr_e("Secret", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["qqSecret"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[qqSecret]" id="wpd-google-client-secret" />
1019
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="enableBaiduLogin">
1020
  <div class="wpd-opt-name">
1021
  <label for="enableBaiduLogin"><?php echo esc_html($setting["options"]["enableBaiduLogin"]["label"]) ?></label>
1022
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableBaiduLogin"]["description"]) ?></p>
1023
  </div>
1024
  <div class="wpd-opt-input">
1025
  <div class="wpd-switcher">
1037
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="baiduAppID">
1038
  <div class="wpd-opt-name">
1039
  <label for="baiduAppID"><?php echo esc_html($setting["options"]["baiduAppID"]["label"]) ?></label>
1040
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["baiduAppID"]["description"]) ?></p>
1041
  </div>
1042
  <div class="wpd-opt-input">
1043
  <input placeholder="<?php esc_attr_e("App ID", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["baiduAppID"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[baiduAppID]" id="wpd-google-client-id" />
1052
  <div class="wpd-opt-row wpd-opt-row-tight" data-wpd-opt="baiduSecret">
1053
  <div class="wpd-opt-name">
1054
  <label for="baiduSecret"><?php echo esc_html($setting["options"]["baiduSecret"]["label"]) ?></label>
1055
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["baiduSecret"]["description"]) ?></p>
1056
  </div>
1057
  <div class="wpd-opt-input">
1058
  <input placeholder="<?php esc_attr_e("Secret", "wpdiscuz"); ?>" type="text" value="<?php echo esc_attr($this->social["baiduSecret"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_SOCIAL); ?>[baiduSecret]" id="wpd-google-client-secret" />
options/options-layouts/html-subscription.php CHANGED
@@ -19,7 +19,7 @@ if (!defined("ABSPATH")) {
19
  <div class="wpd-opt-row" data-wpd-opt="enableUserMentioning">
20
  <div class="wpd-opt-name">
21
  <label for="enableUserMentioning"><?php echo esc_html($setting["options"]["enableUserMentioning"]["label"]) ?></label>
22
- <p class="wpd-desc"><?php echo $setting["options"]["enableUserMentioning"]["description"] ?></p>
23
  </div>
24
  <div class="wpd-opt-input">
25
  <div class="wpd-switcher">
@@ -37,7 +37,7 @@ if (!defined("ABSPATH")) {
37
  <div class="wpd-opt-row" data-wpd-opt="sendMailToMentionedUsers">
38
  <div class="wpd-opt-name">
39
  <label for="sendMailToMentionedUsers"><?php echo esc_html($setting["options"]["sendMailToMentionedUsers"]["label"]) ?></label>
40
- <p class="wpd-desc"><?php echo $setting["options"]["sendMailToMentionedUsers"]["description"] ?></p>
41
  </div>
42
  <div class="wpd-opt-input">
43
  <div class="wpd-switcher">
@@ -55,7 +55,7 @@ if (!defined("ABSPATH")) {
55
  <div class="wpd-opt-row" data-wpd-opt="isNotifyOnCommentApprove">
56
  <div class="wpd-opt-name">
57
  <label for="isNotifyOnCommentApprove"><?php echo esc_html($setting["options"]["isNotifyOnCommentApprove"]["label"]) ?></label>
58
- <p class="wpd-desc"><?php echo $setting["options"]["isNotifyOnCommentApprove"]["description"] ?></p>
59
  </div>
60
  <div class="wpd-opt-input">
61
  <div class="wpd-switcher">
@@ -73,7 +73,7 @@ if (!defined("ABSPATH")) {
73
  <div class="wpd-opt-row" data-wpd-opt="enableMemberConfirm">
74
  <div class="wpd-opt-name">
75
  <label for="enableMemberConfirm"><?php echo esc_html($setting["options"]["enableMemberConfirm"]["label"]) ?></label>
76
- <p class="wpd-desc"><?php echo $setting["options"]["enableMemberConfirm"]["description"] ?></p>
77
  </div>
78
  <div class="wpd-opt-input">
79
  <div class="wpd-switcher">
@@ -91,7 +91,7 @@ if (!defined("ABSPATH")) {
91
  <div class="wpd-opt-row" data-wpd-opt="enableGuestsConfirm">
92
  <div class="wpd-opt-name">
93
  <label for="enableGuestsConfirm"><?php echo esc_html($setting["options"]["enableGuestsConfirm"]["label"]) ?></label>
94
- <p class="wpd-desc"><?php echo $setting["options"]["enableGuestsConfirm"]["description"] ?></p>
95
  </div>
96
  <div class="wpd-opt-input">
97
  <div class="wpd-switcher">
@@ -109,7 +109,7 @@ if (!defined("ABSPATH")) {
109
  <div class="wpd-opt-row" data-wpd-opt="subscriptionType">
110
  <div class="wpd-opt-name">
111
  <label for="subscriptionType"><?php echo esc_html($setting["options"]["subscriptionType"]["label"]) ?></label>
112
- <p class="wpd-desc"><?php echo $setting["options"]["subscriptionType"]["description"] ?></p>
113
  </div>
114
  <div class="wpd-opt-input">
115
  <div class="wpd-radio">
@@ -138,7 +138,7 @@ if (!defined("ABSPATH")) {
138
  <div class="wpd-opt-row" data-wpd-opt="showReplyCheckbox">
139
  <div class="wpd-opt-name">
140
  <label for="showReplyCheckbox"><?php echo esc_html($setting["options"]["showReplyCheckbox"]["label"]) ?></label>
141
- <p class="wpd-desc"><?php echo $setting["options"]["showReplyCheckbox"]["description"] ?></p>
142
  </div>
143
  <div class="wpd-opt-input">
144
  <div class="wpd-switcher">
@@ -156,7 +156,7 @@ if (!defined("ABSPATH")) {
156
  <div class="wpd-opt-row" data-wpd-opt="isReplyDefaultChecked">
157
  <div class="wpd-opt-name">
158
  <label for="isReplyDefaultChecked"><?php echo esc_html($setting["options"]["isReplyDefaultChecked"]["label"]) ?></label>
159
- <p class="wpd-desc"><?php echo $setting["options"]["isReplyDefaultChecked"]["description"] ?></p>
160
  </div>
161
  <div class="wpd-opt-input">
162
  <div class="wpd-switcher">
@@ -175,7 +175,7 @@ if (!defined("ABSPATH")) {
175
  <div class="wpd-opt-row" data-wpd-opt="usePostmaticForCommentNotification">
176
  <div class="wpd-opt-name">
177
  <label for="usePostmaticForCommentNotification"><?php echo esc_html($setting["options"]["usePostmaticForCommentNotification"]["label"]) ?></label>
178
- <p class="wpd-desc"><?php echo $setting["options"]["usePostmaticForCommentNotification"]["description"] ?></p>
179
  </div>
180
  <div class="wpd-opt-input">
181
  <div class="wpd-switcher">
@@ -194,7 +194,7 @@ if (!defined("ABSPATH")) {
194
  <div class="wpd-opt-row" data-wpd-opt="isFollowActive">
195
  <div class="wpd-opt-name">
196
  <label for="isFollowActive"><?php echo esc_html($setting["options"]["isFollowActive"]["label"]) ?></label>
197
- <p class="wpd-desc"><?php echo $setting["options"]["isFollowActive"]["description"] ?></p>
198
  </div>
199
  <div class="wpd-opt-input">
200
  <div class="wpd-switcher">
@@ -212,7 +212,7 @@ if (!defined("ABSPATH")) {
212
  <div class="wpd-opt-row" data-wpd-opt="disableFollowConfirmForUsers">
213
  <div class="wpd-opt-name">
214
  <label for="disableFollowConfirmForUsers"><?php echo esc_html($setting["options"]["disableFollowConfirmForUsers"]["label"]) ?></label>
215
- <p class="wpd-desc"><?php echo $setting["options"]["disableFollowConfirmForUsers"]["description"] ?></p>
216
  </div>
217
  <div class="wpd-opt-input">
218
  <div class="wpd-switcher">
19
  <div class="wpd-opt-row" data-wpd-opt="enableUserMentioning">
20
  <div class="wpd-opt-name">
21
  <label for="enableUserMentioning"><?php echo esc_html($setting["options"]["enableUserMentioning"]["label"]) ?></label>
22
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableUserMentioning"]["description"]) ?></p>
23
  </div>
24
  <div class="wpd-opt-input">
25
  <div class="wpd-switcher">
37
  <div class="wpd-opt-row" data-wpd-opt="sendMailToMentionedUsers">
38
  <div class="wpd-opt-name">
39
  <label for="sendMailToMentionedUsers"><?php echo esc_html($setting["options"]["sendMailToMentionedUsers"]["label"]) ?></label>
40
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["sendMailToMentionedUsers"]["description"]) ?></p>
41
  </div>
42
  <div class="wpd-opt-input">
43
  <div class="wpd-switcher">
55
  <div class="wpd-opt-row" data-wpd-opt="isNotifyOnCommentApprove">
56
  <div class="wpd-opt-name">
57
  <label for="isNotifyOnCommentApprove"><?php echo esc_html($setting["options"]["isNotifyOnCommentApprove"]["label"]) ?></label>
58
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["isNotifyOnCommentApprove"]["description"]) ?></p>
59
  </div>
60
  <div class="wpd-opt-input">
61
  <div class="wpd-switcher">
73
  <div class="wpd-opt-row" data-wpd-opt="enableMemberConfirm">
74
  <div class="wpd-opt-name">
75
  <label for="enableMemberConfirm"><?php echo esc_html($setting["options"]["enableMemberConfirm"]["label"]) ?></label>
76
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableMemberConfirm"]["description"]) ?></p>
77
  </div>
78
  <div class="wpd-opt-input">
79
  <div class="wpd-switcher">
91
  <div class="wpd-opt-row" data-wpd-opt="enableGuestsConfirm">
92
  <div class="wpd-opt-name">
93
  <label for="enableGuestsConfirm"><?php echo esc_html($setting["options"]["enableGuestsConfirm"]["label"]) ?></label>
94
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableGuestsConfirm"]["description"]) ?></p>
95
  </div>
96
  <div class="wpd-opt-input">
97
  <div class="wpd-switcher">
109
  <div class="wpd-opt-row" data-wpd-opt="subscriptionType">
110
  <div class="wpd-opt-name">
111
  <label for="subscriptionType"><?php echo esc_html($setting["options"]["subscriptionType"]["label"]) ?></label>
112
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["subscriptionType"]["description"]) ?></p>
113
  </div>
114
  <div class="wpd-opt-input">
115
  <div class="wpd-radio">
138
  <div class="wpd-opt-row" data-wpd-opt="showReplyCheckbox">
139
  <div class="wpd-opt-name">
140
  <label for="showReplyCheckbox"><?php echo esc_html($setting["options"]["showReplyCheckbox"]["label"]) ?></label>
141
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["showReplyCheckbox"]["description"]) ?></p>
142
  </div>
143
  <div class="wpd-opt-input">
144
  <div class="wpd-switcher">
156
  <div class="wpd-opt-row" data-wpd-opt="isReplyDefaultChecked">
157
  <div class="wpd-opt-name">
158
  <label for="isReplyDefaultChecked"><?php echo esc_html($setting["options"]["isReplyDefaultChecked"]["label"]) ?></label>
159
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["isReplyDefaultChecked"]["description"]) ?></p>
160
  </div>
161
  <div class="wpd-opt-input">
162
  <div class="wpd-switcher">
175
  <div class="wpd-opt-row" data-wpd-opt="usePostmaticForCommentNotification">
176
  <div class="wpd-opt-name">
177
  <label for="usePostmaticForCommentNotification"><?php echo esc_html($setting["options"]["usePostmaticForCommentNotification"]["label"]) ?></label>
178
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["usePostmaticForCommentNotification"]["description"]) ?></p>
179
  </div>
180
  <div class="wpd-opt-input">
181
  <div class="wpd-switcher">
194
  <div class="wpd-opt-row" data-wpd-opt="isFollowActive">
195
  <div class="wpd-opt-name">
196
  <label for="isFollowActive"><?php echo esc_html($setting["options"]["isFollowActive"]["label"]) ?></label>
197
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["isFollowActive"]["description"]) ?></p>
198
  </div>
199
  <div class="wpd-opt-input">
200
  <div class="wpd-switcher">
212
  <div class="wpd-opt-row" data-wpd-opt="disableFollowConfirmForUsers">
213
  <div class="wpd-opt-name">
214
  <label for="disableFollowConfirmForUsers"><?php echo esc_html($setting["options"]["disableFollowConfirmForUsers"]["label"]) ?></label>
215
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["disableFollowConfirmForUsers"]["description"]) ?></p>
216
  </div>
217
  <div class="wpd-opt-input">
218
  <div class="wpd-switcher">
options/options-layouts/html-thread_display.php CHANGED
@@ -19,7 +19,7 @@ if (!defined("ABSPATH")) {
19
  <div class="wpd-opt-row" data-wpd-opt="firstLoadWithAjax">
20
  <div class="wpd-opt-name">
21
  <label for="firstLoadWithAjax"><?php echo esc_html($setting["options"]["firstLoadWithAjax"]["label"]) ?></label>
22
- <p class="wpd-desc"><?php echo $setting["options"]["firstLoadWithAjax"]["description"] ?></p>
23
  </div>
24
  <div class="wpd-opt-input">
25
  <div class="wpd-radio">
@@ -48,7 +48,7 @@ if (!defined("ABSPATH")) {
48
  <div class="wpd-opt-row" data-wpd-opt="commentListLoadType">
49
  <div class="wpd-opt-name">
50
  <label for="commentListLoadType"><?php echo esc_html($setting["options"]["commentListLoadType"]["label"]) ?></label>
51
- <p class="wpd-desc"><?php echo $setting["options"]["commentListLoadType"]["description"] ?></p>
52
  </div>
53
  <div class="wpd-opt-input">
54
  <fieldset>
@@ -84,7 +84,7 @@ if (!defined("ABSPATH")) {
84
  <div class="wpd-opt-row" data-wpd-opt="isLoadOnlyParentComments">
85
  <div class="wpd-opt-name">
86
  <label for="isLoadOnlyParentComments"><?php echo $setting["options"]["isLoadOnlyParentComments"]["label"] ?></label>
87
- <p class="wpd-desc"><?php echo $setting["options"]["isLoadOnlyParentComments"]["description"] ?></p>
88
  </div>
89
  <div class="wpd-opt-input">
90
  <div class="wpd-switcher">
@@ -102,7 +102,7 @@ if (!defined("ABSPATH")) {
102
  <div class="wpd-opt-row" data-wpd-opt="showReactedFilterButton">
103
  <div class="wpd-opt-name">
104
  <label for="showReactedFilterButton"><?php echo esc_html($setting["options"]["showReactedFilterButton"]["label"]) ?></label>
105
- <p class="wpd-desc"><?php echo $setting["options"]["showReactedFilterButton"]["description"] ?></p>
106
  </div>
107
  <div class="wpd-opt-input">
108
  <div class="wpd-switcher">
@@ -120,7 +120,7 @@ if (!defined("ABSPATH")) {
120
  <div class="wpd-opt-row" data-wpd-opt="showHottestFilterButton">
121
  <div class="wpd-opt-name">
122
  <label for="showHottestFilterButton"><?php echo esc_html($setting["options"]["showHottestFilterButton"]["label"]) ?></label>
123
- <p class="wpd-desc"><?php echo $setting["options"]["showHottestFilterButton"]["description"] ?></p>
124
  </div>
125
  <div class="wpd-opt-input">
126
  <div class="wpd-switcher">
@@ -138,7 +138,7 @@ if (!defined("ABSPATH")) {
138
  <div class="wpd-opt-row" data-wpd-opt="showSortingButtons">
139
  <div class="wpd-opt-name">
140
  <label for="showSortingButtons"><?php echo esc_html($setting["options"]["showSortingButtons"]["label"]) ?></label>
141
- <p class="wpd-desc"><?php echo $setting["options"]["showSortingButtons"]["description"] ?></p>
142
  </div>
143
  <div class="wpd-opt-input">
144
  <div class="wpd-switcher">
@@ -156,7 +156,7 @@ if (!defined("ABSPATH")) {
156
  <div class="wpd-opt-row" data-wpd-opt="mostVotedByDefault">
157
  <div class="wpd-opt-name">
158
  <label for="mostVotedByDefault"><?php echo esc_html($setting["options"]["mostVotedByDefault"]["label"]) ?></label>
159
- <p class="wpd-desc"><?php echo $setting["options"]["mostVotedByDefault"]["description"] ?></p>
160
  </div>
161
  <div class="wpd-opt-input">
162
  <div class="wpd-switcher">
@@ -174,7 +174,7 @@ if (!defined("ABSPATH")) {
174
  <div class="wpd-opt-row" data-wpd-opt="reverseChildren">
175
  <div class="wpd-opt-name">
176
  <label for="reverseChildren"><?php echo esc_html($setting["options"]["reverseChildren"]["label"]) ?></label>
177
- <p class="wpd-desc"><?php echo $setting["options"]["reverseChildren"]["description"] ?></p>
178
  </div>
179
  <div class="wpd-opt-input">
180
  <div class="wpd-switcher">
@@ -192,7 +192,7 @@ if (!defined("ABSPATH")) {
192
  <div class="wpd-opt-row" data-wpd-opt="highlightUnreadComments">
193
  <div class="wpd-opt-name">
194
  <label for="highlightUnreadComments"><?php echo esc_html($setting["options"]["highlightUnreadComments"]["label"]) ?></label>
195
- <p class="wpd-desc"><?php echo $setting["options"]["highlightUnreadComments"]["description"] ?></p>
196
  </div>
197
  <div class="wpd-opt-input">
198
  <div class="wpd-switcher">
@@ -210,7 +210,7 @@ if (!defined("ABSPATH")) {
210
  <div class="wpd-opt-row" data-wpd-opt="scrollToComment">
211
  <div class="wpd-opt-name">
212
  <label for="scrollToComment"><?php echo $setting["options"]["scrollToComment"]["label"] ?></label>
213
- <p class="wpd-desc"><?php echo $setting["options"]["scrollToComment"]["description"] ?></p>
214
  </div>
215
  <div class="wpd-opt-input">
216
  <div class="wpd-switcher">
@@ -228,7 +228,7 @@ if (!defined("ABSPATH")) {
228
  <div class="wpd-opt-row" data-wpd-opt="orderCommentsBy">
229
  <div class="wpd-opt-name">
230
  <label for="orderCommentsBy"><?php echo esc_html($setting["options"]["orderCommentsBy"]["label"]) ?></label>
231
- <p class="wpd-desc"><?php echo $setting["options"]["orderCommentsBy"]["description"] ?></p>
232
  </div>
233
  <div class="wpd-opt-input">
234
  <div class="wpd-switch-field">
19
  <div class="wpd-opt-row" data-wpd-opt="firstLoadWithAjax">
20
  <div class="wpd-opt-name">
21
  <label for="firstLoadWithAjax"><?php echo esc_html($setting["options"]["firstLoadWithAjax"]["label"]) ?></label>
22
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["firstLoadWithAjax"]["description"]) ?></p>
23
  </div>
24
  <div class="wpd-opt-input">
25
  <div class="wpd-radio">
48
  <div class="wpd-opt-row" data-wpd-opt="commentListLoadType">
49
  <div class="wpd-opt-name">
50
  <label for="commentListLoadType"><?php echo esc_html($setting["options"]["commentListLoadType"]["label"]) ?></label>
51
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["commentListLoadType"]["description"]) ?></p>
52
  </div>
53
  <div class="wpd-opt-input">
54
  <fieldset>
84
  <div class="wpd-opt-row" data-wpd-opt="isLoadOnlyParentComments">
85
  <div class="wpd-opt-name">
86
  <label for="isLoadOnlyParentComments"><?php echo $setting["options"]["isLoadOnlyParentComments"]["label"] ?></label>
87
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["isLoadOnlyParentComments"]["description"]) ?></p>
88
  </div>
89
  <div class="wpd-opt-input">
90
  <div class="wpd-switcher">
102
  <div class="wpd-opt-row" data-wpd-opt="showReactedFilterButton">
103
  <div class="wpd-opt-name">
104
  <label for="showReactedFilterButton"><?php echo esc_html($setting["options"]["showReactedFilterButton"]["label"]) ?></label>
105
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["showReactedFilterButton"]["description"]) ?></p>
106
  </div>
107
  <div class="wpd-opt-input">
108
  <div class="wpd-switcher">
120
  <div class="wpd-opt-row" data-wpd-opt="showHottestFilterButton">
121
  <div class="wpd-opt-name">
122
  <label for="showHottestFilterButton"><?php echo esc_html($setting["options"]["showHottestFilterButton"]["label"]) ?></label>
123
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["showHottestFilterButton"]["description"]) ?></p>
124
  </div>
125
  <div class="wpd-opt-input">
126
  <div class="wpd-switcher">
138
  <div class="wpd-opt-row" data-wpd-opt="showSortingButtons">
139
  <div class="wpd-opt-name">
140
  <label for="showSortingButtons"><?php echo esc_html($setting["options"]["showSortingButtons"]["label"]) ?></label>
141
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["showSortingButtons"]["description"]) ?></p>
142
  </div>
143
  <div class="wpd-opt-input">
144
  <div class="wpd-switcher">
156
  <div class="wpd-opt-row" data-wpd-opt="mostVotedByDefault">
157
  <div class="wpd-opt-name">
158
  <label for="mostVotedByDefault"><?php echo esc_html($setting["options"]["mostVotedByDefault"]["label"]) ?></label>
159
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["mostVotedByDefault"]["description"]) ?></p>
160
  </div>
161
  <div class="wpd-opt-input">
162
  <div class="wpd-switcher">
174
  <div class="wpd-opt-row" data-wpd-opt="reverseChildren">
175
  <div class="wpd-opt-name">
176
  <label for="reverseChildren"><?php echo esc_html($setting["options"]["reverseChildren"]["label"]) ?></label>
177
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["reverseChildren"]["description"]) ?></p>
178
  </div>
179
  <div class="wpd-opt-input">
180
  <div class="wpd-switcher">
192
  <div class="wpd-opt-row" data-wpd-opt="highlightUnreadComments">
193
  <div class="wpd-opt-name">
194
  <label for="highlightUnreadComments"><?php echo esc_html($setting["options"]["highlightUnreadComments"]["label"]) ?></label>
195
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["highlightUnreadComments"]["description"]) ?></p>
196
  </div>
197
  <div class="wpd-opt-input">
198
  <div class="wpd-switcher">
210
  <div class="wpd-opt-row" data-wpd-opt="scrollToComment">
211
  <div class="wpd-opt-name">
212
  <label for="scrollToComment"><?php echo $setting["options"]["scrollToComment"]["label"] ?></label>
213
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["scrollToComment"]["description"]) ?></p>
214
  </div>
215
  <div class="wpd-opt-input">
216
  <div class="wpd-switcher">
228
  <div class="wpd-opt-row" data-wpd-opt="orderCommentsBy">
229
  <div class="wpd-opt-name">
230
  <label for="orderCommentsBy"><?php echo esc_html($setting["options"]["orderCommentsBy"]["label"]) ?></label>
231
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["orderCommentsBy"]["description"]) ?></p>
232
  </div>
233
  <div class="wpd-opt-input">
234
  <div class="wpd-switch-field">
options/options-layouts/html-thread_layouts.php CHANGED
@@ -43,7 +43,7 @@ if (!defined("ABSPATH")) {
43
  <div class="wpd-opt-row" data-wpd-opt="showAvatars">
44
  <div class="wpd-opt-name">
45
  <label for="showAvatars"><?php echo esc_html($setting["options"]["showAvatars"]["label"]) ?></label>
46
- <p class="wpd-desc"><?php echo $setting["options"]["showAvatars"]["description"] ?></p>
47
  </div>
48
  <div class="wpd-opt-input">
49
  <div class="wpd-switcher">
@@ -61,7 +61,7 @@ if (!defined("ABSPATH")) {
61
  <div class="wpd-opt-row" data-wpd-opt="defaultAvatarUrlForUser">
62
  <div class="wpd-opt-name">
63
  <label for="defaultAvatarUrlForUser"><?php echo esc_html($setting["options"]["defaultAvatarUrlForUser"]["label"]) ?></label>
64
- <p class="wpd-desc"><?php echo $setting["options"]["defaultAvatarUrlForUser"]["description"] ?></p>
65
  </div>
66
  <div class="wpd-opt-input">
67
  <input type="url" value="<?php echo esc_attr($this->thread_layouts["defaultAvatarUrlForUser"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_THREAD_LAYOUTS); ?>[defaultAvatarUrlForUser]" id="defaultAvatarUrlForUser" />
@@ -76,7 +76,7 @@ if (!defined("ABSPATH")) {
76
  <div class="wpd-opt-row" data-wpd-opt="defaultAvatarUrlForGuest">
77
  <div class="wpd-opt-name">
78
  <label for="defaultAvatarUrlForGuest"><?php echo esc_html($setting["options"]["defaultAvatarUrlForGuest"]["label"]) ?></label>
79
- <p class="wpd-desc"><?php echo $setting["options"]["defaultAvatarUrlForGuest"]["description"] ?></p>
80
  </div>
81
  <div class="wpd-opt-input">
82
  <input type="url" value="<?php echo esc_attr($this->thread_layouts["defaultAvatarUrlForGuest"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_THREAD_LAYOUTS); ?>[defaultAvatarUrlForGuest]" id="defaultAvatarUrlForGuest" />
@@ -91,7 +91,7 @@ if (!defined("ABSPATH")) {
91
  <div class="wpd-opt-row" data-wpd-opt="changeAvatarsEverywhere">
92
  <div class="wpd-opt-name">
93
  <label for="changeAvatarsEverywhere"><?php echo esc_html($setting["options"]["changeAvatarsEverywhere"]["label"]) ?></label>
94
- <p class="wpd-desc"><?php echo $setting["options"]["changeAvatarsEverywhere"]["description"] ?></p>
95
  </div>
96
  <div class="wpd-opt-input">
97
  <div class="wpd-switcher">
@@ -113,7 +113,7 @@ if (!defined("ABSPATH")) {
113
  <div class="wpd-opt-row" data-wpd-opt="showVotingButtons">
114
  <div class="wpd-opt-name">
115
  <label for="showVotingButtons"><?php echo esc_html($setting["options"]["showVotingButtons"]["label"]) ?></label>
116
- <p class="wpd-desc"><?php echo $setting["options"]["showVotingButtons"]["description"] ?></p>
117
  </div>
118
  <div class="wpd-opt-input">
119
  <div class="wpd-switcher">
@@ -131,7 +131,7 @@ if (!defined("ABSPATH")) {
131
  <div class="wpd-opt-row" data-wpd-opt="votingButtonsIcon">
132
  <div class="wpd-opt-name">
133
  <label for="votingButtonsIcon"><?php echo esc_html($setting["options"]["votingButtonsIcon"]["label"]) ?></label>
134
- <p class="wpd-desc"><?php echo $setting["options"]["votingButtonsIcon"]["description"] ?></p>
135
  </div>
136
  <div class="wpd-opt-input">
137
  <div class="wpd-switch-field" style="min-width: 220px;">
@@ -155,7 +155,7 @@ if (!defined("ABSPATH")) {
155
  <div class="wpd-opt-row" data-wpd-opt="votingButtonsStyle">
156
  <div class="wpd-opt-name">
157
  <label for="votingButtonsStyle"><?php echo esc_html($setting["options"]["votingButtonsStyle"]["label"]) ?></label>
158
- <p class="wpd-desc"><?php echo $setting["options"]["votingButtonsStyle"]["description"] ?></p>
159
  </div>
160
  <div class="wpd-opt-input">
161
  <div class="wpd-switch-field">
@@ -173,7 +173,7 @@ if (!defined("ABSPATH")) {
173
  <div class="wpd-opt-row" data-wpd-opt="enableDislikeButton">
174
  <div class="wpd-opt-name">
175
  <label for="enableDislikeButton"><?php echo esc_html($setting["options"]["enableDislikeButton"]["label"]) ?></label>
176
- <p class="wpd-desc"><?php echo $setting["options"]["enableDislikeButton"]["description"] ?></p>
177
  </div>
178
  <div class="wpd-opt-input">
179
  <div class="wpd-switcher">
@@ -191,7 +191,7 @@ if (!defined("ABSPATH")) {
191
  <div class="wpd-opt-row" data-wpd-opt="isGuestCanVote">
192
  <div class="wpd-opt-name">
193
  <label for="isGuestCanVote"><?php echo esc_html($setting["options"]["isGuestCanVote"]["label"]) ?></label>
194
- <p class="wpd-desc"><?php echo $setting["options"]["isGuestCanVote"]["description"] ?></p>
195
  </div>
196
  <div class="wpd-opt-input">
197
  <div class="wpd-switcher">
@@ -209,7 +209,7 @@ if (!defined("ABSPATH")) {
209
  <div class="wpd-opt-row" data-wpd-opt="highlightVotingButtons">
210
  <div class="wpd-opt-name">
211
  <label for="highlightVotingButtons"><?php echo esc_html($setting["options"]["highlightVotingButtons"]["label"]) ?></label>
212
- <p class="wpd-desc"><?php echo $setting["options"]["highlightVotingButtons"]["description"] ?></p>
213
  </div>
214
  <div class="wpd-opt-input">
215
  <div class="wpd-switcher">
@@ -232,7 +232,7 @@ if (!defined("ABSPATH")) {
232
  <div class="wpd-opt-row" data-wpd-opt="showCommentLink">
233
  <div class="wpd-opt-name">
234
  <label for="showCommentLink"><?php echo esc_html($setting["options"]["showCommentLink"]["label"]) ?></label>
235
- <p class="wpd-desc"><?php echo $setting["options"]["showCommentLink"]["description"] ?></p>
236
  </div>
237
  <div class="wpd-opt-input">
238
  <div class="wpd-switcher">
@@ -250,7 +250,7 @@ if (!defined("ABSPATH")) {
250
  <div class="wpd-opt-row" data-wpd-opt="showCommentDate">
251
  <div class="wpd-opt-name">
252
  <label for="showCommentDate"><?php echo esc_html($setting["options"]["showCommentDate"]["label"]) ?></label>
253
- <p class="wpd-desc"><?php echo $setting["options"]["showCommentDate"]["description"] ?></p>
254
  </div>
255
  <div class="wpd-opt-input">
256
  <div class="wpd-switcher">
43
  <div class="wpd-opt-row" data-wpd-opt="showAvatars">
44
  <div class="wpd-opt-name">
45
  <label for="showAvatars"><?php echo esc_html($setting["options"]["showAvatars"]["label"]) ?></label>
46
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["showAvatars"]["description"]) ?></p>
47
  </div>
48
  <div class="wpd-opt-input">
49
  <div class="wpd-switcher">
61
  <div class="wpd-opt-row" data-wpd-opt="defaultAvatarUrlForUser">
62
  <div class="wpd-opt-name">
63
  <label for="defaultAvatarUrlForUser"><?php echo esc_html($setting["options"]["defaultAvatarUrlForUser"]["label"]) ?></label>
64
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["defaultAvatarUrlForUser"]["description"]) ?></p>
65
  </div>
66
  <div class="wpd-opt-input">
67
  <input type="url" value="<?php echo esc_attr($this->thread_layouts["defaultAvatarUrlForUser"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_THREAD_LAYOUTS); ?>[defaultAvatarUrlForUser]" id="defaultAvatarUrlForUser" />
76
  <div class="wpd-opt-row" data-wpd-opt="defaultAvatarUrlForGuest">
77
  <div class="wpd-opt-name">
78
  <label for="defaultAvatarUrlForGuest"><?php echo esc_html($setting["options"]["defaultAvatarUrlForGuest"]["label"]) ?></label>
79
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["defaultAvatarUrlForGuest"]["description"]) ?></p>
80
  </div>
81
  <div class="wpd-opt-input">
82
  <input type="url" value="<?php echo esc_attr($this->thread_layouts["defaultAvatarUrlForGuest"]); ?>" name="<?php echo esc_attr(WpdiscuzCore::TAB_THREAD_LAYOUTS); ?>[defaultAvatarUrlForGuest]" id="defaultAvatarUrlForGuest" />
91
  <div class="wpd-opt-row" data-wpd-opt="changeAvatarsEverywhere">
92
  <div class="wpd-opt-name">
93
  <label for="changeAvatarsEverywhere"><?php echo esc_html($setting["options"]["changeAvatarsEverywhere"]["label"]) ?></label>
94
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["changeAvatarsEverywhere"]["description"]) ?></p>
95
  </div>
96
  <div class="wpd-opt-input">
97
  <div class="wpd-switcher">
113
  <div class="wpd-opt-row" data-wpd-opt="showVotingButtons">
114
  <div class="wpd-opt-name">
115
  <label for="showVotingButtons"><?php echo esc_html($setting["options"]["showVotingButtons"]["label"]) ?></label>
116
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["showVotingButtons"]["description"]) ?></p>
117
  </div>
118
  <div class="wpd-opt-input">
119
  <div class="wpd-switcher">
131
  <div class="wpd-opt-row" data-wpd-opt="votingButtonsIcon">
132
  <div class="wpd-opt-name">
133
  <label for="votingButtonsIcon"><?php echo esc_html($setting["options"]["votingButtonsIcon"]["label"]) ?></label>
134
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["votingButtonsIcon"]["description"]) ?></p>
135
  </div>
136
  <div class="wpd-opt-input">
137
  <div class="wpd-switch-field" style="min-width: 220px;">
155
  <div class="wpd-opt-row" data-wpd-opt="votingButtonsStyle">
156
  <div class="wpd-opt-name">
157
  <label for="votingButtonsStyle"><?php echo esc_html($setting["options"]["votingButtonsStyle"]["label"]) ?></label>
158
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["votingButtonsStyle"]["description"]) ?></p>
159
  </div>
160
  <div class="wpd-opt-input">
161
  <div class="wpd-switch-field">
173
  <div class="wpd-opt-row" data-wpd-opt="enableDislikeButton">
174
  <div class="wpd-opt-name">
175
  <label for="enableDislikeButton"><?php echo esc_html($setting["options"]["enableDislikeButton"]["label"]) ?></label>
176
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableDislikeButton"]["description"]) ?></p>
177
  </div>
178
  <div class="wpd-opt-input">
179
  <div class="wpd-switcher">
191
  <div class="wpd-opt-row" data-wpd-opt="isGuestCanVote">
192
  <div class="wpd-opt-name">
193
  <label for="isGuestCanVote"><?php echo esc_html($setting["options"]["isGuestCanVote"]["label"]) ?></label>
194
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["isGuestCanVote"]["description"]) ?></p>
195
  </div>
196
  <div class="wpd-opt-input">
197
  <div class="wpd-switcher">
209
  <div class="wpd-opt-row" data-wpd-opt="highlightVotingButtons">
210
  <div class="wpd-opt-name">
211
  <label for="highlightVotingButtons"><?php echo esc_html($setting["options"]["highlightVotingButtons"]["label"]) ?></label>
212
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["highlightVotingButtons"]["description"]) ?></p>
213
  </div>
214
  <div class="wpd-opt-input">
215
  <div class="wpd-switcher">
232
  <div class="wpd-opt-row" data-wpd-opt="showCommentLink">
233
  <div class="wpd-opt-name">
234
  <label for="showCommentLink"><?php echo esc_html($setting["options"]["showCommentLink"]["label"]) ?></label>
235
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["showCommentLink"]["description"]) ?></p>
236
  </div>
237
  <div class="wpd-opt-input">
238
  <div class="wpd-switcher">
250
  <div class="wpd-opt-row" data-wpd-opt="showCommentDate">
251
  <div class="wpd-opt-name">
252
  <label for="showCommentDate"><?php echo esc_html($setting["options"]["showCommentDate"]["label"]) ?></label>
253
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["showCommentDate"]["description"]) ?></p>
254
  </div>
255
  <div class="wpd-opt-input">
256
  <div class="wpd-switcher">
options/options-layouts/html-thread_styles.php CHANGED
@@ -19,7 +19,7 @@ if (!defined("ABSPATH")) {
19
  <div class="wpd-opt-row" data-wpd-opt="theme">
20
  <div class="wpd-opt-name">
21
  <label for="theme"><?php echo esc_html($setting["options"]["theme"]["label"]) ?></label>
22
- <p class="wpd-desc"><?php echo $setting["options"]["theme"]["description"] ?></p>
23
  </div>
24
  <div class="wpd-opt-input">
25
  <div class="wpd-switch-field">
@@ -38,7 +38,7 @@ if (!defined("ABSPATH")) {
38
  <div class="wpd-opt-row" data-wpd-opt="styleSpecificColors">
39
  <div class="wpd-opt-input" style="width: calc(100% - 40px);">
40
  <h2 style="margin-bottom: 0px;font-size: 15px; color: #555;"><?php echo esc_html($setting["options"]["styleSpecificColors"]["label"]) ?></h2>
41
- <p class="wpd-desc"><?php echo $setting["options"]["styleSpecificColors"]["description"] ?></p>
42
  <div class="wpd-default-style-colors" style="float: left; width: 48%;">
43
  <h4 style="font-size: 14px; color: #0c8d71;"><?php _e("Default Style","wpdiscuz"); ?></h4>
44
  <div class="wpd-scol-wrap">
@@ -105,7 +105,7 @@ if (!defined("ABSPATH")) {
105
  <div class="wpd-opt-row" data-wpd-opt="colors">
106
  <div class="wpd-opt-input" style="width: calc(100% - 40px);">
107
  <h2 style="margin-bottom: 0px;font-size: 15px; color: #555;"><?php echo esc_html($setting["options"]["colors"]["label"]) ?></h2>
108
- <p class="wpd-desc"><?php echo $setting["options"]["colors"]["description"] ?></p>
109
  <hr />
110
  <div class="wpd-color-wrap">
111
  <input type="text" class="wpdiscuz-color-picker regular-text" value="<?php echo esc_attr($this->thread_styles["primaryColor"]); ?>" id="primaryColor" name="<?php echo esc_attr(WpdiscuzCore::TAB_THREAD_STYLES); ?>[primaryColor]" placeholder="<?php esc_attr_e("Example: #00FF00", "wpdiscuz"); ?>"/>
@@ -147,7 +147,7 @@ if (!defined("ABSPATH")) {
147
  <div class="wpd-opt-row" data-wpd-opt="enableFontAwesome">
148
  <div class="wpd-opt-name">
149
  <label for="enableFontAwesome"><?php echo esc_html($setting["options"]["enableFontAwesome"]["label"]) ?></label>
150
- <p class="wpd-desc"><?php echo $setting["options"]["enableFontAwesome"]["description"] ?></p>
151
  </div>
152
  <div class="wpd-opt-input">
153
  <div class="wpd-switcher">
@@ -165,7 +165,7 @@ if (!defined("ABSPATH")) {
165
  <div class="wpd-opt-row" data-wpd-opt="customCss">
166
  <div class="wpd-opt-name" style="width: 28%;">
167
  <label for="customCss"><?php echo esc_html($setting["options"]["customCss"]["label"]) ?></label>
168
- <p class="wpd-desc"><?php echo $setting["options"]["customCss"]["description"] ?></p>
169
  </div>
170
  <div class="wpd-opt-input" style="width: 69%; text-align: right;">
171
  <textarea class="regular-text" id="customCss" name="<?php echo esc_attr(WpdiscuzCore::TAB_THREAD_STYLES); ?>[customCss]" placeholder="" style="width: 90%; height: 100px; color: #333333; font-family: 'Courier New', Courier, monospace; background: #f5f5f5;direction:ltr;text-align:left;"><?php echo stripslashes($this->thread_styles["customCss"]); ?></textarea>
19
  <div class="wpd-opt-row" data-wpd-opt="theme">
20
  <div class="wpd-opt-name">
21
  <label for="theme"><?php echo esc_html($setting["options"]["theme"]["label"]) ?></label>
22
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["theme"]["description"]) ?></p>
23
  </div>
24
  <div class="wpd-opt-input">
25
  <div class="wpd-switch-field">
38
  <div class="wpd-opt-row" data-wpd-opt="styleSpecificColors">
39
  <div class="wpd-opt-input" style="width: calc(100% - 40px);">
40
  <h2 style="margin-bottom: 0px;font-size: 15px; color: #555;"><?php echo esc_html($setting["options"]["styleSpecificColors"]["label"]) ?></h2>
41
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["styleSpecificColors"]["description"]) ?></p>
42
  <div class="wpd-default-style-colors" style="float: left; width: 48%;">
43
  <h4 style="font-size: 14px; color: #0c8d71;"><?php _e("Default Style","wpdiscuz"); ?></h4>
44
  <div class="wpd-scol-wrap">
105
  <div class="wpd-opt-row" data-wpd-opt="colors">
106
  <div class="wpd-opt-input" style="width: calc(100% - 40px);">
107
  <h2 style="margin-bottom: 0px;font-size: 15px; color: #555;"><?php echo esc_html($setting["options"]["colors"]["label"]) ?></h2>
108
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["colors"]["description"]) ?></p>
109
  <hr />
110
  <div class="wpd-color-wrap">
111
  <input type="text" class="wpdiscuz-color-picker regular-text" value="<?php echo esc_attr($this->thread_styles["primaryColor"]); ?>" id="primaryColor" name="<?php echo esc_attr(WpdiscuzCore::TAB_THREAD_STYLES); ?>[primaryColor]" placeholder="<?php esc_attr_e("Example: #00FF00", "wpdiscuz"); ?>"/>
147
  <div class="wpd-opt-row" data-wpd-opt="enableFontAwesome">
148
  <div class="wpd-opt-name">
149
  <label for="enableFontAwesome"><?php echo esc_html($setting["options"]["enableFontAwesome"]["label"]) ?></label>
150
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["enableFontAwesome"]["description"]) ?></p>
151
  </div>
152
  <div class="wpd-opt-input">
153
  <div class="wpd-switcher">
165
  <div class="wpd-opt-row" data-wpd-opt="customCss">
166
  <div class="wpd-opt-name" style="width: 28%;">
167
  <label for="customCss"><?php echo esc_html($setting["options"]["customCss"]["label"]) ?></label>
168
+ <p class="wpd-desc"><?php echo esc_html($setting["options"]["customCss"]["description"]) ?></p>
169
  </div>
170
  <div class="wpd-opt-input" style="width: 69%; text-align: right;">
171
  <textarea class="regular-text" id="customCss" name="<?php echo esc_attr(WpdiscuzCore::TAB_THREAD_STYLES); ?>[customCss]" placeholder="" style="width: 90%; height: 100px; color: #333333; font-family: 'Courier New', Courier, monospace; background: #f5f5f5;direction:ltr;text-align:left;"><?php echo stripslashes($this->thread_styles["customCss"]); ?></textarea>
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: gVectors Team
3
  Tags: comment, comments, ajax comments, comment form, comment fields
4
  Requires at least: 5.0
5
  Tested up to: 5.8
6
- Stable tag: 7.3.4
7
  Requires PHP: 5.6 and higher
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -185,6 +185,18 @@ Nothing will be lost! **Comments - wpDiscuz** will show all old comments.
185
 
186
  == Changelog ==
187
 
 
 
 
 
 
 
 
 
 
 
 
 
188
  = Comments - wpDiscuz v7.3.4 =
189
 
190
  * Fixed bug: Small security issue, wp_nonce verification to all ajax actions
3
  Tags: comment, comments, ajax comments, comment form, comment fields
4
  Requires at least: 5.0
5
  Tested up to: 5.8
6
+ Stable tag: 7.3.5
7
  Requires PHP: 5.6 and higher
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
185
 
186
  == Changelog ==
187
 
188
+ = Comments - wpDiscuz v7.3.5 =
189
+
190
+ * Fixed bug: Proper escaping && sanitization of variables
191
+ * Fixed bug: Nonce is invalid, conflict with cache plugins
192
+ * Fixed bug: Problem with Comment Fields Background option
193
+ * Fixed bug: Problem with Edit Button (Allow comment editing for "Unlimited" time) option
194
+
195
+ **IMPORTANT!**
196
+
197
+ * Please don't forget delete all caches and purge CDN after the update.
198
+
199
+
200
  = Comments - wpDiscuz v7.3.4 =
201
 
202
  * Fixed bug: Small security issue, wp_nonce verification to all ajax actions
themes/default/comment-form.php CHANGED
@@ -147,7 +147,7 @@ if (!post_password_required($post->ID)) {
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) {
152
  $currentUserId = $currentUser->ID;
153
  $currentUserEmail = $currentUser->user_email;
147
  $wpCommClasses = implode(" ", $wpCommClasses);
148
 
149
  $currentUserId = 0;
150
+ $currentUserEmail = isset($_COOKIE["comment_author_email_" . COOKIEHASH]) ? sanitize_email($_COOKIE["comment_author_email_" . COOKIEHASH]) : "";
151
  if ($currentUser && $currentUser->ID) {
152
  $currentUserId = $currentUser->ID;
153
  $currentUserEmail = $currentUser->user_email;
utils/class.WpdiscuzHelper.php CHANGED
@@ -60,6 +60,9 @@ class WpdiscuzHelper implements WpDiscuzConstants {
60
  }
61
  add_filter("wpdiscuz_comment_author", [$this, "umAuthorName"], 10, 2);
62
  add_action("add_meta_boxes", [&$this, "addRatingResetButton"], 10, 2);
 
 
 
63
  }
64
 
65
  public function filterKses() {
@@ -149,6 +152,15 @@ class WpdiscuzHelper implements WpDiscuzConstants {
149
  wp_die(__("Nonce is invalid.", "wpdiscuz"));
150
  }
151
  }
 
 
 
 
 
 
 
 
 
152
 
153
  //==========================================================================
154
 
@@ -399,7 +411,7 @@ class WpdiscuzHelper implements WpDiscuzConstants {
399
  if (isset($commentListArgs["comment_author_email"])) {
400
  $storedCookieEmail = $commentListArgs["comment_author_email"];
401
  } else {
402
- $storedCookieEmail = isset($_COOKIE["comment_author_email_" . COOKIEHASH]) ? $_COOKIE["comment_author_email_" . COOKIEHASH] : "";
403
  }
404
  return !(!$this->options->moderation["enableEditingWhenHaveReplies"] && $comment->get_children(["post_id" => $comment->comment_post_ID])) && (($storedCookieEmail === $comment->comment_author_email && $_SERVER["REMOTE_ADDR"] === $comment->comment_author_IP) || ($currentUser && $currentUser->ID && $currentUser->ID == $comment->user_id));
405
  }
@@ -494,7 +506,7 @@ class WpdiscuzHelper implements WpDiscuzConstants {
494
  $currentUserEmail = $currentUser->user_email;
495
  } else {
496
  $currentUserId = 0;
497
- $currentUserEmail = isset($_COOKIE["comment_author_email_" . COOKIEHASH]) ? $_COOKIE["comment_author_email_" . COOKIEHASH] : "";
498
  }
499
 
500
  if (is_user_logged_in()) {
@@ -1296,7 +1308,7 @@ class WpdiscuzHelper implements WpDiscuzConstants {
1296
  $darkCommentFieldsPlaceholderColor = $this->options->thread_styles["darkCommentFieldsPlaceholderColor"] ? "opacity:1;color:" . $this->options->thread_styles["darkCommentFieldsPlaceholderColor"] . ";" : "";
1297
  $defaultCommentAreaBG = $this->options->thread_styles["defaultCommentAreaBG"] ? "background:" . $this->options->thread_styles["defaultCommentAreaBG"] . ";" : "";
1298
  $defaultCommentTextColor = $this->options->thread_styles["defaultCommentTextColor"] ? "color:" . $this->options->thread_styles["defaultCommentTextColor"] . ";" : "";
1299
- $defaultCommentFieldsBG = $this->options->thread_styles["defaultCommentFieldsBG"] ? "background:" . $this->options->thread_styles["defaultCommentFieldsBorderColor"] . ";" : "";
1300
  $defaultCommentFieldsBorderColor = $this->options->thread_styles["defaultCommentFieldsBorderColor"] ? "border: 1px solid " . $this->options->thread_styles["defaultCommentFieldsBorderColor"] . ";" : "";
1301
  $defaultCommentFieldsTextColor = $this->options->thread_styles["defaultCommentFieldsTextColor"] ? "color:" . $this->options->thread_styles["defaultCommentFieldsTextColor"] . ";" : "";
1302
  $defaultCommentFieldsPlaceholderColor = $this->options->thread_styles["defaultCommentFieldsPlaceholderColor"] ? "opacity:1;color:" . $this->options->thread_styles["defaultCommentFieldsPlaceholderColor"] . ";" : "";
@@ -1307,119 +1319,119 @@ class WpdiscuzHelper implements WpDiscuzConstants {
1307
  }
1308
  foreach ($blogRoles as $role => $color) {
1309
  echo "\r\n";
1310
- echo "#wpdcom .wpd-blog-" . $role . " .wpd-comment-label{color: #ffffff; background-color: " . $color . "; border: none;}\r\n";
1311
- echo "#wpdcom .wpd-blog-" . $role . " .wpd-comment-author, #wpdcom .wpd-blog-" . $role . " .wpd-comment-author a{color: " . $color . ";}\r\n";
1312
  if ($role === "post_author") {
1313
- echo "#wpdcom .wpd-blog-post_author .wpd-avatar img{border-color: " . $color . ";}";
1314
  }
1315
  if ($role !== "subscriber" && $role !== "guest") {
1316
- echo "#wpdcom.wpd-layout-1 .wpd-comment .wpd-blog-" . $role . " .wpd-avatar img{border-color: " . $color . ";}\r\n";
1317
  }
1318
  if ($role === "administrator" || $role === "editor" || $role === "post_author") {
1319
- echo "#wpdcom.wpd-layout-2 .wpd-comment.wpd-reply .wpd-comment-wrap.wpd-blog-" . $role . "{border-" . $left . ": 3px solid " . $color . ";}\r\n";
1320
  }
1321
  if ($role !== "guest") {
1322
- echo "#wpdcom.wpd-layout-2 .wpd-comment .wpd-blog-" . $role . " .wpd-avatar img{border-bottom-color: " . $color . ";}\r\n";
1323
  }
1324
- echo "#wpdcom.wpd-layout-3 .wpd-blog-" . $role . " .wpd-comment-subheader{border-top: 1px dashed " . $color . ";}\r\n";
1325
  if ($role !== "subscriber" && $role !== "guest") {
1326
- echo "#wpdcom.wpd-layout-3 .wpd-reply .wpd-blog-" . $role . " .wpd-comment-right{border-" . $left . ": 1px solid " . $color . ";}\r\n";
1327
  }
1328
  }
1329
  ?>
1330
- <?php echo ( $this->options->thread_styles["commentTextSize"] !== "14px") ? "#wpdcom .wpd-comment-text p{font-size:" . $this->options->thread_styles["commentTextSize"] . ";}\r\n" : ""; ?>
1331
  <?php if ($dark) { ?>
1332
- #comments, #respond, .comments-area, #wpdcom.wpd-dark{<?php echo $darkCommentAreaBG . $darkCommentTextColor ?>}
1333
- #wpdcom .ql-editor > *{<?php echo $darkCommentFieldsTextColor ?>}
1334
- #wpdcom .ql-editor::before{<?php echo $darkCommentFieldsPlaceholderColor ?>}
1335
- #wpdcom .ql-toolbar{<?php echo $darkCommentFieldsBorderColor ?>border-top:none;}
1336
- #wpdcom .ql-container{<?php echo $darkCommentFieldsBG . $darkCommentFieldsBorderColor ?>border-bottom:none;}
1337
- #wpdcom .wpd-form-row .wpdiscuz-item input[type="text"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="email"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="url"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="color"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="date"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="datetime"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="datetime-local"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="month"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="number"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="time"], #wpdcom textarea, #wpdcom select{<?php echo $darkCommentFieldsBG . $darkCommentFieldsBorderColor . $darkCommentFieldsTextColor ?>}
1338
- #wpdcom.wpd-dark .wpdiscuz-item.wpd-field-select select.wpdiscuz_select, #wpdcom.wpd-dark select{<?php echo str_replace(';', '!important;', $darkCommentFieldsBG . $darkCommentFieldsBorderColor . $darkCommentFieldsTextColor) ?>}
1339
- #wpdcom .wpd-form-row .wpdiscuz-item textarea{<?php echo $darkCommentFieldsBorderColor ?>}
1340
- #wpdcom input::placeholder, #wpdcom textarea::placeholder, #wpdcom input::-moz-placeholder, #wpdcom textarea::-webkit-input-placeholder{<?php echo $darkCommentFieldsPlaceholderColor ?>}
1341
- #wpdcom .wpd-comment-text{<?php echo $darkCommentTextColor ?>}
1342
  .lity-wrap .wpd-item a{color: #666;} .lity-wrap .wpd-item a:hover{color: #222;} .wpd-inline-shortcode.wpd-active{background-color: #666;}
1343
  <?php } else { ?>
1344
- #comments, #respond, .comments-area, #wpdcom{<?php echo $defaultCommentAreaBG ?>}
1345
- #wpdcom .ql-editor > *{<?php echo $defaultCommentFieldsTextColor ?>}
1346
- #wpdcom .ql-editor::before{<?php echo $defaultCommentFieldsPlaceholderColor ?>}
1347
- #wpdcom .ql-toolbar{<?php echo $defaultCommentFieldsBorderColor ?>border-top:none;}
1348
- #wpdcom .ql-container{<?php echo $defaultCommentFieldsBG . $defaultCommentFieldsBorderColor ?>border-bottom:none;}
1349
- #wpdcom .wpd-form-row .wpdiscuz-item input[type="text"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="email"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="url"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="color"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="date"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="datetime"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="datetime-local"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="month"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="number"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="time"], #wpdcom textarea, #wpdcom select{<?php echo $defaultCommentFieldsBG . $defaultCommentFieldsBorderColor . $defaultCommentTextColor ?>}
1350
- #wpdcom .wpd-form-row .wpdiscuz-item textarea{<?php echo $defaultCommentFieldsBorderColor ?>}
1351
- #wpdcom input::placeholder, #wpdcom textarea::placeholder, #wpdcom input::-moz-placeholder, #wpdcom textarea::-webkit-input-placeholder{<?php echo $defaultCommentFieldsPlaceholderColor ?>}
1352
- #wpdcom .wpd-comment-text{<?php echo $defaultCommentTextColor ?>}
1353
  <?php } ?>
1354
- #wpdcom .wpd-thread-head .wpd-thread-info{ border-bottom:2px solid <?php echo $this->options->thread_styles["primaryColor"]; ?>;}
1355
- #wpdcom .wpd-thread-head .wpd-thread-info.wpd-reviews-tab svg{fill: <?php echo $this->options->thread_styles["primaryColor"]; ?>;}
1356
- #wpdcom .wpd-thread-head .wpdiscuz-user-settings{border-bottom: 2px solid <?php echo $this->options->thread_styles["primaryColor"]; ?>;}
1357
- #wpdcom .wpd-thread-head .wpdiscuz-user-settings:hover{color: <?php echo $this->options->thread_styles["primaryColor"]; ?>;}
1358
- #wpdcom .wpd-comment .wpd-follow-link:hover{color: <?php echo $this->options->thread_styles["primaryColor"]; ?>;}
1359
- #wpdcom .wpd-comment-status .wpd-sticky{color: <?php echo $this->options->thread_styles["primaryColor"]; ?>;}
1360
- #wpdcom .wpd-thread-filter .wpdf-active{color: <?php echo $this->options->thread_styles["primaryColor"]; ?>; border-bottom-color:<?php echo $this->options->thread_styles["primaryColor"]; ?>;}
1361
- #wpdcom .wpd-comment-info-bar {border: 1px dashed <?php echo $this->colorBrightness($this->options->thread_styles["primaryColor"], '0.2'); ?>; background: <?php echo $this->colorBrightness($this->options->thread_styles["primaryColor"], '0.9'); ?>; }
1362
- #wpdcom .wpd-comment-info-bar .wpd-current-view i{color: <?php echo $this->options->thread_styles["primaryColor"]; ?>;}
1363
- #wpdcom .wpd-filter-view-all:hover{background: <?php echo $this->options->thread_styles["primaryColor"]; ?>;}
1364
- #wpdcom .wpdiscuz-item .wpdiscuz-rating > label {color: <?php echo $this->options->rating["ratingInactiveColor"]; ?>;}
1365
  #wpdcom .wpdiscuz-item .wpdiscuz-rating:not(:checked) > label:hover,
1366
  .wpdiscuz-rating:not(:checked) > label:hover ~ label {}
1367
  #wpdcom .wpdiscuz-item .wpdiscuz-rating > input ~ label:hover,
1368
  #wpdcom .wpdiscuz-item .wpdiscuz-rating > input:not(:checked) ~ label:hover ~ label,
1369
- #wpdcom .wpdiscuz-item .wpdiscuz-rating > input:not(:checked) ~ label:hover ~ label{color: <?php echo $this->options->rating["ratingHoverColor"]; ?>;}
1370
  #wpdcom .wpdiscuz-item .wpdiscuz-rating > input:checked ~ label:hover,
1371
  #wpdcom .wpdiscuz-item .wpdiscuz-rating > input:checked ~ label:hover,
1372
  #wpdcom .wpdiscuz-item .wpdiscuz-rating > label:hover ~ input:checked ~ label,
1373
  #wpdcom .wpdiscuz-item .wpdiscuz-rating > input:checked + label:hover ~ label,
1374
  #wpdcom .wpdiscuz-item .wpdiscuz-rating > input:checked ~ label:hover ~ label, .wpd-custom-field .wcf-active-star,
1375
- #wpdcom .wpdiscuz-item .wpdiscuz-rating > input:checked ~ label{ color:<?php echo $this->options->rating["ratingActiveColor"]; ?>;}
1376
- #wpd-post-rating .wpd-rating-wrap .wpd-rating-stars svg .wpd-star{fill: <?php echo $this->options->rating["ratingInactiveColor"]; ?>;}
1377
- #wpd-post-rating .wpd-rating-wrap .wpd-rating-stars svg .wpd-active{fill:<?php echo $this->options->rating["ratingActiveColor"]; ?>;}
1378
- #wpd-post-rating .wpd-rating-wrap .wpd-rate-starts svg .wpd-star{fill:<?php echo $this->options->rating["ratingInactiveColor"]; ?>;}
1379
- #wpd-post-rating .wpd-rating-wrap .wpd-rate-starts:hover svg .wpd-star{fill:<?php echo $this->options->rating["ratingHoverColor"]; ?>;}
1380
- #wpd-post-rating.wpd-not-rated .wpd-rating-wrap .wpd-rate-starts svg:hover ~ svg .wpd-star{ fill:<?php echo $this->options->rating["ratingInactiveColor"]; ?>;}
1381
- .wpdiscuz-post-rating-wrap .wpd-rating .wpd-rating-wrap .wpd-rating-stars svg .wpd-star{fill:<?php echo $this->options->rating["ratingInactiveColor"]; ?>;}
1382
- .wpdiscuz-post-rating-wrap .wpd-rating .wpd-rating-wrap .wpd-rating-stars svg .wpd-active{fill:<?php echo $this->options->rating["ratingActiveColor"]; ?>;}
1383
  #wpdcom .wpd-comment .wpd-follow-active{color:#ff7a00;}
1384
  #wpdcom .page-numbers{color:#555;border:#555 1px solid;}
1385
  #wpdcom span.current{background:#555;}
1386
- #wpdcom.wpd-layout-1 .wpd-new-loaded-comment > .wpd-comment-wrap > .wpd-comment-right{background:<?php echo $this->options->thread_styles["newLoadedCommentBGColor"]; ?>;}
1387
- #wpdcom.wpd-layout-2 .wpd-new-loaded-comment.wpd-comment > .wpd-comment-wrap > .wpd-comment-right{background:<?php echo $this->options->thread_styles["newLoadedCommentBGColor"]; ?>;}
1388
  #wpdcom.wpd-layout-2 .wpd-new-loaded-comment.wpd-comment.wpd-reply > .wpd-comment-wrap > .wpd-comment-right{background:transparent;}
1389
- #wpdcom.wpd-layout-2 .wpd-new-loaded-comment.wpd-comment.wpd-reply > .wpd-comment-wrap {background:<?php echo $this->options->thread_styles["newLoadedCommentBGColor"]; ?>;}
1390
- #wpdcom.wpd-layout-3 .wpd-new-loaded-comment.wpd-comment > .wpd-comment-wrap > .wpd-comment-right{background:<?php echo $this->options->thread_styles["newLoadedCommentBGColor"]; ?>;}
1391
- #wpdcom .wpd-follow:hover i, #wpdcom .wpd-unfollow:hover i, #wpdcom .wpd-comment .wpd-follow-active:hover i{color:<?php echo $this->options->thread_styles["primaryColor"]; ?>;}
1392
- #wpdcom .wpdiscuz-readmore{cursor:pointer;color:<?php echo $this->options->thread_styles["primaryColor"]; ?>;}
1393
- .wpd-custom-field .wcf-pasiv-star, #wpcomm .wpdiscuz-item .wpdiscuz-rating > label {color: <?php echo $this->options->rating["ratingInactiveColor"]; ?>;}
1394
- .wpd-wrapper .wpd-list-item.wpd-active{border-top: 3px solid <?php echo $this->options->thread_styles["primaryColor"]; ?>;}
1395
- #wpdcom.wpd-layout-2 .wpd-comment.wpd-reply.wpd-unapproved-comment .wpd-comment-wrap{border-<?php echo $left ?>: 3px solid <?php echo $this->options->thread_styles["newLoadedCommentBGColor"]; ?>;}
1396
- #wpdcom.wpd-layout-3 .wpd-comment.wpd-reply.wpd-unapproved-comment .wpd-comment-right{border-<?php echo $left ?>: 1px solid <?php echo $this->options->thread_styles["newLoadedCommentBGColor"]; ?>;}
1397
- #wpdcom .wpd-prim-button{background-color: <?php echo $this->options->thread_styles["primaryButtonBG"]; ?>; color: <?php echo $this->options->thread_styles["primaryButtonColor"]; ?>;}
1398
- #wpdcom .wpd_label__check i.wpdicon-on{color: <?php echo $this->options->thread_styles["primaryButtonBG"]; ?>; border: 1px solid <?php echo $this->colorBrightness($this->options->thread_styles["primaryButtonBG"], 0.5); ?>;}
1399
- #wpd-bubble-wrapper #wpd-bubble-all-comments-count{color:<?php echo $this->options->thread_styles["bubbleColors"]; ?>;}
1400
- #wpd-bubble-wrapper > div{background-color:<?php echo $this->options->thread_styles["bubbleColors"]; ?>;}
1401
- #wpd-bubble-wrapper > #wpd-bubble #wpd-bubble-add-message{background-color:<?php echo $this->options->thread_styles["bubbleColors"]; ?>;}
1402
- #wpd-bubble-wrapper > #wpd-bubble #wpd-bubble-add-message::before{border-left-color:<?php echo $this->options->thread_styles["bubbleColors"]; ?>; border-right-color:<?php echo $this->options->thread_styles["bubbleColors"]; ?>;}
1403
- #wpd-bubble-wrapper.wpd-right-corner > #wpd-bubble #wpd-bubble-add-message::before{border-left-color:<?php echo $this->options->thread_styles["bubbleColors"]; ?>; border-right-color:<?php echo $this->options->thread_styles["bubbleColors"]; ?>;}
1404
- .wpd-inline-icon-wrapper path.wpd-inline-icon-first{fill:<?php echo $this->options->thread_styles["inlineFeedbackColors"]; ?>;}
1405
- .wpd-inline-icon-count{background-color:<?php echo $this->options->thread_styles["inlineFeedbackColors"]; ?>;}
1406
- .wpd-inline-icon-count::before{border-<?php echo $right ?>-color:<?php echo $this->options->thread_styles["inlineFeedbackColors"]; ?>;}
1407
- .wpd-inline-form-wrapper::before{border-bottom-color:<?php echo $this->options->thread_styles["inlineFeedbackColors"]; ?>;}
1408
- .wpd-inline-form-question{background-color:<?php echo $this->options->thread_styles["inlineFeedbackColors"]; ?>;}
1409
- .wpd-inline-form{background-color:<?php echo $this->options->thread_styles["inlineFeedbackColors"]; ?>;}
1410
- .wpd-last-inline-comments-wrapper{border-color:<?php echo $this->options->thread_styles["inlineFeedbackColors"]; ?>;}
1411
- .wpd-last-inline-comments-wrapper::before{border-bottom-color:<?php echo $this->options->thread_styles["inlineFeedbackColors"]; ?>;}
1412
- .wpd-last-inline-comments-wrapper .wpd-view-all-inline-comments{background:<?php echo $this->options->thread_styles["inlineFeedbackColors"]; ?>;}
1413
- .wpd-last-inline-comments-wrapper .wpd-view-all-inline-comments:hover,.wpd-last-inline-comments-wrapper .wpd-view-all-inline-comments:active,.wpd-last-inline-comments-wrapper .wpd-view-all-inline-comments:focus{background-color:<?php echo $this->options->thread_styles["inlineFeedbackColors"]; ?>;}
1414
  <?php
1415
  }
1416
  ?>
1417
- #wpdcom .ql-snow .ql-tooltip[data-mode="link"]::before{content:"<?php _e("Enter link:", "wpdiscuz"); ?>";}
1418
- #wpdcom .ql-snow .ql-tooltip.ql-editing a.ql-action::after{content:"<?php _e("Save", "wpdiscuz"); ?>";}
1419
  <?php
1420
  do_action("wpdiscuz_dynamic_css", $this->options);
1421
  if ($this->options->thread_styles["theme"] !== "wpd-minimal") {
1422
- echo stripslashes($this->options->thread_styles["customCss"]);
1423
  }
1424
  $css = ob_get_clean();
1425
  /* xMinfy Star ********************************************************* */
60
  }
61
  add_filter("wpdiscuz_comment_author", [$this, "umAuthorName"], 10, 2);
62
  add_action("add_meta_boxes", [&$this, "addRatingResetButton"], 10, 2);
63
+
64
+ add_action("wp_ajax_wpdGetNonce", [&$this, "getNonce"]);
65
+ add_action("wp_ajax_nopriv_wpdGetNonce", [&$this, "getNonce"]);
66
  }
67
 
68
  public function filterKses() {
152
  wp_die(__("Nonce is invalid.", "wpdiscuz"));
153
  }
154
  }
155
+
156
+ public function getNonce(){
157
+ $key = filter_input(INPUT_POST, "key", FILTER_SANITIZE_STRING);
158
+ if($key && $key === md5($this->generateNonceKey())){
159
+ wp_send_json_success($this->generateNonce());
160
+ }else{
161
+ wp_send_json_error(__("Nonce key is invalid.","wpdiscuz"));
162
+ }
163
+ }
164
 
165
  //==========================================================================
166
 
411
  if (isset($commentListArgs["comment_author_email"])) {
412
  $storedCookieEmail = $commentListArgs["comment_author_email"];
413
  } else {
414
+ $storedCookieEmail = isset($_COOKIE["comment_author_email_" . COOKIEHASH]) ? sanitize_email($_COOKIE["comment_author_email_" . COOKIEHASH]) : "";
415
  }
416
  return !(!$this->options->moderation["enableEditingWhenHaveReplies"] && $comment->get_children(["post_id" => $comment->comment_post_ID])) && (($storedCookieEmail === $comment->comment_author_email && $_SERVER["REMOTE_ADDR"] === $comment->comment_author_IP) || ($currentUser && $currentUser->ID && $currentUser->ID == $comment->user_id));
417
  }
506
  $currentUserEmail = $currentUser->user_email;
507
  } else {
508
  $currentUserId = 0;
509
+ $currentUserEmail = isset($_COOKIE["comment_author_email_" . COOKIEHASH]) ? sanitize_email($_COOKIE["comment_author_email_" . COOKIEHASH]) : "";
510
  }
511
 
512
  if (is_user_logged_in()) {
1308
  $darkCommentFieldsPlaceholderColor = $this->options->thread_styles["darkCommentFieldsPlaceholderColor"] ? "opacity:1;color:" . $this->options->thread_styles["darkCommentFieldsPlaceholderColor"] . ";" : "";
1309
  $defaultCommentAreaBG = $this->options->thread_styles["defaultCommentAreaBG"] ? "background:" . $this->options->thread_styles["defaultCommentAreaBG"] . ";" : "";
1310
  $defaultCommentTextColor = $this->options->thread_styles["defaultCommentTextColor"] ? "color:" . $this->options->thread_styles["defaultCommentTextColor"] . ";" : "";
1311
+ $defaultCommentFieldsBG = $this->options->thread_styles["defaultCommentFieldsBG"] ? "background:" . $this->options->thread_styles["defaultCommentFieldsBG"] . ";" : "";
1312
  $defaultCommentFieldsBorderColor = $this->options->thread_styles["defaultCommentFieldsBorderColor"] ? "border: 1px solid " . $this->options->thread_styles["defaultCommentFieldsBorderColor"] . ";" : "";
1313
  $defaultCommentFieldsTextColor = $this->options->thread_styles["defaultCommentFieldsTextColor"] ? "color:" . $this->options->thread_styles["defaultCommentFieldsTextColor"] . ";" : "";
1314
  $defaultCommentFieldsPlaceholderColor = $this->options->thread_styles["defaultCommentFieldsPlaceholderColor"] ? "opacity:1;color:" . $this->options->thread_styles["defaultCommentFieldsPlaceholderColor"] . ";" : "";
1319
  }
1320
  foreach ($blogRoles as $role => $color) {
1321
  echo "\r\n";
1322
+ echo "#wpdcom .wpd-blog-" . esc_html($role) . " .wpd-comment-label{color: #ffffff; background-color: " . esc_html($color) . "; border: none;}\r\n";
1323
+ echo "#wpdcom .wpd-blog-" . esc_html($role) . " .wpd-comment-author, #wpdcom .wpd-blog-" . esc_html($role) . " .wpd-comment-author a{color: " . esc_html($color) . ";}\r\n";
1324
  if ($role === "post_author") {
1325
+ echo "#wpdcom .wpd-blog-post_author .wpd-avatar img{border-color: " . esc_html($color) . ";}";
1326
  }
1327
  if ($role !== "subscriber" && $role !== "guest") {
1328
+ echo "#wpdcom.wpd-layout-1 .wpd-comment .wpd-blog-" . esc_html($role) . " .wpd-avatar img{border-color: " . esc_html($color) . ";}\r\n";
1329
  }
1330
  if ($role === "administrator" || $role === "editor" || $role === "post_author") {
1331
+ echo "#wpdcom.wpd-layout-2 .wpd-comment.wpd-reply .wpd-comment-wrap.wpd-blog-" . esc_html($role) . "{border-" . esc_html($left) . ": 3px solid " . esc_html($color) . ";}\r\n";
1332
  }
1333
  if ($role !== "guest") {
1334
+ echo "#wpdcom.wpd-layout-2 .wpd-comment .wpd-blog-" . esc_html($role) . " .wpd-avatar img{border-bottom-color: " . esc_html($color) . ";}\r\n";
1335
  }
1336
+ echo "#wpdcom.wpd-layout-3 .wpd-blog-" . esc_html($role) . " .wpd-comment-subheader{border-top: 1px dashed " . esc_html($color) . ";}\r\n";
1337
  if ($role !== "subscriber" && $role !== "guest") {
1338
+ echo "#wpdcom.wpd-layout-3 .wpd-reply .wpd-blog-" . esc_html($role) . " .wpd-comment-right{border-" . esc_html($left) . ": 1px solid " . esc_html($color) . ";}\r\n";
1339
  }
1340
  }
1341
  ?>
1342
+ <?php echo ( $this->options->thread_styles["commentTextSize"] !== "14px") ? "#wpdcom .wpd-comment-text p{font-size:" . esc_html($this->options->thread_styles["commentTextSize"]) . ";}\r\n" : ""; ?>
1343
  <?php if ($dark) { ?>
1344
+ #comments, #respond, .comments-area, #wpdcom.wpd-dark{<?php echo esc_html($darkCommentAreaBG . $darkCommentTextColor) ?>}
1345
+ #wpdcom .ql-editor > *{<?php echo esc_html($darkCommentFieldsTextColor) ?>}
1346
+ #wpdcom .ql-editor::before{<?php echo esc_html($darkCommentFieldsPlaceholderColor) ?>}
1347
+ #wpdcom .ql-toolbar{<?php echo esc_html($darkCommentFieldsBorderColor) ?>border-top:none;}
1348
+ #wpdcom .ql-container{<?php echo esc_html($darkCommentFieldsBG . $darkCommentFieldsBorderColor) ?>border-bottom:none;}
1349
+ #wpdcom .wpd-form-row .wpdiscuz-item input[type="text"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="email"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="url"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="color"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="date"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="datetime"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="datetime-local"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="month"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="number"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="time"], #wpdcom textarea, #wpdcom select{<?php echo esc_html($darkCommentFieldsBG . $darkCommentFieldsBorderColor . $darkCommentFieldsTextColor) ?>}
1350
+ #wpdcom.wpd-dark .wpdiscuz-item.wpd-field-select select.wpdiscuz_select, #wpdcom.wpd-dark select{<?php echo str_replace(';', '!important;', esc_html($darkCommentFieldsBG . $darkCommentFieldsBorderColor . $darkCommentFieldsTextColor)) ?>}
1351
+ #wpdcom .wpd-form-row .wpdiscuz-item textarea{<?php echo esc_html($darkCommentFieldsBorderColor) ?>}
1352
+ #wpdcom input::placeholder, #wpdcom textarea::placeholder, #wpdcom input::-moz-placeholder, #wpdcom textarea::-webkit-input-placeholder{<?php echo esc_html($darkCommentFieldsPlaceholderColor) ?>}
1353
+ #wpdcom .wpd-comment-text{<?php echo esc_html($darkCommentTextColor) ?>}
1354
  .lity-wrap .wpd-item a{color: #666;} .lity-wrap .wpd-item a:hover{color: #222;} .wpd-inline-shortcode.wpd-active{background-color: #666;}
1355
  <?php } else { ?>
1356
+ #comments, #respond, .comments-area, #wpdcom{<?php echo esc_html($defaultCommentAreaBG) ?>}
1357
+ #wpdcom .ql-editor > *{<?php echo esc_html($defaultCommentFieldsTextColor) ?>}
1358
+ #wpdcom .ql-editor::before{<?php echo esc_html($defaultCommentFieldsPlaceholderColor) ?>}
1359
+ #wpdcom .ql-toolbar{<?php echo esc_html($defaultCommentFieldsBorderColor) ?>border-top:none;}
1360
+ #wpdcom .ql-container{<?php echo esc_html($defaultCommentFieldsBG . $defaultCommentFieldsBorderColor) ?>border-bottom:none;}
1361
+ #wpdcom .wpd-form-row .wpdiscuz-item input[type="text"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="email"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="url"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="color"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="date"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="datetime"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="datetime-local"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="month"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="number"], #wpdcom .wpd-form-row .wpdiscuz-item input[type="time"], #wpdcom textarea, #wpdcom select{<?php echo esc_html($defaultCommentFieldsBG . $defaultCommentFieldsBorderColor . $defaultCommentTextColor) ?>}
1362
+ #wpdcom .wpd-form-row .wpdiscuz-item textarea{<?php echo esc_html($defaultCommentFieldsBorderColor) ?>}
1363
+ #wpdcom input::placeholder, #wpdcom textarea::placeholder, #wpdcom input::-moz-placeholder, #wpdcom textarea::-webkit-input-placeholder{<?php echo esc_html($defaultCommentFieldsPlaceholderColor) ?>}
1364
+ #wpdcom .wpd-comment-text{<?php echo esc_html($defaultCommentTextColor) ?>}
1365
  <?php } ?>
1366
+ #wpdcom .wpd-thread-head .wpd-thread-info{ border-bottom:2px solid <?php echo esc_html($this->options->thread_styles["primaryColor"]); ?>;}
1367
+ #wpdcom .wpd-thread-head .wpd-thread-info.wpd-reviews-tab svg{fill: <?php echo esc_html($this->options->thread_styles["primaryColor"]); ?>;}
1368
+ #wpdcom .wpd-thread-head .wpdiscuz-user-settings{border-bottom: 2px solid <?php echo esc_html($this->options->thread_styles["primaryColor"]); ?>;}
1369
+ #wpdcom .wpd-thread-head .wpdiscuz-user-settings:hover{color: <?php echo esc_html($this->options->thread_styles["primaryColor"]); ?>;}
1370
+ #wpdcom .wpd-comment .wpd-follow-link:hover{color: <?php echo esc_html($this->options->thread_styles["primaryColor"]); ?>;}
1371
+ #wpdcom .wpd-comment-status .wpd-sticky{color: <?php echo esc_html($this->options->thread_styles["primaryColor"]); ?>;}
1372
+ #wpdcom .wpd-thread-filter .wpdf-active{color: <?php echo esc_html($this->options->thread_styles["primaryColor"]); ?>; border-bottom-color:<?php echo esc_html($this->options->thread_styles["primaryColor"]); ?>;}
1373
+ #wpdcom .wpd-comment-info-bar {border: 1px dashed <?php echo esc_html($this->colorBrightness($this->options->thread_styles["primaryColor"], '0.2')); ?>; background: <?php echo esc_html($this->colorBrightness($this->options->thread_styles["primaryColor"], '0.9')); ?>; }
1374
+ #wpdcom .wpd-comment-info-bar .wpd-current-view i{color: <?php echo esc_html($this->options->thread_styles["primaryColor"]); ?>;}
1375
+ #wpdcom .wpd-filter-view-all:hover{background: <?php echo esc_html($this->options->thread_styles["primaryColor"]); ?>;}
1376
+ #wpdcom .wpdiscuz-item .wpdiscuz-rating > label {color: <?php echo esc_html($this->options->rating["ratingInactiveColor"]); ?>;}
1377
  #wpdcom .wpdiscuz-item .wpdiscuz-rating:not(:checked) > label:hover,
1378
  .wpdiscuz-rating:not(:checked) > label:hover ~ label {}
1379
  #wpdcom .wpdiscuz-item .wpdiscuz-rating > input ~ label:hover,
1380
  #wpdcom .wpdiscuz-item .wpdiscuz-rating > input:not(:checked) ~ label:hover ~ label,
1381
+ #wpdcom .wpdiscuz-item .wpdiscuz-rating > input:not(:checked) ~ label:hover ~ label{color: <?php echo esc_html($this->options->rating["ratingHoverColor"]); ?>;}
1382
  #wpdcom .wpdiscuz-item .wpdiscuz-rating > input:checked ~ label:hover,
1383
  #wpdcom .wpdiscuz-item .wpdiscuz-rating > input:checked ~ label:hover,
1384
  #wpdcom .wpdiscuz-item .wpdiscuz-rating > label:hover ~ input:checked ~ label,
1385
  #wpdcom .wpdiscuz-item .wpdiscuz-rating > input:checked + label:hover ~ label,
1386
  #wpdcom .wpdiscuz-item .wpdiscuz-rating > input:checked ~ label:hover ~ label, .wpd-custom-field .wcf-active-star,
1387
+ #wpdcom .wpdiscuz-item .wpdiscuz-rating > input:checked ~ label{ color:<?php echo esc_html($this->options->rating["ratingActiveColor"]); ?>;}
1388
+ #wpd-post-rating .wpd-rating-wrap .wpd-rating-stars svg .wpd-star{fill: <?php echo esc_html($this->options->rating["ratingInactiveColor"]); ?>;}
1389
+ #wpd-post-rating .wpd-rating-wrap .wpd-rating-stars svg .wpd-active{fill:<?php echo esc_html($this->options->rating["ratingActiveColor"]); ?>;}
1390
+ #wpd-post-rating .wpd-rating-wrap .wpd-rate-starts svg .wpd-star{fill:<?php echo esc_html($this->options->rating["ratingInactiveColor"]); ?>;}
1391
+ #wpd-post-rating .wpd-rating-wrap .wpd-rate-starts:hover svg .wpd-star{fill:<?php echo esc_html($this->options->rating["ratingHoverColor"]); ?>;}
1392
+ #wpd-post-rating.wpd-not-rated .wpd-rating-wrap .wpd-rate-starts svg:hover ~ svg .wpd-star{ fill:<?php echo esc_html($this->options->rating["ratingInactiveColor"]); ?>;}
1393
+ .wpdiscuz-post-rating-wrap .wpd-rating .wpd-rating-wrap .wpd-rating-stars svg .wpd-star{fill:<?php echo esc_html($this->options->rating["ratingInactiveColor"]); ?>;}
1394
+ .wpdiscuz-post-rating-wrap .wpd-rating .wpd-rating-wrap .wpd-rating-stars svg .wpd-active{fill:<?php echo esc_html($this->options->rating["ratingActiveColor"]); ?>;}
1395
  #wpdcom .wpd-comment .wpd-follow-active{color:#ff7a00;}
1396
  #wpdcom .page-numbers{color:#555;border:#555 1px solid;}
1397
  #wpdcom span.current{background:#555;}
1398
+ #wpdcom.wpd-layout-1 .wpd-new-loaded-comment > .wpd-comment-wrap > .wpd-comment-right{background:<?php echo esc_html($this->options->thread_styles["newLoadedCommentBGColor"]); ?>;}
1399
+ #wpdcom.wpd-layout-2 .wpd-new-loaded-comment.wpd-comment > .wpd-comment-wrap > .wpd-comment-right{background:<?php echo esc_html($this->options->thread_styles["newLoadedCommentBGColor"]); ?>;}
1400
  #wpdcom.wpd-layout-2 .wpd-new-loaded-comment.wpd-comment.wpd-reply > .wpd-comment-wrap > .wpd-comment-right{background:transparent;}
1401
+ #wpdcom.wpd-layout-2 .wpd-new-loaded-comment.wpd-comment.wpd-reply > .wpd-comment-wrap {background:<?php echo esc_html($this->options->thread_styles["newLoadedCommentBGColor"]); ?>;}
1402
+ #wpdcom.wpd-layout-3 .wpd-new-loaded-comment.wpd-comment > .wpd-comment-wrap > .wpd-comment-right{background:<?php echo esc_html($this->options->thread_styles["newLoadedCommentBGColor"]); ?>;}
1403
+ #wpdcom .wpd-follow:hover i, #wpdcom .wpd-unfollow:hover i, #wpdcom .wpd-comment .wpd-follow-active:hover i{color:<?php echo esc_html($this->options->thread_styles["primaryColor"]); ?>;}
1404
+ #wpdcom .wpdiscuz-readmore{cursor:pointer;color:<?php echo esc_html($this->options->thread_styles["primaryColor"]); ?>;}
1405
+ .wpd-custom-field .wcf-pasiv-star, #wpcomm .wpdiscuz-item .wpdiscuz-rating > label {color: <?php echo esc_html($this->options->rating["ratingInactiveColor"]); ?>;}
1406
+ .wpd-wrapper .wpd-list-item.wpd-active{border-top: 3px solid <?php echo esc_html($this->options->thread_styles["primaryColor"]); ?>;}
1407
+ #wpdcom.wpd-layout-2 .wpd-comment.wpd-reply.wpd-unapproved-comment .wpd-comment-wrap{border-<?php echo esc_html($left) ?>: 3px solid <?php echo esc_html($this->options->thread_styles["newLoadedCommentBGColor"]); ?>;}
1408
+ #wpdcom.wpd-layout-3 .wpd-comment.wpd-reply.wpd-unapproved-comment .wpd-comment-right{border-<?php echo esc_html($left) ?>: 1px solid <?php echo esc_html($this->options->thread_styles["newLoadedCommentBGColor"]); ?>;}
1409
+ #wpdcom .wpd-prim-button{background-color: <?php echo esc_html($this->options->thread_styles["primaryButtonBG"]); ?>; color: <?php echo esc_html($this->options->thread_styles["primaryButtonColor"]); ?>;}
1410
+ #wpdcom .wpd_label__check i.wpdicon-on{color: <?php echo esc_html($this->options->thread_styles["primaryButtonBG"]); ?>; border: 1px solid <?php echo esc_html($this->colorBrightness($this->options->thread_styles["primaryButtonBG"], 0.5)); ?>;}
1411
+ #wpd-bubble-wrapper #wpd-bubble-all-comments-count{color:<?php echo esc_html($this->options->thread_styles["bubbleColors"]); ?>;}
1412
+ #wpd-bubble-wrapper > div{background-color:<?php echo esc_html($this->options->thread_styles["bubbleColors"]); ?>;}
1413
+ #wpd-bubble-wrapper > #wpd-bubble #wpd-bubble-add-message{background-color:<?php echo esc_html($this->options->thread_styles["bubbleColors"]); ?>;}
1414
+ #wpd-bubble-wrapper > #wpd-bubble #wpd-bubble-add-message::before{border-left-color:<?php echo esc_html($this->options->thread_styles["bubbleColors"]); ?>; border-right-color:<?php echo esc_html($this->options->thread_styles["bubbleColors"]); ?>;}
1415
+ #wpd-bubble-wrapper.wpd-right-corner > #wpd-bubble #wpd-bubble-add-message::before{border-left-color:<?php echo esc_html($this->options->thread_styles["bubbleColors"]); ?>; border-right-color:<?php echo esc_html($this->options->thread_styles["bubbleColors"]); ?>;}
1416
+ .wpd-inline-icon-wrapper path.wpd-inline-icon-first{fill:<?php echo esc_html($this->options->thread_styles["inlineFeedbackColors"]); ?>;}
1417
+ .wpd-inline-icon-count{background-color:<?php echo esc_html($this->options->thread_styles["inlineFeedbackColors"]); ?>;}
1418
+ .wpd-inline-icon-count::before{border-<?php echo esc_html($right) ?>-color:<?php echo esc_html($this->options->thread_styles["inlineFeedbackColors"]); ?>;}
1419
+ .wpd-inline-form-wrapper::before{border-bottom-color:<?php echo esc_html($this->options->thread_styles["inlineFeedbackColors"]); ?>;}
1420
+ .wpd-inline-form-question{background-color:<?php echo esc_html($this->options->thread_styles["inlineFeedbackColors"]); ?>;}
1421
+ .wpd-inline-form{background-color:<?php echo esc_html($this->options->thread_styles["inlineFeedbackColors"]); ?>;}
1422
+ .wpd-last-inline-comments-wrapper{border-color:<?php echo esc_html($this->options->thread_styles["inlineFeedbackColors"]); ?>;}
1423
+ .wpd-last-inline-comments-wrapper::before{border-bottom-color:<?php echo esc_html($this->options->thread_styles["inlineFeedbackColors"]); ?>;}
1424
+ .wpd-last-inline-comments-wrapper .wpd-view-all-inline-comments{background:<?php echo esc_html($this->options->thread_styles["inlineFeedbackColors"]); ?>;}
1425
+ .wpd-last-inline-comments-wrapper .wpd-view-all-inline-comments:hover,.wpd-last-inline-comments-wrapper .wpd-view-all-inline-comments:active,.wpd-last-inline-comments-wrapper .wpd-view-all-inline-comments:focus{background-color:<?php echo esc_html($this->options->thread_styles["inlineFeedbackColors"]); ?>;}
1426
  <?php
1427
  }
1428
  ?>
1429
+ #wpdcom .ql-snow .ql-tooltip[data-mode="link"]::before{content:"<?php esc_html_e("Enter link:", "wpdiscuz"); ?>";}
1430
+ #wpdcom .ql-snow .ql-tooltip.ql-editing a.ql-action::after{content:"<?php esc_html_e("Save", "wpdiscuz"); ?>";}
1431
  <?php
1432
  do_action("wpdiscuz_dynamic_css", $this->options);
1433
  if ($this->options->thread_styles["theme"] !== "wpd-minimal") {
1434
+ echo esc_html(stripslashes($this->options->thread_styles["customCss"]));
1435
  }
1436
  $css = ob_get_clean();
1437
  /* xMinfy Star ********************************************************* */
utils/class.WpdiscuzHelperAjax.php CHANGED
@@ -22,7 +22,7 @@ class WpdiscuzHelperAjax implements WpDiscuzConstants {
22
  add_action("wp_ajax_wpdDeactivate", [&$this, "deactivate"]);
23
  add_action("wp_ajax_wpdImportSTCR", [&$this, "importSTCR"]);
24
  add_action("wp_ajax_wpdImportLSTC", [&$this, "importLSTC"]);
25
-
26
  add_action("wp_ajax_wpdFollowUser", [&$this, "followUser"]);
27
  add_action("wp_ajax_wpdRegenerateVoteMetas", [&$this, "regenerateVoteMetas"]);
28
  add_action("wp_ajax_wpdRegenerateClosedComments", [&$this, "regenerateClosedComments"]);
@@ -257,7 +257,7 @@ class WpdiscuzHelperAjax implements WpDiscuzConstants {
257
  public function deleteSubscription() {
258
  $this->helper->validateNonce();
259
  $subscriptionId = WpdiscuzHelper::sanitize(INPUT_POST, "id", FILTER_SANITIZE_NUMBER_INT, 0);
260
- $currentUser = WpdiscuzHelper::getCurrentUser();
261
  if ($subscriptionId && !empty($currentUser->ID) && $this->options->login["showSubscriptionsTab"] && ($subscription = $this->dbManager->getSubscriptionById($subscriptionId)) && $currentUser->user_email === $subscription->email) {
262
  $this->dbManager->unsubscribeById($subscriptionId);
263
  $this->helper->getSubscriptionsPage();
@@ -267,8 +267,8 @@ class WpdiscuzHelperAjax implements WpDiscuzConstants {
267
  public function deleteFollow() {
268
  $this->helper->validateNonce();
269
  $followId = WpdiscuzHelper::sanitize(INPUT_POST, "id", FILTER_SANITIZE_NUMBER_INT, 0);
270
- $currentUser = WpdiscuzHelper::getCurrentUser();
271
- if ($followId && !empty($currentUser->ID) && $this->options->login["showFollowsTab"] && ($follow = $this->dbManager->getFollowById($followId)) && $currentUser->ID === intval($follow->follower_id)) {
272
  $this->dbManager->unfollowById($followId);
273
  do_action("wpdiscuz_follow_cancelled", (array) $follow);
274
  $this->helper->getFollowsPage();
@@ -432,6 +432,8 @@ class WpdiscuzHelperAjax implements WpDiscuzConstants {
432
  $response["followClass"] = "wpd-follow-active";
433
  $response["followTip"] = esc_attr($this->options->getPhrase("wc_unfollow_user", ["comment" => $comment]));
434
  do_action("wpdiscuz_follow_added", $args);
 
 
435
  wp_send_json_success($response);
436
  } else {
437
  $this->followConfirmAction($comment->comment_post_ID, $followData["id"], $followData["activation_key"], $args["follower_email"]);
@@ -768,6 +770,7 @@ class WpdiscuzHelperAjax implements WpDiscuzConstants {
768
  $response["curUserReaction"] = $voteType;
769
  }
770
  $response["callbackFunctions"] = [];
 
771
  $response = apply_filters("wpdiscuz_comment_vote", $response);
772
  if ($this->options->thread_display["mostVotedByDefault"]) {
773
  do_action("wpdiscuz_reset_comments_cache", $comment->comment_post_ID);
@@ -782,7 +785,6 @@ class WpdiscuzHelperAjax implements WpDiscuzConstants {
782
  }
783
 
784
  public function getInlineCommentForm() {
785
- $this->helper->validateNonce();
786
  $post_id = WpdiscuzHelper::sanitize(INPUT_POST, "postId", FILTER_SANITIZE_NUMBER_INT, 0);
787
  if ($post_id && apply_filters("wpdiscuz_enable_feedback_shortcode_button", true) && $this->dbManager->postHasFeedbackForms($post_id)) {
788
  $currentUser = WpdiscuzHelper::getCurrentUser();
@@ -897,7 +899,9 @@ class WpdiscuzHelperAjax implements WpDiscuzConstants {
897
  update_post_meta($post_id, self::POSTMETA_POST_RATING_COUNT, $count);
898
  do_action("wpdiscuz_add_rating", $rating, $post_id);
899
  do_action("wpdiscuz_clean_post_cache", $post_id, "user_rated");
900
- wp_send_json_success();
 
 
901
  } else {
902
  wp_send_json_error("wc_cannot_rate_again");
903
  }
@@ -914,8 +918,10 @@ class WpdiscuzHelperAjax implements WpDiscuzConstants {
914
  update_post_meta($post_id, self::POSTMETA_POST_RATING, round($votes / $count, 1));
915
  update_post_meta($post_id, self::POSTMETA_POST_RATING_COUNT, $count);
916
  do_action("wpdiscuz_add_rating", $rating, $post_id);
917
- do_action("wpdiscuz_clean_post_cache", $post_id, "user_rated");
918
- wp_send_json_success();
 
 
919
  } else {
920
  wp_send_json_error("wc_cannot_rate_again");
921
  }
@@ -939,12 +945,10 @@ class WpdiscuzHelperAjax implements WpDiscuzConstants {
939
  }
940
 
941
  public function wpd_stat_brief() {
942
- $this->helper->validateNonce();
943
  wp_send_json_success(["all" => esc_html($this->dbManager->getCommentsCount()), "inline" => esc_html($this->dbManager->getInlineCommentsCount()), "threads" => esc_html($this->dbManager->getThreadsCount()), "replies" => esc_html($this->dbManager->getRepliesCount()), "users" => esc_html($this->dbManager->getUserCommentersCount()), "guests" => esc_html($this->dbManager->getGuestCommentersCount())]);
944
  }
945
 
946
  public function wpd_stat_subs() {
947
- $this->helper->validateNonce();
948
  ob_start();
949
  ?>
950
  <ul class="wpd-box-list">
@@ -960,7 +964,6 @@ class WpdiscuzHelperAjax implements WpDiscuzConstants {
960
  }
961
 
962
  public function wpd_stat_graph() {
963
- $this->helper->validateNonce();
964
  $interval = trim(WpdiscuzHelper::sanitize(INPUT_POST, "interval", FILTER_SANITIZE_STRING, ""));
965
  if ($interval) {
966
  $all = $this->dbManager->getGraphAllComments($interval);
@@ -982,8 +985,8 @@ class WpdiscuzHelperAjax implements WpDiscuzConstants {
982
  "all" => array_values($all),
983
  "inline" => array_values($inline),
984
  "labels" => array_map(function ($v) {
985
- return esc_html(date("d M", $v));
986
- }, array_keys($all)),
987
  ];
988
  wp_send_json_success($data);
989
  }
@@ -991,7 +994,6 @@ class WpdiscuzHelperAjax implements WpDiscuzConstants {
991
  }
992
 
993
  public function wpd_stat_user() {
994
- $this->helper->validateNonce();
995
  $orderby = WpdiscuzHelper::sanitize(INPUT_POST, "orderby", FILTER_SANITIZE_STRING, "");
996
  $order = WpdiscuzHelper::sanitize(INPUT_POST, "order", FILTER_SANITIZE_STRING, "");
997
  $page = WpdiscuzHelper::sanitize(INPUT_POST, "page", FILTER_SANITIZE_STRING, "");
@@ -1058,7 +1060,6 @@ class WpdiscuzHelperAjax implements WpDiscuzConstants {
1058
  }
1059
 
1060
  public function searchOption() {
1061
- $this->helper->validateNonce();
1062
  $search = WpdiscuzHelper::sanitize(INPUT_POST, "s", FILTER_SANITIZE_STRING, "");
1063
  if ($search) {
1064
  $optionsObject = $this->options;
22
  add_action("wp_ajax_wpdDeactivate", [&$this, "deactivate"]);
23
  add_action("wp_ajax_wpdImportSTCR", [&$this, "importSTCR"]);
24
  add_action("wp_ajax_wpdImportLSTC", [&$this, "importLSTC"]);
25
+
26
  add_action("wp_ajax_wpdFollowUser", [&$this, "followUser"]);
27
  add_action("wp_ajax_wpdRegenerateVoteMetas", [&$this, "regenerateVoteMetas"]);
28
  add_action("wp_ajax_wpdRegenerateClosedComments", [&$this, "regenerateClosedComments"]);
257
  public function deleteSubscription() {
258
  $this->helper->validateNonce();
259
  $subscriptionId = WpdiscuzHelper::sanitize(INPUT_POST, "id", FILTER_SANITIZE_NUMBER_INT, 0);
260
+ $currentUser = WpdiscuzHelper::getCurrentUser();
261
  if ($subscriptionId && !empty($currentUser->ID) && $this->options->login["showSubscriptionsTab"] && ($subscription = $this->dbManager->getSubscriptionById($subscriptionId)) && $currentUser->user_email === $subscription->email) {
262
  $this->dbManager->unsubscribeById($subscriptionId);
263
  $this->helper->getSubscriptionsPage();
267
  public function deleteFollow() {
268
  $this->helper->validateNonce();
269
  $followId = WpdiscuzHelper::sanitize(INPUT_POST, "id", FILTER_SANITIZE_NUMBER_INT, 0);
270
+ $currentUser = WpdiscuzHelper::getCurrentUser();
271
+ if ($followId && !empty($currentUser->ID) && $this->options->login["showFollowsTab"] && ($follow = $this->dbManager->getFollowById($followId)) && $currentUser->ID === intval($follow->follower_id)) {
272
  $this->dbManager->unfollowById($followId);
273
  do_action("wpdiscuz_follow_cancelled", (array) $follow);
274
  $this->helper->getFollowsPage();
432
  $response["followClass"] = "wpd-follow-active";
433
  $response["followTip"] = esc_attr($this->options->getPhrase("wc_unfollow_user", ["comment" => $comment]));
434
  do_action("wpdiscuz_follow_added", $args);
435
+ $response["callbackFunctions"] = [];
436
+ $response = apply_filters("wpdiscuz_ajax_callbacks", $response);
437
  wp_send_json_success($response);
438
  } else {
439
  $this->followConfirmAction($comment->comment_post_ID, $followData["id"], $followData["activation_key"], $args["follower_email"]);
770
  $response["curUserReaction"] = $voteType;
771
  }
772
  $response["callbackFunctions"] = [];
773
+ $response = apply_filters("wpdiscuz_ajax_callbacks", $response);
774
  $response = apply_filters("wpdiscuz_comment_vote", $response);
775
  if ($this->options->thread_display["mostVotedByDefault"]) {
776
  do_action("wpdiscuz_reset_comments_cache", $comment->comment_post_ID);
785
  }
786
 
787
  public function getInlineCommentForm() {
 
788
  $post_id = WpdiscuzHelper::sanitize(INPUT_POST, "postId", FILTER_SANITIZE_NUMBER_INT, 0);
789
  if ($post_id && apply_filters("wpdiscuz_enable_feedback_shortcode_button", true) && $this->dbManager->postHasFeedbackForms($post_id)) {
790
  $currentUser = WpdiscuzHelper::getCurrentUser();
899
  update_post_meta($post_id, self::POSTMETA_POST_RATING_COUNT, $count);
900
  do_action("wpdiscuz_add_rating", $rating, $post_id);
901
  do_action("wpdiscuz_clean_post_cache", $post_id, "user_rated");
902
+ $response = ["callbackFunctions" => []];
903
+ $response = apply_filters("wpdiscuz_ajax_callbacks", $response);
904
+ wp_send_json_success($response);
905
  } else {
906
  wp_send_json_error("wc_cannot_rate_again");
907
  }
918
  update_post_meta($post_id, self::POSTMETA_POST_RATING, round($votes / $count, 1));
919
  update_post_meta($post_id, self::POSTMETA_POST_RATING_COUNT, $count);
920
  do_action("wpdiscuz_add_rating", $rating, $post_id);
921
+ do_action("wpdiscuz_clean_post_cache", $post_id, "user_rated");
922
+ $response = ["callbackFunctions" => []];
923
+ $response = apply_filters("wpdiscuz_ajax_callbacks", $response);
924
+ wp_send_json_success($response);
925
  } else {
926
  wp_send_json_error("wc_cannot_rate_again");
927
  }
945
  }
946
 
947
  public function wpd_stat_brief() {
 
948
  wp_send_json_success(["all" => esc_html($this->dbManager->getCommentsCount()), "inline" => esc_html($this->dbManager->getInlineCommentsCount()), "threads" => esc_html($this->dbManager->getThreadsCount()), "replies" => esc_html($this->dbManager->getRepliesCount()), "users" => esc_html($this->dbManager->getUserCommentersCount()), "guests" => esc_html($this->dbManager->getGuestCommentersCount())]);
949
  }
950
 
951
  public function wpd_stat_subs() {
 
952
  ob_start();
953
  ?>
954
  <ul class="wpd-box-list">
964
  }
965
 
966
  public function wpd_stat_graph() {
 
967
  $interval = trim(WpdiscuzHelper::sanitize(INPUT_POST, "interval", FILTER_SANITIZE_STRING, ""));
968
  if ($interval) {
969
  $all = $this->dbManager->getGraphAllComments($interval);
985
  "all" => array_values($all),
986
  "inline" => array_values($inline),
987
  "labels" => array_map(function ($v) {
988
+ return esc_html(date("d M", $v));
989
+ }, array_keys($all)),
990
  ];
991
  wp_send_json_success($data);
992
  }
994
  }
995
 
996
  public function wpd_stat_user() {
 
997
  $orderby = WpdiscuzHelper::sanitize(INPUT_POST, "orderby", FILTER_SANITIZE_STRING, "");
998
  $order = WpdiscuzHelper::sanitize(INPUT_POST, "order", FILTER_SANITIZE_STRING, "");
999
  $page = WpdiscuzHelper::sanitize(INPUT_POST, "page", FILTER_SANITIZE_STRING, "");
1060
  }
1061
 
1062
  public function searchOption() {
 
1063
  $search = WpdiscuzHelper::sanitize(INPUT_POST, "s", FILTER_SANITIZE_STRING, "");
1064
  if ($search) {
1065
  $optionsObject = $this->options;
utils/class.WpdiscuzHelperUpload.php CHANGED
@@ -52,7 +52,7 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
52
  add_filter("wpdiscuz_privacy_personal_data_export", [&$this, "exportPersonalData"], 10, 2);
53
  add_filter("wpdiscuz_do_export_personal_data", "__return_true");
54
 
55
- add_action(self::DELETE_UNATTACHED_FILES_ACTION, [&$this, "deleteUnattachedFiles"]);
56
  }
57
  }
58
 
@@ -236,11 +236,10 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
236
  }
237
 
238
  public function uploadFiles() {
239
- $nonceKey = ($key = get_home_url()) ? md5($key) : "wmu-nonce";
240
- check_ajax_referer($nonceKey, "wmu_nonce");
241
  $response = ["errorCode" => "", "error" => "", "errors" => [], "attachmentsHtml" => "", "previewsData" => ""];
242
  $postId = WpdiscuzHelper::sanitize(INPUT_POST, "postId", FILTER_SANITIZE_NUMBER_INT, 0);
243
- $uniqueId = trim(WpdiscuzHelper::sanitize(INPUT_POST, "uniqueId", FILTER_SANITIZE_STRING, ""));
244
 
245
  if (!$postId) {
246
  $response["errorCode"] = "msgPostIdNotExists";
@@ -272,8 +271,7 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
272
  // all expected data are correct, continue uploading
273
  $attachmentIds = apply_filters("wpdiscuz_mu_attachment_ids", [self::KEY_IMAGES => []]);
274
  $attachmentsData = apply_filters("wpdiscuz_mu_attachments_data", [self::KEY_IMAGES => []]);
275
-
276
- $wmuAttachmentsData = empty($_POST["wmuAttachmentsData"]) ? "" : json_decode(stripslashes($_POST["wmuAttachmentsData"]), JSON_OBJECT_AS_ARRAY);
277
 
278
  if ($wmuAttachmentsData && is_array($wmuAttachmentsData)) {
279
  if ($allowedCount == 1) {
@@ -412,11 +410,10 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
412
  }
413
 
414
  public function removeAttachmentPreview() {
415
- $nonceKey = ($key = get_home_url()) ? md5($key) : "wmu-nonce";
416
- check_ajax_referer($nonceKey, "wmu_nonce");
417
  $response = ["errorCode" => "", "error" => "", "attachmentsHtml" => ""];
418
  $attachmentId = WpdiscuzHelper::sanitize(INPUT_POST, "attachmentId", FILTER_SANITIZE_NUMBER_INT, 0);
419
- $uniqueId = WpdiscuzHelper::sanitize(INPUT_POST, "uniqueId", FILTER_SANITIZE_STRING, "");
420
  $attachment = get_post($attachmentId);
421
 
422
  // add attachment not exists message in wpdoptions > jsargs
@@ -425,9 +422,9 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
425
  wp_send_json_error($response);
426
  }
427
 
428
- if (empty($this->currentUser->ID)) {
429
- $this->setCurrentUser(WpdiscuzHelper::getCurrentUser());
430
- }
431
  $ip = WpdiscuzHelper::getRealIPAddr();
432
  $ownerIp = get_post_meta($attachmentId, self::METAKEY_ATTCHMENT_OWNER_IP, true);
433
  if (!current_user_can("manage_options") && (($attachment->post_author != 0 && $attachment->post_author != $this->currentUser->ID) || ($attachment->post_author == 0 && $ownerIp !== $ip))) {
@@ -440,7 +437,7 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
440
  $attachmentsData = apply_filters("wpdiscuz_mu_attachments_data", [self::KEY_IMAGES => []]);
441
  wp_delete_attachment($attachmentId, true);
442
 
443
- $wmuAttachmentsData = empty($_POST["wmuAttachmentsData"]) ? "" : json_decode(stripslashes($_POST["wmuAttachmentsData"]), JSON_OBJECT_AS_ARRAY);
444
 
445
  if ($wmuAttachmentsData && is_array($wmuAttachmentsData)) {
446
  foreach ($wmuAttachmentsData as $key => $value) {
@@ -468,8 +465,7 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
468
  }
469
 
470
  public function deleteAttachment() {
471
- $nonceKey = ($key = get_home_url()) ? md5($key) : "wmu-nonce";
472
- check_ajax_referer($nonceKey, "wmu_nonce");
473
  $response = ["errorCode" => "", "error" => ""];
474
  $attachmentId = isset($_POST["attachmentId"]) ? intval($_POST["attachmentId"]) : 0;
475
  $attachment = get_post($attachmentId);
@@ -485,7 +481,7 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
485
  }
486
  if (current_user_can("moderate_comments") || ($this->helper->isCommentEditable($comment) && $this->helper->canUserEditComment($comment, $this->currentUser, $args))) {
487
  wp_delete_attachment($attachmentId, true);
488
- do_action("wpdiscuz_reset_comments_extra_cache", $comment->comment_post_ID);
489
  wp_send_json_success($response);
490
  }
491
  } else {
@@ -580,23 +576,23 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
580
 
581
  private function getImageSizes() {
582
  $sizes = [];
583
- $this->options->content["wmuImageSizes"] = array_filter($this->options->content["wmuImageSizes"], function ($v) {
584
- return in_array($v, get_intermediate_image_sizes());
585
- });
586
  foreach ($this->options->content["wmuImageSizes"] as $_size) {
587
- if (in_array($_size, $this->options->getDefaultImageSizes())) {
588
- $sizes[$_size]["width"] = intval(get_option("{$_size}_size_w"));
589
- $sizes[$_size]["height"] = intval(get_option("{$_size}_size_h"));
590
- } else if (isset($additionalSizes[$_size])) {
591
- $sizes[$_size]["width"] = $additionalSizes[$_size]["width"];
592
- $sizes[$_size]["height"] = $additionalSizes[$_size]["height"];
593
- }
594
  }
595
  return $sizes;
596
  }
597
 
598
  public function getImagesSizes() {
599
- $sizes = $this->options->content["wmuImageSizes"];
600
  if ($sizes && is_array($sizes) && !in_array("full", $sizes)) {
601
  $sizes[] = "full";
602
  }
@@ -709,20 +705,20 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
709
  return $hasItems;
710
  }
711
 
712
- public function canEditAttachments($currentUser, $attachment) {
713
- $args = [];
714
- if (isset($this->currentUser->user_email)) {
715
- $args["comment_author_email"] = $this->currentUser->user_email;
716
- }
717
- $commentId = get_post_meta($attachment->ID, self::METAKEY_ATTCHMENT_COMMENT_ID, true);
718
- $comment = get_comment($commentId);
719
- return current_user_can("moderate_comments") || ($this->helper->isCommentEditable($comment) && $this->helper->canUserEditComment($comment, $currentUser, $args));
720
- }
721
 
722
- public function getDeleteHtml($currentUser, $attachment, $type) {
723
- $deleteHtml = "<div class='wmu-attachment-delete wmu-delete-$type' title='" . esc_html__("Delete", "wpdiscuz") . "' data-wmu-attachment='$attachment->ID'>&nbsp;</div>";
724
- return $this->canEditAttachments($currentUser, $attachment) ? $deleteHtml : "<div class='wmu-separator'></div>";
725
- }
726
 
727
  public function commentListArgs($args) {
728
  if (empty($args["current_user"])) {
@@ -791,33 +787,32 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
791
  return $data;
792
  }
793
 
794
-
795
  public function deleteUnattachedFiles() {
796
- if (!apply_filters("wpdiscuz_delete_unattached_files", true)) {
797
- wp_clear_scheduled_hook(self::DELETE_UNATTACHED_FILES_ACTION);
798
- return;
799
- }
800
- $attachments = get_posts([
801
- "post_type" => "attachment",
802
- "posts_per_page" => apply_filters("wpdiscuz_delete_unattached_files_limit", 20),
803
- "date_query" => [
804
- [
805
- "column" => "post_date_gmt",
806
- "before" => "30 minutes ago",
807
- ],
808
- ],
809
- "meta_query" => [
810
- [
811
- "key" => self::METAKEY_ATTCHMENT_COMMENT_ID,
812
- "value" => "0",
813
- "compare" => "=",
814
- ],
815
- ],
816
- "fields" => "ids",
817
- ]);
818
- foreach ($attachments as $key => $attachment) {
819
- wp_delete_attachment($attachment, true);
820
- }
821
- }
822
 
823
  }
52
  add_filter("wpdiscuz_privacy_personal_data_export", [&$this, "exportPersonalData"], 10, 2);
53
  add_filter("wpdiscuz_do_export_personal_data", "__return_true");
54
 
55
+ add_action(self::DELETE_UNATTACHED_FILES_ACTION, [&$this, "deleteUnattachedFiles"]);
56
  }
57
  }
58
 
236
  }
237
 
238
  public function uploadFiles() {
239
+ $this->helper->validateNonce();
 
240
  $response = ["errorCode" => "", "error" => "", "errors" => [], "attachmentsHtml" => "", "previewsData" => ""];
241
  $postId = WpdiscuzHelper::sanitize(INPUT_POST, "postId", FILTER_SANITIZE_NUMBER_INT, 0);
242
+ $uniqueId = trim(WpdiscuzHelper::sanitize(INPUT_POST, "uniqueId", FILTER_SANITIZE_STRING, ""));
243
 
244
  if (!$postId) {
245
  $response["errorCode"] = "msgPostIdNotExists";
271
  // all expected data are correct, continue uploading
272
  $attachmentIds = apply_filters("wpdiscuz_mu_attachment_ids", [self::KEY_IMAGES => []]);
273
  $attachmentsData = apply_filters("wpdiscuz_mu_attachments_data", [self::KEY_IMAGES => []]);
274
+ $wmuAttachmentsData = empty($_POST["wmuAttachmentsData"]) ? "" : json_decode(stripslashes(sanitize_text_field($_POST["wmuAttachmentsData"])), JSON_OBJECT_AS_ARRAY);
 
275
 
276
  if ($wmuAttachmentsData && is_array($wmuAttachmentsData)) {
277
  if ($allowedCount == 1) {
410
  }
411
 
412
  public function removeAttachmentPreview() {
413
+ $this->helper->validateNonce();
 
414
  $response = ["errorCode" => "", "error" => "", "attachmentsHtml" => ""];
415
  $attachmentId = WpdiscuzHelper::sanitize(INPUT_POST, "attachmentId", FILTER_SANITIZE_NUMBER_INT, 0);
416
+ $uniqueId = WpdiscuzHelper::sanitize(INPUT_POST, "uniqueId", FILTER_SANITIZE_STRING, "");
417
  $attachment = get_post($attachmentId);
418
 
419
  // add attachment not exists message in wpdoptions > jsargs
422
  wp_send_json_error($response);
423
  }
424
 
425
+ if (empty($this->currentUser->ID)) {
426
+ $this->setCurrentUser(WpdiscuzHelper::getCurrentUser());
427
+ }
428
  $ip = WpdiscuzHelper::getRealIPAddr();
429
  $ownerIp = get_post_meta($attachmentId, self::METAKEY_ATTCHMENT_OWNER_IP, true);
430
  if (!current_user_can("manage_options") && (($attachment->post_author != 0 && $attachment->post_author != $this->currentUser->ID) || ($attachment->post_author == 0 && $ownerIp !== $ip))) {
437
  $attachmentsData = apply_filters("wpdiscuz_mu_attachments_data", [self::KEY_IMAGES => []]);
438
  wp_delete_attachment($attachmentId, true);
439
 
440
+ $wmuAttachmentsData = empty($_POST["wmuAttachmentsData"]) ? "" : json_decode(stripslashes(sanitize_text_field($_POST["wmuAttachmentsData"])), JSON_OBJECT_AS_ARRAY);
441
 
442
  if ($wmuAttachmentsData && is_array($wmuAttachmentsData)) {
443
  foreach ($wmuAttachmentsData as $key => $value) {
465
  }
466
 
467
  public function deleteAttachment() {
468
+ $this->helper->validateNonce();
 
469
  $response = ["errorCode" => "", "error" => ""];
470
  $attachmentId = isset($_POST["attachmentId"]) ? intval($_POST["attachmentId"]) : 0;
471
  $attachment = get_post($attachmentId);
481
  }
482
  if (current_user_can("moderate_comments") || ($this->helper->isCommentEditable($comment) && $this->helper->canUserEditComment($comment, $this->currentUser, $args))) {
483
  wp_delete_attachment($attachmentId, true);
484
+ do_action("wpdiscuz_reset_comments_extra_cache", $comment->comment_post_ID);
485
  wp_send_json_success($response);
486
  }
487
  } else {
576
 
577
  private function getImageSizes() {
578
  $sizes = [];
579
+ $this->options->content["wmuImageSizes"] = array_filter($this->options->content["wmuImageSizes"], function ($v) {
580
+ return in_array($v, get_intermediate_image_sizes());
581
+ });
582
  foreach ($this->options->content["wmuImageSizes"] as $_size) {
583
+ if (in_array($_size, $this->options->getDefaultImageSizes())) {
584
+ $sizes[$_size]["width"] = intval(get_option("{$_size}_size_w"));
585
+ $sizes[$_size]["height"] = intval(get_option("{$_size}_size_h"));
586
+ } else if (isset($additionalSizes[$_size])) {
587
+ $sizes[$_size]["width"] = $additionalSizes[$_size]["width"];
588
+ $sizes[$_size]["height"] = $additionalSizes[$_size]["height"];
589
+ }
590
  }
591
  return $sizes;
592
  }
593
 
594
  public function getImagesSizes() {
595
+ $sizes = $this->options->content["wmuImageSizes"];
596
  if ($sizes && is_array($sizes) && !in_array("full", $sizes)) {
597
  $sizes[] = "full";
598
  }
705
  return $hasItems;
706
  }
707
 
708
+ public function canEditAttachments($currentUser, $attachment) {
709
+ $args = [];
710
+ if (isset($this->currentUser->user_email)) {
711
+ $args["comment_author_email"] = $this->currentUser->user_email;
712
+ }
713
+ $commentId = get_post_meta($attachment->ID, self::METAKEY_ATTCHMENT_COMMENT_ID, true);
714
+ $comment = get_comment($commentId);
715
+ return current_user_can("moderate_comments") || ($this->helper->isCommentEditable($comment) && $this->helper->canUserEditComment($comment, $currentUser, $args));
716
+ }
717
 
718
+ public function getDeleteHtml($currentUser, $attachment, $type) {
719
+ $deleteHtml = "<div class='wmu-attachment-delete wmu-delete-$type' title='" . esc_html__("Delete", "wpdiscuz") . "' data-wmu-attachment='$attachment->ID'>&nbsp;</div>";
720
+ return $this->canEditAttachments($currentUser, $attachment) ? $deleteHtml : "<div class='wmu-separator'></div>";
721
+ }
722
 
723
  public function commentListArgs($args) {
724
  if (empty($args["current_user"])) {
787
  return $data;
788
  }
789
 
 
790
  public function deleteUnattachedFiles() {
791
+ if (!apply_filters("wpdiscuz_delete_unattached_files", true)) {
792
+ wp_clear_scheduled_hook(self::DELETE_UNATTACHED_FILES_ACTION);
793
+ return;
794
+ }
795
+ $attachments = get_posts([
796
+ "post_type" => "attachment",
797
+ "posts_per_page" => apply_filters("wpdiscuz_delete_unattached_files_limit", 20),
798
+ "date_query" => [
799
+ [
800
+ "column" => "post_date_gmt",
801
+ "before" => "30 minutes ago",
802
+ ],
803
+ ],
804
+ "meta_query" => [
805
+ [
806
+ "key" => self::METAKEY_ATTCHMENT_COMMENT_ID,
807
+ "value" => "0",
808
+ "compare" => "=",
809
+ ],
810
+ ],
811
+ "fields" => "ids",
812
+ ]);
813
+ foreach ($attachments as $key => $attachment) {
814
+ wp_delete_attachment($attachment, true);
815
+ }
816
+ }
817
 
818
  }