Comments – wpDiscuz - Version 7.1.3

Version Description

Download this release

Release Info

Developer taron96
Plugin Icon 128x128 Comments – wpDiscuz
Version 7.1.3
Comparing to
See all releases

Code changes from version 7.1.2 to 7.1.3

assets/js/wpdiscuz-combo-no_quill.min.js CHANGED
@@ -11,6 +11,6 @@ jQuery(document).ready(function(e){if(e(document).on("click","#wpdcom .wmu-uploa
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 */
14
- jQuery(document).ready(function(e){var t=0,n=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),d=parseInt(wpdiscuzUCObj.additionalTab);e(document).on("click",".wpd-info,.wpd-page-link,.wpd-delete-content,.wpd-user-email-delete-links",function(e){e.preventDefault()}),e(document).on("click",".wpd-info.wpd-not-clicked",function(t){var a=e(this);a.removeClass("wpd-not-clicked");var o=new FormData;return o.append("action","wpdGetInfo"),function(t,a){var o=e(".fas",t),i=o.attr("class");o.removeClass(),o.addClass("fas fa-pulse fa-spinner"),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,a).done(function(n){t.addClass("wpd-not-clicked"),o.removeClass(),o.addClass(i),n&&(e("#wpdUserContentInfo").html(n),e("#wpdUserContentInfo ul.wpd-list .wpd-list-item:first-child").addClass("wpd-active"),e("#wpdUserContentInfo div.wpd-content .wpd-content-item:first-child").addClass("wpd-active"),e("#wpdUserContentInfo").is(":visible")||e("#wpdUserContentInfoAnchor").trigger("click"))})}(a,o),!1}),e(document).on("click",".wpd-list-item",function(){var t=e("input.wpd-rel",this).val();e("#wpdUserContentInfo .wpd-list-item").removeClass("wpd-active"),e("#wpdUserContentInfo .wpd-content-item").removeClass("wpd-active");var a=e(this);if(e("#wpdUserContentInfo #"+t).text().length)a.addClass("wpd-active"),e("#wpdUserContentInfo #"+t).addClass("wpd-active");else{var o=new FormData;o.append("action",a.attr("data-action")),o.append("page",0),e("#wpdUserContentInfo #"+t).addClass("wpd-active"),e("#wpdUserContentInfo #"+t).css("text-align","center"),wpdiscuzAjaxObj.getAjaxObj(n||d,!0,o).done(function(n){n&&(e("#wpdUserContentInfo #"+t).css("text-align",""),a.addClass("wpd-active"),e("#wpdUserContentInfo #"+t).html(n)),e("#wpdiscuz-loading-bar").hide()})}}),e(document).on("click",".wpd-page-link.wpd-not-clicked",function(t){var a=e(this);a.removeClass("wpd-not-clicked");var o=a.data("wpd-page"),i=e(".wpd-active .wpd-pagination .wpd-action").val(),s=new FormData;s.append("action",i),s.append("page",o),wpdiscuzAjaxObj.getAjaxObj(n||d,!0,s).done(function(t){a.addClass("wpd-not-clicked"),t&&e(".wpd-content-item.wpd-active").html(t),e("#wpdiscuz-loading-bar").hide()})}),e(document).on("click",".wpd-delete-content.wpd-not-clicked",function(){var a=e(this),o=parseInt(a.data("wpd-content-id"));if(!isNaN(o)){var i=a.data("wpd-delete-action");if("wpdDeleteComment"==i&&!confirm(wpdiscuzUCObj.msgConfirmDeleteComment))return!1;if("wpdCancelSubscription"==i&&!confirm(wpdiscuzUCObj.msgConfirmCancelSubscription))return!1;if("wpdCancelFollow"==i&&!confirm(wpdiscuzUCObj.msgConfirmCancelFollow))return!1;var s=e("i",a),c=s.attr("class"),p=e(".wpd-wrapper .wpd-page-number").val(),l=e(".wpd-content-item.wpd-active").children(".wpd-item").length;a.removeClass("wpd-not-clicked"),s.removeClass().addClass("fas fa-pulse fa-spinner"),1==l&&p>0&&(p-=1);var w=new FormData;w.append("id",o),w.append("page",p),w.append("action",i),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,w).done(function(n){a.addClass("wpd-not-clicked"),s.removeClass().addClass(c),e(".wpd-content-item.wpd-active").html(n),t=1})}}),e(document).on("click","[data-lity-close]",function(n){e(n.target).is("[data-lity-close]")&&t&&window.location.reload(!0)}),e(document).on("click",".wpd-user-email-delete-links.wpd-not-clicked",function(){var t=e(this);t.removeClass("wpd-not-clicked"),e(".wpd-loading",t).addClass("wpd-show");var a=new FormData;a.append("action","wpdEmailDeleteLinks"),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,a).done(function(n){t.addClass("wpd-not-clicked"),e("[data-lity-close]",window.parent.document).trigger("click")})}),e(document).on("click",".wpd-user-settings-button.wpd-not-clicked",function(){var t=e(this);t.removeClass("wpd-not-clicked");var a=t.data("wpd-delete-action");if("deleteCookies"!==a){t.find(".wpd-loading").addClass("wpd-show");var o=new FormData;o.append("action","wpdGuestAction"),o.append("guestAction",a),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,o).done(function(n){t.addClass("wpd-not-clicked"),t.find(".wpd-loading").removeClass("wpd-show");try{var d=e.parseJSON(n);t.after(d.message);var a=t.next(".wpd-guest-action-message");a.fadeIn(100).fadeOut(7e3,function(){a.remove(),1===parseInt(d.code)&&(t.parent().remove(),e(".wpd-delete-all-comments").length||e(".wpd-delete-all-subscriptions").length||e(".wpd-delete-all-cookies").parent().addClass("wpd-show"))})}catch(e){console.log(e)}})}else!function(){for(var e=document.cookie.split(";"),t=0;t<e.length;t++){var n=e[t],d=n.indexOf("="),a=d>-1?n.substr(0,d):n;Cookies.remove(a.trim())}location.reload(!0)}()})});
15
  /* Social */
16
  function wpcShareCommentFB(e,s){FB.ui({method:"share",href:e,quote:s},function(e){})}(wpdiscuzAjaxObj.enableFbLogin||wpdiscuzAjaxObj.enableFbShare)&&wpdiscuzAjaxObj.facebookAppID&&(!function(e,s,n){var o,a=e.getElementsByTagName(s)[0];e.getElementById(n)||((o=e.createElement(s)).id=n,o.src="//connect.facebook.net/en_US/sdk.js",a.parentNode.insertBefore(o,a))}(document,"script","facebook-jssdk"),window.fbAsyncInit=function(){FB.init({appId:wpdiscuzAjaxObj.facebookAppID,cookie:!0,xfbml:!0,version:"v7.0"})}),jQuery(document).ready(function(e){var s;(s=Cookies.get("wpdiscuz_social_login_message"))&&"undefined"!==s&&(Cookies.remove("wpdiscuz_social_login_message"),wpdiscuzAjaxObj.setCommentMessage(decodeURIComponent(s.replace(/\+/g,"%20")),"error")),Cookies.get("wpdiscuz_scroll_to_comments")&&(Cookies.remove("wpdiscuz_scroll_to_comments",{path:"/"}),e("html, body").animate({scrollTop:e("#comments").offset().top-32},1e3)),e(document).on("click",".wpd-comment-share .fa-facebook-f",function(){if(1==wpdiscuzAjaxObj.enableFbShare){var s=e(this).parents(".wpd-comment").find(".wpd-comment-right").attr("id"),n=window.location.href;-1!==n.indexOf("#")&&(n=n.substring(0,n.indexOf("#"))),wpcShareCommentFB(n+="#"+s,e(this).parents(".wpd-comment-right").find(".wpd-comment-text").text())}});var n="";function o(e,s){var n,o="";i(s,1),Cookies.set("wpdiscuz_scroll_to_comments",1,{path:"/"}),"facebook"===e&&0==wpdiscuzAjaxObj.facebookUseOAuth2?FB.getLoginStatus(function(i){"connected"===i.status?(n=i.authResponse.accessToken,o=i.authResponse.userID,a(e,n,o,s)):FB.login(function(i){"connected"===i.status&&(n=i.authResponse.accessToken,o=i.authResponse.userID,a(e,n,o,s))},{scope:"public_profile,email"})}):a(e,n,o,s)}function a(s,n,o,a){return e.ajax({type:"POST",url:wpdiscuzAjaxObj.url,data:{action:"wpd_social_login",provider:s,token:n,userID:o,postID:wpdiscuzAjaxObj.wc_post_id}}).done(function(s){!function(s,n){try{var o=e.parseJSON(s),a=o.code,t=o.message,c=o.url;200===parseInt(a)?location.assign(c):wpdiscuzAjaxObj.setCommentMessage(t,"error")}catch(e){console.log(e)}i(n,0)}(s,a)}),""}function i(e,s){1===s?e.find(".wpdiscuz-social-login-spinner").show():e.find(".wpdiscuz-social-login-spinner").hide()}e(document).on("click","#wpdcom .wpd-social-login .wpdiscuz-login-button",function(){var s=e(this).parents(".wpd-social-login");!function(e,s){1!=parseInt(wpdiscuzAjaxObj.socialLoginAgreementCheckbox)||1==Cookies.get("socialLoginAgreementConfirmed")?o(e,s):s.parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").first().slideDown(700)}(n=function(e){var s="";e.hasClass("wpdsn-fb")&&(s="facebook");e.hasClass("wpdsn-insta")&&(s="instagram");e.hasClass("wpdsn-gg")&&(s="google");e.hasClass("wpdsn-ds")&&(s="disqus");e.hasClass("wpdsn-wp")&&(s="wordpress");e.hasClass("wpdsn-tw")&&(s="twitter");e.hasClass("wpdsn-vk")&&(s="vk");e.hasClass("wpdsn-ok")&&(s="ok");e.hasClass("wpdsn-linked")&&(s="linkedin");e.hasClass("wpdsn-yandex")&&(s="yandex");e.hasClass("wpdsn-mailru")&&(s="mailru");e.hasClass("wpdsn-weixin")&&(s="wechat");e.hasClass("wpdsn-weibo")&&(s="weibo");e.hasClass("wpdsn-qq")&&(s="qq");e.hasClass("wpdsn-baidu")&&(s="baidu");return s}(e(this)),s)}),e(document).on("click","#wpdcom .wpd-agreement-buttons-right .wpd-agreement-button",function(){var s=e(this).parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").slideUp(700);e(this).hasClass("wpd-agreement-button-agree")&&(wpdiscuzAjaxObj.isCookiesEnabled&&Cookies.set("socialLoginAgreementConfirmed",1,{expires:30,path:"/"}),o(n,s))})});
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 */
14
+ jQuery(document).ready(function(e){var t=0,n=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),d=parseInt(wpdiscuzUCObj.additionalTab);e(document).on("click",".wpd-info,.wpd-page-link,.wpd-delete-content,.wpd-user-email-delete-links",function(e){e.preventDefault()}),e(document).on("click",".wpd-info.wpd-not-clicked",function(t){var a=e(this);a.removeClass("wpd-not-clicked");var o=new FormData;return o.append("action","wpdGetInfo"),function(t,a){var o=e(".fas",t),i=o.attr("class");o.removeClass(),o.addClass("fas fa-pulse fa-spinner"),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,a).done(function(n){t.addClass("wpd-not-clicked"),o.removeClass(),o.addClass(i),n&&(e("#wpdUserContentInfo").html(n),e("#wpdUserContentInfo ul.wpd-list .wpd-list-item:first-child").addClass("wpd-active"),e("#wpdUserContentInfo div.wpd-content .wpd-content-item:first-child").addClass("wpd-active"),e("#wpdUserContentInfo").is(":visible")||e("#wpdUserContentInfoAnchor").trigger("click"))})}(a,o),!1}),e(document).on("click",".wpd-list-item",function(){var t=e("input.wpd-rel",this).val();e("#wpdUserContentInfo .wpd-list-item").removeClass("wpd-active"),e("#wpdUserContentInfo .wpd-content-item").removeClass("wpd-active");var a=e(this);if(e("#wpdUserContentInfo #"+t).text().length)a.addClass("wpd-active"),e("#wpdUserContentInfo #"+t).addClass("wpd-active");else{var o=new FormData;o.append("action",a.attr("data-action")),o.append("page",0),e("#wpdUserContentInfo #"+t).addClass("wpd-active"),e("#wpdUserContentInfo #"+t).css("text-align","center"),wpdiscuzAjaxObj.getAjaxObj(n||d,!0,o).done(function(n){n&&(e("#wpdUserContentInfo #"+t).css("text-align",""),a.addClass("wpd-active"),e("#wpdUserContentInfo #"+t).html(n)),e("#wpdiscuz-loading-bar").hide()})}}),e(document).on("click",".wpd-page-link.wpd-not-clicked",function(t){var a=e(this);a.removeClass("wpd-not-clicked");var o=a.data("wpd-page"),i=e(".wpd-active .wpd-pagination .wpd-action").val(),s=new FormData;s.append("action",i),s.append("page",o),wpdiscuzAjaxObj.getAjaxObj(n||d,!0,s).done(function(t){a.addClass("wpd-not-clicked"),t&&e(".wpd-content-item.wpd-active").html(t),e("#wpdiscuz-loading-bar").hide()})}),e(document).on("click",".wpd-delete-content.wpd-not-clicked",function(){var a=e(this),o=parseInt(a.data("wpd-content-id"));if(!isNaN(o)){var i=a.data("wpd-delete-action");if("wpdDeleteComment"===i&&!confirm(wpdiscuzUCObj.msgConfirmDeleteComment))return!1;if("wpdCancelSubscription"===i&&!confirm(wpdiscuzUCObj.msgConfirmCancelSubscription))return!1;if("wpdCancelFollow"===i&&!confirm(wpdiscuzUCObj.msgConfirmCancelFollow))return!1;var s=e("i",a),c=s.attr("class"),p=e(".wpd-wrapper .wpd-page-number").val(),l=e(".wpd-content-item.wpd-active").children(".wpd-item").length;a.removeClass("wpd-not-clicked"),s.removeClass().addClass("fas fa-pulse fa-spinner"),1===l&&p>0&&(p-=1);var w=new FormData;w.append("id",o),w.append("page",p),w.append("action",i),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,w).done(function(n){a.addClass("wpd-not-clicked"),s.removeClass().addClass(c),e(".wpd-content-item.wpd-active").html(n),t=1})}}),e(document).on("click","[data-lity-close]",function(n){e(n.target).is("[data-lity-close]")&&t&&window.location.reload(!0)}),e(document).on("click",".wpd-user-email-delete-links.wpd-not-clicked",function(){var t=e(this);t.removeClass("wpd-not-clicked"),e(".wpd-loading",t).addClass("wpd-show");var a=new FormData;a.append("action","wpdEmailDeleteLinks"),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,a).done(function(n){t.addClass("wpd-not-clicked"),e("[data-lity-close]",window.parent.document).trigger("click")})}),e(document).on("click",".wpd-user-settings-button.wpd-not-clicked",function(){var t=e(this);t.removeClass("wpd-not-clicked");var a=t.data("wpd-delete-action");if("deleteCookies"!==a){t.find(".wpd-loading").addClass("wpd-show");var o=new FormData;o.append("action","wpdGuestAction"),o.append("guestAction",a),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,o).done(function(n){t.addClass("wpd-not-clicked"),t.find(".wpd-loading").removeClass("wpd-show");try{var d=e.parseJSON(n);t.after(d.message);var a=t.next(".wpd-guest-action-message");a.fadeIn(100).fadeOut(7e3,function(){a.remove(),1===parseInt(d.code)&&(t.parent().remove(),e(".wpd-delete-all-comments").length||e(".wpd-delete-all-subscriptions").length||e(".wpd-delete-all-cookies").parent().addClass("wpd-show"))})}catch(e){console.log(e)}})}else!function(){for(var e=document.cookie.split(";"),t=0;t<e.length;t++){var n=e[t],d=n.indexOf("="),a=d>-1?n.substr(0,d):n;Cookies.remove(a.trim())}location.reload(!0)}()})});
15
  /* Social */
16
  function wpcShareCommentFB(e,s){FB.ui({method:"share",href:e,quote:s},function(e){})}(wpdiscuzAjaxObj.enableFbLogin||wpdiscuzAjaxObj.enableFbShare)&&wpdiscuzAjaxObj.facebookAppID&&(!function(e,s,n){var o,a=e.getElementsByTagName(s)[0];e.getElementById(n)||((o=e.createElement(s)).id=n,o.src="//connect.facebook.net/en_US/sdk.js",a.parentNode.insertBefore(o,a))}(document,"script","facebook-jssdk"),window.fbAsyncInit=function(){FB.init({appId:wpdiscuzAjaxObj.facebookAppID,cookie:!0,xfbml:!0,version:"v7.0"})}),jQuery(document).ready(function(e){var s;(s=Cookies.get("wpdiscuz_social_login_message"))&&"undefined"!==s&&(Cookies.remove("wpdiscuz_social_login_message"),wpdiscuzAjaxObj.setCommentMessage(decodeURIComponent(s.replace(/\+/g,"%20")),"error")),Cookies.get("wpdiscuz_scroll_to_comments")&&(Cookies.remove("wpdiscuz_scroll_to_comments",{path:"/"}),e("html, body").animate({scrollTop:e("#comments").offset().top-32},1e3)),e(document).on("click",".wpd-comment-share .fa-facebook-f",function(){if(1==wpdiscuzAjaxObj.enableFbShare){var s=e(this).parents(".wpd-comment").find(".wpd-comment-right").attr("id"),n=window.location.href;-1!==n.indexOf("#")&&(n=n.substring(0,n.indexOf("#"))),wpcShareCommentFB(n+="#"+s,e(this).parents(".wpd-comment-right").find(".wpd-comment-text").text())}});var n="";function o(e,s){var n,o="";i(s,1),Cookies.set("wpdiscuz_scroll_to_comments",1,{path:"/"}),"facebook"===e&&0==wpdiscuzAjaxObj.facebookUseOAuth2?FB.getLoginStatus(function(i){"connected"===i.status?(n=i.authResponse.accessToken,o=i.authResponse.userID,a(e,n,o,s)):FB.login(function(i){"connected"===i.status&&(n=i.authResponse.accessToken,o=i.authResponse.userID,a(e,n,o,s))},{scope:"public_profile,email"})}):a(e,n,o,s)}function a(s,n,o,a){return e.ajax({type:"POST",url:wpdiscuzAjaxObj.url,data:{action:"wpd_social_login",provider:s,token:n,userID:o,postID:wpdiscuzAjaxObj.wc_post_id}}).done(function(s){!function(s,n){try{var o=e.parseJSON(s),a=o.code,t=o.message,c=o.url;200===parseInt(a)?location.assign(c):wpdiscuzAjaxObj.setCommentMessage(t,"error")}catch(e){console.log(e)}i(n,0)}(s,a)}),""}function i(e,s){1===s?e.find(".wpdiscuz-social-login-spinner").show():e.find(".wpdiscuz-social-login-spinner").hide()}e(document).on("click","#wpdcom .wpd-social-login .wpdiscuz-login-button",function(){var s=e(this).parents(".wpd-social-login");!function(e,s){1!=parseInt(wpdiscuzAjaxObj.socialLoginAgreementCheckbox)||1==Cookies.get("socialLoginAgreementConfirmed")?o(e,s):s.parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").first().slideDown(700)}(n=function(e){var s="";e.hasClass("wpdsn-fb")&&(s="facebook");e.hasClass("wpdsn-insta")&&(s="instagram");e.hasClass("wpdsn-gg")&&(s="google");e.hasClass("wpdsn-ds")&&(s="disqus");e.hasClass("wpdsn-wp")&&(s="wordpress");e.hasClass("wpdsn-tw")&&(s="twitter");e.hasClass("wpdsn-vk")&&(s="vk");e.hasClass("wpdsn-ok")&&(s="ok");e.hasClass("wpdsn-linked")&&(s="linkedin");e.hasClass("wpdsn-yandex")&&(s="yandex");e.hasClass("wpdsn-mailru")&&(s="mailru");e.hasClass("wpdsn-weixin")&&(s="wechat");e.hasClass("wpdsn-weibo")&&(s="weibo");e.hasClass("wpdsn-qq")&&(s="qq");e.hasClass("wpdsn-baidu")&&(s="baidu");return s}(e(this)),s)}),e(document).on("click","#wpdcom .wpd-agreement-buttons-right .wpd-agreement-button",function(){var s=e(this).parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").slideUp(700);e(this).hasClass("wpd-agreement-button-agree")&&(wpdiscuzAjaxObj.isCookiesEnabled&&Cookies.set("socialLoginAgreementConfirmed",1,{expires:30,path:"/"}),o(n,s))})});
assets/js/wpdiscuz-combo.min.js CHANGED
@@ -15,6 +15,6 @@ jQuery(document).ready(function(e){if(e(document).on("click","#wpdcom .wmu-uploa
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 */
18
- jQuery(document).ready(function(e){var t=0,n=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),d=parseInt(wpdiscuzUCObj.additionalTab);e(document).on("click",".wpd-info,.wpd-page-link,.wpd-delete-content,.wpd-user-email-delete-links",function(e){e.preventDefault()}),e(document).on("click",".wpd-info.wpd-not-clicked",function(t){var a=e(this);a.removeClass("wpd-not-clicked");var o=new FormData;return o.append("action","wpdGetInfo"),function(t,a){var o=e(".fas",t),i=o.attr("class");o.removeClass(),o.addClass("fas fa-pulse fa-spinner"),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,a).done(function(n){t.addClass("wpd-not-clicked"),o.removeClass(),o.addClass(i),n&&(e("#wpdUserContentInfo").html(n),e("#wpdUserContentInfo ul.wpd-list .wpd-list-item:first-child").addClass("wpd-active"),e("#wpdUserContentInfo div.wpd-content .wpd-content-item:first-child").addClass("wpd-active"),e("#wpdUserContentInfo").is(":visible")||e("#wpdUserContentInfoAnchor").trigger("click"))})}(a,o),!1}),e(document).on("click",".wpd-list-item",function(){var t=e("input.wpd-rel",this).val();e("#wpdUserContentInfo .wpd-list-item").removeClass("wpd-active"),e("#wpdUserContentInfo .wpd-content-item").removeClass("wpd-active");var a=e(this);if(e("#wpdUserContentInfo #"+t).text().length)a.addClass("wpd-active"),e("#wpdUserContentInfo #"+t).addClass("wpd-active");else{var o=new FormData;o.append("action",a.attr("data-action")),o.append("page",0),e("#wpdUserContentInfo #"+t).addClass("wpd-active"),e("#wpdUserContentInfo #"+t).css("text-align","center"),wpdiscuzAjaxObj.getAjaxObj(n||d,!0,o).done(function(n){n&&(e("#wpdUserContentInfo #"+t).css("text-align",""),a.addClass("wpd-active"),e("#wpdUserContentInfo #"+t).html(n)),e("#wpdiscuz-loading-bar").hide()})}}),e(document).on("click",".wpd-page-link.wpd-not-clicked",function(t){var a=e(this);a.removeClass("wpd-not-clicked");var o=a.data("wpd-page"),i=e(".wpd-active .wpd-pagination .wpd-action").val(),s=new FormData;s.append("action",i),s.append("page",o),wpdiscuzAjaxObj.getAjaxObj(n||d,!0,s).done(function(t){a.addClass("wpd-not-clicked"),t&&e(".wpd-content-item.wpd-active").html(t),e("#wpdiscuz-loading-bar").hide()})}),e(document).on("click",".wpd-delete-content.wpd-not-clicked",function(){var a=e(this),o=parseInt(a.data("wpd-content-id"));if(!isNaN(o)){var i=a.data("wpd-delete-action");if("wpdDeleteComment"==i&&!confirm(wpdiscuzUCObj.msgConfirmDeleteComment))return!1;if("wpdCancelSubscription"==i&&!confirm(wpdiscuzUCObj.msgConfirmCancelSubscription))return!1;if("wpdCancelFollow"==i&&!confirm(wpdiscuzUCObj.msgConfirmCancelFollow))return!1;var s=e("i",a),c=s.attr("class"),p=e(".wpd-wrapper .wpd-page-number").val(),l=e(".wpd-content-item.wpd-active").children(".wpd-item").length;a.removeClass("wpd-not-clicked"),s.removeClass().addClass("fas fa-pulse fa-spinner"),1==l&&p>0&&(p-=1);var w=new FormData;w.append("id",o),w.append("page",p),w.append("action",i),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,w).done(function(n){a.addClass("wpd-not-clicked"),s.removeClass().addClass(c),e(".wpd-content-item.wpd-active").html(n),t=1})}}),e(document).on("click","[data-lity-close]",function(n){e(n.target).is("[data-lity-close]")&&t&&window.location.reload(!0)}),e(document).on("click",".wpd-user-email-delete-links.wpd-not-clicked",function(){var t=e(this);t.removeClass("wpd-not-clicked"),e(".wpd-loading",t).addClass("wpd-show");var a=new FormData;a.append("action","wpdEmailDeleteLinks"),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,a).done(function(n){t.addClass("wpd-not-clicked"),e("[data-lity-close]",window.parent.document).trigger("click")})}),e(document).on("click",".wpd-user-settings-button.wpd-not-clicked",function(){var t=e(this);t.removeClass("wpd-not-clicked");var a=t.data("wpd-delete-action");if("deleteCookies"!==a){t.find(".wpd-loading").addClass("wpd-show");var o=new FormData;o.append("action","wpdGuestAction"),o.append("guestAction",a),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,o).done(function(n){t.addClass("wpd-not-clicked"),t.find(".wpd-loading").removeClass("wpd-show");try{var d=e.parseJSON(n);t.after(d.message);var a=t.next(".wpd-guest-action-message");a.fadeIn(100).fadeOut(7e3,function(){a.remove(),1===parseInt(d.code)&&(t.parent().remove(),e(".wpd-delete-all-comments").length||e(".wpd-delete-all-subscriptions").length||e(".wpd-delete-all-cookies").parent().addClass("wpd-show"))})}catch(e){console.log(e)}})}else!function(){for(var e=document.cookie.split(";"),t=0;t<e.length;t++){var n=e[t],d=n.indexOf("="),a=d>-1?n.substr(0,d):n;Cookies.remove(a.trim())}location.reload(!0)}()})});
19
  /* Social */
20
  function wpcShareCommentFB(e,s){FB.ui({method:"share",href:e,quote:s},function(e){})}(wpdiscuzAjaxObj.enableFbLogin||wpdiscuzAjaxObj.enableFbShare)&&wpdiscuzAjaxObj.facebookAppID&&(!function(e,s,n){var o,a=e.getElementsByTagName(s)[0];e.getElementById(n)||((o=e.createElement(s)).id=n,o.src="//connect.facebook.net/en_US/sdk.js",a.parentNode.insertBefore(o,a))}(document,"script","facebook-jssdk"),window.fbAsyncInit=function(){FB.init({appId:wpdiscuzAjaxObj.facebookAppID,cookie:!0,xfbml:!0,version:"v7.0"})}),jQuery(document).ready(function(e){var s;(s=Cookies.get("wpdiscuz_social_login_message"))&&"undefined"!==s&&(Cookies.remove("wpdiscuz_social_login_message"),wpdiscuzAjaxObj.setCommentMessage(decodeURIComponent(s.replace(/\+/g,"%20")),"error")),Cookies.get("wpdiscuz_scroll_to_comments")&&(Cookies.remove("wpdiscuz_scroll_to_comments",{path:"/"}),e("html, body").animate({scrollTop:e("#comments").offset().top-32},1e3)),e(document).on("click",".wpd-comment-share .fa-facebook-f",function(){if(1==wpdiscuzAjaxObj.enableFbShare){var s=e(this).parents(".wpd-comment").find(".wpd-comment-right").attr("id"),n=window.location.href;-1!==n.indexOf("#")&&(n=n.substring(0,n.indexOf("#"))),wpcShareCommentFB(n+="#"+s,e(this).parents(".wpd-comment-right").find(".wpd-comment-text").text())}});var n="";function o(e,s){var n,o="";i(s,1),Cookies.set("wpdiscuz_scroll_to_comments",1,{path:"/"}),"facebook"===e&&0==wpdiscuzAjaxObj.facebookUseOAuth2?FB.getLoginStatus(function(i){"connected"===i.status?(n=i.authResponse.accessToken,o=i.authResponse.userID,a(e,n,o,s)):FB.login(function(i){"connected"===i.status&&(n=i.authResponse.accessToken,o=i.authResponse.userID,a(e,n,o,s))},{scope:"public_profile,email"})}):a(e,n,o,s)}function a(s,n,o,a){return e.ajax({type:"POST",url:wpdiscuzAjaxObj.url,data:{action:"wpd_social_login",provider:s,token:n,userID:o,postID:wpdiscuzAjaxObj.wc_post_id}}).done(function(s){!function(s,n){try{var o=e.parseJSON(s),a=o.code,t=o.message,c=o.url;200===parseInt(a)?location.assign(c):wpdiscuzAjaxObj.setCommentMessage(t,"error")}catch(e){console.log(e)}i(n,0)}(s,a)}),""}function i(e,s){1===s?e.find(".wpdiscuz-social-login-spinner").show():e.find(".wpdiscuz-social-login-spinner").hide()}e(document).on("click","#wpdcom .wpd-social-login .wpdiscuz-login-button",function(){var s=e(this).parents(".wpd-social-login");!function(e,s){1!=parseInt(wpdiscuzAjaxObj.socialLoginAgreementCheckbox)||1==Cookies.get("socialLoginAgreementConfirmed")?o(e,s):s.parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").first().slideDown(700)}(n=function(e){var s="";e.hasClass("wpdsn-fb")&&(s="facebook");e.hasClass("wpdsn-insta")&&(s="instagram");e.hasClass("wpdsn-gg")&&(s="google");e.hasClass("wpdsn-ds")&&(s="disqus");e.hasClass("wpdsn-wp")&&(s="wordpress");e.hasClass("wpdsn-tw")&&(s="twitter");e.hasClass("wpdsn-vk")&&(s="vk");e.hasClass("wpdsn-ok")&&(s="ok");e.hasClass("wpdsn-linked")&&(s="linkedin");e.hasClass("wpdsn-yandex")&&(s="yandex");e.hasClass("wpdsn-mailru")&&(s="mailru");e.hasClass("wpdsn-weixin")&&(s="wechat");e.hasClass("wpdsn-weibo")&&(s="weibo");e.hasClass("wpdsn-qq")&&(s="qq");e.hasClass("wpdsn-baidu")&&(s="baidu");return s}(e(this)),s)}),e(document).on("click","#wpdcom .wpd-agreement-buttons-right .wpd-agreement-button",function(){var s=e(this).parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").slideUp(700);e(this).hasClass("wpd-agreement-button-agree")&&(wpdiscuzAjaxObj.isCookiesEnabled&&Cookies.set("socialLoginAgreementConfirmed",1,{expires:30,path:"/"}),o(n,s))})});
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 */
18
+ jQuery(document).ready(function(e){var t=0,n=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),d=parseInt(wpdiscuzUCObj.additionalTab);e(document).on("click",".wpd-info,.wpd-page-link,.wpd-delete-content,.wpd-user-email-delete-links",function(e){e.preventDefault()}),e(document).on("click",".wpd-info.wpd-not-clicked",function(t){var a=e(this);a.removeClass("wpd-not-clicked");var o=new FormData;return o.append("action","wpdGetInfo"),function(t,a){var o=e(".fas",t),i=o.attr("class");o.removeClass(),o.addClass("fas fa-pulse fa-spinner"),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,a).done(function(n){t.addClass("wpd-not-clicked"),o.removeClass(),o.addClass(i),n&&(e("#wpdUserContentInfo").html(n),e("#wpdUserContentInfo ul.wpd-list .wpd-list-item:first-child").addClass("wpd-active"),e("#wpdUserContentInfo div.wpd-content .wpd-content-item:first-child").addClass("wpd-active"),e("#wpdUserContentInfo").is(":visible")||e("#wpdUserContentInfoAnchor").trigger("click"))})}(a,o),!1}),e(document).on("click",".wpd-list-item",function(){var t=e("input.wpd-rel",this).val();e("#wpdUserContentInfo .wpd-list-item").removeClass("wpd-active"),e("#wpdUserContentInfo .wpd-content-item").removeClass("wpd-active");var a=e(this);if(e("#wpdUserContentInfo #"+t).text().length)a.addClass("wpd-active"),e("#wpdUserContentInfo #"+t).addClass("wpd-active");else{var o=new FormData;o.append("action",a.attr("data-action")),o.append("page",0),e("#wpdUserContentInfo #"+t).addClass("wpd-active"),e("#wpdUserContentInfo #"+t).css("text-align","center"),wpdiscuzAjaxObj.getAjaxObj(n||d,!0,o).done(function(n){n&&(e("#wpdUserContentInfo #"+t).css("text-align",""),a.addClass("wpd-active"),e("#wpdUserContentInfo #"+t).html(n)),e("#wpdiscuz-loading-bar").hide()})}}),e(document).on("click",".wpd-page-link.wpd-not-clicked",function(t){var a=e(this);a.removeClass("wpd-not-clicked");var o=a.data("wpd-page"),i=e(".wpd-active .wpd-pagination .wpd-action").val(),s=new FormData;s.append("action",i),s.append("page",o),wpdiscuzAjaxObj.getAjaxObj(n||d,!0,s).done(function(t){a.addClass("wpd-not-clicked"),t&&e(".wpd-content-item.wpd-active").html(t),e("#wpdiscuz-loading-bar").hide()})}),e(document).on("click",".wpd-delete-content.wpd-not-clicked",function(){var a=e(this),o=parseInt(a.data("wpd-content-id"));if(!isNaN(o)){var i=a.data("wpd-delete-action");if("wpdDeleteComment"===i&&!confirm(wpdiscuzUCObj.msgConfirmDeleteComment))return!1;if("wpdCancelSubscription"===i&&!confirm(wpdiscuzUCObj.msgConfirmCancelSubscription))return!1;if("wpdCancelFollow"===i&&!confirm(wpdiscuzUCObj.msgConfirmCancelFollow))return!1;var s=e("i",a),c=s.attr("class"),p=e(".wpd-wrapper .wpd-page-number").val(),l=e(".wpd-content-item.wpd-active").children(".wpd-item").length;a.removeClass("wpd-not-clicked"),s.removeClass().addClass("fas fa-pulse fa-spinner"),1===l&&p>0&&(p-=1);var w=new FormData;w.append("id",o),w.append("page",p),w.append("action",i),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,w).done(function(n){a.addClass("wpd-not-clicked"),s.removeClass().addClass(c),e(".wpd-content-item.wpd-active").html(n),t=1})}}),e(document).on("click","[data-lity-close]",function(n){e(n.target).is("[data-lity-close]")&&t&&window.location.reload(!0)}),e(document).on("click",".wpd-user-email-delete-links.wpd-not-clicked",function(){var t=e(this);t.removeClass("wpd-not-clicked"),e(".wpd-loading",t).addClass("wpd-show");var a=new FormData;a.append("action","wpdEmailDeleteLinks"),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,a).done(function(n){t.addClass("wpd-not-clicked"),e("[data-lity-close]",window.parent.document).trigger("click")})}),e(document).on("click",".wpd-user-settings-button.wpd-not-clicked",function(){var t=e(this);t.removeClass("wpd-not-clicked");var a=t.data("wpd-delete-action");if("deleteCookies"!==a){t.find(".wpd-loading").addClass("wpd-show");var o=new FormData;o.append("action","wpdGuestAction"),o.append("guestAction",a),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,o).done(function(n){t.addClass("wpd-not-clicked"),t.find(".wpd-loading").removeClass("wpd-show");try{var d=e.parseJSON(n);t.after(d.message);var a=t.next(".wpd-guest-action-message");a.fadeIn(100).fadeOut(7e3,function(){a.remove(),1===parseInt(d.code)&&(t.parent().remove(),e(".wpd-delete-all-comments").length||e(".wpd-delete-all-subscriptions").length||e(".wpd-delete-all-cookies").parent().addClass("wpd-show"))})}catch(e){console.log(e)}})}else!function(){for(var e=document.cookie.split(";"),t=0;t<e.length;t++){var n=e[t],d=n.indexOf("="),a=d>-1?n.substr(0,d):n;Cookies.remove(a.trim())}location.reload(!0)}()})});
19
  /* Social */
20
  function wpcShareCommentFB(e,s){FB.ui({method:"share",href:e,quote:s},function(e){})}(wpdiscuzAjaxObj.enableFbLogin||wpdiscuzAjaxObj.enableFbShare)&&wpdiscuzAjaxObj.facebookAppID&&(!function(e,s,n){var o,a=e.getElementsByTagName(s)[0];e.getElementById(n)||((o=e.createElement(s)).id=n,o.src="//connect.facebook.net/en_US/sdk.js",a.parentNode.insertBefore(o,a))}(document,"script","facebook-jssdk"),window.fbAsyncInit=function(){FB.init({appId:wpdiscuzAjaxObj.facebookAppID,cookie:!0,xfbml:!0,version:"v7.0"})}),jQuery(document).ready(function(e){var s;(s=Cookies.get("wpdiscuz_social_login_message"))&&"undefined"!==s&&(Cookies.remove("wpdiscuz_social_login_message"),wpdiscuzAjaxObj.setCommentMessage(decodeURIComponent(s.replace(/\+/g,"%20")),"error")),Cookies.get("wpdiscuz_scroll_to_comments")&&(Cookies.remove("wpdiscuz_scroll_to_comments",{path:"/"}),e("html, body").animate({scrollTop:e("#comments").offset().top-32},1e3)),e(document).on("click",".wpd-comment-share .fa-facebook-f",function(){if(1==wpdiscuzAjaxObj.enableFbShare){var s=e(this).parents(".wpd-comment").find(".wpd-comment-right").attr("id"),n=window.location.href;-1!==n.indexOf("#")&&(n=n.substring(0,n.indexOf("#"))),wpcShareCommentFB(n+="#"+s,e(this).parents(".wpd-comment-right").find(".wpd-comment-text").text())}});var n="";function o(e,s){var n,o="";i(s,1),Cookies.set("wpdiscuz_scroll_to_comments",1,{path:"/"}),"facebook"===e&&0==wpdiscuzAjaxObj.facebookUseOAuth2?FB.getLoginStatus(function(i){"connected"===i.status?(n=i.authResponse.accessToken,o=i.authResponse.userID,a(e,n,o,s)):FB.login(function(i){"connected"===i.status&&(n=i.authResponse.accessToken,o=i.authResponse.userID,a(e,n,o,s))},{scope:"public_profile,email"})}):a(e,n,o,s)}function a(s,n,o,a){return e.ajax({type:"POST",url:wpdiscuzAjaxObj.url,data:{action:"wpd_social_login",provider:s,token:n,userID:o,postID:wpdiscuzAjaxObj.wc_post_id}}).done(function(s){!function(s,n){try{var o=e.parseJSON(s),a=o.code,t=o.message,c=o.url;200===parseInt(a)?location.assign(c):wpdiscuzAjaxObj.setCommentMessage(t,"error")}catch(e){console.log(e)}i(n,0)}(s,a)}),""}function i(e,s){1===s?e.find(".wpdiscuz-social-login-spinner").show():e.find(".wpdiscuz-social-login-spinner").hide()}e(document).on("click","#wpdcom .wpd-social-login .wpdiscuz-login-button",function(){var s=e(this).parents(".wpd-social-login");!function(e,s){1!=parseInt(wpdiscuzAjaxObj.socialLoginAgreementCheckbox)||1==Cookies.get("socialLoginAgreementConfirmed")?o(e,s):s.parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").first().slideDown(700)}(n=function(e){var s="";e.hasClass("wpdsn-fb")&&(s="facebook");e.hasClass("wpdsn-insta")&&(s="instagram");e.hasClass("wpdsn-gg")&&(s="google");e.hasClass("wpdsn-ds")&&(s="disqus");e.hasClass("wpdsn-wp")&&(s="wordpress");e.hasClass("wpdsn-tw")&&(s="twitter");e.hasClass("wpdsn-vk")&&(s="vk");e.hasClass("wpdsn-ok")&&(s="ok");e.hasClass("wpdsn-linked")&&(s="linkedin");e.hasClass("wpdsn-yandex")&&(s="yandex");e.hasClass("wpdsn-mailru")&&(s="mailru");e.hasClass("wpdsn-weixin")&&(s="wechat");e.hasClass("wpdsn-weibo")&&(s="weibo");e.hasClass("wpdsn-qq")&&(s="qq");e.hasClass("wpdsn-baidu")&&(s="baidu");return s}(e(this)),s)}),e(document).on("click","#wpdcom .wpd-agreement-buttons-right .wpd-agreement-button",function(){var s=e(this).parents(".wpd-form-wrap, .wpd-form").find(".wpd-social-login-agreement").slideUp(700);e(this).hasClass("wpd-agreement-button-agree")&&(wpdiscuzAjaxObj.isCookiesEnabled&&Cookies.set("socialLoginAgreementConfirmed",1,{expires:30,path:"/"}),o(n,s))})});
assets/js/wpdiscuz-user-content.js CHANGED
@@ -1,4 +1,8 @@
1
  ;
 
 
 
 
2
  jQuery(document).ready(function ($) {
3
  var refreshAfterDeleting = 0;
4
  var isNativeAjaxEnabled = parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled);
@@ -84,16 +88,15 @@ jQuery(document).ready(function ($) {
84
  });
85
 
86
  $(document).on('click', '.wpd-delete-content.wpd-not-clicked', function () {
87
-
88
  var btn = $(this);
89
  var id = parseInt(btn.data('wpd-content-id'));
90
  if (!isNaN(id)) {
91
  var action = btn.data('wpd-delete-action');
92
- if (action == 'wpdDeleteComment' && !confirm(wpdiscuzUCObj.msgConfirmDeleteComment)) {
93
  return false;
94
- } else if (action == 'wpdCancelSubscription' && !confirm(wpdiscuzUCObj.msgConfirmCancelSubscription)) {
95
  return false;
96
- } else if (action == 'wpdCancelFollow' && !confirm(wpdiscuzUCObj.msgConfirmCancelFollow)) {
97
  return false;
98
  }
99
  var icon = $('i', btn);
@@ -102,7 +105,7 @@ jQuery(document).ready(function ($) {
102
  var childCount = $('.wpd-content-item.wpd-active').children('.wpd-item').length;
103
  btn.removeClass('wpd-not-clicked');
104
  icon.removeClass().addClass('fas fa-pulse fa-spinner');
105
- if (childCount == 1 && goToPage > 0) {
106
  goToPage = goToPage - 1;
107
  }
108
 
1
  ;
2
+ /* global jQuery */
3
+ /* global wpdiscuzAjaxObj */
4
+ /* global wpdiscuzUCObj */
5
+ /* global Cookies */
6
  jQuery(document).ready(function ($) {
7
  var refreshAfterDeleting = 0;
8
  var isNativeAjaxEnabled = parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled);
88
  });
89
 
90
  $(document).on('click', '.wpd-delete-content.wpd-not-clicked', function () {
 
91
  var btn = $(this);
92
  var id = parseInt(btn.data('wpd-content-id'));
93
  if (!isNaN(id)) {
94
  var action = btn.data('wpd-delete-action');
95
+ if (action === 'wpdDeleteComment' && !confirm(wpdiscuzUCObj.msgConfirmDeleteComment)) {
96
  return false;
97
+ } else if (action === 'wpdCancelSubscription' && !confirm(wpdiscuzUCObj.msgConfirmCancelSubscription)) {
98
  return false;
99
+ } else if (action === 'wpdCancelFollow' && !confirm(wpdiscuzUCObj.msgConfirmCancelFollow)) {
100
  return false;
101
  }
102
  var icon = $('i', btn);
105
  var childCount = $('.wpd-content-item.wpd-active').children('.wpd-item').length;
106
  btn.removeClass('wpd-not-clicked');
107
  icon.removeClass().addClass('fas fa-pulse fa-spinner');
108
+ if (childCount === 1 && goToPage > 0) {
109
  goToPage = goToPage - 1;
110
  }
111
 
assets/js/wpdiscuz-user-content.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(e){var t=0,n=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),d=parseInt(wpdiscuzUCObj.additionalTab);e(document).on("click",".wpd-info,.wpd-page-link,.wpd-delete-content,.wpd-user-email-delete-links",function(e){e.preventDefault()}),e(document).on("click",".wpd-info.wpd-not-clicked",function(t){var a=e(this);a.removeClass("wpd-not-clicked");var o=new FormData;return o.append("action","wpdGetInfo"),function(t,a){var o=e(".fas",t),i=o.attr("class");o.removeClass(),o.addClass("fas fa-pulse fa-spinner"),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,a).done(function(n){t.addClass("wpd-not-clicked"),o.removeClass(),o.addClass(i),n&&(e("#wpdUserContentInfo").html(n),e("#wpdUserContentInfo ul.wpd-list .wpd-list-item:first-child").addClass("wpd-active"),e("#wpdUserContentInfo div.wpd-content .wpd-content-item:first-child").addClass("wpd-active"),e("#wpdUserContentInfo").is(":visible")||e("#wpdUserContentInfoAnchor").trigger("click"))})}(a,o),!1}),e(document).on("click",".wpd-list-item",function(){var t=e("input.wpd-rel",this).val();e("#wpdUserContentInfo .wpd-list-item").removeClass("wpd-active"),e("#wpdUserContentInfo .wpd-content-item").removeClass("wpd-active");var a=e(this);if(e("#wpdUserContentInfo #"+t).text().length)a.addClass("wpd-active"),e("#wpdUserContentInfo #"+t).addClass("wpd-active");else{var o=new FormData;o.append("action",a.attr("data-action")),o.append("page",0),e("#wpdUserContentInfo #"+t).addClass("wpd-active"),e("#wpdUserContentInfo #"+t).css("text-align","center"),wpdiscuzAjaxObj.getAjaxObj(n||d,!0,o).done(function(n){n&&(e("#wpdUserContentInfo #"+t).css("text-align",""),a.addClass("wpd-active"),e("#wpdUserContentInfo #"+t).html(n)),e("#wpdiscuz-loading-bar").hide()})}}),e(document).on("click",".wpd-page-link.wpd-not-clicked",function(t){var a=e(this);a.removeClass("wpd-not-clicked");var o=a.data("wpd-page"),i=e(".wpd-active .wpd-pagination .wpd-action").val(),s=new FormData;s.append("action",i),s.append("page",o),wpdiscuzAjaxObj.getAjaxObj(n||d,!0,s).done(function(t){a.addClass("wpd-not-clicked"),t&&e(".wpd-content-item.wpd-active").html(t),e("#wpdiscuz-loading-bar").hide()})}),e(document).on("click",".wpd-delete-content.wpd-not-clicked",function(){var a=e(this),o=parseInt(a.data("wpd-content-id"));if(!isNaN(o)){var i=a.data("wpd-delete-action");if("wpdDeleteComment"==i&&!confirm(wpdiscuzUCObj.msgConfirmDeleteComment))return!1;if("wpdCancelSubscription"==i&&!confirm(wpdiscuzUCObj.msgConfirmCancelSubscription))return!1;if("wpdCancelFollow"==i&&!confirm(wpdiscuzUCObj.msgConfirmCancelFollow))return!1;var s=e("i",a),c=s.attr("class"),p=e(".wpd-wrapper .wpd-page-number").val(),l=e(".wpd-content-item.wpd-active").children(".wpd-item").length;a.removeClass("wpd-not-clicked"),s.removeClass().addClass("fas fa-pulse fa-spinner"),1==l&&p>0&&(p-=1);var w=new FormData;w.append("id",o),w.append("page",p),w.append("action",i),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,w).done(function(n){a.addClass("wpd-not-clicked"),s.removeClass().addClass(c),e(".wpd-content-item.wpd-active").html(n),t=1})}}),e(document).on("click","[data-lity-close]",function(n){e(n.target).is("[data-lity-close]")&&t&&window.location.reload(!0)}),e(document).on("click",".wpd-user-email-delete-links.wpd-not-clicked",function(){var t=e(this);t.removeClass("wpd-not-clicked"),e(".wpd-loading",t).addClass("wpd-show");var a=new FormData;a.append("action","wpdEmailDeleteLinks"),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,a).done(function(n){t.addClass("wpd-not-clicked"),e("[data-lity-close]",window.parent.document).trigger("click")})}),e(document).on("click",".wpd-user-settings-button.wpd-not-clicked",function(){var t=e(this);t.removeClass("wpd-not-clicked");var a=t.data("wpd-delete-action");if("deleteCookies"!==a){t.find(".wpd-loading").addClass("wpd-show");var o=new FormData;o.append("action","wpdGuestAction"),o.append("guestAction",a),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,o).done(function(n){t.addClass("wpd-not-clicked"),t.find(".wpd-loading").removeClass("wpd-show");try{var d=e.parseJSON(n);t.after(d.message);var a=t.next(".wpd-guest-action-message");a.fadeIn(100).fadeOut(7e3,function(){a.remove(),1===parseInt(d.code)&&(t.parent().remove(),e(".wpd-delete-all-comments").length||e(".wpd-delete-all-subscriptions").length||e(".wpd-delete-all-cookies").parent().addClass("wpd-show"))})}catch(e){console.log(e)}})}else!function(){for(var e=document.cookie.split(";"),t=0;t<e.length;t++){var n=e[t],d=n.indexOf("="),a=d>-1?n.substr(0,d):n;Cookies.remove(a.trim())}location.reload(!0)}()})});
1
+ jQuery(document).ready(function(e){var t=0,n=parseInt(wpdiscuzAjaxObj.isNativeAjaxEnabled),d=parseInt(wpdiscuzUCObj.additionalTab);e(document).on("click",".wpd-info,.wpd-page-link,.wpd-delete-content,.wpd-user-email-delete-links",function(e){e.preventDefault()}),e(document).on("click",".wpd-info.wpd-not-clicked",function(t){var a=e(this);a.removeClass("wpd-not-clicked");var o=new FormData;return o.append("action","wpdGetInfo"),function(t,a){var o=e(".fas",t),i=o.attr("class");o.removeClass(),o.addClass("fas fa-pulse fa-spinner"),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,a).done(function(n){t.addClass("wpd-not-clicked"),o.removeClass(),o.addClass(i),n&&(e("#wpdUserContentInfo").html(n),e("#wpdUserContentInfo ul.wpd-list .wpd-list-item:first-child").addClass("wpd-active"),e("#wpdUserContentInfo div.wpd-content .wpd-content-item:first-child").addClass("wpd-active"),e("#wpdUserContentInfo").is(":visible")||e("#wpdUserContentInfoAnchor").trigger("click"))})}(a,o),!1}),e(document).on("click",".wpd-list-item",function(){var t=e("input.wpd-rel",this).val();e("#wpdUserContentInfo .wpd-list-item").removeClass("wpd-active"),e("#wpdUserContentInfo .wpd-content-item").removeClass("wpd-active");var a=e(this);if(e("#wpdUserContentInfo #"+t).text().length)a.addClass("wpd-active"),e("#wpdUserContentInfo #"+t).addClass("wpd-active");else{var o=new FormData;o.append("action",a.attr("data-action")),o.append("page",0),e("#wpdUserContentInfo #"+t).addClass("wpd-active"),e("#wpdUserContentInfo #"+t).css("text-align","center"),wpdiscuzAjaxObj.getAjaxObj(n||d,!0,o).done(function(n){n&&(e("#wpdUserContentInfo #"+t).css("text-align",""),a.addClass("wpd-active"),e("#wpdUserContentInfo #"+t).html(n)),e("#wpdiscuz-loading-bar").hide()})}}),e(document).on("click",".wpd-page-link.wpd-not-clicked",function(t){var a=e(this);a.removeClass("wpd-not-clicked");var o=a.data("wpd-page"),i=e(".wpd-active .wpd-pagination .wpd-action").val(),s=new FormData;s.append("action",i),s.append("page",o),wpdiscuzAjaxObj.getAjaxObj(n||d,!0,s).done(function(t){a.addClass("wpd-not-clicked"),t&&e(".wpd-content-item.wpd-active").html(t),e("#wpdiscuz-loading-bar").hide()})}),e(document).on("click",".wpd-delete-content.wpd-not-clicked",function(){var a=e(this),o=parseInt(a.data("wpd-content-id"));if(!isNaN(o)){var i=a.data("wpd-delete-action");if("wpdDeleteComment"===i&&!confirm(wpdiscuzUCObj.msgConfirmDeleteComment))return!1;if("wpdCancelSubscription"===i&&!confirm(wpdiscuzUCObj.msgConfirmCancelSubscription))return!1;if("wpdCancelFollow"===i&&!confirm(wpdiscuzUCObj.msgConfirmCancelFollow))return!1;var s=e("i",a),c=s.attr("class"),p=e(".wpd-wrapper .wpd-page-number").val(),l=e(".wpd-content-item.wpd-active").children(".wpd-item").length;a.removeClass("wpd-not-clicked"),s.removeClass().addClass("fas fa-pulse fa-spinner"),1===l&&p>0&&(p-=1);var w=new FormData;w.append("id",o),w.append("page",p),w.append("action",i),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,w).done(function(n){a.addClass("wpd-not-clicked"),s.removeClass().addClass(c),e(".wpd-content-item.wpd-active").html(n),t=1})}}),e(document).on("click","[data-lity-close]",function(n){e(n.target).is("[data-lity-close]")&&t&&window.location.reload(!0)}),e(document).on("click",".wpd-user-email-delete-links.wpd-not-clicked",function(){var t=e(this);t.removeClass("wpd-not-clicked"),e(".wpd-loading",t).addClass("wpd-show");var a=new FormData;a.append("action","wpdEmailDeleteLinks"),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,a).done(function(n){t.addClass("wpd-not-clicked"),e("[data-lity-close]",window.parent.document).trigger("click")})}),e(document).on("click",".wpd-user-settings-button.wpd-not-clicked",function(){var t=e(this);t.removeClass("wpd-not-clicked");var a=t.data("wpd-delete-action");if("deleteCookies"!==a){t.find(".wpd-loading").addClass("wpd-show");var o=new FormData;o.append("action","wpdGuestAction"),o.append("guestAction",a),wpdiscuzAjaxObj.getAjaxObj(n||d,!1,o).done(function(n){t.addClass("wpd-not-clicked"),t.find(".wpd-loading").removeClass("wpd-show");try{var d=e.parseJSON(n);t.after(d.message);var a=t.next(".wpd-guest-action-message");a.fadeIn(100).fadeOut(7e3,function(){a.remove(),1===parseInt(d.code)&&(t.parent().remove(),e(".wpd-delete-all-comments").length||e(".wpd-delete-all-subscriptions").length||e(".wpd-delete-all-cookies").parent().addClass("wpd-show"))})}catch(e){console.log(e)}})}else!function(){for(var e=document.cookie.split(";"),t=0;t<e.length;t++){var n=e[t],d=n.indexOf("="),a=d>-1?n.substr(0,d):n;Cookies.remove(a.trim())}location.reload(!0)}()})});
class.WpdiscuzCore.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  * Plugin Name: wpDiscuz
4
  * Description: #1 WordPress Comment Plugin. Innovative, modern and feature-rich comment system to supercharge your website comment section.
5
- * Version: 7.1.2
6
  * Author: gVectors Team
7
  * Author URI: https://gvectors.com/
8
  * Plugin URI: https://wpdiscuz.com/
2
  /*
3
  * Plugin Name: wpDiscuz
4
  * Description: #1 WordPress Comment Plugin. Innovative, modern and feature-rich comment system to supercharge your website comment section.
5
+ * Version: 7.1.3
6
  * Author: gVectors Team
7
  * Author URI: https://gvectors.com/
8
  * Plugin URI: https://wpdiscuz.com/
includes/class.WpdiscuzDBManager.php CHANGED
@@ -732,15 +732,18 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
732
 
733
  public function getSubscriptionsCount($userEmail) {
734
  $sql = $this->db->prepare("SELECT COUNT(*) FROM `{$this->emailNotification}` WHERE `email` = %s;", trim($userEmail));
735
- $result = $this->db->get_var($sql);
736
- return $result;
737
  }
738
 
739
  public function getSubscriptions($userEmail, $limit, $offset) {
740
  $limitCondition = ($l = intval($limit)) > 0 ? "LIMIT $l OFFSET $offset" : "";
741
  $sql = $this->db->prepare("SELECT * FROM `{$this->emailNotification}` WHERE `email` = %s $limitCondition;", trim($userEmail));
742
- $result = $this->db->get_results($sql);
743
- return $result;
 
 
 
 
744
  }
745
 
746
  public function unsubscribeById($sId) {
@@ -756,15 +759,18 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
756
  // FOLLOWS
757
  public function getFollowsCount($userEmail) {
758
  $sql = $this->db->prepare("SELECT COUNT(*) FROM `{$this->followUsers}` WHERE `follower_email` = %s;", trim($userEmail));
759
- $result = $this->db->get_var($sql);
760
- return $result;
761
  }
762
 
763
  public function getFollows($userEmail, $limit, $offset) {
764
  $limitCondition = ($l = intval($limit)) > 0 ? "LIMIT $l OFFSET $offset" : "";
765
  $sql = $this->db->prepare("SELECT * FROM `{$this->followUsers}` WHERE `follower_email` = %s $limitCondition;", trim($userEmail));
766
- $result = $this->db->get_results($sql);
767
- return $result;
 
 
 
 
768
  }
769
 
770
  public function unfollowById($fId) {
732
 
733
  public function getSubscriptionsCount($userEmail) {
734
  $sql = $this->db->prepare("SELECT COUNT(*) FROM `{$this->emailNotification}` WHERE `email` = %s;", trim($userEmail));
735
+ return $this->db->get_var($sql);
 
736
  }
737
 
738
  public function getSubscriptions($userEmail, $limit, $offset) {
739
  $limitCondition = ($l = intval($limit)) > 0 ? "LIMIT $l OFFSET $offset" : "";
740
  $sql = $this->db->prepare("SELECT * FROM `{$this->emailNotification}` WHERE `email` = %s $limitCondition;", trim($userEmail));
741
+ return $this->db->get_results($sql);
742
+ }
743
+
744
+ public function getSubscriptionById($sId) {
745
+ $sql = $this->db->prepare("SELECT * FROM `{$this->emailNotification}` WHERE `id` = %d;", $sId);
746
+ return $this->db->get_row($sql);
747
  }
748
 
749
  public function unsubscribeById($sId) {
759
  // FOLLOWS
760
  public function getFollowsCount($userEmail) {
761
  $sql = $this->db->prepare("SELECT COUNT(*) FROM `{$this->followUsers}` WHERE `follower_email` = %s;", trim($userEmail));
762
+ return $this->db->get_var($sql);
 
763
  }
764
 
765
  public function getFollows($userEmail, $limit, $offset) {
766
  $limitCondition = ($l = intval($limit)) > 0 ? "LIMIT $l OFFSET $offset" : "";
767
  $sql = $this->db->prepare("SELECT * FROM `{$this->followUsers}` WHERE `follower_email` = %s $limitCondition;", trim($userEmail));
768
+ return $this->db->get_results($sql);
769
+ }
770
+
771
+ public function getFollowById($fId) {
772
+ $sql = $this->db->prepare("SELECT * FROM `{$this->followUsers}` WHERE `id` = %d;", $fId);
773
+ return $this->db->get_row($sql);
774
  }
775
 
776
  public function unfollowById($fId) {
options/options-layouts/html-login.php CHANGED
@@ -106,7 +106,7 @@ if (!defined("ABSPATH")) {
106
  <label for="showFollowsTab"></label>
107
  </div>
108
  <div class="wpd-optset-label">
109
- <label for="showFollowsTab"><?php esc_html_e("Show Followers Tab", "wpdiscuz") ?></label>
110
  </div>
111
  </div>
112
  </div>
106
  <label for="showFollowsTab"></label>
107
  </div>
108
  <div class="wpd-optset-label">
109
+ <label for="showFollowsTab"><?php esc_html_e("Show Follows Tab", "wpdiscuz") ?></label>
110
  </div>
111
  </div>
112
  </div>
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.6
6
- Stable tag: 7.1.2
7
  Requires PHP: 5.4 and higher
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -179,16 +179,22 @@ Nothing will be lost! **Comments - wpDiscuz** will show all old comments.
179
 
180
  == Changelog ==
181
 
182
- = Comments - wpDiscuz v7.1.2 =
183
 
184
- * Fixed Bug: Guest doesn't see comments
185
- * Fixed Bug: Some issues with the previous version.
186
 
187
  **IMPORTANT!**
188
  1. Please don't forget delete all caches and purge CDN after the update.
189
  2. If you're updating from 5.x.x versions please read this topic: [https://wordpress.org/support/topic/before-updating-to-wpdiscuz-7-version/](https://wordpress.org/support/topic/before-updating-to-wpdiscuz-7-version/)
190
 
191
 
 
 
 
 
 
 
192
  = Comments - wpDiscuz v7.1.1 =
193
 
194
  * Added: Auto-cleanup of orphaned comment attachments
3
  Tags: comment, comments, ajax comments, comment form, comment fields
4
  Requires at least: 5.0
5
  Tested up to: 5.6
6
+ Stable tag: 7.1.3
7
  Requires PHP: 5.4 and higher
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
179
 
180
  == Changelog ==
181
 
182
+ = Comments - wpDiscuz v7.1.3 =
183
 
184
+ * Updated: Better protection of AJAX requests
185
+ * Updated: Better optimization of AJAX requests
186
 
187
  **IMPORTANT!**
188
  1. Please don't forget delete all caches and purge CDN after the update.
189
  2. If you're updating from 5.x.x versions please read this topic: [https://wordpress.org/support/topic/before-updating-to-wpdiscuz-7-version/](https://wordpress.org/support/topic/before-updating-to-wpdiscuz-7-version/)
190
 
191
 
192
+ = Comments - wpDiscuz v7.1.2 =
193
+
194
+ * Fixed Bug: Guest doesn't see comments
195
+ * Fixed Bug: Some issues with the previous version.
196
+
197
+
198
  = Comments - wpDiscuz v7.1.1 =
199
 
200
  * Added: Auto-cleanup of orphaned comment attachments
utils/ajax/wpdiscuz-ajax.php CHANGED
@@ -109,13 +109,10 @@ add_action("wpdiscuz_wpdGetFollowsPage", [$wpdiscuz->helper, "getFollowsPage"]);
109
  add_action("wpdiscuz_nopriv_wpdGetFollowsPage", [$wpdiscuz->helper, "getFollowsPage"]);
110
  // Delete users" comment
111
  add_action("wpdiscuz_wpdDeleteComment", [$wpdiscuz->helperAjax, "deleteComment"]);
112
- add_action("wpdiscuz_nopriv_wpdDeleteComment", [$wpdiscuz->helperAjax, "deleteComment"]);
113
  // Delete users" subscription
114
  add_action("wpdiscuz_wpdCancelSubscription", [$wpdiscuz->helperAjax, "deleteSubscription"]);
115
- add_action("wpdiscuz_nopriv_wpdCancelSubscription", [$wpdiscuz->helperAjax, "deleteSubscription"]);
116
  // Delete users" follow
117
  add_action("wpdiscuz_wpdCancelFollow", [$wpdiscuz->helperAjax, "deleteFollow"]);
118
- add_action("wpdiscuz_nopriv_wpdCancelFollow", [$wpdiscuz->helperAjax, "deleteFollow"]);
119
  // Email to user the delete links
120
  add_action("wpdiscuz_wpdEmailDeleteLinks", [$wpdiscuz->helperAjax, "emailDeleteLinks"]);
121
  // Guest action
109
  add_action("wpdiscuz_nopriv_wpdGetFollowsPage", [$wpdiscuz->helper, "getFollowsPage"]);
110
  // Delete users" comment
111
  add_action("wpdiscuz_wpdDeleteComment", [$wpdiscuz->helperAjax, "deleteComment"]);
 
112
  // Delete users" subscription
113
  add_action("wpdiscuz_wpdCancelSubscription", [$wpdiscuz->helperAjax, "deleteSubscription"]);
 
114
  // Delete users" follow
115
  add_action("wpdiscuz_wpdCancelFollow", [$wpdiscuz->helperAjax, "deleteFollow"]);
 
116
  // Email to user the delete links
117
  add_action("wpdiscuz_wpdEmailDeleteLinks", [$wpdiscuz->helperAjax, "emailDeleteLinks"]);
118
  // Guest action
utils/class.WpdiscuzHelperAjax.php CHANGED
@@ -32,11 +32,8 @@ class WpdiscuzHelperAjax implements WpDiscuzConstants {
32
  add_action("wp_ajax_wpdFixTables", [&$this, "fixTables"]);
33
  if ($this->options->login["showActivityTab"] || $this->options->login["showSubscriptionsTab"] || $this->options->login["showFollowsTab"]) {
34
  add_action("wp_ajax_wpdDeleteComment", [&$this, "deleteComment"]);
35
- add_action("wp_ajax_nopriv_wpdDeleteComment", [&$this, "deleteComment"]);
36
  add_action("wp_ajax_wpdCancelSubscription", [&$this, "deleteSubscription"]);
37
- add_action("wp_ajax_nopriv_wpdCancelSubscription", [&$this, "deleteSubscription"]);
38
  add_action("wp_ajax_wpdCancelFollow", [&$this, "deleteFollow"]);
39
- add_action("wp_ajax_nopriv_wpdCancelFollow", [&$this, "deleteFollow"]);
40
  add_action("wp_ajax_wpdEmailDeleteLinks", [&$this, "emailDeleteLinks"]);
41
  add_action("wp_ajax_nopriv_wpdGuestAction", [&$this, "guestAction"]);
42
  }
@@ -243,20 +240,29 @@ class WpdiscuzHelperAjax implements WpDiscuzConstants {
243
 
244
  public function deleteComment() {
245
  $commentId = isset($_POST["id"]) ? intval($_POST["id"]) : 0;
246
- wp_delete_comment($commentId, true);
247
- $this->helper->getActivityPage();
 
 
 
248
  }
249
 
250
  public function deleteSubscription() {
251
  $subscriptionId = isset($_POST["id"]) ? intval($_POST["id"]) : 0;
252
- $this->dbManager->unsubscribeById($subscriptionId);
253
- $this->helper->getSubscriptionsPage();
 
 
 
254
  }
255
 
256
  public function deleteFollow() {
257
  $followId = isset($_POST["id"]) ? intval($_POST["id"]) : 0;
258
- $this->dbManager->unfollowById($followId);
259
- $this->helper->getFollowsPage();
 
 
 
260
  }
261
 
262
  public function emailDeleteLinks() {
32
  add_action("wp_ajax_wpdFixTables", [&$this, "fixTables"]);
33
  if ($this->options->login["showActivityTab"] || $this->options->login["showSubscriptionsTab"] || $this->options->login["showFollowsTab"]) {
34
  add_action("wp_ajax_wpdDeleteComment", [&$this, "deleteComment"]);
 
35
  add_action("wp_ajax_wpdCancelSubscription", [&$this, "deleteSubscription"]);
 
36
  add_action("wp_ajax_wpdCancelFollow", [&$this, "deleteFollow"]);
 
37
  add_action("wp_ajax_wpdEmailDeleteLinks", [&$this, "emailDeleteLinks"]);
38
  add_action("wp_ajax_nopriv_wpdGuestAction", [&$this, "guestAction"]);
39
  }
240
 
241
  public function deleteComment() {
242
  $commentId = isset($_POST["id"]) ? intval($_POST["id"]) : 0;
243
+ $currentUser = WpdiscuzHelper::getCurrentUser();
244
+ if ($commentId && !empty($currentUser->ID) && $this->options->login["showActivityTab"] && ($comment = get_comment($commentId)) && intval($currentUser->ID) === intval($comment->user_id)) {
245
+ wp_delete_comment($commentId, true);
246
+ $this->helper->getActivityPage();
247
+ }
248
  }
249
 
250
  public function deleteSubscription() {
251
  $subscriptionId = isset($_POST["id"]) ? intval($_POST["id"]) : 0;
252
+ $currentUser = WpdiscuzHelper::getCurrentUser();
253
+ if ($subscriptionId && !empty($currentUser->ID) && $this->options->login["showSubscriptionsTab"] && ($subscription = $this->dbManager->getSubscriptionById($subscriptionId)) && $currentUser->user_email === $subscription->email) {
254
+ $this->dbManager->unsubscribeById($subscriptionId);
255
+ $this->helper->getSubscriptionsPage();
256
+ }
257
  }
258
 
259
  public function deleteFollow() {
260
  $followId = isset($_POST["id"]) ? intval($_POST["id"]) : 0;
261
+ $currentUser = WpdiscuzHelper::getCurrentUser();
262
+ if ($followId && !empty($currentUser->ID) && $this->options->login["showFollowsTab"] && ($follow = $this->dbManager->getFollowById($followId)) && $currentUser->ID === intval($follow->follower_id)) {
263
+ $this->dbManager->unfollowById($followId);
264
+ $this->helper->getFollowsPage();
265
+ }
266
  }
267
 
268
  public function emailDeleteLinks() {