From 9929f59714461a0517b7bdf315429802d667c3ac Mon Sep 17 00:00:00 2001 From: Yudhisthir Nahar Date: Fri, 29 Nov 2024 02:40:00 +0530 Subject: [PATCH 1/3] PROD-8092 Update reactions popup refresh logic --- src/bp-templates/bp-nouveau/js/bb-activity-reacted.js | 6 +++++- src/bp-templates/bp-nouveau/js/bb-activity-reacted.min.js | 2 +- src/bp-templates/bp-nouveau/js/buddypress-activity.js | 7 +++++++ src/bp-templates/bp-nouveau/js/buddypress-activity.min.js | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/bp-templates/bp-nouveau/js/bb-activity-reacted.js b/src/bp-templates/bp-nouveau/js/bb-activity-reacted.js index 6e4ee30233..0521e7f529 100644 --- a/src/bp-templates/bp-nouveau/js/bb-activity-reacted.js +++ b/src/bp-templates/bp-nouveau/js/bb-activity-reacted.js @@ -77,7 +77,10 @@ window.bp = window.bp || {}; target.find( '#reaction-content-' + item_id + ' .reaction-loader' ).remove(); target.find( '#reaction-content-' + item_id + ' .activity_reaction_popup_error' ).remove(); - if ( '' === $.trim( target.find( '#reaction-content-' + item_id ).html() ) ) { + if ( '' === $.trim( target.find( '#reaction-content-' + item_id ).html() ) || target.parent().hasClass( 'bb-has-reaction_update' ) ) { + if ( '' !== $.trim( target.find( '#reaction-content-' + item_id ).html() ) ) { + target.find( '#reaction-content-' + item_id ).html(''); + } self.collections[ collection_key ] = new bp.Collections.ActivityReactionCollection(); self.loader[ item_id ] = new bp.Views.ReactionPopup( { @@ -87,6 +90,7 @@ window.bp = window.bp || {}; item_type: item_type, } ); + target.parent().removeClass( 'bb-has-reaction_update' ); } target.show(); } diff --git a/src/bp-templates/bp-nouveau/js/bb-activity-reacted.min.js b/src/bp-templates/bp-nouveau/js/bb-activity-reacted.min.js index d6018d2fe8..92cc78e85c 100644 --- a/src/bp-templates/bp-nouveau/js/bb-activity-reacted.min.js +++ b/src/bp-templates/bp-nouveau/js/bb-activity-reacted.min.js @@ -1 +1 @@ -window.wp=window.wp||{},window.bp=window.bp||{},function(c){"undefined"!=typeof BP_Nouveau&&(_.extend(bp,_.pick(wp,"Backbone","ajax","template")),bp.Models=bp.Models||{},bp.Collections=bp.Collections||{},bp.Views=bp.Views||{},bp.Nouveau=bp.Nouveau||{},bp.Nouveau.ActivityReaction={start:function(){this.views=new Backbone.Collection,this.collections=[],this.types=[],this.fetchXhr=null,this.loader=[],this.loader_html=c('

'),this.addListeners(),this.Initialize()},addListeners:function(){c(document).on("click",".activity-state-reactions",this.showActivityReactions)},Initialize:function(){},showActivityReactions:function(t){t.preventDefault();var e=bp.Nouveau.ActivityReaction,i=c(t.currentTarget),a=i.next(".activity-state-popup"),o=0,t="",t=0 ul")&&(n=this).targetElement.find(".activity-state-popup_tab_item > ul").each(function(){c(this).on("scroll",_.bind(n.onScrollLoadMore,n))})):this.onOpenFailedRender(t,e,i),this},onOpenFailedRender:function(t,e,i){this.loader.remove(),void 0!==e.statusText&&"abort"===e.statusText||(e={collection:i.collection,data:e.success?{}:e.data},this.targetElement.find(".activity_reaction_popup_error").remove(),e=new bp.Views.ReactionErrorHandle(e),this.targetElement.append(e.render().el))},onScrollLoadMore:function(t){var e,i,a,arguments,o,n=t.currentTarget,s=c(n);c(n).hasClass("loading")||(e=n.scrollHeight-s.scrollTop()-s.outerHeight(),i=s.parents(".activity-state-popup_tab_item").attr("data-reaction-id"),a=parseInt(s.parents(".activity-state-popup_tab_item").attr("data-total-pages")),void 0===(o=s.parents(".activity-state-popup_tab_item").attr("data-paged"))&&(o=1),e<=10&&o a",_.bind(this.LoadTabData,this)),this.args={collection:this.options.collection,item_id:this.options.item_id,item_type:this.options.item_type,model:this.model}},render:function(){return this.$el.html(this.template(this.options.data)),this},LoadTabData:function(t){var arguments,e=c(t.currentTarget),i=e.data("tab"),e=e.parents(".activity-state-popup_tab").find("."+i);0

'),this.addListeners(),this.Initialize()},addListeners:function(){c(document).on("click",".activity-state-reactions",this.showActivityReactions)},Initialize:function(){},showActivityReactions:function(t){t.preventDefault();var e=bp.Nouveau.ActivityReaction,i=c(t.currentTarget),a=i.next(".activity-state-popup"),o=0,t="",t=0 ul")&&(n=this).targetElement.find(".activity-state-popup_tab_item > ul").each(function(){c(this).on("scroll",_.bind(n.onScrollLoadMore,n))})):this.onOpenFailedRender(t,e,i),this},onOpenFailedRender:function(t,e,i){this.loader.remove(),void 0!==e.statusText&&"abort"===e.statusText||(e={collection:i.collection,data:e.success?{}:e.data},this.targetElement.find(".activity_reaction_popup_error").remove(),e=new bp.Views.ReactionErrorHandle(e),this.targetElement.append(e.render().el))},onScrollLoadMore:function(t){var e,i,a,arguments,o,n=t.currentTarget,s=c(n);c(n).hasClass("loading")||(e=n.scrollHeight-s.scrollTop()-s.outerHeight(),i=s.parents(".activity-state-popup_tab_item").attr("data-reaction-id"),a=parseInt(s.parents(".activity-state-popup_tab_item").attr("data-total-pages")),void 0===(o=s.parents(".activity-state-popup_tab_item").attr("data-paged"))&&(o=1),e<=10&&o a",_.bind(this.LoadTabData,this)),this.args={collection:this.options.collection,item_id:this.options.item_id,item_type:this.options.item_type,model:this.model}},render:function(){return this.$el.html(this.template(this.options.data)),this},LoadTabData:function(t){var arguments,e=c(t.currentTarget),i=e.data("tab"),e=e.parents(".activity-state-popup_tab").find("."+i);0li.bb-edit-privacy a",bp.Nouveau,this.activityPrivacyRedirect.bind(this)),Z('#buddypress [data-bp-list="activity"], #activity-modal').on("click",".activity-privacy>li:not(.bb-edit-privacy)",bp.Nouveau,this.activityPrivacyChange.bind(this)),Z('#buddypress [data-bp-list="activity"], #bb-media-model-container .activity-list, #activity-modal').on("click","span.privacy",bp.Nouveau,this.togglePrivacyDropdown.bind(this)),Z("#bb-media-model-container .activity-list").on("click",".activity-item",bp.Nouveau,this.activityActions.bind(this)),Z(".bb-activity-model-wrapper").on("click",".ac-form-placeholder",bp.Nouveau,this.activityRootComment.bind(this)),Z(document).keydown(this.commentFormAction),Z(document).click(this.togglePopupDropdown),Z('#buddypress [data-bp-list="activity"], #bb-media-model-container .activity-list, #activity-modal .activity-list, .bb-modal-activity-footer').on("click",".ac-reply-media-button",this.openCommentsMediaUploader.bind(this)),Z('#buddypress [data-bp-list="activity"], #bb-media-model-container .activity-list, #activity-modal .activity-list, .bb-modal-activity-footer').on("click",".ac-reply-document-button",this.openCommentsDocumentUploader.bind(this)),Z('#buddypress [data-bp-list="activity"], #bb-media-model-container .activity-list, #activity-modal .activity-list, .bb-modal-activity-footer').on("click",".ac-reply-video-button",this.openCommentsVideoUploader.bind(this)),Z('#buddypress [data-bp-list="activity"], #bb-media-model-container .activity-list, #activity-modal .activity-list, .bb-modal-activity-footer').on("click",".ac-reply-gif-button",this.openGifPicker.bind(this)),Z(document).on("click",".activity-state-popup_overlay",bp.Nouveau,this.closeActivityState.bind(this)),Z(document).on("click",".activity-state-popup .activity-state-popup_tab_panel a",this.ReactionStatePopupTab),_.isUndefined(BP_Nouveau.activity.params.autoload)||Z(window).scroll(this.loadMoreActivities),Z(".bb-activity-model-wrapper, .bb-media-model-wrapper").on("click",".acomments-view-more",this.viewMoreComments.bind(this)),Z(document).on("click","#activity-stream .activity-comments .view-more-comments, #activity-stream .activity-state-comments > .comments-count",function(e){e.preventDefault(),Z(this).parents("li.activity-item").find(".activity-comments > ul > li.acomments-view-more, .activity-comments > .activity-actions > ul > li.acomments-view-more").trigger("click")}),Z("#activity-modal > .bb-modal-activity-body").on("scroll",this.autoloadMoreComments.bind(this)),Z("#activity-modal > .bb-modal-activity-body").on("scroll",this.discardGifEmojiPicker.bind(this)),Z(".bb-activity-model-wrapper .bb-model-close-button").on("click",this.activitySyncOnModalClose.bind(this)),void 0!==BP_Nouveau.is_send_ajax_request&&"1"===BP_Nouveau.is_send_ajax_request?Z("#buddypress").on("bp_ajax_request",'[data-bp-list="activity"]',function(){setTimeout(function(){Z(".ac-form.not-initialized").each(function(){var e=Z(this),t=e.find(".ac-textarea");bp.Nouveau.Activity.toggleMultiMediaOptions(e,t)})},1e3)}):setTimeout(function(){Z(".ac-form.not-initialized").each(function(){var e=Z(this),t=e.find(".ac-textarea");bp.Nouveau.Activity.toggleMultiMediaOptions(e,t)})},1e3)},heartbeatSend:function(e,t){this.heartbeat_data.first_recorded=Z("#buddypress [data-bp-list] [data-bp-activity-id]:not(.bb-pinned)").first().data("bp-timestamp")||0;var a=Z("#buddypress [data-bp-list] [data-bp-activity-id]").first().data("bp-timestamp")||0;a>this.heartbeat_data.first_recorded&&(this.heartbeat_data.first_recorded=a),(0===this.heartbeat_data.last_recorded||this.heartbeat_data.first_recorded>this.heartbeat_data.last_recorded)&&(this.heartbeat_data.last_recorded=this.heartbeat_data.first_recorded),t.bp_activity_last_recorded=this.heartbeat_data.last_recorded,Z("#buddypress .dir-search input[type=search]").length&&(t.bp_activity_last_recorded_search_terms=Z("#buddypress .dir-search input[type=search]").val()),Z.extend(t,{bp_heartbeat:bp.Nouveau.getStorage("bp-activity")})},heartbeatTick:function(e,t){var a,i,o=bp.Nouveau.objects,d=bp.Nouveau.getStorage("bp-activity","scope"),s=this;void 0!==t&&t.bp_activity_newest_activities&&(this.heartbeat_data.newest=Z.trim(t.bp_activity_newest_activities.activities)+this.heartbeat_data.newest,this.heartbeat_data.last_recorded=Number(t.bp_activity_newest_activities.last_recorded),i=Z(this.heartbeat_data.newest).filter(".activity-item"),a=Number(i.length),o.push("mentions"),"all"===d?(Z.each(i,function(e,a){a=Z(a),Z.each(o,function(e,t){-1!==Z.inArray("bp-my-"+t,a.get(0).classList)&&(void 0===s.heartbeat_data.highlights[t]?s.heartbeat_data.highlights[t]=[a.data("bp-activity-id")]:-1===Z.inArray(a.data("bp-activity-id"),s.heartbeat_data.highlights[t])&&s.heartbeat_data.highlights[t].push(a.data("bp-activity-id")))})}),t=new RegExp("bp-my-("+o.join("|")+")","g"),this.heartbeat_data.newest=this.heartbeat_data.newest.replace(t,""),Z(bp.Nouveau.objectNavParent+' [data-bp-scope="all"]').find("a span").html(a)):(this.heartbeat_data.highlights[d]=[],Z.each(i,function(e,t){s.heartbeat_data.highlights[d].push(Z(t).data("bp-activity-id"))})),Z.each(o,function(e,t){var a;void 0!==s.heartbeat_data.highlights[t]&&s.heartbeat_data.highlights[t].length&&(a=0,"mentions"===t&&(a=s.mentions_count),Z(bp.Nouveau.objectNavParent+' [data-bp-scope="'+t+'"]').find("a span").html(Number(s.heartbeat_data.highlights[t].length)+a))}),o.pop(),Z(document).prop("title","("+a+") "+this.heartbeat_data.document_title),Z('#buddypress [data-bp-list="activity"]').first().hasClass("load-newest")?(i=Z('#buddypress [data-bp-list="activity"] .load-newest a').html(),Z('#buddypress [data-bp-list="activity"] .load-newest a').html(i.replace(/([0-9]+)/,a))):Z('#buddypress [data-bp-list="activity"] ul.activity-list').prepend('
  • '+BP_Nouveau.newest+" ("+a+")
  • "),Z('#buddypress [data-bp-list="activity"] li.load-newest').trigger("click"),Z('#buddypress [data-bp-list="activity"]').trigger("bp_heartbeat_pending",this.heartbeat_data),void 0!==bp.Nouveau&&bp.Nouveau.reportPopUp())},injectActivities:function(e){var t,a,i,o,d=bp.Nouveau.getStorage("bp-activity"),s=d.scope||null,d=d.filter||null;Z(e.currentTarget).hasClass("load-newest")?(e.preventDefault(),Z(e.currentTarget).remove(),i=Z.parseHTML(this.heartbeat_data.newest),Z.each(i,function(e,t){"LI"===t.nodeName&&Z(t).hasClass("just-posted")&&Z("#"+Z(t).prop("id")).length&&Z("#"+Z(t).prop("id")).remove()}),(0<(i=Z(e.delegateTarget).find(".activity-list .activity-item").first()).length&&i.hasClass("bb-pinned")?Z(i).after(this.heartbeat_data.newest):Z(e.delegateTarget).find(".activity-list").prepend(this.heartbeat_data.newest)).find("li.activity-item").each(bp.Nouveau.hideSingleUrl).trigger("bp_heartbeat_prepend",this.heartbeat_data),this.heartbeat_data.newest="","all"===s&&Z(bp.Nouveau.objectNavParent+' [data-bp-scope="all"]').find("a span").html(""),"mentions"===s&&(bp.Nouveau.ajax({action:"activity_clear_new_mentions"},"activity"),this.mentions_count=0),Z(bp.Nouveau.objectNavParent+' [data-bp-scope="'+s+'"]').find("a span").html(""),void 0!==this.heartbeat_data.highlights[s]&&(this.heartbeat_data.highlights[s]=[]),setTimeout(function(){Z(e.delegateTarget).find("[data-bp-activity-id]").removeClass("newest_"+s+"_activity")},3e3),Z(document).prop("title",this.heartbeat_data.document_title),jQuery(window).scroll()):Z(e.currentTarget).hasClass("load-more")&&(t=+Number(this.current_page)+1,a=this,i="",e.preventDefault(),(o=Z(e.currentTarget)).find("a").first().addClass("loading"),this.just_posted=[],Z(e.delegateTarget).children(".just-posted").each(function(){a.just_posted.push(Z(this).data("bp-activity-id"))}),Z("#buddypress .dir-search input[type=search]").length&&(i=Z("#buddypress .dir-search input[type=search]").val()),bp.Nouveau.objectRequest({object:"activity",scope:s,filter:d,search_terms:i,page:t,method:"append",exclude_just_posted:this.just_posted.join(","),target:'#buddypress [data-bp-list]:not( #bb-schedule-posts_modal [data-bp-list="activity"] ) ul.bp-list'}).done(function(e){!0===e.success&&(o.remove(),a.current_page=t,jQuery(window).scroll())})),Z(".activity-item.bb-closed-comments").find(".edit-activity, .acomment-edit").parents(".generic-button").hide()},hideComments:function(e){var a,i,o,e=Z(e.target).find(".activity-comments");e.length&&e.each(function(e,t){o=Z(t).children("ul").not(".conflict-activity-ul-li-comment"),(i=Z(o).find("li").not(Z(".document-action-class, .media-action-class, .video-action-class"))).length&&(Z("body").hasClass("activity-singular")&&""!==window.location.hash&&Z(window.location.hash).length&&0!==Z(window.location.hash).closest(".activity-comments").length||(a=Z(t).closest(".activity-item"),Z("#acomment-comment-"+a.data("bp-activity-id")+" span.comment-count").html(),i.each(function(e,t){if(e"),window.location.hash&&"#"+Z(t).attr("id")===window.location.hash)return Z(t).parents("li.comment-item").show(),!1;Z(t).addClass("bp-hidden").hide()}}),Z(o).children(".bp-hidden").length===Z(o).children("li").length-1&&Z(o).find("li.show-all").length&&Z(o).children("li:not(.show-all)").removeClass("bp-hidden").toggle()))})},showActivity:function(e){e.preventDefault();var t=Z(e.currentTarget).parent(),a=t.data("parent_comment_id"),t=Z(t).data("activity_id");Z(document).trigger("activityModalOpened",{activityId:t}),Z(e.currentTarget).parents(".activity-comments").find(".ac-form").each(function(){var e=Z(this),t=Z(this).closest(".activity-comments"),a=Z(this).closest(".comment-item");e.find(".post-elements-buttons-item.post-emoji").removeClass("active").empty(""),bp.Nouveau.Activity.resetActivityCommentForm(e,"hardReset"),t.append(e),a.find(".acomment-display").removeClass("display-focus"),a.removeClass("comment-item-focus")}),bp.Nouveau.Activity.launchActivityPopup(t,a)},closeActivity:function(e){e.preventDefault();var t=Z(e.target).closest(".bb-activity-model-wrapper"),a=t.find(".bb-modal-activity-footer"),i=t.find(".activity-item").data("bp-activity-id"),e=t.find("#ac-form-"+i);bp.Nouveau.Activity.reinitializeActivityCommentForm(e),_.isUndefined(BP_Nouveau.media)||_.isUndefined(BP_Nouveau.media.emoji)||bp.Nouveau.Activity.initializeEmojioneArea(!1,"",i),t.find("#activity-modal").removeClass("bb-closed-comments"),t.closest("body").removeClass("acomments-modal-open"),t.hide(),t.find("ul.activity-list").empty(),a.removeClass("active"),a.find("form.ac-form").remove()},scopeLoaded:function(e,a){this.current_page=1,"mentions"===a.scope&&void 0!==a.response.new_mentions?(Z.each(a.response.new_mentions,function(e,t){Z("#buddypress #activity-stream").find('[data-bp-activity-id="'+t+'"]').addClass("newest_mentions_activity")}),this.mentions_count=0):void 0!==this.heartbeat_data.highlights[a.scope]&&this.heartbeat_data.highlights[a.scope].length&&Z.each(this.heartbeat_data.highlights[a.scope],function(e,t){Z("#buddypress #activity-stream").find('[data-bp-activity-id="'+t+'"]').length&&Z("#buddypress #activity-stream").find('[data-bp-activity-id="'+t+'"]').addClass("newest_"+a.scope+"_activity")}),this.heartbeat_data.newest="",Z.each(Z(bp.Nouveau.objectNavParent+" [data-bp-scope]").find("a span"),function(e,t){0===parseInt(Z(t).html(),10)&&Z(t).html("")}),void 0!==this.heartbeat_data.highlights[a.scope]&&(this.heartbeat_data.highlights[a.scope]=[]),Z(document).prop("title",this.heartbeat_data.document_title),setTimeout(function(){Z("#buddypress #activity-stream .activity-item").removeClass("newest_"+a.scope+"_activity")},3e3),void 0!==window.instgrm&&window.instgrm.Embeds.process(),void 0!==window.FB&&void 0!==window.FB.XFBML&&window.FB.XFBML.parse(),this.fixAtWhoActivity(),this.openEditActivityPopup(),this.navigateToSpecificComment(),setTimeout(function(){jQuery(window).scroll()},200)},openEditActivityPopup:function(){var e,t;!_.isUndefined(BP_Nouveau.activity.params.is_activity_edit)&&0 ul");if(e.data.redirect)return window.location.href=e.data.redirect;e.data.parent_activity_id&&e.data.activity&&Z("body:not(.activity-singular) #buddypress #activity-stream ul.activity-list li#activity-"+e.data.parent_activity_id).replaceWith(e.data.activity),k&&(x=1,i=B.find(".acomments-view-more").data("child-count"),c.append(B.find("form")),Z.each(B.find("li.comment-item"),function(){x+=1}),x+=void 0!==i?parseFloat(i):0,N=m.find("span.comments-count"),z=N.text().length?N.text().match(/\d+/)[0]:0,z=Number(z-x),p.length?(i=1 ul").html().trim()&&t.removeClass("has-child-comments")}),k||c.data("bp-timestamp")!==d.Activity.heartbeat_data.last_recorded||(d.Activity.heartbeat_data.newest="",d.Activity.heartbeat_data.last_recorded=0),Z(document).trigger("bp_activity_ajax_delete_request",Z.extend(A,{response:e})),Z(document).trigger("bp_activity_ajax_delete_request_video",Z.extend(A,{response:e})),bp.Nouveau.Activity.activityHasUpdates=!0,bp.Nouveau.Activity.currentActivityId=r}P.removeClass("active")})}if(l.closest("span").hasClass("activity-read-more")){var T=l.closest("div"),U=l.closest("span");if(C=null,Z(T).hasClass("activity-inner")?C=r:Z(T).hasClass("acomment-content")&&(C=l.closest("li").data("bp-activity-comment-id")),!C)return e;e.preventDefault(),Z(U).addClass("loading"),d.ajax({action:"get_single_activity_content",id:C},"activity").done(function(e){"object"!=typeof e&&0@'+L+" ";_.isUndefined(BP_Nouveau.activity.params.user_id)||(D=BP_Nouveau.activity.params.user_id);var L={offset:-(Z(window).height()/2-75),easing:"swing"},I=M.get(0);jQuery("body").hasClass("bb-is-mobile")?setTimeout(function(){var e=300/gi,"\n").replace(/<\/div>/gi,""),O={action:"new_activity_comment",_wpnonce_new_activity_comment:Z("#_wpnonce_new_activity_comment").val(),comment_id:C,form_id:r,content:H};Z("#_bp_as_nonce_"+r).val()&&(O["_bp_as_nonce_"+r]=Z("#_bp_as_nonce_"+r).val()),this.dropzone_media.length&&(O.media=this.dropzone_media),this.dropzone_document.length&&(O.document=this.dropzone_document),this.dropzone_video.length&&(O.video=this.dropzone_video,_.isEmpty(O.content)&&(O.content="​")),_.isUndefined(this.models[r])||(n=this.models[r],O.gif_data=this.models[r].get("gif_data")),O.content=O.content.replace(/ /g," "),s.hasClass("acomment-edit")&&(O.edit_comment=!0);var Q=0"):t.append("
      ")),Q?s.closest("#activity-modal").find(".bb-modal-activity-body .activity-comments, .bb-modal-activity-body .activity-comments .activity-actions").children("ul").append(Z(a)):t.children("ul").append(Z(a).hide().fadeIn(200)),Z(s).find(".ac-input").first().html(""),t.parent().addClass("has-comments"),t.parent().addClass("comments-loaded"),m.addClass("has-comments")),s.removeClass("acomment-edit");t=s.find(".ac-reply-content");if(0'+BP_Nouveau.activity.strings.commentPostError+""):(e=e.responseJSON&&e.responseJSON.message?e.responseJSON.message:e.statusText,s.find(".ac-reply-content").after('
      '+e+"
      "))})}if(l.hasClass("edit")&&l.hasClass("edit-activity")&&(e.preventDefault(),H=c.data("bp-activity"),O=""!==c.data("link-url")?c.data("link-url"):null,void 0!==H&&(bp.Nouveau.Activity.postForm.displayEditActivityForm(H,O),l.closest("li").hasClass("groups")?Z("#bp-nouveau-activity-form").addClass("group-activity"):Z("#bp-nouveau-activity-form").removeClass("group-activity"),void 0!==bp.Nouveau.Media&&void 0!==bp.Nouveau.Media.Theatre&&(bp.Nouveau.Media.Theatre.is_open_media||bp.Nouveau.Media.Theatre.is_open_document)&&(Z(document).find(".bb-close-media-theatre").trigger("click"),Z(document).find(".bb-close-document-theatre").trigger("click")))),v&&(l.hasClass("bb-open-media-theatre")||l.hasClass("bb-open-video-theatre")||l.hasClass("bb-open-document-theatre")||l.hasClass("document-detail-wrap-description-popup"))&&(e.preventDefault(),l.closest("#activity-modal").find(".bb-modal-activity-header .bb-close-action-popup").trigger("click")),l.hasClass("pin-activity")||l.hasClass("unpin-activity")){if(e.preventDefault(),!r)return e;l.closest(".activity-item").addClass("loading-pin");var V="pin";l.hasClass("unpin-activity")&&(V="unpin"),d.ajax({action:"activity_update_pinned_post",id:r,pin_action:V},"activity").done(function(e){var t,a,i,o,d,s,n;l.closest(".activity-item").removeClass("loading-pin"),void 0!==(e="object"!=typeof e?JSON.parse(e):e).data&&void 0!==e.data.feedback&&(t=l.closest("ul.activity-list"),n=v?l.closest(".buddypress-wrap").find("#activity-stream"):l.closest("#activity-stream"),e.success&&(a=bp.Nouveau.getStorage("bp-activity","scope"),o=i=!1,d="",l.closest("li.activity-item").hasClass("groups")&&(o=!0,d=(d=l.closest("li.activity-item").attr("class").match(/group-\d+/))[0].replace("group-","")),n.hasClass("single-user")?i=!1:(n.hasClass("activity")&&"all"===a&&!o||n.hasClass("single-group"))&&(i=!0),"pin"===V?(i&&t.find("li.activity-item").removeClass("bb-pinned"),s="li.activity-item:not(.groups)",o&&!n.hasClass("single-group")?s="li.activity-item.group-"+d:o&&n.hasClass("single-group")&&(s="li.activity-item"),t.find(s).each(function(){var e=Z(this).find(".unpin-activity");e.removeClass("unpin-activity").addClass("pin-activity"),o?e.find("span").html(BP_Nouveau.activity.strings.pinGroupPost):e.find("span").html(BP_Nouveau.activity.strings.pinPost)}),i&&l.closest("li.activity-item").addClass("bb-pinned"),l.addClass("unpin-activity"),l.removeClass("pin-activity"),l.closest("li.activity-item").hasClass("groups")?l.find("span").html(BP_Nouveau.activity.strings.unpinGroupPost):l.find("span").html(BP_Nouveau.activity.strings.unpinPost)):"unpin"===V&&(l.closest("li.activity-item").removeClass("bb-pinned"),l.addClass("pin-activity"),l.removeClass("unpin-activity"),l.closest("li.activity-item").hasClass("groups")?l.find("span").html(BP_Nouveau.activity.strings.pinGroupPost):l.find("span").html(BP_Nouveau.activity.strings.pinPost)),"all"===a&&i&&(bp.Nouveau.Activity.heartbeat_data.last_recorded=0,bp.Nouveau.refreshActivities())),Z(document).trigger("bb_trigger_toast_message",["","
      "+e.data.feedback+"
      ","success",null,!0]))}).fail(function(){l.closest(".activity-item").removeClass("loading-pin"),Z(document).trigger("bb_trigger_toast_message",["","
      "+BP_Nouveau.activity.strings.pinPostError+"
      ","error",null,!0])})}if(l.hasClass("bb-icon-bell-slash")||l.hasClass("bb-icon-bell")){if(e.preventDefault(),!r)return e;l.closest(".activity-item").addClass("loading-mute");var q="mute";l.hasClass("bb-icon-bell")&&(q="unmute"),d.ajax({action:"toggle_activity_notification_status",id:r,notification_toggle_action:q},"activity").done(function(e){l.closest(".activity-item").removeClass("loading-mute"),void 0!==(e="object"!=typeof e?JSON.parse(e):e).data&&void 0!==e.data.feedback&&(e.success&&("mute"===q?(l.closest("li.activity-item").addClass("bb-muted"),l.removeClass("bb-icon-bell-slash"),l.addClass("bb-icon-bell"),l.attr("title",BP_Nouveau.activity.strings.unmuteNotification),l.find("span").html(BP_Nouveau.activity.strings.unmuteNotification)):"unmute"===q&&(l.closest("li.activity-item").removeClass("bb-muted"),l.removeClass("bb-icon-bell"),l.addClass("bb-icon-bell-slash"),l.attr("title",BP_Nouveau.activity.strings.muteNotification),l.find("span").html(BP_Nouveau.activity.strings.muteNotification)),void 0!==bp.Nouveau.Activity.activityHasUpdates&&(bp.Nouveau.Activity.activityHasUpdates=!0)),Z(document).trigger("bb_trigger_toast_message",["","
      "+e.data.feedback+"
      ","success",null,!0])),v&&(bp.Nouveau.Activity.activityPinHasUpdates=!0),bp.Nouveau.Activity.activityHasUpdates=!0,bp.Nouveau.Activity.currentActivityId=r}).fail(function(){l.closest(".activity-item").removeClass("loading-pin"),Z(document).trigger("bb_trigger_toast_message",["","
      "+BP_Nouveau.activity.strings.pinPostError+"
      ","error",null,!0])})}if(l.hasClass("close-activity-comment")||l.hasClass("unclose-activity-comment")){if(e.preventDefault(),!r)return e;l.closest(".activity-item").addClass("loading-pin");var W="close_comments";l.hasClass("unclose-activity-comment")&&(W="unclose_comments"),d.ajax({action:"activity_update_close_comments",id:r,close_comments_action:W},"activity").done(function(e){var t;l.closest(".activity-item").removeClass("loading-pin"),void 0!==(e="object"!=typeof e?JSON.parse(e):e).data&&void 0!==e.data.feedback&&(e.success&&(t=Z("#activity-stream > .activity-list").find("[data-bp-activity-id="+r+"]"),l.closest(".activity-item").find(".bb-activity-closed-comments-notice").remove(),"close_comments"===W?(l.closest("li.activity-item").addClass("bb-closed-comments"),0'+e.data.feedback+""),0'+e.data.feedback+""))):"unclose_comments"===W&&(l.closest("li.activity-item.bb-closed-comments").find(".edit-activity, .acomment-edit").parents(".generic-button").show(),l.closest("li.activity-item").removeClass("bb-closed-comments"),0"+e.data.feedback+"",e.success?"success":"error",null,!0]))}).fail(function(){l.closest(".activity-item").removeClass("loading-pin"),Z(document).trigger("bb_trigger_toast_message",["","
      "+BP_Nouveau.activity.strings.closeCommentsError+"
      ","error",null,!0])})}},commentFormAction:function(e){var t,a;return(e=e||window.event).target?t=e.target:e.srcElement&&(t=e.srcElement),3===t.nodeType&&(t=t.parentNode),!0!==e.altKey&&!0!==e.metaKey&&"TEXTAREA"===t.tagName&&Z(t).hasClass("ac-input")?void(27===(a=e.keyCode||e.which)&&!1===e.ctrlKey?"TEXTAREA"===t.tagName&&Z(t).closest("form").slideUp(200):e.ctrlKey&&13===a&&Z(t).val()&&Z(t).closest("form").find("[type=submit]").first().trigger("click")):e},togglePopupDropdown:function(e){var t;return(e=e||window.event).target?t=e.target:e.srcElement&&(t=e.srcElement),3===t.nodeType&&(t=t.parentNode),!0===e.altKey||!0===e.metaKey||Z(t).hasClass("privacy-wrap")||Z(t).parent().hasClass("privacy-wrap")?e:void Z("ul.activity-privacy").removeClass("bb-open")},loadMoreActivities:function(){var e,t=Z(".load-more:visible").last(),a=Z(window);t.closest(".activity-list").length&&t.get(0)&&!t.data("bp-autoloaded")&&(e=t.offset().top-50,a.scrollTop()+a.height()>e&&(t.data("bp-autoloaded",1),t.find("a").text(BP_Nouveau.activity.strings.loadingMore),t.find("a").trigger("click")))},destroyCommentMediaUploader:function(e){_.isNull(this.dropzone_obj)||(this.dropzone_obj.destroy(),Z("#ac-reply-post-media-uploader-"+e).html(""),Z("#ac-reply-post-media-uploader-1-"+e).html("")),this.dropzone_media=[],Z("#ac-reply-post-media-uploader-"+e).removeClass("open").addClass("closed"),Z("#ac-reply-media-button-"+e).removeClass("active")},destroyCommentDocumentUploader:function(e){_.isNull(this.dropzone_document_obj)||(this.dropzone_document_obj.destroy(),Z("#ac-reply-post-document-uploader-"+e).html("")),this.dropzone_document=[],Z("#ac-reply-post-document-uploader-"+e).removeClass("open").addClass("closed"),Z("#ac-reply-document-button-"+e).removeClass("active")},destroyCommentVideoUploader:function(e){_.isNull(this.dropzone_video_obj)||(this.dropzone_video_obj.destroy(),Z("#ac-reply-post-video-uploader-"+e).html("")),this.dropzone_video=[],Z("#ac-reply-post-video-uploader-"+e).removeClass("open").addClass("closed"),Z("#ac-reply-video-button-"+e).removeClass("active")},resetGifPicker:function(e){Z("#ac-reply-gif-button-"+e).closest(".post-gif").find(".gif-media-search-dropdown").removeClass("open").empty(),Z("#ac-reply-gif-button-"+e).removeClass("active"),Z(".gif-media-search-dropdown-standalone").removeClass("open").empty(),_.isUndefined(this.models[e])||(this.models[e].set("gif_data",{}),Z("#ac-reply-post-gif-"+e).find(".activity-attached-gif-container").removeAttr("style"))},openCommentsMediaUploader:function(e){var l=this,o=Z(e.currentTarget),t=o.data("ac-id"),a=o.closest(".bp-ac-form-container").find("#ac-reply-post-media-uploader-"+t),i=0'+t+""),this.removeFile(e),a.removeClass("media-uploading"))}),l.dropzone_obj.on("removedfile",function(e){if(l.dropzone_media.length)for(var t in l.dropzone_media)if(e.upload.uuid==l.dropzone_media[t].uuid){void 0===l.dropzone_media[t].saved||l.dropzone_media[t].saved||bp.Nouveau.Media.removeAttachment(l.dropzone_media[t].id),l.dropzone_media.splice(t,1);break}var a,i;_.isNull(l.dropzone_obj)||_.isNull(l.dropzone_obj.files)||0!==l.dropzone_obj.files.length?o.closest(".ac-form").addClass("has-content"):(a=o.parents(".ac-reply-toolbar"),(i=o.closest(".ac-form")).removeClass("has-media"),a.find(".ac-reply-document-button")&&a.find(".ac-reply-document-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-video-button")&&a.find(".ac-reply-video-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-gif-button")&&a.find(".ac-reply-gif-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-media-button")&&a.find(".ac-reply-media-button").parents(".post-elements-buttons-item").removeClass("no-click").find(".toolbar-button").removeClass("active"),Z(l.dropzone_obj.element).removeClass("files-uploaded dz-progress-view").find(".dz-global-progress").remove(),l.validateCommentContent(i.find(".ac-textarea").children(".ac-input")))}),l.dropzone_obj.on("complete",function(){0===this.getUploadingFiles().length&&0===this.getQueuedFiles().length&&0'+t+""),this.removeFile(e),a.removeClass("media-uploading"))}),l.dropzone_document_obj.on("removedfile",function(e){if(l.dropzone_document.length)for(var t in l.dropzone_document)if(e.upload.uuid==l.dropzone_document[t].uuid){void 0===l.dropzone_document[t].saved||l.dropzone_document[t].saved||bp.Nouveau.Media.removeAttachment(l.dropzone_document[t].id),l.dropzone_document.splice(t,1);break}var a,i;_.isNull(l.dropzone_document_obj)||_.isNull(l.dropzone_document_obj.files)||0!==l.dropzone_document_obj.files.length?o.closest(".ac-form").addClass("has-content"):(a=o.parents(".ac-reply-toolbar"),(i=o.closest(".ac-form")).removeClass("has-media"),a.find(".ac-reply-media-button")&&a.find(".ac-reply-media-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-video-button")&&a.find(".ac-reply-video-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-gif-button")&&a.find(".ac-reply-gif-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-document-button")&&a.find(".ac-reply-document-button").parents(".post-elements-buttons-item").removeClass("no-click").find(".toolbar-button").removeClass("active"),Z(l.dropzone_document_obj.element).removeClass("files-uploaded dz-progress-view").find(".dz-global-progress").remove(),l.validateCommentContent(i.find(".ac-textarea").children(".ac-input")))}),l.dropzone_document_obj.on("complete",function(){0===this.getUploadingFiles().length&&0===this.getQueuedFiles().length&&0'),Z(e.previewElement).closest(".dz-preview").addClass("dz-has-thumbnail")):bp.Nouveau.getVideoThumb&&bp.Nouveau.getVideoThumb(e,".dz-video-thumbnail")}),l.dropzone_video_obj.on("uploadprogress",function(){o.closest(".ac-form").addClass("media-uploading"),bp.Nouveau.dropZoneGlobalProgress&&bp.Nouveau.dropZoneGlobalProgress(this)}),l.dropzone_video_obj.on("success",function(e,t){if(100===e.upload.progress&&(Z(e.previewElement).find(".dz-progress-ring circle")[0].style.strokeDashoffset=0,Z(e.previewElement).find(".dz-progress-count").text("100% "+BP_Nouveau.video.i18n_strings.video_uploaded_text),Z(e.previewElement).closest(".dz-preview").addClass("dz-complete")),t.data.id)return e.id=t.id,t.data.uuid=e.upload.uuid,t.data.menu_order=Z(e.previewElement).closest(".dropzone").find(e.previewElement).index()-1,t.data.album_id=void 0!==BP_Nouveau.video&&void 0!==BP_Nouveau.video.album_id&&BP_Nouveau.video.album_id,t.data.group_id=void 0!==BP_Nouveau.video&&void 0!==BP_Nouveau.video.group_id&&BP_Nouveau.video.group_id,t.data.saved=!1,t.data.js_preview=Z(e.previewElement).find(".dz-video-thumbnail img").attr("src"),l.dropzone_video.push(t.data),e.previewElement.classList.add("dz-success");var a,i,o,d,s,n=t.data.feedback;for(e.previewElement.classList.add("dz-error"),s=[],i=0,o=(d=e.previewElement.querySelectorAll("[data-dz-errormessage]")).length;i'+t+""),this.removeFile(e),a.removeClass("media-uploading"))}),l.dropzone_video_obj.on("removedfile",function(e){if(l.dropzone_video.length)for(var t in l.dropzone_video)if(e.upload.uuid==l.dropzone_video[t].uuid){void 0===l.dropzone_video[t].saved||l.dropzone_video[t].saved||bp.Nouveau.Media.removeAttachment(l.dropzone_video[t].id),l.dropzone_video.splice(t,1);break}var a,i;_.isNull(l.dropzone_video_obj)||_.isNull(l.dropzone_video_obj.files)||0!==l.dropzone_video_obj.files.length?o.closest(".ac-form").addClass("has-content"):(a=o.parents(".ac-reply-toolbar"),(i=o.closest(".ac-form")).removeClass("has-media"),a.find(".ac-reply-media-button")&&a.find(".ac-reply-media-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-document-button")&&a.find(".ac-reply-document-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-gif-button")&&a.find(".ac-reply-gif-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-video-button")&&a.find(".ac-reply-video-button").parents(".post-elements-buttons-item").removeClass("no-click").find(".toolbar-button").removeClass("active"),Z(l.dropzone_video_obj.element).removeClass("files-uploaded dz-progress-view").find(".dz-global-progress").remove(),l.validateCommentContent(i.find(".ac-textarea").children(".ac-input")))}),l.dropzone_video_obj.on("complete",function(){0===this.getUploadingFiles().length&&0===this.getQueuedFiles().length&&0/gi,"\n").replace(/<\/div>/gi,""))).replace(/ /g," ");""!==e.text().trim()||0<=t.indexOf("emojioneemoji")||e.closest("form").hasClass("acomment-edit")?e.closest("form").addClass("has-content"):e.closest("form").removeClass("has-content")},ReactionStatePopupTab:function(e){e.preventDefault(),Z(this).closest(".activity-state-popup").find(".activity-state-popup_tab_panel li a").removeClass("active"),Z(this).addClass("active"),Z(this).closest(".activity-state-popup").find(".activity-state-popup_tab_content .activity-state-popup_tab_item").removeClass("active"),Z(this).closest(".activity-state-popup").find("."+Z(this).data("tab")).addClass("active")},closeActivityState:function(){Z(".activity-state-popup").hide().removeClass("active")},listenCommentInput:function(e){var t,a;0/gi,"\n").replace(/<\/div>/gi,""));t=t.replace(/ /g," "),""!==jQuery(e.currentTarget).text().trim()||0<=t.indexOf("emojioneemoji")?jQuery(e.currentTarget).closest("form").addClass("has-content"):jQuery(e.currentTarget).closest("form").removeClass("has-content")}),Z(t).closest("form").addClass("events-initiated"),this.InitiatedCommentForms.push(a)))},activityRootComment:function(e){var t=Z(e.currentTarget).closest("#activity-modal"),a=t.find(".activity-item").data("bp-activity-id"),e=t.find("#ac-form-"+a);bp.Nouveau.Activity.resetActivityCommentForm(e,"hardReset"),t.find(".acomment-display").removeClass("display-focus"),t.find(".comment-item").removeClass("comment-item-focus"),t.find(".bb-modal-activity-footer").addClass("active").append(e),e.addClass("root"),e.find("#ac-input-"+a).focus(),bp.Nouveau.Activity.clearFeedbackNotice(e)},clearFeedbackNotice:function(e){e.find(".bp-ac-form-container").find(".bp-feedback").length&&e.find(".bp-ac-form-container").find(".bp-feedback").remove()},launchActivityPopup:function(e,t){var a=Z("#activity-"+e),i=Z(".bb-activity-model-wrapper"),o=a[0].outerHTML,d='[data-parent_comment_id="'+t+'"]',t=a.data("activity-popup-title");bp.Nouveau.Activity.activityHasUpdates=!1,bp.Nouveau.Activity.currentActivityId=null,bp.Nouveau.Activity.activityPinHasUpdates=!1,i.closest("body").addClass("acomments-modal-open"),i.show(),i.find("ul.activity-list").html(o),i.find(".bb-modal-activity-header h2").text(t),i.find(".bb-activity-video-elem").each(function(e,t){var o=Z(t);o.find("video").each(function(e,t){var a=Z(t),i=a.attr("id")+Math.floor(1e4*Math.random());a.attr("id",i);t=o.find(".video-action-wrap");a.insertAfter(t),o.find(".video-js").remove(),a.addClass("video-js"),videojs(i,{controls:!0,aspectRatio:"16:9",fluid:!0,playbackRates:[.5,1,1.5,2],fullscreenToggle:!1})})}),a.hasClass("bb-closed-comments")&&i.find("#activity-modal").addClass("bb-closed-comments");t=i.find("#ac-form-"+e);i.find(".acomment-display").removeClass("display-focus"),i.find(".comment-item").removeClass("comment-item-focus"),i.find(".bb-modal-activity-footer").addClass("active").append(t),t.removeClass("not-initialized").addClass("root"),t.find("#ac-input-"+e).focus(),bp.Nouveau.Activity.clearFeedbackNotice(t),t.removeClass("events-initiated");a=i.find(".bb-modal-activity-footer").find(".ac-input[contenteditable]");bp.Nouveau.Activity.listenCommentInput(a),i.find(".bb-activity-more-options-wrap .bb-activity-more-options-action, .bb-pin-action_button, .bb-mute-action_button").attr("data-balloon-pos","left"),i.find(".privacy-wrap").attr("data-bp-tooltip-pos","right"),i.find(d).children(".acomments-view-more").first().trigger("click"),_.isUndefined(BP_Nouveau.media)||_.isUndefined(BP_Nouveau.media.emoji)||bp.Nouveau.Activity.initializeEmojioneArea(!0,"#activity-modal ",e),void 0!==bp.Nouveau&&bp.Nouveau.reportPopUp(),bp.Nouveau.Activity.toggleMultiMediaOptions(t,"",".bb-modal-activity-footer")},viewMoreComments:function(e){e.preventDefault();var t=Z(e.currentTarget).parent(),i=Z(e.currentTarget),o=Z(t).data("activity_id"),d=Z(e.currentTarget).closest(".activity-comments"),s=Z(e.currentTarget).closest(".activity-item"),n=Z(t).data("parent_comment_id"),l="";i.addClass("loading").removeClass("acomments-view-more--hide"),d.addClass("active"),s.addClass("active"),i.html('
      ');var a={action:"activity_loadmore_comments",activity_id:o,parent_comment_id:n,offset:Z(e.currentTarget).parents(".activity-comments").find('ul[data-parent_comment_id ="'+n+'"] > li.comment-item:not(.bb-recent-comment)').length,activity_type_is_blog:1"+e.data.message+"

      ").removeClass("acomments-view-more--hide"),d.removeClass("active"),s.removeClass("active")):void 0!==e.data&&void 0!==e.data.comments&&(t=Z(".bb-internal-model .activity-comments").find("[data-activity_id='"+o+"'][data-parent_comment_id='"+n+"']"),a=Z(Z.parseHTML(e.data.comments)),0"+e.statusText+"

      ").removeClass("acomments-view-more--hide"),d.removeClass("active"),s.removeClass("active")})},autoloadMoreComments:function(){var e,t,a,i,o;0 ul > li.acomments-view-more:not(.loading), .bb-modal-activity-body .activity-comments .activity-actions > ul > li.acomments-view-more:not(.loading)"),o=Z(".bb-activity-model-wrapper .bb-modal-activity-body"),i=Z(".bb-activity-model-wrapper .bb-modal-activity-body").find(".activity-comments:not(.active)"),0a&&Z(e).trigger("click").addClass("loading")),setTimeout(function(){jQuery(window).scroll()},200))},activitySyncOnModalClose:function(e,t){e.preventDefault();var e=(Z(e.currentTarget).is(document)?Z(".bb-activity-model-wrapper"):Z(e.currentTarget).parents(".bb-activity-model-wrapper")).find("ul.activity-list > li").data("bp-activity-id"),e=void 0!==t?t:e,a=Z("#activity-stream li.activity-item[data-bp-activity-id="+e+"]");0 .bb-modal-activity-body .activity-item").data("bp-activity-id");0/gi,"\n").replace(/<\/div>/gi,""));t=t.replace(/ /g," "),""!==e.text()||0<=t.indexOf("emojioneemoji")?e.closest("form").addClass("has-content"):e.closest("form").removeClass("has-content")},picker_show:function(){Z(this.button[0]).closest(".post-emoji").addClass("active"),Z(".emojionearea-theatre").removeClass("hide").addClass("show")},picker_hide:function(){Z(this.button[0]).closest(".post-emoji").removeClass("active"),Z(".emojionearea-theatre").removeClass("show").addClass("hide")}}})}},bp.Nouveau.Activity.start())}((bp,jQuery)); \ No newline at end of file +window.bp=window.bp||{},function(Z){"undefined"!=typeof BP_Nouveau&&(bp.Nouveau=bp.Nouveau||{},bp.Models=bp.Models||{},bp.Models.ACReply=Backbone.Model.extend({defaults:{gif_data:{}}}),bp.Nouveau.Activity={start:function(){this.setupGlobals(),this.addListeners()},setupGlobals:function(){this.just_posted=[],this.current_page=1,this.mentions_count=Number(Z(bp.Nouveau.objectNavParent+' [data-bp-scope="mentions"]').find("a span").html())||0,this.heartbeat_data={newest:"",highlights:{},last_recorded:0,first_recorded:0,document_title:Z(document).prop("title")},void 0!==window.Dropzone&&void 0!==BP_Nouveau.media&&(window.Dropzone.autoDiscover=!1,this.dropzone_options={url:BP_Nouveau.ajaxurl,timeout:108e5,dictFileTooBig:BP_Nouveau.media.dictFileTooBig,dictDefaultMessage:BP_Nouveau.media.dropzone_media_message,acceptedFiles:"image/*",autoProcessQueue:!0,addRemoveLinks:!0,uploadMultiple:!1,maxFiles:void 0!==BP_Nouveau.media.maxFiles?BP_Nouveau.media.maxFiles:10,maxFilesize:void 0!==BP_Nouveau.media.max_upload_size?BP_Nouveau.media.max_upload_size:2,dictMaxFilesExceeded:BP_Nouveau.media.media_dict_file_exceeded,dictCancelUploadConfirmation:BP_Nouveau.media.dictCancelUploadConfirmation,maxThumbnailFilesize:void 0!==BP_Nouveau.media.max_upload_size?BP_Nouveau.media.max_upload_size:2},void 0!==BP_Nouveau.media.dropzone_options&&Object.assign(this.dropzone_options,BP_Nouveau.media.dropzone_options)),this.dropzone_obj=null,this.dropzone_media=[],this.dropzone_document_obj=null,this.dropzone_document=[],this.dropzone_video_obj=null,this.dropzone_video=[],this.models=[],this.InitiatedCommentForms=[],this.activityHasUpdates=!1,this.currentActivityId=null,this.activityPinHasUpdates=!1},addListeners:function(){Z("body").hasClass("activity-singular")||Z("#buddypress").on("bp_heartbeat_send",this.heartbeatSend.bind(this)),Z("#buddypress").on("bp_heartbeat_tick",this.heartbeatTick.bind(this)),Z('#buddypress [data-bp-list="activity"]:not( #bb-schedule-posts_modal [data-bp-list="activity"] )').on("click","li.load-newest, li.load-more",this.injectActivities.bind(this)),Z("#buddypress").on("bp_ajax_request",'[data-bp-list="activity"]',this.scopeLoaded.bind(this)),Z("#activity-stream").on("click",".acomments-view-more",this.showActivity),Z("body").on("click",".bb-close-action-popup",this.closeActivity),Z(document).on("activityModalOpened",function(e,t){var a=t.activityId;Z(document).on("click",function(e){0li.bb-edit-privacy a",bp.Nouveau,this.activityPrivacyRedirect.bind(this)),Z('#buddypress [data-bp-list="activity"], #activity-modal').on("click",".activity-privacy>li:not(.bb-edit-privacy)",bp.Nouveau,this.activityPrivacyChange.bind(this)),Z('#buddypress [data-bp-list="activity"], #bb-media-model-container .activity-list, #activity-modal').on("click","span.privacy",bp.Nouveau,this.togglePrivacyDropdown.bind(this)),Z("#bb-media-model-container .activity-list").on("click",".activity-item",bp.Nouveau,this.activityActions.bind(this)),Z(".bb-activity-model-wrapper").on("click",".ac-form-placeholder",bp.Nouveau,this.activityRootComment.bind(this)),Z(document).keydown(this.commentFormAction),Z(document).click(this.togglePopupDropdown),Z('#buddypress [data-bp-list="activity"], #bb-media-model-container .activity-list, #activity-modal .activity-list, .bb-modal-activity-footer').on("click",".ac-reply-media-button",this.openCommentsMediaUploader.bind(this)),Z('#buddypress [data-bp-list="activity"], #bb-media-model-container .activity-list, #activity-modal .activity-list, .bb-modal-activity-footer').on("click",".ac-reply-document-button",this.openCommentsDocumentUploader.bind(this)),Z('#buddypress [data-bp-list="activity"], #bb-media-model-container .activity-list, #activity-modal .activity-list, .bb-modal-activity-footer').on("click",".ac-reply-video-button",this.openCommentsVideoUploader.bind(this)),Z('#buddypress [data-bp-list="activity"], #bb-media-model-container .activity-list, #activity-modal .activity-list, .bb-modal-activity-footer').on("click",".ac-reply-gif-button",this.openGifPicker.bind(this)),Z(document).on("click",".activity-state-popup_overlay",bp.Nouveau,this.closeActivityState.bind(this)),Z(document).on("click",".activity-state-popup .activity-state-popup_tab_panel a",this.ReactionStatePopupTab),_.isUndefined(BP_Nouveau.activity.params.autoload)||Z(window).scroll(this.loadMoreActivities),Z(".bb-activity-model-wrapper, .bb-media-model-wrapper").on("click",".acomments-view-more",this.viewMoreComments.bind(this)),Z(document).on("click","#activity-stream .activity-comments .view-more-comments, #activity-stream .activity-state-comments > .comments-count",function(e){e.preventDefault(),Z(this).parents("li.activity-item").find(".activity-comments > ul > li.acomments-view-more, .activity-comments > .activity-actions > ul > li.acomments-view-more").trigger("click")}),Z("#activity-modal > .bb-modal-activity-body").on("scroll",this.autoloadMoreComments.bind(this)),Z("#activity-modal > .bb-modal-activity-body").on("scroll",this.discardGifEmojiPicker.bind(this)),Z(".bb-activity-model-wrapper .bb-model-close-button").on("click",this.activitySyncOnModalClose.bind(this)),void 0!==BP_Nouveau.is_send_ajax_request&&"1"===BP_Nouveau.is_send_ajax_request?Z("#buddypress").on("bp_ajax_request",'[data-bp-list="activity"]',function(){setTimeout(function(){Z(".ac-form.not-initialized").each(function(){var e=Z(this),t=e.find(".ac-textarea");bp.Nouveau.Activity.toggleMultiMediaOptions(e,t)})},1e3)}):setTimeout(function(){Z(".ac-form.not-initialized").each(function(){var e=Z(this),t=e.find(".ac-textarea");bp.Nouveau.Activity.toggleMultiMediaOptions(e,t)})},1e3)},heartbeatSend:function(e,t){this.heartbeat_data.first_recorded=Z("#buddypress [data-bp-list] [data-bp-activity-id]:not(.bb-pinned)").first().data("bp-timestamp")||0;var a=Z("#buddypress [data-bp-list] [data-bp-activity-id]").first().data("bp-timestamp")||0;a>this.heartbeat_data.first_recorded&&(this.heartbeat_data.first_recorded=a),(0===this.heartbeat_data.last_recorded||this.heartbeat_data.first_recorded>this.heartbeat_data.last_recorded)&&(this.heartbeat_data.last_recorded=this.heartbeat_data.first_recorded),t.bp_activity_last_recorded=this.heartbeat_data.last_recorded,Z("#buddypress .dir-search input[type=search]").length&&(t.bp_activity_last_recorded_search_terms=Z("#buddypress .dir-search input[type=search]").val()),Z.extend(t,{bp_heartbeat:bp.Nouveau.getStorage("bp-activity")})},heartbeatTick:function(e,t){var a,i,o=bp.Nouveau.objects,d=bp.Nouveau.getStorage("bp-activity","scope"),s=this;void 0!==t&&t.bp_activity_newest_activities&&(this.heartbeat_data.newest=Z.trim(t.bp_activity_newest_activities.activities)+this.heartbeat_data.newest,this.heartbeat_data.last_recorded=Number(t.bp_activity_newest_activities.last_recorded),i=Z(this.heartbeat_data.newest).filter(".activity-item"),a=Number(i.length),o.push("mentions"),"all"===d?(Z.each(i,function(e,a){a=Z(a),Z.each(o,function(e,t){-1!==Z.inArray("bp-my-"+t,a.get(0).classList)&&(void 0===s.heartbeat_data.highlights[t]?s.heartbeat_data.highlights[t]=[a.data("bp-activity-id")]:-1===Z.inArray(a.data("bp-activity-id"),s.heartbeat_data.highlights[t])&&s.heartbeat_data.highlights[t].push(a.data("bp-activity-id")))})}),t=new RegExp("bp-my-("+o.join("|")+")","g"),this.heartbeat_data.newest=this.heartbeat_data.newest.replace(t,""),Z(bp.Nouveau.objectNavParent+' [data-bp-scope="all"]').find("a span").html(a)):(this.heartbeat_data.highlights[d]=[],Z.each(i,function(e,t){s.heartbeat_data.highlights[d].push(Z(t).data("bp-activity-id"))})),Z.each(o,function(e,t){var a;void 0!==s.heartbeat_data.highlights[t]&&s.heartbeat_data.highlights[t].length&&(a=0,"mentions"===t&&(a=s.mentions_count),Z(bp.Nouveau.objectNavParent+' [data-bp-scope="'+t+'"]').find("a span").html(Number(s.heartbeat_data.highlights[t].length)+a))}),o.pop(),Z(document).prop("title","("+a+") "+this.heartbeat_data.document_title),Z('#buddypress [data-bp-list="activity"]').first().hasClass("load-newest")?(i=Z('#buddypress [data-bp-list="activity"] .load-newest a').html(),Z('#buddypress [data-bp-list="activity"] .load-newest a').html(i.replace(/([0-9]+)/,a))):Z('#buddypress [data-bp-list="activity"] ul.activity-list').prepend('
    • '+BP_Nouveau.newest+" ("+a+")
    • "),Z('#buddypress [data-bp-list="activity"] li.load-newest').trigger("click"),Z('#buddypress [data-bp-list="activity"]').trigger("bp_heartbeat_pending",this.heartbeat_data),void 0!==bp.Nouveau&&bp.Nouveau.reportPopUp())},injectActivities:function(e){var t,a,i,o,d=bp.Nouveau.getStorage("bp-activity"),s=d.scope||null,d=d.filter||null;Z(e.currentTarget).hasClass("load-newest")?(e.preventDefault(),Z(e.currentTarget).remove(),i=Z.parseHTML(this.heartbeat_data.newest),Z.each(i,function(e,t){"LI"===t.nodeName&&Z(t).hasClass("just-posted")&&Z("#"+Z(t).prop("id")).length&&Z("#"+Z(t).prop("id")).remove()}),(0<(i=Z(e.delegateTarget).find(".activity-list .activity-item").first()).length&&i.hasClass("bb-pinned")?Z(i).after(this.heartbeat_data.newest):Z(e.delegateTarget).find(".activity-list").prepend(this.heartbeat_data.newest)).find("li.activity-item").each(bp.Nouveau.hideSingleUrl).trigger("bp_heartbeat_prepend",this.heartbeat_data),this.heartbeat_data.newest="","all"===s&&Z(bp.Nouveau.objectNavParent+' [data-bp-scope="all"]').find("a span").html(""),"mentions"===s&&(bp.Nouveau.ajax({action:"activity_clear_new_mentions"},"activity"),this.mentions_count=0),Z(bp.Nouveau.objectNavParent+' [data-bp-scope="'+s+'"]').find("a span").html(""),void 0!==this.heartbeat_data.highlights[s]&&(this.heartbeat_data.highlights[s]=[]),setTimeout(function(){Z(e.delegateTarget).find("[data-bp-activity-id]").removeClass("newest_"+s+"_activity")},3e3),Z(document).prop("title",this.heartbeat_data.document_title),jQuery(window).scroll()):Z(e.currentTarget).hasClass("load-more")&&(t=+Number(this.current_page)+1,a=this,i="",e.preventDefault(),(o=Z(e.currentTarget)).find("a").first().addClass("loading"),this.just_posted=[],Z(e.delegateTarget).children(".just-posted").each(function(){a.just_posted.push(Z(this).data("bp-activity-id"))}),Z("#buddypress .dir-search input[type=search]").length&&(i=Z("#buddypress .dir-search input[type=search]").val()),bp.Nouveau.objectRequest({object:"activity",scope:s,filter:d,search_terms:i,page:t,method:"append",exclude_just_posted:this.just_posted.join(","),target:'#buddypress [data-bp-list]:not( #bb-schedule-posts_modal [data-bp-list="activity"] ) ul.bp-list'}).done(function(e){!0===e.success&&(o.remove(),a.current_page=t,jQuery(window).scroll())})),Z(".activity-item.bb-closed-comments").find(".edit-activity, .acomment-edit").parents(".generic-button").hide()},hideComments:function(e){var a,i,o,e=Z(e.target).find(".activity-comments");e.length&&e.each(function(e,t){o=Z(t).children("ul").not(".conflict-activity-ul-li-comment"),(i=Z(o).find("li").not(Z(".document-action-class, .media-action-class, .video-action-class"))).length&&(Z("body").hasClass("activity-singular")&&""!==window.location.hash&&Z(window.location.hash).length&&0!==Z(window.location.hash).closest(".activity-comments").length||(a=Z(t).closest(".activity-item"),Z("#acomment-comment-"+a.data("bp-activity-id")+" span.comment-count").html(),i.each(function(e,t){if(e"),window.location.hash&&"#"+Z(t).attr("id")===window.location.hash)return Z(t).parents("li.comment-item").show(),!1;Z(t).addClass("bp-hidden").hide()}}),Z(o).children(".bp-hidden").length===Z(o).children("li").length-1&&Z(o).find("li.show-all").length&&Z(o).children("li:not(.show-all)").removeClass("bp-hidden").toggle()))})},showActivity:function(e){e.preventDefault();var t=Z(e.currentTarget).parent(),a=t.data("parent_comment_id"),t=Z(t).data("activity_id");Z(document).trigger("activityModalOpened",{activityId:t}),Z(e.currentTarget).parents(".activity-comments").find(".ac-form").each(function(){var e=Z(this),t=Z(this).closest(".activity-comments"),a=Z(this).closest(".comment-item");e.find(".post-elements-buttons-item.post-emoji").removeClass("active").empty(""),bp.Nouveau.Activity.resetActivityCommentForm(e,"hardReset"),t.append(e),a.find(".acomment-display").removeClass("display-focus"),a.removeClass("comment-item-focus")}),bp.Nouveau.Activity.launchActivityPopup(t,a)},closeActivity:function(e){e.preventDefault();var t=Z(e.target).closest(".bb-activity-model-wrapper"),a=t.find(".bb-modal-activity-footer"),i=t.find(".activity-item").data("bp-activity-id"),e=t.find("#ac-form-"+i);bp.Nouveau.Activity.reinitializeActivityCommentForm(e),_.isUndefined(BP_Nouveau.media)||_.isUndefined(BP_Nouveau.media.emoji)||bp.Nouveau.Activity.initializeEmojioneArea(!1,"",i),t.find("#activity-modal").removeClass("bb-closed-comments"),t.closest("body").removeClass("acomments-modal-open"),t.hide(),t.find("ul.activity-list").empty(),a.removeClass("active"),a.find("form.ac-form").remove()},scopeLoaded:function(e,a){this.current_page=1,"mentions"===a.scope&&void 0!==a.response.new_mentions?(Z.each(a.response.new_mentions,function(e,t){Z("#buddypress #activity-stream").find('[data-bp-activity-id="'+t+'"]').addClass("newest_mentions_activity")}),this.mentions_count=0):void 0!==this.heartbeat_data.highlights[a.scope]&&this.heartbeat_data.highlights[a.scope].length&&Z.each(this.heartbeat_data.highlights[a.scope],function(e,t){Z("#buddypress #activity-stream").find('[data-bp-activity-id="'+t+'"]').length&&Z("#buddypress #activity-stream").find('[data-bp-activity-id="'+t+'"]').addClass("newest_"+a.scope+"_activity")}),this.heartbeat_data.newest="",Z.each(Z(bp.Nouveau.objectNavParent+" [data-bp-scope]").find("a span"),function(e,t){0===parseInt(Z(t).html(),10)&&Z(t).html("")}),void 0!==this.heartbeat_data.highlights[a.scope]&&(this.heartbeat_data.highlights[a.scope]=[]),Z(document).prop("title",this.heartbeat_data.document_title),setTimeout(function(){Z("#buddypress #activity-stream .activity-item").removeClass("newest_"+a.scope+"_activity")},3e3),void 0!==window.instgrm&&window.instgrm.Embeds.process(),void 0!==window.FB&&void 0!==window.FB.XFBML&&window.FB.XFBML.parse(),this.fixAtWhoActivity(),this.openEditActivityPopup(),this.navigateToSpecificComment(),setTimeout(function(){jQuery(window).scroll()},200)},openEditActivityPopup:function(){var e,t;!_.isUndefined(BP_Nouveau.activity.params.is_activity_edit)&&0 ul");if(e.data.redirect)return window.location.href=e.data.redirect;e.data.parent_activity_id&&e.data.activity&&Z("body:not(.activity-singular) #buddypress #activity-stream ul.activity-list li#activity-"+e.data.parent_activity_id).replaceWith(e.data.activity),k&&(x=1,i=B.find(".acomments-view-more").data("child-count"),c.append(B.find("form")),Z.each(B.find("li.comment-item"),function(){x+=1}),x+=void 0!==i?parseFloat(i):0,N=m.find("span.comments-count"),z=N.text().length?N.text().match(/\d+/)[0]:0,z=Number(z-x),p.length?(i=1 ul").html().trim()&&t.removeClass("has-child-comments")}),k||c.data("bp-timestamp")!==d.Activity.heartbeat_data.last_recorded||(d.Activity.heartbeat_data.newest="",d.Activity.heartbeat_data.last_recorded=0),Z(document).trigger("bp_activity_ajax_delete_request",Z.extend(A,{response:e})),Z(document).trigger("bp_activity_ajax_delete_request_video",Z.extend(A,{response:e})),bp.Nouveau.Activity.activityHasUpdates=!0,bp.Nouveau.Activity.currentActivityId=r}P.removeClass("active")})}if(l.closest("span").hasClass("activity-read-more")){var T=l.closest("div"),U=l.closest("span");if(C=null,Z(T).hasClass("activity-inner")?C=r:Z(T).hasClass("acomment-content")&&(C=l.closest("li").data("bp-activity-comment-id")),!C)return e;e.preventDefault(),Z(U).addClass("loading"),d.ajax({action:"get_single_activity_content",id:C},"activity").done(function(e){"object"!=typeof e&&0@'+L+" ";_.isUndefined(BP_Nouveau.activity.params.user_id)||(D=BP_Nouveau.activity.params.user_id);var L={offset:-(Z(window).height()/2-75),easing:"swing"},I=M.get(0);jQuery("body").hasClass("bb-is-mobile")?setTimeout(function(){var e=300/gi,"\n").replace(/<\/div>/gi,""),O={action:"new_activity_comment",_wpnonce_new_activity_comment:Z("#_wpnonce_new_activity_comment").val(),comment_id:C,form_id:r,content:H};Z("#_bp_as_nonce_"+r).val()&&(O["_bp_as_nonce_"+r]=Z("#_bp_as_nonce_"+r).val()),this.dropzone_media.length&&(O.media=this.dropzone_media),this.dropzone_document.length&&(O.document=this.dropzone_document),this.dropzone_video.length&&(O.video=this.dropzone_video,_.isEmpty(O.content)&&(O.content="​")),_.isUndefined(this.models[r])||(n=this.models[r],O.gif_data=this.models[r].get("gif_data")),O.content=O.content.replace(/ /g," "),s.hasClass("acomment-edit")&&(O.edit_comment=!0);var Q=0"):t.append("
        ")),Q?s.closest("#activity-modal").find(".bb-modal-activity-body .activity-comments, .bb-modal-activity-body .activity-comments .activity-actions").children("ul").append(Z(a)):t.children("ul").append(Z(a).hide().fadeIn(200)),Z(s).find(".ac-input").first().html(""),t.parent().addClass("has-comments"),t.parent().addClass("comments-loaded"),m.addClass("has-comments")),s.removeClass("acomment-edit");t=s.find(".ac-reply-content");if(0'+BP_Nouveau.activity.strings.commentPostError+""):(e=e.responseJSON&&e.responseJSON.message?e.responseJSON.message:e.statusText,s.find(".ac-reply-content").after('
        '+e+"
        "))})}if(l.hasClass("edit")&&l.hasClass("edit-activity")&&(e.preventDefault(),H=c.data("bp-activity"),O=""!==c.data("link-url")?c.data("link-url"):null,void 0!==H&&(bp.Nouveau.Activity.postForm.displayEditActivityForm(H,O),l.closest("li").hasClass("groups")?Z("#bp-nouveau-activity-form").addClass("group-activity"):Z("#bp-nouveau-activity-form").removeClass("group-activity"),void 0!==bp.Nouveau.Media&&void 0!==bp.Nouveau.Media.Theatre&&(bp.Nouveau.Media.Theatre.is_open_media||bp.Nouveau.Media.Theatre.is_open_document)&&(Z(document).find(".bb-close-media-theatre").trigger("click"),Z(document).find(".bb-close-document-theatre").trigger("click")))),v&&(l.hasClass("bb-open-media-theatre")||l.hasClass("bb-open-video-theatre")||l.hasClass("bb-open-document-theatre")||l.hasClass("document-detail-wrap-description-popup"))&&(e.preventDefault(),l.closest("#activity-modal").find(".bb-modal-activity-header .bb-close-action-popup").trigger("click")),l.hasClass("pin-activity")||l.hasClass("unpin-activity")){if(e.preventDefault(),!r)return e;l.closest(".activity-item").addClass("loading-pin");var V="pin";l.hasClass("unpin-activity")&&(V="unpin"),d.ajax({action:"activity_update_pinned_post",id:r,pin_action:V},"activity").done(function(e){var t,a,i,o,d,s,n;l.closest(".activity-item").removeClass("loading-pin"),void 0!==(e="object"!=typeof e?JSON.parse(e):e).data&&void 0!==e.data.feedback&&(t=l.closest("ul.activity-list"),n=v?l.closest(".buddypress-wrap").find("#activity-stream"):l.closest("#activity-stream"),e.success&&(a=bp.Nouveau.getStorage("bp-activity","scope"),o=i=!1,d="",l.closest("li.activity-item").hasClass("groups")&&(o=!0,d=(d=l.closest("li.activity-item").attr("class").match(/group-\d+/))[0].replace("group-","")),n.hasClass("single-user")?i=!1:(n.hasClass("activity")&&"all"===a&&!o||n.hasClass("single-group"))&&(i=!0),"pin"===V?(i&&t.find("li.activity-item").removeClass("bb-pinned"),s="li.activity-item:not(.groups)",o&&!n.hasClass("single-group")?s="li.activity-item.group-"+d:o&&n.hasClass("single-group")&&(s="li.activity-item"),t.find(s).each(function(){var e=Z(this).find(".unpin-activity");e.removeClass("unpin-activity").addClass("pin-activity"),o?e.find("span").html(BP_Nouveau.activity.strings.pinGroupPost):e.find("span").html(BP_Nouveau.activity.strings.pinPost)}),i&&l.closest("li.activity-item").addClass("bb-pinned"),l.addClass("unpin-activity"),l.removeClass("pin-activity"),l.closest("li.activity-item").hasClass("groups")?l.find("span").html(BP_Nouveau.activity.strings.unpinGroupPost):l.find("span").html(BP_Nouveau.activity.strings.unpinPost)):"unpin"===V&&(l.closest("li.activity-item").removeClass("bb-pinned"),l.addClass("pin-activity"),l.removeClass("unpin-activity"),l.closest("li.activity-item").hasClass("groups")?l.find("span").html(BP_Nouveau.activity.strings.pinGroupPost):l.find("span").html(BP_Nouveau.activity.strings.pinPost)),"all"===a&&i&&(bp.Nouveau.Activity.heartbeat_data.last_recorded=0,bp.Nouveau.refreshActivities())),Z(document).trigger("bb_trigger_toast_message",["","
        "+e.data.feedback+"
        ","success",null,!0]))}).fail(function(){l.closest(".activity-item").removeClass("loading-pin"),Z(document).trigger("bb_trigger_toast_message",["","
        "+BP_Nouveau.activity.strings.pinPostError+"
        ","error",null,!0])})}if(l.hasClass("bb-icon-bell-slash")||l.hasClass("bb-icon-bell")){if(e.preventDefault(),!r)return e;l.closest(".activity-item").addClass("loading-mute");var q="mute";l.hasClass("bb-icon-bell")&&(q="unmute"),d.ajax({action:"toggle_activity_notification_status",id:r,notification_toggle_action:q},"activity").done(function(e){l.closest(".activity-item").removeClass("loading-mute"),void 0!==(e="object"!=typeof e?JSON.parse(e):e).data&&void 0!==e.data.feedback&&(e.success&&("mute"===q?(l.closest("li.activity-item").addClass("bb-muted"),l.removeClass("bb-icon-bell-slash"),l.addClass("bb-icon-bell"),l.attr("title",BP_Nouveau.activity.strings.unmuteNotification),l.find("span").html(BP_Nouveau.activity.strings.unmuteNotification)):"unmute"===q&&(l.closest("li.activity-item").removeClass("bb-muted"),l.removeClass("bb-icon-bell"),l.addClass("bb-icon-bell-slash"),l.attr("title",BP_Nouveau.activity.strings.muteNotification),l.find("span").html(BP_Nouveau.activity.strings.muteNotification)),void 0!==bp.Nouveau.Activity.activityHasUpdates&&(bp.Nouveau.Activity.activityHasUpdates=!0)),Z(document).trigger("bb_trigger_toast_message",["","
        "+e.data.feedback+"
        ","success",null,!0])),v&&(bp.Nouveau.Activity.activityPinHasUpdates=!0),bp.Nouveau.Activity.activityHasUpdates=!0,bp.Nouveau.Activity.currentActivityId=r}).fail(function(){l.closest(".activity-item").removeClass("loading-pin"),Z(document).trigger("bb_trigger_toast_message",["","
        "+BP_Nouveau.activity.strings.pinPostError+"
        ","error",null,!0])})}if(l.hasClass("close-activity-comment")||l.hasClass("unclose-activity-comment")){if(e.preventDefault(),!r)return e;l.closest(".activity-item").addClass("loading-pin");var W="close_comments";l.hasClass("unclose-activity-comment")&&(W="unclose_comments"),d.ajax({action:"activity_update_close_comments",id:r,close_comments_action:W},"activity").done(function(e){var t;l.closest(".activity-item").removeClass("loading-pin"),void 0!==(e="object"!=typeof e?JSON.parse(e):e).data&&void 0!==e.data.feedback&&(e.success&&(t=Z("#activity-stream > .activity-list").find("[data-bp-activity-id="+r+"]"),l.closest(".activity-item").find(".bb-activity-closed-comments-notice").remove(),"close_comments"===W?(l.closest("li.activity-item").addClass("bb-closed-comments"),0'+e.data.feedback+""),0'+e.data.feedback+""))):"unclose_comments"===W&&(l.closest("li.activity-item.bb-closed-comments").find(".edit-activity, .acomment-edit").parents(".generic-button").show(),l.closest("li.activity-item").removeClass("bb-closed-comments"),0"+e.data.feedback+"",e.success?"success":"error",null,!0]))}).fail(function(){l.closest(".activity-item").removeClass("loading-pin"),Z(document).trigger("bb_trigger_toast_message",["","
        "+BP_Nouveau.activity.strings.closeCommentsError+"
        ","error",null,!0])})}},commentFormAction:function(e){var t,a;return(e=e||window.event).target?t=e.target:e.srcElement&&(t=e.srcElement),3===t.nodeType&&(t=t.parentNode),!0!==e.altKey&&!0!==e.metaKey&&"TEXTAREA"===t.tagName&&Z(t).hasClass("ac-input")?void(27===(a=e.keyCode||e.which)&&!1===e.ctrlKey?"TEXTAREA"===t.tagName&&Z(t).closest("form").slideUp(200):e.ctrlKey&&13===a&&Z(t).val()&&Z(t).closest("form").find("[type=submit]").first().trigger("click")):e},togglePopupDropdown:function(e){var t;return(e=e||window.event).target?t=e.target:e.srcElement&&(t=e.srcElement),3===t.nodeType&&(t=t.parentNode),!0===e.altKey||!0===e.metaKey||Z(t).hasClass("privacy-wrap")||Z(t).parent().hasClass("privacy-wrap")?e:void Z("ul.activity-privacy").removeClass("bb-open")},loadMoreActivities:function(){var e,t=Z(".load-more:visible").last(),a=Z(window);t.closest(".activity-list").length&&t.get(0)&&!t.data("bp-autoloaded")&&(e=t.offset().top-50,a.scrollTop()+a.height()>e&&(t.data("bp-autoloaded",1),t.find("a").text(BP_Nouveau.activity.strings.loadingMore),t.find("a").trigger("click")))},destroyCommentMediaUploader:function(e){_.isNull(this.dropzone_obj)||(this.dropzone_obj.destroy(),Z("#ac-reply-post-media-uploader-"+e).html(""),Z("#ac-reply-post-media-uploader-1-"+e).html("")),this.dropzone_media=[],Z("#ac-reply-post-media-uploader-"+e).removeClass("open").addClass("closed"),Z("#ac-reply-media-button-"+e).removeClass("active")},destroyCommentDocumentUploader:function(e){_.isNull(this.dropzone_document_obj)||(this.dropzone_document_obj.destroy(),Z("#ac-reply-post-document-uploader-"+e).html("")),this.dropzone_document=[],Z("#ac-reply-post-document-uploader-"+e).removeClass("open").addClass("closed"),Z("#ac-reply-document-button-"+e).removeClass("active")},destroyCommentVideoUploader:function(e){_.isNull(this.dropzone_video_obj)||(this.dropzone_video_obj.destroy(),Z("#ac-reply-post-video-uploader-"+e).html("")),this.dropzone_video=[],Z("#ac-reply-post-video-uploader-"+e).removeClass("open").addClass("closed"),Z("#ac-reply-video-button-"+e).removeClass("active")},resetGifPicker:function(e){Z("#ac-reply-gif-button-"+e).closest(".post-gif").find(".gif-media-search-dropdown").removeClass("open").empty(),Z("#ac-reply-gif-button-"+e).removeClass("active"),Z(".gif-media-search-dropdown-standalone").removeClass("open").empty(),_.isUndefined(this.models[e])||(this.models[e].set("gif_data",{}),Z("#ac-reply-post-gif-"+e).find(".activity-attached-gif-container").removeAttr("style"))},openCommentsMediaUploader:function(e){var l=this,o=Z(e.currentTarget),t=o.data("ac-id"),a=o.closest(".bp-ac-form-container").find("#ac-reply-post-media-uploader-"+t),i=0'+t+""),this.removeFile(e),a.removeClass("media-uploading"))}),l.dropzone_obj.on("removedfile",function(e){if(l.dropzone_media.length)for(var t in l.dropzone_media)if(e.upload.uuid==l.dropzone_media[t].uuid){void 0===l.dropzone_media[t].saved||l.dropzone_media[t].saved||bp.Nouveau.Media.removeAttachment(l.dropzone_media[t].id),l.dropzone_media.splice(t,1);break}var a,i;_.isNull(l.dropzone_obj)||_.isNull(l.dropzone_obj.files)||0!==l.dropzone_obj.files.length?o.closest(".ac-form").addClass("has-content"):(a=o.parents(".ac-reply-toolbar"),(i=o.closest(".ac-form")).removeClass("has-media"),a.find(".ac-reply-document-button")&&a.find(".ac-reply-document-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-video-button")&&a.find(".ac-reply-video-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-gif-button")&&a.find(".ac-reply-gif-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-media-button")&&a.find(".ac-reply-media-button").parents(".post-elements-buttons-item").removeClass("no-click").find(".toolbar-button").removeClass("active"),Z(l.dropzone_obj.element).removeClass("files-uploaded dz-progress-view").find(".dz-global-progress").remove(),l.validateCommentContent(i.find(".ac-textarea").children(".ac-input")))}),l.dropzone_obj.on("complete",function(){0===this.getUploadingFiles().length&&0===this.getQueuedFiles().length&&0'+t+""),this.removeFile(e),a.removeClass("media-uploading"))}),l.dropzone_document_obj.on("removedfile",function(e){if(l.dropzone_document.length)for(var t in l.dropzone_document)if(e.upload.uuid==l.dropzone_document[t].uuid){void 0===l.dropzone_document[t].saved||l.dropzone_document[t].saved||bp.Nouveau.Media.removeAttachment(l.dropzone_document[t].id),l.dropzone_document.splice(t,1);break}var a,i;_.isNull(l.dropzone_document_obj)||_.isNull(l.dropzone_document_obj.files)||0!==l.dropzone_document_obj.files.length?o.closest(".ac-form").addClass("has-content"):(a=o.parents(".ac-reply-toolbar"),(i=o.closest(".ac-form")).removeClass("has-media"),a.find(".ac-reply-media-button")&&a.find(".ac-reply-media-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-video-button")&&a.find(".ac-reply-video-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-gif-button")&&a.find(".ac-reply-gif-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-document-button")&&a.find(".ac-reply-document-button").parents(".post-elements-buttons-item").removeClass("no-click").find(".toolbar-button").removeClass("active"),Z(l.dropzone_document_obj.element).removeClass("files-uploaded dz-progress-view").find(".dz-global-progress").remove(),l.validateCommentContent(i.find(".ac-textarea").children(".ac-input")))}),l.dropzone_document_obj.on("complete",function(){0===this.getUploadingFiles().length&&0===this.getQueuedFiles().length&&0'),Z(e.previewElement).closest(".dz-preview").addClass("dz-has-thumbnail")):bp.Nouveau.getVideoThumb&&bp.Nouveau.getVideoThumb(e,".dz-video-thumbnail")}),l.dropzone_video_obj.on("uploadprogress",function(){o.closest(".ac-form").addClass("media-uploading"),bp.Nouveau.dropZoneGlobalProgress&&bp.Nouveau.dropZoneGlobalProgress(this)}),l.dropzone_video_obj.on("success",function(e,t){if(100===e.upload.progress&&(Z(e.previewElement).find(".dz-progress-ring circle")[0].style.strokeDashoffset=0,Z(e.previewElement).find(".dz-progress-count").text("100% "+BP_Nouveau.video.i18n_strings.video_uploaded_text),Z(e.previewElement).closest(".dz-preview").addClass("dz-complete")),t.data.id)return e.id=t.id,t.data.uuid=e.upload.uuid,t.data.menu_order=Z(e.previewElement).closest(".dropzone").find(e.previewElement).index()-1,t.data.album_id=void 0!==BP_Nouveau.video&&void 0!==BP_Nouveau.video.album_id&&BP_Nouveau.video.album_id,t.data.group_id=void 0!==BP_Nouveau.video&&void 0!==BP_Nouveau.video.group_id&&BP_Nouveau.video.group_id,t.data.saved=!1,t.data.js_preview=Z(e.previewElement).find(".dz-video-thumbnail img").attr("src"),l.dropzone_video.push(t.data),e.previewElement.classList.add("dz-success");var a,i,o,d,s,n=t.data.feedback;for(e.previewElement.classList.add("dz-error"),s=[],i=0,o=(d=e.previewElement.querySelectorAll("[data-dz-errormessage]")).length;i'+t+""),this.removeFile(e),a.removeClass("media-uploading"))}),l.dropzone_video_obj.on("removedfile",function(e){if(l.dropzone_video.length)for(var t in l.dropzone_video)if(e.upload.uuid==l.dropzone_video[t].uuid){void 0===l.dropzone_video[t].saved||l.dropzone_video[t].saved||bp.Nouveau.Media.removeAttachment(l.dropzone_video[t].id),l.dropzone_video.splice(t,1);break}var a,i;_.isNull(l.dropzone_video_obj)||_.isNull(l.dropzone_video_obj.files)||0!==l.dropzone_video_obj.files.length?o.closest(".ac-form").addClass("has-content"):(a=o.parents(".ac-reply-toolbar"),(i=o.closest(".ac-form")).removeClass("has-media"),a.find(".ac-reply-media-button")&&a.find(".ac-reply-media-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-document-button")&&a.find(".ac-reply-document-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-gif-button")&&a.find(".ac-reply-gif-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-video-button")&&a.find(".ac-reply-video-button").parents(".post-elements-buttons-item").removeClass("no-click").find(".toolbar-button").removeClass("active"),Z(l.dropzone_video_obj.element).removeClass("files-uploaded dz-progress-view").find(".dz-global-progress").remove(),l.validateCommentContent(i.find(".ac-textarea").children(".ac-input")))}),l.dropzone_video_obj.on("complete",function(){0===this.getUploadingFiles().length&&0===this.getQueuedFiles().length&&0/gi,"\n").replace(/<\/div>/gi,""))).replace(/ /g," ");""!==e.text().trim()||0<=t.indexOf("emojioneemoji")||e.closest("form").hasClass("acomment-edit")?e.closest("form").addClass("has-content"):e.closest("form").removeClass("has-content")},ReactionStatePopupTab:function(e){e.preventDefault(),Z(this).closest(".activity-state-popup").find(".activity-state-popup_tab_panel li a").removeClass("active"),Z(this).addClass("active"),Z(this).closest(".activity-state-popup").find(".activity-state-popup_tab_content .activity-state-popup_tab_item").removeClass("active"),Z(this).closest(".activity-state-popup").find("."+Z(this).data("tab")).addClass("active")},closeActivityState:function(){Z(".activity-state-popup").hide().removeClass("active")},listenCommentInput:function(e){var t,a;0/gi,"\n").replace(/<\/div>/gi,""));t=t.replace(/ /g," "),""!==jQuery(e.currentTarget).text().trim()||0<=t.indexOf("emojioneemoji")?jQuery(e.currentTarget).closest("form").addClass("has-content"):jQuery(e.currentTarget).closest("form").removeClass("has-content")}),Z(t).closest("form").addClass("events-initiated"),this.InitiatedCommentForms.push(a)))},activityRootComment:function(e){var t=Z(e.currentTarget).closest("#activity-modal"),a=t.find(".activity-item").data("bp-activity-id"),e=t.find("#ac-form-"+a);bp.Nouveau.Activity.resetActivityCommentForm(e,"hardReset"),t.find(".acomment-display").removeClass("display-focus"),t.find(".comment-item").removeClass("comment-item-focus"),t.find(".bb-modal-activity-footer").addClass("active").append(e),e.addClass("root"),e.find("#ac-input-"+a).focus(),bp.Nouveau.Activity.clearFeedbackNotice(e)},clearFeedbackNotice:function(e){e.find(".bp-ac-form-container").find(".bp-feedback").length&&e.find(".bp-ac-form-container").find(".bp-feedback").remove()},launchActivityPopup:function(e,t){var a=Z("#activity-"+e),i=Z(".bb-activity-model-wrapper"),o=a[0].outerHTML,d='[data-parent_comment_id="'+t+'"]',t=a.data("activity-popup-title");bp.Nouveau.Activity.activityHasUpdates=!1,bp.Nouveau.Activity.currentActivityId=null,bp.Nouveau.Activity.activityPinHasUpdates=!1,i.closest("body").addClass("acomments-modal-open"),i.show(),i.find("ul.activity-list").html(o),i.find(".bb-modal-activity-header h2").text(t),i.find(".bb-activity-video-elem").each(function(e,t){var o=Z(t);o.find("video").each(function(e,t){var a=Z(t),i=a.attr("id")+Math.floor(1e4*Math.random());a.attr("id",i);t=o.find(".video-action-wrap");a.insertAfter(t),o.find(".video-js").remove(),a.addClass("video-js"),videojs(i,{controls:!0,aspectRatio:"16:9",fluid:!0,playbackRates:[.5,1,1.5,2],fullscreenToggle:!1})})}),a.hasClass("bb-closed-comments")&&i.find("#activity-modal").addClass("bb-closed-comments");t=i.find("#ac-form-"+e);i.find(".acomment-display").removeClass("display-focus"),i.find(".comment-item").removeClass("comment-item-focus"),i.find(".bb-modal-activity-footer").addClass("active").append(t),t.removeClass("not-initialized").addClass("root"),t.find("#ac-input-"+e).focus(),bp.Nouveau.Activity.clearFeedbackNotice(t),t.removeClass("events-initiated");a=i.find(".bb-modal-activity-footer").find(".ac-input[contenteditable]");bp.Nouveau.Activity.listenCommentInput(a),i.find(".bb-activity-more-options-wrap .bb-activity-more-options-action, .bb-pin-action_button, .bb-mute-action_button").attr("data-balloon-pos","left"),i.find(".privacy-wrap").attr("data-bp-tooltip-pos","right"),i.find(d).children(".acomments-view-more").first().trigger("click"),_.isUndefined(BP_Nouveau.media)||_.isUndefined(BP_Nouveau.media.emoji)||bp.Nouveau.Activity.initializeEmojioneArea(!0,"#activity-modal ",e),void 0!==bp.Nouveau&&bp.Nouveau.reportPopUp(),bp.Nouveau.Activity.toggleMultiMediaOptions(t,"",".bb-modal-activity-footer")},viewMoreComments:function(e){e.preventDefault();var t=Z(e.currentTarget).parent(),i=Z(e.currentTarget),o=Z(t).data("activity_id"),d=Z(e.currentTarget).closest(".activity-comments"),s=Z(e.currentTarget).closest(".activity-item"),n=Z(t).data("parent_comment_id"),l="";i.addClass("loading").removeClass("acomments-view-more--hide"),d.addClass("active"),s.addClass("active"),i.html('
        ');var a={action:"activity_loadmore_comments",activity_id:o,parent_comment_id:n,offset:Z(e.currentTarget).parents(".activity-comments").find('ul[data-parent_comment_id ="'+n+'"] > li.comment-item:not(.bb-recent-comment)').length,activity_type_is_blog:1"+e.data.message+"

        ").removeClass("acomments-view-more--hide"),d.removeClass("active"),s.removeClass("active")):void 0!==e.data&&void 0!==e.data.comments&&(t=Z(".bb-internal-model .activity-comments").find("[data-activity_id='"+o+"'][data-parent_comment_id='"+n+"']"),a=Z(Z.parseHTML(e.data.comments)),0"+e.statusText+"

        ").removeClass("acomments-view-more--hide"),d.removeClass("active"),s.removeClass("active")})},autoloadMoreComments:function(){var e,t,a,i,o;0 ul > li.acomments-view-more:not(.loading), .bb-modal-activity-body .activity-comments .activity-actions > ul > li.acomments-view-more:not(.loading)"),o=Z(".bb-activity-model-wrapper .bb-modal-activity-body"),i=Z(".bb-activity-model-wrapper .bb-modal-activity-body").find(".activity-comments:not(.active)"),0a&&Z(e).trigger("click").addClass("loading")),setTimeout(function(){jQuery(window).scroll()},200))},activitySyncOnModalClose:function(e,t){e.preventDefault();var e=(Z(e.currentTarget).is(document)?Z(".bb-activity-model-wrapper"):Z(e.currentTarget).parents(".bb-activity-model-wrapper")).find("ul.activity-list > li").data("bp-activity-id"),e=void 0!==t?t:e,a=Z("#activity-stream li.activity-item[data-bp-activity-id="+e+"]");0 .bb-modal-activity-body .activity-item").data("bp-activity-id");0/gi,"\n").replace(/<\/div>/gi,""));t=t.replace(/ /g," "),""!==e.text()||0<=t.indexOf("emojioneemoji")?e.closest("form").addClass("has-content"):e.closest("form").removeClass("has-content")},picker_show:function(){Z(this.button[0]).closest(".post-emoji").addClass("active"),Z(".emojionearea-theatre").removeClass("hide").addClass("show")},picker_hide:function(){Z(this.button[0]).closest(".post-emoji").removeClass("active"),Z(".emojionearea-theatre").removeClass("show").addClass("hide")}}})}},bp.Nouveau.Activity.start())}((bp,jQuery)); \ No newline at end of file From ea88c4fd307d2e97224898569c703d91b57b1315 Mon Sep 17 00:00:00 2001 From: Yudhisthir Nahar Date: Wed, 1 Jan 2025 16:09:31 +0530 Subject: [PATCH 2/3] PROD-8092 Update the conditions supporting the media theatre --- src/bp-templates/bp-nouveau/js/buddypress-activity.js | 6 +++--- src/bp-templates/bp-nouveau/js/buddypress-activity.min.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bp-templates/bp-nouveau/js/buddypress-activity.js b/src/bp-templates/bp-nouveau/js/buddypress-activity.js index 6540437d03..e626071cfd 100644 --- a/src/bp-templates/bp-nouveau/js/buddypress-activity.js +++ b/src/bp-templates/bp-nouveau/js/buddypress-activity.js @@ -965,9 +965,9 @@ window.bp = window.bp || {}; // Add flag for ajax load for getting reactions. if ( 'activity_comment' === item_type ) { - $( '#acomment' + '-' + item_id ).find( '.activity-state-reactions' ).parent().addClass( 'bb-has-reaction_update' ); - } else { - $( '#' + item_type + '-' + item_id ).find( '.activity-state-reactions' ).parent().addClass( 'bb-has-reaction_update' ); + $( '.activity-comment[data-bp-activity-comment-id=' + item_id + '] > .acomment-display > .acomment_inner' ).find( '.activity-state-reactions' ).parent().addClass( 'bb-has-reaction_update' ); + } else if ( 'activity' === item_type ) { + $( '.activity[data-bp-activity-id=' + item_id + '] > .activity-content' ).find( '.activity-state-reactions' ).parent().addClass( 'bb-has-reaction_update' ); } } diff --git a/src/bp-templates/bp-nouveau/js/buddypress-activity.min.js b/src/bp-templates/bp-nouveau/js/buddypress-activity.min.js index f5d777d5b6..e0c6598258 100644 --- a/src/bp-templates/bp-nouveau/js/buddypress-activity.min.js +++ b/src/bp-templates/bp-nouveau/js/buddypress-activity.min.js @@ -1 +1 @@ -window.bp=window.bp||{},function(Z){"undefined"!=typeof BP_Nouveau&&(bp.Nouveau=bp.Nouveau||{},bp.Models=bp.Models||{},bp.Models.ACReply=Backbone.Model.extend({defaults:{gif_data:{}}}),bp.Nouveau.Activity={start:function(){this.setupGlobals(),this.addListeners()},setupGlobals:function(){this.just_posted=[],this.current_page=1,this.mentions_count=Number(Z(bp.Nouveau.objectNavParent+' [data-bp-scope="mentions"]').find("a span").html())||0,this.heartbeat_data={newest:"",highlights:{},last_recorded:0,first_recorded:0,document_title:Z(document).prop("title")},void 0!==window.Dropzone&&void 0!==BP_Nouveau.media&&(window.Dropzone.autoDiscover=!1,this.dropzone_options={url:BP_Nouveau.ajaxurl,timeout:108e5,dictFileTooBig:BP_Nouveau.media.dictFileTooBig,dictDefaultMessage:BP_Nouveau.media.dropzone_media_message,acceptedFiles:"image/*",autoProcessQueue:!0,addRemoveLinks:!0,uploadMultiple:!1,maxFiles:void 0!==BP_Nouveau.media.maxFiles?BP_Nouveau.media.maxFiles:10,maxFilesize:void 0!==BP_Nouveau.media.max_upload_size?BP_Nouveau.media.max_upload_size:2,dictMaxFilesExceeded:BP_Nouveau.media.media_dict_file_exceeded,dictCancelUploadConfirmation:BP_Nouveau.media.dictCancelUploadConfirmation,maxThumbnailFilesize:void 0!==BP_Nouveau.media.max_upload_size?BP_Nouveau.media.max_upload_size:2},void 0!==BP_Nouveau.media.dropzone_options&&Object.assign(this.dropzone_options,BP_Nouveau.media.dropzone_options)),this.dropzone_obj=null,this.dropzone_media=[],this.dropzone_document_obj=null,this.dropzone_document=[],this.dropzone_video_obj=null,this.dropzone_video=[],this.models=[],this.InitiatedCommentForms=[],this.activityHasUpdates=!1,this.currentActivityId=null,this.activityPinHasUpdates=!1},addListeners:function(){Z("body").hasClass("activity-singular")||Z("#buddypress").on("bp_heartbeat_send",this.heartbeatSend.bind(this)),Z("#buddypress").on("bp_heartbeat_tick",this.heartbeatTick.bind(this)),Z('#buddypress [data-bp-list="activity"]:not( #bb-schedule-posts_modal [data-bp-list="activity"] )').on("click","li.load-newest, li.load-more",this.injectActivities.bind(this)),Z("#buddypress").on("bp_ajax_request",'[data-bp-list="activity"]',this.scopeLoaded.bind(this)),Z("#activity-stream").on("click",".acomments-view-more",this.showActivity),Z("body").on("click",".bb-close-action-popup",this.closeActivity),Z(document).on("activityModalOpened",function(e,t){var a=t.activityId;Z(document).on("click",function(e){0li.bb-edit-privacy a",bp.Nouveau,this.activityPrivacyRedirect.bind(this)),Z('#buddypress [data-bp-list="activity"], #activity-modal').on("click",".activity-privacy>li:not(.bb-edit-privacy)",bp.Nouveau,this.activityPrivacyChange.bind(this)),Z('#buddypress [data-bp-list="activity"], #bb-media-model-container .activity-list, #activity-modal').on("click","span.privacy",bp.Nouveau,this.togglePrivacyDropdown.bind(this)),Z("#bb-media-model-container .activity-list").on("click",".activity-item",bp.Nouveau,this.activityActions.bind(this)),Z(".bb-activity-model-wrapper").on("click",".ac-form-placeholder",bp.Nouveau,this.activityRootComment.bind(this)),Z(document).keydown(this.commentFormAction),Z(document).click(this.togglePopupDropdown),Z('#buddypress [data-bp-list="activity"], #bb-media-model-container .activity-list, #activity-modal .activity-list, .bb-modal-activity-footer').on("click",".ac-reply-media-button",this.openCommentsMediaUploader.bind(this)),Z('#buddypress [data-bp-list="activity"], #bb-media-model-container .activity-list, #activity-modal .activity-list, .bb-modal-activity-footer').on("click",".ac-reply-document-button",this.openCommentsDocumentUploader.bind(this)),Z('#buddypress [data-bp-list="activity"], #bb-media-model-container .activity-list, #activity-modal .activity-list, .bb-modal-activity-footer').on("click",".ac-reply-video-button",this.openCommentsVideoUploader.bind(this)),Z('#buddypress [data-bp-list="activity"], #bb-media-model-container .activity-list, #activity-modal .activity-list, .bb-modal-activity-footer').on("click",".ac-reply-gif-button",this.openGifPicker.bind(this)),Z(document).on("click",".activity-state-popup_overlay",bp.Nouveau,this.closeActivityState.bind(this)),Z(document).on("click",".activity-state-popup .activity-state-popup_tab_panel a",this.ReactionStatePopupTab),_.isUndefined(BP_Nouveau.activity.params.autoload)||Z(window).scroll(this.loadMoreActivities),Z(".bb-activity-model-wrapper, .bb-media-model-wrapper").on("click",".acomments-view-more",this.viewMoreComments.bind(this)),Z(document).on("click","#activity-stream .activity-comments .view-more-comments, #activity-stream .activity-state-comments > .comments-count",function(e){e.preventDefault(),Z(this).parents("li.activity-item").find(".activity-comments > ul > li.acomments-view-more, .activity-comments > .activity-actions > ul > li.acomments-view-more").trigger("click")}),Z("#activity-modal > .bb-modal-activity-body").on("scroll",this.autoloadMoreComments.bind(this)),Z("#activity-modal > .bb-modal-activity-body").on("scroll",this.discardGifEmojiPicker.bind(this)),Z(".bb-activity-model-wrapper .bb-model-close-button").on("click",this.activitySyncOnModalClose.bind(this)),void 0!==BP_Nouveau.is_send_ajax_request&&"1"===BP_Nouveau.is_send_ajax_request?Z("#buddypress").on("bp_ajax_request",'[data-bp-list="activity"]',function(){setTimeout(function(){Z(".ac-form.not-initialized").each(function(){var e=Z(this),t=e.find(".ac-textarea");bp.Nouveau.Activity.toggleMultiMediaOptions(e,t)})},1e3)}):setTimeout(function(){Z(".ac-form.not-initialized").each(function(){var e=Z(this),t=e.find(".ac-textarea");bp.Nouveau.Activity.toggleMultiMediaOptions(e,t)})},1e3)},heartbeatSend:function(e,t){this.heartbeat_data.first_recorded=Z("#buddypress [data-bp-list] [data-bp-activity-id]:not(.bb-pinned)").first().data("bp-timestamp")||0;var a=Z("#buddypress [data-bp-list] [data-bp-activity-id]").first().data("bp-timestamp")||0;a>this.heartbeat_data.first_recorded&&(this.heartbeat_data.first_recorded=a),(0===this.heartbeat_data.last_recorded||this.heartbeat_data.first_recorded>this.heartbeat_data.last_recorded)&&(this.heartbeat_data.last_recorded=this.heartbeat_data.first_recorded),t.bp_activity_last_recorded=this.heartbeat_data.last_recorded,Z("#buddypress .dir-search input[type=search]").length&&(t.bp_activity_last_recorded_search_terms=Z("#buddypress .dir-search input[type=search]").val()),Z.extend(t,{bp_heartbeat:bp.Nouveau.getStorage("bp-activity")})},heartbeatTick:function(e,t){var a,i,o=bp.Nouveau.objects,d=bp.Nouveau.getStorage("bp-activity","scope"),s=this;void 0!==t&&t.bp_activity_newest_activities&&(this.heartbeat_data.newest=Z.trim(t.bp_activity_newest_activities.activities)+this.heartbeat_data.newest,this.heartbeat_data.last_recorded=Number(t.bp_activity_newest_activities.last_recorded),i=Z(this.heartbeat_data.newest).filter(".activity-item"),a=Number(i.length),o.push("mentions"),"all"===d?(Z.each(i,function(e,a){a=Z(a),Z.each(o,function(e,t){-1!==Z.inArray("bp-my-"+t,a.get(0).classList)&&(void 0===s.heartbeat_data.highlights[t]?s.heartbeat_data.highlights[t]=[a.data("bp-activity-id")]:-1===Z.inArray(a.data("bp-activity-id"),s.heartbeat_data.highlights[t])&&s.heartbeat_data.highlights[t].push(a.data("bp-activity-id")))})}),t=new RegExp("bp-my-("+o.join("|")+")","g"),this.heartbeat_data.newest=this.heartbeat_data.newest.replace(t,""),Z(bp.Nouveau.objectNavParent+' [data-bp-scope="all"]').find("a span").html(a)):(this.heartbeat_data.highlights[d]=[],Z.each(i,function(e,t){s.heartbeat_data.highlights[d].push(Z(t).data("bp-activity-id"))})),Z.each(o,function(e,t){var a;void 0!==s.heartbeat_data.highlights[t]&&s.heartbeat_data.highlights[t].length&&(a=0,"mentions"===t&&(a=s.mentions_count),Z(bp.Nouveau.objectNavParent+' [data-bp-scope="'+t+'"]').find("a span").html(Number(s.heartbeat_data.highlights[t].length)+a))}),o.pop(),Z(document).prop("title","("+a+") "+this.heartbeat_data.document_title),Z('#buddypress [data-bp-list="activity"]').first().hasClass("load-newest")?(i=Z('#buddypress [data-bp-list="activity"] .load-newest a').html(),Z('#buddypress [data-bp-list="activity"] .load-newest a').html(i.replace(/([0-9]+)/,a))):Z('#buddypress [data-bp-list="activity"] ul.activity-list').prepend('
      • '+BP_Nouveau.newest+" ("+a+")
      • "),Z('#buddypress [data-bp-list="activity"] li.load-newest').trigger("click"),Z('#buddypress [data-bp-list="activity"]').trigger("bp_heartbeat_pending",this.heartbeat_data),void 0!==bp.Nouveau&&bp.Nouveau.reportPopUp())},injectActivities:function(e){var t,a,i,o,d=bp.Nouveau.getStorage("bp-activity"),s=d.scope||null,d=d.filter||null;Z(e.currentTarget).hasClass("load-newest")?(e.preventDefault(),Z(e.currentTarget).remove(),i=Z.parseHTML(this.heartbeat_data.newest),Z.each(i,function(e,t){"LI"===t.nodeName&&Z(t).hasClass("just-posted")&&Z("#"+Z(t).prop("id")).length&&Z("#"+Z(t).prop("id")).remove()}),(0<(i=Z(e.delegateTarget).find(".activity-list .activity-item").first()).length&&i.hasClass("bb-pinned")?Z(i).after(this.heartbeat_data.newest):Z(e.delegateTarget).find(".activity-list").prepend(this.heartbeat_data.newest)).find("li.activity-item").each(bp.Nouveau.hideSingleUrl).trigger("bp_heartbeat_prepend",this.heartbeat_data),this.heartbeat_data.newest="","all"===s&&Z(bp.Nouveau.objectNavParent+' [data-bp-scope="all"]').find("a span").html(""),"mentions"===s&&(bp.Nouveau.ajax({action:"activity_clear_new_mentions"},"activity"),this.mentions_count=0),Z(bp.Nouveau.objectNavParent+' [data-bp-scope="'+s+'"]').find("a span").html(""),void 0!==this.heartbeat_data.highlights[s]&&(this.heartbeat_data.highlights[s]=[]),setTimeout(function(){Z(e.delegateTarget).find("[data-bp-activity-id]").removeClass("newest_"+s+"_activity")},3e3),Z(document).prop("title",this.heartbeat_data.document_title),jQuery(window).scroll()):Z(e.currentTarget).hasClass("load-more")&&(t=+Number(this.current_page)+1,a=this,i="",e.preventDefault(),(o=Z(e.currentTarget)).find("a").first().addClass("loading"),this.just_posted=[],Z(e.delegateTarget).children(".just-posted").each(function(){a.just_posted.push(Z(this).data("bp-activity-id"))}),Z("#buddypress .dir-search input[type=search]").length&&(i=Z("#buddypress .dir-search input[type=search]").val()),bp.Nouveau.objectRequest({object:"activity",scope:s,filter:d,search_terms:i,page:t,method:"append",exclude_just_posted:this.just_posted.join(","),target:'#buddypress [data-bp-list]:not( #bb-schedule-posts_modal [data-bp-list="activity"] ) ul.bp-list'}).done(function(e){!0===e.success&&(o.remove(),a.current_page=t,jQuery(window).scroll())})),Z(".activity-item.bb-closed-comments").find(".edit-activity, .acomment-edit").parents(".generic-button").hide()},hideComments:function(e){var a,i,o,e=Z(e.target).find(".activity-comments");e.length&&e.each(function(e,t){o=Z(t).children("ul").not(".conflict-activity-ul-li-comment"),(i=Z(o).find("li").not(Z(".document-action-class, .media-action-class, .video-action-class"))).length&&(Z("body").hasClass("activity-singular")&&""!==window.location.hash&&Z(window.location.hash).length&&0!==Z(window.location.hash).closest(".activity-comments").length||(a=Z(t).closest(".activity-item"),Z("#acomment-comment-"+a.data("bp-activity-id")+" span.comment-count").html(),i.each(function(e,t){if(e"),window.location.hash&&"#"+Z(t).attr("id")===window.location.hash)return Z(t).parents("li.comment-item").show(),!1;Z(t).addClass("bp-hidden").hide()}}),Z(o).children(".bp-hidden").length===Z(o).children("li").length-1&&Z(o).find("li.show-all").length&&Z(o).children("li:not(.show-all)").removeClass("bp-hidden").toggle()))})},showActivity:function(e){e.preventDefault();var t=Z(e.currentTarget).parent(),a=t.data("parent_comment_id"),t=Z(t).data("activity_id");Z(document).trigger("activityModalOpened",{activityId:t}),Z(e.currentTarget).parents(".activity-comments").find(".ac-form").each(function(){var e=Z(this),t=Z(this).closest(".activity-comments"),a=Z(this).closest(".comment-item");e.find(".post-elements-buttons-item.post-emoji").removeClass("active").empty(""),bp.Nouveau.Activity.resetActivityCommentForm(e,"hardReset"),t.append(e),a.find(".acomment-display").removeClass("display-focus"),a.removeClass("comment-item-focus")}),bp.Nouveau.Activity.launchActivityPopup(t,a)},closeActivity:function(e){e.preventDefault();var t=Z(e.target).closest(".bb-activity-model-wrapper"),a=t.find(".bb-modal-activity-footer"),i=t.find(".activity-item").data("bp-activity-id"),e=t.find("#ac-form-"+i);bp.Nouveau.Activity.reinitializeActivityCommentForm(e),_.isUndefined(BP_Nouveau.media)||_.isUndefined(BP_Nouveau.media.emoji)||bp.Nouveau.Activity.initializeEmojioneArea(!1,"",i),t.find("#activity-modal").removeClass("bb-closed-comments"),t.closest("body").removeClass("acomments-modal-open"),t.hide(),t.find("ul.activity-list").empty(),a.removeClass("active"),a.find("form.ac-form").remove()},scopeLoaded:function(e,a){this.current_page=1,"mentions"===a.scope&&void 0!==a.response.new_mentions?(Z.each(a.response.new_mentions,function(e,t){Z("#buddypress #activity-stream").find('[data-bp-activity-id="'+t+'"]').addClass("newest_mentions_activity")}),this.mentions_count=0):void 0!==this.heartbeat_data.highlights[a.scope]&&this.heartbeat_data.highlights[a.scope].length&&Z.each(this.heartbeat_data.highlights[a.scope],function(e,t){Z("#buddypress #activity-stream").find('[data-bp-activity-id="'+t+'"]').length&&Z("#buddypress #activity-stream").find('[data-bp-activity-id="'+t+'"]').addClass("newest_"+a.scope+"_activity")}),this.heartbeat_data.newest="",Z.each(Z(bp.Nouveau.objectNavParent+" [data-bp-scope]").find("a span"),function(e,t){0===parseInt(Z(t).html(),10)&&Z(t).html("")}),void 0!==this.heartbeat_data.highlights[a.scope]&&(this.heartbeat_data.highlights[a.scope]=[]),Z(document).prop("title",this.heartbeat_data.document_title),setTimeout(function(){Z("#buddypress #activity-stream .activity-item").removeClass("newest_"+a.scope+"_activity")},3e3),void 0!==window.instgrm&&window.instgrm.Embeds.process(),void 0!==window.FB&&void 0!==window.FB.XFBML&&window.FB.XFBML.parse(),this.fixAtWhoActivity(),this.openEditActivityPopup(),this.navigateToSpecificComment(),setTimeout(function(){jQuery(window).scroll()},200)},openEditActivityPopup:function(){var e,t;!_.isUndefined(BP_Nouveau.activity.params.is_activity_edit)&&0 ul");if(e.data.redirect)return window.location.href=e.data.redirect;e.data.parent_activity_id&&e.data.activity&&Z("body:not(.activity-singular) #buddypress #activity-stream ul.activity-list li#activity-"+e.data.parent_activity_id).replaceWith(e.data.activity),k&&(x=1,i=B.find(".acomments-view-more").data("child-count"),c.append(B.find("form")),Z.each(B.find("li.comment-item"),function(){x+=1}),x+=void 0!==i?parseFloat(i):0,N=m.find("span.comments-count"),z=N.text().length?N.text().match(/\d+/)[0]:0,z=Number(z-x),p.length?(i=1 ul").html().trim()&&t.removeClass("has-child-comments")}),k||c.data("bp-timestamp")!==d.Activity.heartbeat_data.last_recorded||(d.Activity.heartbeat_data.newest="",d.Activity.heartbeat_data.last_recorded=0),Z(document).trigger("bp_activity_ajax_delete_request",Z.extend(A,{response:e})),Z(document).trigger("bp_activity_ajax_delete_request_video",Z.extend(A,{response:e})),bp.Nouveau.Activity.activityHasUpdates=!0,bp.Nouveau.Activity.currentActivityId=r}P.removeClass("active")})}if(l.closest("span").hasClass("activity-read-more")){var T=l.closest("div"),U=l.closest("span");if(C=null,Z(T).hasClass("activity-inner")?C=r:Z(T).hasClass("acomment-content")&&(C=l.closest("li").data("bp-activity-comment-id")),!C)return e;e.preventDefault(),Z(U).addClass("loading"),d.ajax({action:"get_single_activity_content",id:C},"activity").done(function(e){"object"!=typeof e&&0@'+L+" ";_.isUndefined(BP_Nouveau.activity.params.user_id)||(D=BP_Nouveau.activity.params.user_id);var L={offset:-(Z(window).height()/2-75),easing:"swing"},I=M.get(0);jQuery("body").hasClass("bb-is-mobile")?setTimeout(function(){var e=300/gi,"\n").replace(/<\/div>/gi,""),O={action:"new_activity_comment",_wpnonce_new_activity_comment:Z("#_wpnonce_new_activity_comment").val(),comment_id:C,form_id:r,content:H};Z("#_bp_as_nonce_"+r).val()&&(O["_bp_as_nonce_"+r]=Z("#_bp_as_nonce_"+r).val()),this.dropzone_media.length&&(O.media=this.dropzone_media),this.dropzone_document.length&&(O.document=this.dropzone_document),this.dropzone_video.length&&(O.video=this.dropzone_video,_.isEmpty(O.content)&&(O.content="​")),_.isUndefined(this.models[r])||(n=this.models[r],O.gif_data=this.models[r].get("gif_data")),O.content=O.content.replace(/ /g," "),s.hasClass("acomment-edit")&&(O.edit_comment=!0);var Q=0"):t.append("
          ")),Q?s.closest("#activity-modal").find(".bb-modal-activity-body .activity-comments, .bb-modal-activity-body .activity-comments .activity-actions").children("ul").append(Z(a)):t.children("ul").append(Z(a).hide().fadeIn(200)),Z(s).find(".ac-input").first().html(""),t.parent().addClass("has-comments"),t.parent().addClass("comments-loaded"),m.addClass("has-comments")),s.removeClass("acomment-edit");t=s.find(".ac-reply-content");if(0'+BP_Nouveau.activity.strings.commentPostError+""):(e=e.responseJSON&&e.responseJSON.message?e.responseJSON.message:e.statusText,s.find(".ac-reply-content").after('
          '+e+"
          "))})}if(l.hasClass("edit")&&l.hasClass("edit-activity")&&(e.preventDefault(),H=c.data("bp-activity"),O=""!==c.data("link-url")?c.data("link-url"):null,void 0!==H&&(bp.Nouveau.Activity.postForm.displayEditActivityForm(H,O),l.closest("li").hasClass("groups")?Z("#bp-nouveau-activity-form").addClass("group-activity"):Z("#bp-nouveau-activity-form").removeClass("group-activity"),void 0!==bp.Nouveau.Media&&void 0!==bp.Nouveau.Media.Theatre&&(bp.Nouveau.Media.Theatre.is_open_media||bp.Nouveau.Media.Theatre.is_open_document)&&(Z(document).find(".bb-close-media-theatre").trigger("click"),Z(document).find(".bb-close-document-theatre").trigger("click")))),v&&(l.hasClass("bb-open-media-theatre")||l.hasClass("bb-open-video-theatre")||l.hasClass("bb-open-document-theatre")||l.hasClass("document-detail-wrap-description-popup"))&&(e.preventDefault(),l.closest("#activity-modal").find(".bb-modal-activity-header .bb-close-action-popup").trigger("click")),l.hasClass("pin-activity")||l.hasClass("unpin-activity")){if(e.preventDefault(),!r)return e;l.closest(".activity-item").addClass("loading-pin");var V="pin";l.hasClass("unpin-activity")&&(V="unpin"),d.ajax({action:"activity_update_pinned_post",id:r,pin_action:V},"activity").done(function(e){var t,a,i,o,d,s,n;l.closest(".activity-item").removeClass("loading-pin"),void 0!==(e="object"!=typeof e?JSON.parse(e):e).data&&void 0!==e.data.feedback&&(t=l.closest("ul.activity-list"),n=v?l.closest(".buddypress-wrap").find("#activity-stream"):l.closest("#activity-stream"),e.success&&(a=bp.Nouveau.getStorage("bp-activity","scope"),o=i=!1,d="",l.closest("li.activity-item").hasClass("groups")&&(o=!0,d=(d=l.closest("li.activity-item").attr("class").match(/group-\d+/))[0].replace("group-","")),n.hasClass("single-user")?i=!1:(n.hasClass("activity")&&"all"===a&&!o||n.hasClass("single-group"))&&(i=!0),"pin"===V?(i&&t.find("li.activity-item").removeClass("bb-pinned"),s="li.activity-item:not(.groups)",o&&!n.hasClass("single-group")?s="li.activity-item.group-"+d:o&&n.hasClass("single-group")&&(s="li.activity-item"),t.find(s).each(function(){var e=Z(this).find(".unpin-activity");e.removeClass("unpin-activity").addClass("pin-activity"),o?e.find("span").html(BP_Nouveau.activity.strings.pinGroupPost):e.find("span").html(BP_Nouveau.activity.strings.pinPost)}),i&&l.closest("li.activity-item").addClass("bb-pinned"),l.addClass("unpin-activity"),l.removeClass("pin-activity"),l.closest("li.activity-item").hasClass("groups")?l.find("span").html(BP_Nouveau.activity.strings.unpinGroupPost):l.find("span").html(BP_Nouveau.activity.strings.unpinPost)):"unpin"===V&&(l.closest("li.activity-item").removeClass("bb-pinned"),l.addClass("pin-activity"),l.removeClass("unpin-activity"),l.closest("li.activity-item").hasClass("groups")?l.find("span").html(BP_Nouveau.activity.strings.pinGroupPost):l.find("span").html(BP_Nouveau.activity.strings.pinPost)),"all"===a&&i&&(bp.Nouveau.Activity.heartbeat_data.last_recorded=0,bp.Nouveau.refreshActivities())),Z(document).trigger("bb_trigger_toast_message",["","
          "+e.data.feedback+"
          ","success",null,!0]))}).fail(function(){l.closest(".activity-item").removeClass("loading-pin"),Z(document).trigger("bb_trigger_toast_message",["","
          "+BP_Nouveau.activity.strings.pinPostError+"
          ","error",null,!0])})}if(l.hasClass("bb-icon-bell-slash")||l.hasClass("bb-icon-bell")){if(e.preventDefault(),!r)return e;l.closest(".activity-item").addClass("loading-mute");var q="mute";l.hasClass("bb-icon-bell")&&(q="unmute"),d.ajax({action:"toggle_activity_notification_status",id:r,notification_toggle_action:q},"activity").done(function(e){l.closest(".activity-item").removeClass("loading-mute"),void 0!==(e="object"!=typeof e?JSON.parse(e):e).data&&void 0!==e.data.feedback&&(e.success&&("mute"===q?(l.closest("li.activity-item").addClass("bb-muted"),l.removeClass("bb-icon-bell-slash"),l.addClass("bb-icon-bell"),l.attr("title",BP_Nouveau.activity.strings.unmuteNotification),l.find("span").html(BP_Nouveau.activity.strings.unmuteNotification)):"unmute"===q&&(l.closest("li.activity-item").removeClass("bb-muted"),l.removeClass("bb-icon-bell"),l.addClass("bb-icon-bell-slash"),l.attr("title",BP_Nouveau.activity.strings.muteNotification),l.find("span").html(BP_Nouveau.activity.strings.muteNotification)),void 0!==bp.Nouveau.Activity.activityHasUpdates&&(bp.Nouveau.Activity.activityHasUpdates=!0)),Z(document).trigger("bb_trigger_toast_message",["","
          "+e.data.feedback+"
          ","success",null,!0])),v&&(bp.Nouveau.Activity.activityPinHasUpdates=!0),bp.Nouveau.Activity.activityHasUpdates=!0,bp.Nouveau.Activity.currentActivityId=r}).fail(function(){l.closest(".activity-item").removeClass("loading-pin"),Z(document).trigger("bb_trigger_toast_message",["","
          "+BP_Nouveau.activity.strings.pinPostError+"
          ","error",null,!0])})}if(l.hasClass("close-activity-comment")||l.hasClass("unclose-activity-comment")){if(e.preventDefault(),!r)return e;l.closest(".activity-item").addClass("loading-pin");var W="close_comments";l.hasClass("unclose-activity-comment")&&(W="unclose_comments"),d.ajax({action:"activity_update_close_comments",id:r,close_comments_action:W},"activity").done(function(e){var t;l.closest(".activity-item").removeClass("loading-pin"),void 0!==(e="object"!=typeof e?JSON.parse(e):e).data&&void 0!==e.data.feedback&&(e.success&&(t=Z("#activity-stream > .activity-list").find("[data-bp-activity-id="+r+"]"),l.closest(".activity-item").find(".bb-activity-closed-comments-notice").remove(),"close_comments"===W?(l.closest("li.activity-item").addClass("bb-closed-comments"),0'+e.data.feedback+""),0'+e.data.feedback+""))):"unclose_comments"===W&&(l.closest("li.activity-item.bb-closed-comments").find(".edit-activity, .acomment-edit").parents(".generic-button").show(),l.closest("li.activity-item").removeClass("bb-closed-comments"),0"+e.data.feedback+"",e.success?"success":"error",null,!0]))}).fail(function(){l.closest(".activity-item").removeClass("loading-pin"),Z(document).trigger("bb_trigger_toast_message",["","
          "+BP_Nouveau.activity.strings.closeCommentsError+"
          ","error",null,!0])})}},commentFormAction:function(e){var t,a;return(e=e||window.event).target?t=e.target:e.srcElement&&(t=e.srcElement),3===t.nodeType&&(t=t.parentNode),!0!==e.altKey&&!0!==e.metaKey&&"TEXTAREA"===t.tagName&&Z(t).hasClass("ac-input")?void(27===(a=e.keyCode||e.which)&&!1===e.ctrlKey?"TEXTAREA"===t.tagName&&Z(t).closest("form").slideUp(200):e.ctrlKey&&13===a&&Z(t).val()&&Z(t).closest("form").find("[type=submit]").first().trigger("click")):e},togglePopupDropdown:function(e){var t;return(e=e||window.event).target?t=e.target:e.srcElement&&(t=e.srcElement),3===t.nodeType&&(t=t.parentNode),!0===e.altKey||!0===e.metaKey||Z(t).hasClass("privacy-wrap")||Z(t).parent().hasClass("privacy-wrap")?e:void Z("ul.activity-privacy").removeClass("bb-open")},loadMoreActivities:function(){var e,t=Z(".load-more:visible").last(),a=Z(window);t.closest(".activity-list").length&&t.get(0)&&!t.data("bp-autoloaded")&&(e=t.offset().top-50,a.scrollTop()+a.height()>e&&(t.data("bp-autoloaded",1),t.find("a").text(BP_Nouveau.activity.strings.loadingMore),t.find("a").trigger("click")))},destroyCommentMediaUploader:function(e){_.isNull(this.dropzone_obj)||(this.dropzone_obj.destroy(),Z("#ac-reply-post-media-uploader-"+e).html(""),Z("#ac-reply-post-media-uploader-1-"+e).html("")),this.dropzone_media=[],Z("#ac-reply-post-media-uploader-"+e).removeClass("open").addClass("closed"),Z("#ac-reply-media-button-"+e).removeClass("active")},destroyCommentDocumentUploader:function(e){_.isNull(this.dropzone_document_obj)||(this.dropzone_document_obj.destroy(),Z("#ac-reply-post-document-uploader-"+e).html("")),this.dropzone_document=[],Z("#ac-reply-post-document-uploader-"+e).removeClass("open").addClass("closed"),Z("#ac-reply-document-button-"+e).removeClass("active")},destroyCommentVideoUploader:function(e){_.isNull(this.dropzone_video_obj)||(this.dropzone_video_obj.destroy(),Z("#ac-reply-post-video-uploader-"+e).html("")),this.dropzone_video=[],Z("#ac-reply-post-video-uploader-"+e).removeClass("open").addClass("closed"),Z("#ac-reply-video-button-"+e).removeClass("active")},resetGifPicker:function(e){Z("#ac-reply-gif-button-"+e).closest(".post-gif").find(".gif-media-search-dropdown").removeClass("open").empty(),Z("#ac-reply-gif-button-"+e).removeClass("active"),Z(".gif-media-search-dropdown-standalone").removeClass("open").empty(),_.isUndefined(this.models[e])||(this.models[e].set("gif_data",{}),Z("#ac-reply-post-gif-"+e).find(".activity-attached-gif-container").removeAttr("style"))},openCommentsMediaUploader:function(e){var l=this,o=Z(e.currentTarget),t=o.data("ac-id"),a=o.closest(".bp-ac-form-container").find("#ac-reply-post-media-uploader-"+t),i=0'+t+""),this.removeFile(e),a.removeClass("media-uploading"))}),l.dropzone_obj.on("removedfile",function(e){if(l.dropzone_media.length)for(var t in l.dropzone_media)if(e.upload.uuid==l.dropzone_media[t].uuid){void 0===l.dropzone_media[t].saved||l.dropzone_media[t].saved||bp.Nouveau.Media.removeAttachment(l.dropzone_media[t].id),l.dropzone_media.splice(t,1);break}var a,i;_.isNull(l.dropzone_obj)||_.isNull(l.dropzone_obj.files)||0!==l.dropzone_obj.files.length?o.closest(".ac-form").addClass("has-content"):(a=o.parents(".ac-reply-toolbar"),(i=o.closest(".ac-form")).removeClass("has-media"),a.find(".ac-reply-document-button")&&a.find(".ac-reply-document-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-video-button")&&a.find(".ac-reply-video-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-gif-button")&&a.find(".ac-reply-gif-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-media-button")&&a.find(".ac-reply-media-button").parents(".post-elements-buttons-item").removeClass("no-click").find(".toolbar-button").removeClass("active"),Z(l.dropzone_obj.element).removeClass("files-uploaded dz-progress-view").find(".dz-global-progress").remove(),l.validateCommentContent(i.find(".ac-textarea").children(".ac-input")))}),l.dropzone_obj.on("complete",function(){0===this.getUploadingFiles().length&&0===this.getQueuedFiles().length&&0'+t+""),this.removeFile(e),a.removeClass("media-uploading"))}),l.dropzone_document_obj.on("removedfile",function(e){if(l.dropzone_document.length)for(var t in l.dropzone_document)if(e.upload.uuid==l.dropzone_document[t].uuid){void 0===l.dropzone_document[t].saved||l.dropzone_document[t].saved||bp.Nouveau.Media.removeAttachment(l.dropzone_document[t].id),l.dropzone_document.splice(t,1);break}var a,i;_.isNull(l.dropzone_document_obj)||_.isNull(l.dropzone_document_obj.files)||0!==l.dropzone_document_obj.files.length?o.closest(".ac-form").addClass("has-content"):(a=o.parents(".ac-reply-toolbar"),(i=o.closest(".ac-form")).removeClass("has-media"),a.find(".ac-reply-media-button")&&a.find(".ac-reply-media-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-video-button")&&a.find(".ac-reply-video-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-gif-button")&&a.find(".ac-reply-gif-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-document-button")&&a.find(".ac-reply-document-button").parents(".post-elements-buttons-item").removeClass("no-click").find(".toolbar-button").removeClass("active"),Z(l.dropzone_document_obj.element).removeClass("files-uploaded dz-progress-view").find(".dz-global-progress").remove(),l.validateCommentContent(i.find(".ac-textarea").children(".ac-input")))}),l.dropzone_document_obj.on("complete",function(){0===this.getUploadingFiles().length&&0===this.getQueuedFiles().length&&0'),Z(e.previewElement).closest(".dz-preview").addClass("dz-has-thumbnail")):bp.Nouveau.getVideoThumb&&bp.Nouveau.getVideoThumb(e,".dz-video-thumbnail")}),l.dropzone_video_obj.on("uploadprogress",function(){o.closest(".ac-form").addClass("media-uploading"),bp.Nouveau.dropZoneGlobalProgress&&bp.Nouveau.dropZoneGlobalProgress(this)}),l.dropzone_video_obj.on("success",function(e,t){if(100===e.upload.progress&&(Z(e.previewElement).find(".dz-progress-ring circle")[0].style.strokeDashoffset=0,Z(e.previewElement).find(".dz-progress-count").text("100% "+BP_Nouveau.video.i18n_strings.video_uploaded_text),Z(e.previewElement).closest(".dz-preview").addClass("dz-complete")),t.data.id)return e.id=t.id,t.data.uuid=e.upload.uuid,t.data.menu_order=Z(e.previewElement).closest(".dropzone").find(e.previewElement).index()-1,t.data.album_id=void 0!==BP_Nouveau.video&&void 0!==BP_Nouveau.video.album_id&&BP_Nouveau.video.album_id,t.data.group_id=void 0!==BP_Nouveau.video&&void 0!==BP_Nouveau.video.group_id&&BP_Nouveau.video.group_id,t.data.saved=!1,t.data.js_preview=Z(e.previewElement).find(".dz-video-thumbnail img").attr("src"),l.dropzone_video.push(t.data),e.previewElement.classList.add("dz-success");var a,i,o,d,s,n=t.data.feedback;for(e.previewElement.classList.add("dz-error"),s=[],i=0,o=(d=e.previewElement.querySelectorAll("[data-dz-errormessage]")).length;i'+t+""),this.removeFile(e),a.removeClass("media-uploading"))}),l.dropzone_video_obj.on("removedfile",function(e){if(l.dropzone_video.length)for(var t in l.dropzone_video)if(e.upload.uuid==l.dropzone_video[t].uuid){void 0===l.dropzone_video[t].saved||l.dropzone_video[t].saved||bp.Nouveau.Media.removeAttachment(l.dropzone_video[t].id),l.dropzone_video.splice(t,1);break}var a,i;_.isNull(l.dropzone_video_obj)||_.isNull(l.dropzone_video_obj.files)||0!==l.dropzone_video_obj.files.length?o.closest(".ac-form").addClass("has-content"):(a=o.parents(".ac-reply-toolbar"),(i=o.closest(".ac-form")).removeClass("has-media"),a.find(".ac-reply-media-button")&&a.find(".ac-reply-media-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-document-button")&&a.find(".ac-reply-document-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-gif-button")&&a.find(".ac-reply-gif-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-video-button")&&a.find(".ac-reply-video-button").parents(".post-elements-buttons-item").removeClass("no-click").find(".toolbar-button").removeClass("active"),Z(l.dropzone_video_obj.element).removeClass("files-uploaded dz-progress-view").find(".dz-global-progress").remove(),l.validateCommentContent(i.find(".ac-textarea").children(".ac-input")))}),l.dropzone_video_obj.on("complete",function(){0===this.getUploadingFiles().length&&0===this.getQueuedFiles().length&&0/gi,"\n").replace(/<\/div>/gi,""))).replace(/ /g," ");""!==e.text().trim()||0<=t.indexOf("emojioneemoji")||e.closest("form").hasClass("acomment-edit")?e.closest("form").addClass("has-content"):e.closest("form").removeClass("has-content")},ReactionStatePopupTab:function(e){e.preventDefault(),Z(this).closest(".activity-state-popup").find(".activity-state-popup_tab_panel li a").removeClass("active"),Z(this).addClass("active"),Z(this).closest(".activity-state-popup").find(".activity-state-popup_tab_content .activity-state-popup_tab_item").removeClass("active"),Z(this).closest(".activity-state-popup").find("."+Z(this).data("tab")).addClass("active")},closeActivityState:function(){Z(".activity-state-popup").hide().removeClass("active")},listenCommentInput:function(e){var t,a;0/gi,"\n").replace(/<\/div>/gi,""));t=t.replace(/ /g," "),""!==jQuery(e.currentTarget).text().trim()||0<=t.indexOf("emojioneemoji")?jQuery(e.currentTarget).closest("form").addClass("has-content"):jQuery(e.currentTarget).closest("form").removeClass("has-content")}),Z(t).closest("form").addClass("events-initiated"),this.InitiatedCommentForms.push(a)))},activityRootComment:function(e){var t=Z(e.currentTarget).closest("#activity-modal"),a=t.find(".activity-item").data("bp-activity-id"),e=t.find("#ac-form-"+a);bp.Nouveau.Activity.resetActivityCommentForm(e,"hardReset"),t.find(".acomment-display").removeClass("display-focus"),t.find(".comment-item").removeClass("comment-item-focus"),t.find(".bb-modal-activity-footer").addClass("active").append(e),e.addClass("root"),e.find("#ac-input-"+a).focus(),bp.Nouveau.Activity.clearFeedbackNotice(e)},clearFeedbackNotice:function(e){e.find(".bp-ac-form-container").find(".bp-feedback").length&&e.find(".bp-ac-form-container").find(".bp-feedback").remove()},launchActivityPopup:function(e,t){var a=Z("#activity-"+e),i=Z(".bb-activity-model-wrapper"),o=a[0].outerHTML,d='[data-parent_comment_id="'+t+'"]',t=a.data("activity-popup-title");bp.Nouveau.Activity.activityHasUpdates=!1,bp.Nouveau.Activity.currentActivityId=null,bp.Nouveau.Activity.activityPinHasUpdates=!1,i.closest("body").addClass("acomments-modal-open"),i.show(),i.find("ul.activity-list").html(o),i.find(".bb-modal-activity-header h2").text(t),i.find(".bb-activity-video-elem").each(function(e,t){var o=Z(t);o.find("video").each(function(e,t){var a=Z(t),i=a.attr("id")+Math.floor(1e4*Math.random());a.attr("id",i);t=o.find(".video-action-wrap");a.insertAfter(t),o.find(".video-js").remove(),a.addClass("video-js"),videojs(i,{controls:!0,aspectRatio:"16:9",fluid:!0,playbackRates:[.5,1,1.5,2],fullscreenToggle:!1})})}),a.hasClass("bb-closed-comments")&&i.find("#activity-modal").addClass("bb-closed-comments");t=i.find("#ac-form-"+e);i.find(".acomment-display").removeClass("display-focus"),i.find(".comment-item").removeClass("comment-item-focus"),i.find(".bb-modal-activity-footer").addClass("active").append(t),t.removeClass("not-initialized").addClass("root"),t.find("#ac-input-"+e).focus(),bp.Nouveau.Activity.clearFeedbackNotice(t),t.removeClass("events-initiated");a=i.find(".bb-modal-activity-footer").find(".ac-input[contenteditable]");bp.Nouveau.Activity.listenCommentInput(a),i.find(".bb-activity-more-options-wrap .bb-activity-more-options-action, .bb-pin-action_button, .bb-mute-action_button").attr("data-balloon-pos","left"),i.find(".privacy-wrap").attr("data-bp-tooltip-pos","right"),i.find(d).children(".acomments-view-more").first().trigger("click"),_.isUndefined(BP_Nouveau.media)||_.isUndefined(BP_Nouveau.media.emoji)||bp.Nouveau.Activity.initializeEmojioneArea(!0,"#activity-modal ",e),void 0!==bp.Nouveau&&bp.Nouveau.reportPopUp(),bp.Nouveau.Activity.toggleMultiMediaOptions(t,"",".bb-modal-activity-footer")},viewMoreComments:function(e){e.preventDefault();var t=Z(e.currentTarget).parent(),i=Z(e.currentTarget),o=Z(t).data("activity_id"),d=Z(e.currentTarget).closest(".activity-comments"),s=Z(e.currentTarget).closest(".activity-item"),n=Z(t).data("parent_comment_id"),l="";i.addClass("loading").removeClass("acomments-view-more--hide"),d.addClass("active"),s.addClass("active"),i.html('
          ');var a={action:"activity_loadmore_comments",activity_id:o,parent_comment_id:n,offset:Z(e.currentTarget).parents(".activity-comments").find('ul[data-parent_comment_id ="'+n+'"] > li.comment-item:not(.bb-recent-comment)').length,activity_type_is_blog:1"+e.data.message+"

          ").removeClass("acomments-view-more--hide"),d.removeClass("active"),s.removeClass("active")):void 0!==e.data&&void 0!==e.data.comments&&(t=Z(".bb-internal-model .activity-comments").find("[data-activity_id='"+o+"'][data-parent_comment_id='"+n+"']"),a=Z(Z.parseHTML(e.data.comments)),0"+e.statusText+"

          ").removeClass("acomments-view-more--hide"),d.removeClass("active"),s.removeClass("active")})},autoloadMoreComments:function(){var e,t,a,i,o;0 ul > li.acomments-view-more:not(.loading), .bb-modal-activity-body .activity-comments .activity-actions > ul > li.acomments-view-more:not(.loading)"),o=Z(".bb-activity-model-wrapper .bb-modal-activity-body"),i=Z(".bb-activity-model-wrapper .bb-modal-activity-body").find(".activity-comments:not(.active)"),0a&&Z(e).trigger("click").addClass("loading")),setTimeout(function(){jQuery(window).scroll()},200))},activitySyncOnModalClose:function(e,t){e.preventDefault();var e=(Z(e.currentTarget).is(document)?Z(".bb-activity-model-wrapper"):Z(e.currentTarget).parents(".bb-activity-model-wrapper")).find("ul.activity-list > li").data("bp-activity-id"),e=void 0!==t?t:e,a=Z("#activity-stream li.activity-item[data-bp-activity-id="+e+"]");0 .bb-modal-activity-body .activity-item").data("bp-activity-id");0/gi,"\n").replace(/<\/div>/gi,""));t=t.replace(/ /g," "),""!==e.text()||0<=t.indexOf("emojioneemoji")?e.closest("form").addClass("has-content"):e.closest("form").removeClass("has-content")},picker_show:function(){Z(this.button[0]).closest(".post-emoji").addClass("active"),Z(".emojionearea-theatre").removeClass("hide").addClass("show")},picker_hide:function(){Z(this.button[0]).closest(".post-emoji").removeClass("active"),Z(".emojionearea-theatre").removeClass("show").addClass("hide")}}})}},bp.Nouveau.Activity.start())}((bp,jQuery)); \ No newline at end of file +window.bp=window.bp||{},function(Z){"undefined"!=typeof BP_Nouveau&&(bp.Nouveau=bp.Nouveau||{},bp.Models=bp.Models||{},bp.Models.ACReply=Backbone.Model.extend({defaults:{gif_data:{}}}),bp.Nouveau.Activity={start:function(){this.setupGlobals(),this.addListeners()},setupGlobals:function(){this.just_posted=[],this.current_page=1,this.mentions_count=Number(Z(bp.Nouveau.objectNavParent+' [data-bp-scope="mentions"]').find("a span").html())||0,this.heartbeat_data={newest:"",highlights:{},last_recorded:0,first_recorded:0,document_title:Z(document).prop("title")},void 0!==window.Dropzone&&void 0!==BP_Nouveau.media&&(window.Dropzone.autoDiscover=!1,this.dropzone_options={url:BP_Nouveau.ajaxurl,timeout:108e5,dictFileTooBig:BP_Nouveau.media.dictFileTooBig,dictDefaultMessage:BP_Nouveau.media.dropzone_media_message,acceptedFiles:"image/*",autoProcessQueue:!0,addRemoveLinks:!0,uploadMultiple:!1,maxFiles:void 0!==BP_Nouveau.media.maxFiles?BP_Nouveau.media.maxFiles:10,maxFilesize:void 0!==BP_Nouveau.media.max_upload_size?BP_Nouveau.media.max_upload_size:2,dictMaxFilesExceeded:BP_Nouveau.media.media_dict_file_exceeded,dictCancelUploadConfirmation:BP_Nouveau.media.dictCancelUploadConfirmation,maxThumbnailFilesize:void 0!==BP_Nouveau.media.max_upload_size?BP_Nouveau.media.max_upload_size:2},void 0!==BP_Nouveau.media.dropzone_options&&Object.assign(this.dropzone_options,BP_Nouveau.media.dropzone_options)),this.dropzone_obj=null,this.dropzone_media=[],this.dropzone_document_obj=null,this.dropzone_document=[],this.dropzone_video_obj=null,this.dropzone_video=[],this.models=[],this.InitiatedCommentForms=[],this.activityHasUpdates=!1,this.currentActivityId=null,this.activityPinHasUpdates=!1},addListeners:function(){Z("body").hasClass("activity-singular")||Z("#buddypress").on("bp_heartbeat_send",this.heartbeatSend.bind(this)),Z("#buddypress").on("bp_heartbeat_tick",this.heartbeatTick.bind(this)),Z('#buddypress [data-bp-list="activity"]:not( #bb-schedule-posts_modal [data-bp-list="activity"] )').on("click","li.load-newest, li.load-more",this.injectActivities.bind(this)),Z("#buddypress").on("bp_ajax_request",'[data-bp-list="activity"]',this.scopeLoaded.bind(this)),Z("#activity-stream").on("click",".acomments-view-more",this.showActivity),Z("body").on("click",".bb-close-action-popup",this.closeActivity),Z(document).on("activityModalOpened",function(e,t){var a=t.activityId;Z(document).on("click",function(e){0li.bb-edit-privacy a",bp.Nouveau,this.activityPrivacyRedirect.bind(this)),Z('#buddypress [data-bp-list="activity"], #activity-modal').on("click",".activity-privacy>li:not(.bb-edit-privacy)",bp.Nouveau,this.activityPrivacyChange.bind(this)),Z('#buddypress [data-bp-list="activity"], #bb-media-model-container .activity-list, #activity-modal').on("click","span.privacy",bp.Nouveau,this.togglePrivacyDropdown.bind(this)),Z("#bb-media-model-container .activity-list").on("click",".activity-item",bp.Nouveau,this.activityActions.bind(this)),Z(".bb-activity-model-wrapper").on("click",".ac-form-placeholder",bp.Nouveau,this.activityRootComment.bind(this)),Z(document).keydown(this.commentFormAction),Z(document).click(this.togglePopupDropdown),Z('#buddypress [data-bp-list="activity"], #bb-media-model-container .activity-list, #activity-modal .activity-list, .bb-modal-activity-footer').on("click",".ac-reply-media-button",this.openCommentsMediaUploader.bind(this)),Z('#buddypress [data-bp-list="activity"], #bb-media-model-container .activity-list, #activity-modal .activity-list, .bb-modal-activity-footer').on("click",".ac-reply-document-button",this.openCommentsDocumentUploader.bind(this)),Z('#buddypress [data-bp-list="activity"], #bb-media-model-container .activity-list, #activity-modal .activity-list, .bb-modal-activity-footer').on("click",".ac-reply-video-button",this.openCommentsVideoUploader.bind(this)),Z('#buddypress [data-bp-list="activity"], #bb-media-model-container .activity-list, #activity-modal .activity-list, .bb-modal-activity-footer').on("click",".ac-reply-gif-button",this.openGifPicker.bind(this)),Z(document).on("click",".activity-state-popup_overlay",bp.Nouveau,this.closeActivityState.bind(this)),Z(document).on("click",".activity-state-popup .activity-state-popup_tab_panel a",this.ReactionStatePopupTab),_.isUndefined(BP_Nouveau.activity.params.autoload)||Z(window).scroll(this.loadMoreActivities),Z(".bb-activity-model-wrapper, .bb-media-model-wrapper").on("click",".acomments-view-more",this.viewMoreComments.bind(this)),Z(document).on("click","#activity-stream .activity-comments .view-more-comments, #activity-stream .activity-state-comments > .comments-count",function(e){e.preventDefault(),Z(this).parents("li.activity-item").find(".activity-comments > ul > li.acomments-view-more, .activity-comments > .activity-actions > ul > li.acomments-view-more").trigger("click")}),Z("#activity-modal > .bb-modal-activity-body").on("scroll",this.autoloadMoreComments.bind(this)),Z("#activity-modal > .bb-modal-activity-body").on("scroll",this.discardGifEmojiPicker.bind(this)),Z(".bb-activity-model-wrapper .bb-model-close-button").on("click",this.activitySyncOnModalClose.bind(this)),void 0!==BP_Nouveau.is_send_ajax_request&&"1"===BP_Nouveau.is_send_ajax_request?Z("#buddypress").on("bp_ajax_request",'[data-bp-list="activity"]',function(){setTimeout(function(){Z(".ac-form.not-initialized").each(function(){var e=Z(this),t=e.find(".ac-textarea");bp.Nouveau.Activity.toggleMultiMediaOptions(e,t)})},1e3)}):setTimeout(function(){Z(".ac-form.not-initialized").each(function(){var e=Z(this),t=e.find(".ac-textarea");bp.Nouveau.Activity.toggleMultiMediaOptions(e,t)})},1e3)},heartbeatSend:function(e,t){this.heartbeat_data.first_recorded=Z("#buddypress [data-bp-list] [data-bp-activity-id]:not(.bb-pinned)").first().data("bp-timestamp")||0;var a=Z("#buddypress [data-bp-list] [data-bp-activity-id]").first().data("bp-timestamp")||0;a>this.heartbeat_data.first_recorded&&(this.heartbeat_data.first_recorded=a),(0===this.heartbeat_data.last_recorded||this.heartbeat_data.first_recorded>this.heartbeat_data.last_recorded)&&(this.heartbeat_data.last_recorded=this.heartbeat_data.first_recorded),t.bp_activity_last_recorded=this.heartbeat_data.last_recorded,Z("#buddypress .dir-search input[type=search]").length&&(t.bp_activity_last_recorded_search_terms=Z("#buddypress .dir-search input[type=search]").val()),Z.extend(t,{bp_heartbeat:bp.Nouveau.getStorage("bp-activity")})},heartbeatTick:function(e,t){var a,i,o=bp.Nouveau.objects,d=bp.Nouveau.getStorage("bp-activity","scope"),s=this;void 0!==t&&t.bp_activity_newest_activities&&(this.heartbeat_data.newest=Z.trim(t.bp_activity_newest_activities.activities)+this.heartbeat_data.newest,this.heartbeat_data.last_recorded=Number(t.bp_activity_newest_activities.last_recorded),i=Z(this.heartbeat_data.newest).filter(".activity-item"),a=Number(i.length),o.push("mentions"),"all"===d?(Z.each(i,function(e,a){a=Z(a),Z.each(o,function(e,t){-1!==Z.inArray("bp-my-"+t,a.get(0).classList)&&(void 0===s.heartbeat_data.highlights[t]?s.heartbeat_data.highlights[t]=[a.data("bp-activity-id")]:-1===Z.inArray(a.data("bp-activity-id"),s.heartbeat_data.highlights[t])&&s.heartbeat_data.highlights[t].push(a.data("bp-activity-id")))})}),t=new RegExp("bp-my-("+o.join("|")+")","g"),this.heartbeat_data.newest=this.heartbeat_data.newest.replace(t,""),Z(bp.Nouveau.objectNavParent+' [data-bp-scope="all"]').find("a span").html(a)):(this.heartbeat_data.highlights[d]=[],Z.each(i,function(e,t){s.heartbeat_data.highlights[d].push(Z(t).data("bp-activity-id"))})),Z.each(o,function(e,t){var a;void 0!==s.heartbeat_data.highlights[t]&&s.heartbeat_data.highlights[t].length&&(a=0,"mentions"===t&&(a=s.mentions_count),Z(bp.Nouveau.objectNavParent+' [data-bp-scope="'+t+'"]').find("a span").html(Number(s.heartbeat_data.highlights[t].length)+a))}),o.pop(),Z(document).prop("title","("+a+") "+this.heartbeat_data.document_title),Z('#buddypress [data-bp-list="activity"]').first().hasClass("load-newest")?(i=Z('#buddypress [data-bp-list="activity"] .load-newest a').html(),Z('#buddypress [data-bp-list="activity"] .load-newest a').html(i.replace(/([0-9]+)/,a))):Z('#buddypress [data-bp-list="activity"] ul.activity-list').prepend('
        • '+BP_Nouveau.newest+" ("+a+")
        • "),Z('#buddypress [data-bp-list="activity"] li.load-newest').trigger("click"),Z('#buddypress [data-bp-list="activity"]').trigger("bp_heartbeat_pending",this.heartbeat_data),void 0!==bp.Nouveau&&bp.Nouveau.reportPopUp())},injectActivities:function(e){var t,a,i,o,d=bp.Nouveau.getStorage("bp-activity"),s=d.scope||null,d=d.filter||null;Z(e.currentTarget).hasClass("load-newest")?(e.preventDefault(),Z(e.currentTarget).remove(),i=Z.parseHTML(this.heartbeat_data.newest),Z.each(i,function(e,t){"LI"===t.nodeName&&Z(t).hasClass("just-posted")&&Z("#"+Z(t).prop("id")).length&&Z("#"+Z(t).prop("id")).remove()}),(0<(i=Z(e.delegateTarget).find(".activity-list .activity-item").first()).length&&i.hasClass("bb-pinned")?Z(i).after(this.heartbeat_data.newest):Z(e.delegateTarget).find(".activity-list").prepend(this.heartbeat_data.newest)).find("li.activity-item").each(bp.Nouveau.hideSingleUrl).trigger("bp_heartbeat_prepend",this.heartbeat_data),this.heartbeat_data.newest="","all"===s&&Z(bp.Nouveau.objectNavParent+' [data-bp-scope="all"]').find("a span").html(""),"mentions"===s&&(bp.Nouveau.ajax({action:"activity_clear_new_mentions"},"activity"),this.mentions_count=0),Z(bp.Nouveau.objectNavParent+' [data-bp-scope="'+s+'"]').find("a span").html(""),void 0!==this.heartbeat_data.highlights[s]&&(this.heartbeat_data.highlights[s]=[]),setTimeout(function(){Z(e.delegateTarget).find("[data-bp-activity-id]").removeClass("newest_"+s+"_activity")},3e3),Z(document).prop("title",this.heartbeat_data.document_title),jQuery(window).scroll()):Z(e.currentTarget).hasClass("load-more")&&(t=+Number(this.current_page)+1,a=this,i="",e.preventDefault(),(o=Z(e.currentTarget)).find("a").first().addClass("loading"),this.just_posted=[],Z(e.delegateTarget).children(".just-posted").each(function(){a.just_posted.push(Z(this).data("bp-activity-id"))}),Z("#buddypress .dir-search input[type=search]").length&&(i=Z("#buddypress .dir-search input[type=search]").val()),bp.Nouveau.objectRequest({object:"activity",scope:s,filter:d,search_terms:i,page:t,method:"append",exclude_just_posted:this.just_posted.join(","),target:'#buddypress [data-bp-list]:not( #bb-schedule-posts_modal [data-bp-list="activity"] ) ul.bp-list'}).done(function(e){!0===e.success&&(o.remove(),a.current_page=t,jQuery(window).scroll())})),Z(".activity-item.bb-closed-comments").find(".edit-activity, .acomment-edit").parents(".generic-button").hide()},hideComments:function(e){var a,i,o,e=Z(e.target).find(".activity-comments");e.length&&e.each(function(e,t){o=Z(t).children("ul").not(".conflict-activity-ul-li-comment"),(i=Z(o).find("li").not(Z(".document-action-class, .media-action-class, .video-action-class"))).length&&(Z("body").hasClass("activity-singular")&&""!==window.location.hash&&Z(window.location.hash).length&&0!==Z(window.location.hash).closest(".activity-comments").length||(a=Z(t).closest(".activity-item"),Z("#acomment-comment-"+a.data("bp-activity-id")+" span.comment-count").html(),i.each(function(e,t){if(e"),window.location.hash&&"#"+Z(t).attr("id")===window.location.hash)return Z(t).parents("li.comment-item").show(),!1;Z(t).addClass("bp-hidden").hide()}}),Z(o).children(".bp-hidden").length===Z(o).children("li").length-1&&Z(o).find("li.show-all").length&&Z(o).children("li:not(.show-all)").removeClass("bp-hidden").toggle()))})},showActivity:function(e){e.preventDefault();var t=Z(e.currentTarget).parent(),a=t.data("parent_comment_id"),t=Z(t).data("activity_id");Z(document).trigger("activityModalOpened",{activityId:t}),Z(e.currentTarget).parents(".activity-comments").find(".ac-form").each(function(){var e=Z(this),t=Z(this).closest(".activity-comments"),a=Z(this).closest(".comment-item");e.find(".post-elements-buttons-item.post-emoji").removeClass("active").empty(""),bp.Nouveau.Activity.resetActivityCommentForm(e,"hardReset"),t.append(e),a.find(".acomment-display").removeClass("display-focus"),a.removeClass("comment-item-focus")}),bp.Nouveau.Activity.launchActivityPopup(t,a)},closeActivity:function(e){e.preventDefault();var t=Z(e.target).closest(".bb-activity-model-wrapper"),a=t.find(".bb-modal-activity-footer"),i=t.find(".activity-item").data("bp-activity-id"),e=t.find("#ac-form-"+i);bp.Nouveau.Activity.reinitializeActivityCommentForm(e),_.isUndefined(BP_Nouveau.media)||_.isUndefined(BP_Nouveau.media.emoji)||bp.Nouveau.Activity.initializeEmojioneArea(!1,"",i),t.find("#activity-modal").removeClass("bb-closed-comments"),t.closest("body").removeClass("acomments-modal-open"),t.hide(),t.find("ul.activity-list").empty(),a.removeClass("active"),a.find("form.ac-form").remove()},scopeLoaded:function(e,a){this.current_page=1,"mentions"===a.scope&&void 0!==a.response.new_mentions?(Z.each(a.response.new_mentions,function(e,t){Z("#buddypress #activity-stream").find('[data-bp-activity-id="'+t+'"]').addClass("newest_mentions_activity")}),this.mentions_count=0):void 0!==this.heartbeat_data.highlights[a.scope]&&this.heartbeat_data.highlights[a.scope].length&&Z.each(this.heartbeat_data.highlights[a.scope],function(e,t){Z("#buddypress #activity-stream").find('[data-bp-activity-id="'+t+'"]').length&&Z("#buddypress #activity-stream").find('[data-bp-activity-id="'+t+'"]').addClass("newest_"+a.scope+"_activity")}),this.heartbeat_data.newest="",Z.each(Z(bp.Nouveau.objectNavParent+" [data-bp-scope]").find("a span"),function(e,t){0===parseInt(Z(t).html(),10)&&Z(t).html("")}),void 0!==this.heartbeat_data.highlights[a.scope]&&(this.heartbeat_data.highlights[a.scope]=[]),Z(document).prop("title",this.heartbeat_data.document_title),setTimeout(function(){Z("#buddypress #activity-stream .activity-item").removeClass("newest_"+a.scope+"_activity")},3e3),void 0!==window.instgrm&&window.instgrm.Embeds.process(),void 0!==window.FB&&void 0!==window.FB.XFBML&&window.FB.XFBML.parse(),this.fixAtWhoActivity(),this.openEditActivityPopup(),this.navigateToSpecificComment(),setTimeout(function(){jQuery(window).scroll()},200)},openEditActivityPopup:function(){var e,t;!_.isUndefined(BP_Nouveau.activity.params.is_activity_edit)&&0 .acomment-display > .acomment_inner").find(".activity-state-reactions").parent().addClass("bb-has-reaction_update"):"activity"===f&&Z(".activity[data-bp-activity-id="+C+"] > .activity-content").find(".activity-state-reactions").parent().addClass("bb-has-reaction_update"),void("fav"===b?void 0===e.data.directory_tab||""===e.data.directory_tab||Z(d.objectNavParent+' [data-bp-scope="favorites"]').length||Z(d.objectNavParent+' [data-bp-scope="all"]').after(e.data.directory_tab):"unfav"===b&&((t=Z('[data-bp-user-scope="favorites"]').hasClass("selected")||Z(d.objectNavParent+' [data-bp-scope="favorites"]').hasClass("selected"))&&c.remove(),void 0!==e.data.no_favorite&&(Z(d.objectNavParent+' [data-bp-scope="all"]').length&&Z(d.objectNavParent+' [data-bp-scope="all"]').hasClass("selected")?Z(d.objectNavParent+' [data-bp-scope="favorites"]').remove():t&&a.append(e.data.no_favorite)))));var t}).fail(function(){l.removeClass("loading")})}if(l.hasClass("delete-activity")||l.hasClass("acomment-delete")||l.hasClass("spam-activity")||l.hasClass("spam-activity-comment")){var w,N,z,j,P,B=l.closest("[data-bp-activity-comment-id]"),k=B.data("bp-activity-comment-id"),x=0;if((P=l.closest(".activity-comments")).addClass("active"),e.preventDefault(),void 0!==BP_Nouveau.confirm&&!1===window.confirm(BP_Nouveau.confirm))return!1;l.addClass("loading");var A={action:"delete_activity",id:r,_wpnonce:d.getLinkParams(l.prop("href"),"_wpnonce"),is_single:l.closest("[data-bp-single]").length};(l.hasClass("spam-activity")||l.hasClass("spam-activity-comment"))&&(A.action="bp_spam_activity"),w=c,k&&(delete A.is_single,A.id=k,A.is_comment=!0,w=B),d.ajax(A,"activity").done(function(e){if(l.removeClass("loading"),!1===e.success)w.append(e.data.feedback),w.find(".bp-feedback").hide().fadeIn(300);else{var t,a=w.closest(".has-child-comments");w.hasClass("has-child-comments")&&(t=w.closest("ul").closest("li"));var i,o=a.find("> ul");if(e.data.redirect)return window.location.href=e.data.redirect;e.data.parent_activity_id&&e.data.activity&&Z("body:not(.activity-singular) #buddypress #activity-stream ul.activity-list li#activity-"+e.data.parent_activity_id).replaceWith(e.data.activity),k&&(x=1,i=B.find(".acomments-view-more").data("child-count"),c.append(B.find("form")),Z.each(B.find("li.comment-item"),function(){x+=1}),x+=void 0!==i?parseFloat(i):0,N=m.find("span.comments-count"),z=N.text().length?N.text().match(/\d+/)[0]:0,z=Number(z-x),p.length?(i=1 ul").html().trim()&&t.removeClass("has-child-comments")}),k||c.data("bp-timestamp")!==d.Activity.heartbeat_data.last_recorded||(d.Activity.heartbeat_data.newest="",d.Activity.heartbeat_data.last_recorded=0),Z(document).trigger("bp_activity_ajax_delete_request",Z.extend(A,{response:e})),Z(document).trigger("bp_activity_ajax_delete_request_video",Z.extend(A,{response:e})),bp.Nouveau.Activity.activityHasUpdates=!0,bp.Nouveau.Activity.currentActivityId=r}P.removeClass("active")})}if(l.closest("span").hasClass("activity-read-more")){var T=l.closest("div"),U=l.closest("span");if(C=null,Z(T).hasClass("activity-inner")?C=r:Z(T).hasClass("acomment-content")&&(C=l.closest("li").data("bp-activity-comment-id")),!C)return e;e.preventDefault(),Z(U).addClass("loading"),d.ajax({action:"get_single_activity_content",id:C},"activity").done(function(e){"object"!=typeof e&&0@'+L+" ";_.isUndefined(BP_Nouveau.activity.params.user_id)||(D=BP_Nouveau.activity.params.user_id);var L={offset:-(Z(window).height()/2-75),easing:"swing"},I=M.get(0);jQuery("body").hasClass("bb-is-mobile")?setTimeout(function(){var e=300/gi,"\n").replace(/<\/div>/gi,""),O={action:"new_activity_comment",_wpnonce_new_activity_comment:Z("#_wpnonce_new_activity_comment").val(),comment_id:C,form_id:r,content:H};Z("#_bp_as_nonce_"+r).val()&&(O["_bp_as_nonce_"+r]=Z("#_bp_as_nonce_"+r).val()),this.dropzone_media.length&&(O.media=this.dropzone_media),this.dropzone_document.length&&(O.document=this.dropzone_document),this.dropzone_video.length&&(O.video=this.dropzone_video,_.isEmpty(O.content)&&(O.content="​")),_.isUndefined(this.models[r])||(n=this.models[r],O.gif_data=this.models[r].get("gif_data")),O.content=O.content.replace(/ /g," "),s.hasClass("acomment-edit")&&(O.edit_comment=!0);var Q=0"):t.append("
            ")),Q?s.closest("#activity-modal").find(".bb-modal-activity-body .activity-comments, .bb-modal-activity-body .activity-comments .activity-actions").children("ul").append(Z(a)):t.children("ul").append(Z(a).hide().fadeIn(200)),Z(s).find(".ac-input").first().html(""),t.parent().addClass("has-comments"),t.parent().addClass("comments-loaded"),m.addClass("has-comments")),s.removeClass("acomment-edit");t=s.find(".ac-reply-content");if(0'+BP_Nouveau.activity.strings.commentPostError+""):(e=e.responseJSON&&e.responseJSON.message?e.responseJSON.message:e.statusText,s.find(".ac-reply-content").after('
            '+e+"
            "))})}if(l.hasClass("edit")&&l.hasClass("edit-activity")&&(e.preventDefault(),H=c.data("bp-activity"),O=""!==c.data("link-url")?c.data("link-url"):null,void 0!==H&&(bp.Nouveau.Activity.postForm.displayEditActivityForm(H,O),l.closest("li").hasClass("groups")?Z("#bp-nouveau-activity-form").addClass("group-activity"):Z("#bp-nouveau-activity-form").removeClass("group-activity"),void 0!==bp.Nouveau.Media&&void 0!==bp.Nouveau.Media.Theatre&&(bp.Nouveau.Media.Theatre.is_open_media||bp.Nouveau.Media.Theatre.is_open_document)&&(Z(document).find(".bb-close-media-theatre").trigger("click"),Z(document).find(".bb-close-document-theatre").trigger("click")))),v&&(l.hasClass("bb-open-media-theatre")||l.hasClass("bb-open-video-theatre")||l.hasClass("bb-open-document-theatre")||l.hasClass("document-detail-wrap-description-popup"))&&(e.preventDefault(),l.closest("#activity-modal").find(".bb-modal-activity-header .bb-close-action-popup").trigger("click")),l.hasClass("pin-activity")||l.hasClass("unpin-activity")){if(e.preventDefault(),!r)return e;l.closest(".activity-item").addClass("loading-pin");var V="pin";l.hasClass("unpin-activity")&&(V="unpin"),d.ajax({action:"activity_update_pinned_post",id:r,pin_action:V},"activity").done(function(e){var t,a,i,o,d,s,n;l.closest(".activity-item").removeClass("loading-pin"),void 0!==(e="object"!=typeof e?JSON.parse(e):e).data&&void 0!==e.data.feedback&&(t=l.closest("ul.activity-list"),n=v?l.closest(".buddypress-wrap").find("#activity-stream"):l.closest("#activity-stream"),e.success&&(a=bp.Nouveau.getStorage("bp-activity","scope"),o=i=!1,d="",l.closest("li.activity-item").hasClass("groups")&&(o=!0,d=(d=l.closest("li.activity-item").attr("class").match(/group-\d+/))[0].replace("group-","")),n.hasClass("single-user")?i=!1:(n.hasClass("activity")&&"all"===a&&!o||n.hasClass("single-group"))&&(i=!0),"pin"===V?(i&&t.find("li.activity-item").removeClass("bb-pinned"),s="li.activity-item:not(.groups)",o&&!n.hasClass("single-group")?s="li.activity-item.group-"+d:o&&n.hasClass("single-group")&&(s="li.activity-item"),t.find(s).each(function(){var e=Z(this).find(".unpin-activity");e.removeClass("unpin-activity").addClass("pin-activity"),o?e.find("span").html(BP_Nouveau.activity.strings.pinGroupPost):e.find("span").html(BP_Nouveau.activity.strings.pinPost)}),i&&l.closest("li.activity-item").addClass("bb-pinned"),l.addClass("unpin-activity"),l.removeClass("pin-activity"),l.closest("li.activity-item").hasClass("groups")?l.find("span").html(BP_Nouveau.activity.strings.unpinGroupPost):l.find("span").html(BP_Nouveau.activity.strings.unpinPost)):"unpin"===V&&(l.closest("li.activity-item").removeClass("bb-pinned"),l.addClass("pin-activity"),l.removeClass("unpin-activity"),l.closest("li.activity-item").hasClass("groups")?l.find("span").html(BP_Nouveau.activity.strings.pinGroupPost):l.find("span").html(BP_Nouveau.activity.strings.pinPost)),"all"===a&&i&&(bp.Nouveau.Activity.heartbeat_data.last_recorded=0,bp.Nouveau.refreshActivities())),Z(document).trigger("bb_trigger_toast_message",["","
            "+e.data.feedback+"
            ","success",null,!0]))}).fail(function(){l.closest(".activity-item").removeClass("loading-pin"),Z(document).trigger("bb_trigger_toast_message",["","
            "+BP_Nouveau.activity.strings.pinPostError+"
            ","error",null,!0])})}if(l.hasClass("bb-icon-bell-slash")||l.hasClass("bb-icon-bell")){if(e.preventDefault(),!r)return e;l.closest(".activity-item").addClass("loading-mute");var q="mute";l.hasClass("bb-icon-bell")&&(q="unmute"),d.ajax({action:"toggle_activity_notification_status",id:r,notification_toggle_action:q},"activity").done(function(e){l.closest(".activity-item").removeClass("loading-mute"),void 0!==(e="object"!=typeof e?JSON.parse(e):e).data&&void 0!==e.data.feedback&&(e.success&&("mute"===q?(l.closest("li.activity-item").addClass("bb-muted"),l.removeClass("bb-icon-bell-slash"),l.addClass("bb-icon-bell"),l.attr("title",BP_Nouveau.activity.strings.unmuteNotification),l.find("span").html(BP_Nouveau.activity.strings.unmuteNotification)):"unmute"===q&&(l.closest("li.activity-item").removeClass("bb-muted"),l.removeClass("bb-icon-bell"),l.addClass("bb-icon-bell-slash"),l.attr("title",BP_Nouveau.activity.strings.muteNotification),l.find("span").html(BP_Nouveau.activity.strings.muteNotification)),void 0!==bp.Nouveau.Activity.activityHasUpdates&&(bp.Nouveau.Activity.activityHasUpdates=!0)),Z(document).trigger("bb_trigger_toast_message",["","
            "+e.data.feedback+"
            ","success",null,!0])),v&&(bp.Nouveau.Activity.activityPinHasUpdates=!0),bp.Nouveau.Activity.activityHasUpdates=!0,bp.Nouveau.Activity.currentActivityId=r}).fail(function(){l.closest(".activity-item").removeClass("loading-pin"),Z(document).trigger("bb_trigger_toast_message",["","
            "+BP_Nouveau.activity.strings.pinPostError+"
            ","error",null,!0])})}if(l.hasClass("close-activity-comment")||l.hasClass("unclose-activity-comment")){if(e.preventDefault(),!r)return e;l.closest(".activity-item").addClass("loading-pin");var W="close_comments";l.hasClass("unclose-activity-comment")&&(W="unclose_comments"),d.ajax({action:"activity_update_close_comments",id:r,close_comments_action:W},"activity").done(function(e){var t;l.closest(".activity-item").removeClass("loading-pin"),void 0!==(e="object"!=typeof e?JSON.parse(e):e).data&&void 0!==e.data.feedback&&(e.success&&(t=Z("#activity-stream > .activity-list").find("[data-bp-activity-id="+r+"]"),l.closest(".activity-item").find(".bb-activity-closed-comments-notice").remove(),"close_comments"===W?(l.closest("li.activity-item").addClass("bb-closed-comments"),0'+e.data.feedback+""),0'+e.data.feedback+""))):"unclose_comments"===W&&(l.closest("li.activity-item.bb-closed-comments").find(".edit-activity, .acomment-edit").parents(".generic-button").show(),l.closest("li.activity-item").removeClass("bb-closed-comments"),0"+e.data.feedback+"",e.success?"success":"error",null,!0]))}).fail(function(){l.closest(".activity-item").removeClass("loading-pin"),Z(document).trigger("bb_trigger_toast_message",["","
            "+BP_Nouveau.activity.strings.closeCommentsError+"
            ","error",null,!0])})}},commentFormAction:function(e){var t,a;return(e=e||window.event).target?t=e.target:e.srcElement&&(t=e.srcElement),3===t.nodeType&&(t=t.parentNode),!0!==e.altKey&&!0!==e.metaKey&&"TEXTAREA"===t.tagName&&Z(t).hasClass("ac-input")?void(27===(a=e.keyCode||e.which)&&!1===e.ctrlKey?"TEXTAREA"===t.tagName&&Z(t).closest("form").slideUp(200):e.ctrlKey&&13===a&&Z(t).val()&&Z(t).closest("form").find("[type=submit]").first().trigger("click")):e},togglePopupDropdown:function(e){var t;return(e=e||window.event).target?t=e.target:e.srcElement&&(t=e.srcElement),3===t.nodeType&&(t=t.parentNode),!0===e.altKey||!0===e.metaKey||Z(t).hasClass("privacy-wrap")||Z(t).parent().hasClass("privacy-wrap")?e:void Z("ul.activity-privacy").removeClass("bb-open")},loadMoreActivities:function(){var e,t=Z(".load-more:visible").last(),a=Z(window);t.closest(".activity-list").length&&t.get(0)&&!t.data("bp-autoloaded")&&(e=t.offset().top-50,a.scrollTop()+a.height()>e&&(t.data("bp-autoloaded",1),t.find("a").text(BP_Nouveau.activity.strings.loadingMore),t.find("a").trigger("click")))},destroyCommentMediaUploader:function(e){_.isNull(this.dropzone_obj)||(this.dropzone_obj.destroy(),Z("#ac-reply-post-media-uploader-"+e).html(""),Z("#ac-reply-post-media-uploader-1-"+e).html("")),this.dropzone_media=[],Z("#ac-reply-post-media-uploader-"+e).removeClass("open").addClass("closed"),Z("#ac-reply-media-button-"+e).removeClass("active")},destroyCommentDocumentUploader:function(e){_.isNull(this.dropzone_document_obj)||(this.dropzone_document_obj.destroy(),Z("#ac-reply-post-document-uploader-"+e).html("")),this.dropzone_document=[],Z("#ac-reply-post-document-uploader-"+e).removeClass("open").addClass("closed"),Z("#ac-reply-document-button-"+e).removeClass("active")},destroyCommentVideoUploader:function(e){_.isNull(this.dropzone_video_obj)||(this.dropzone_video_obj.destroy(),Z("#ac-reply-post-video-uploader-"+e).html("")),this.dropzone_video=[],Z("#ac-reply-post-video-uploader-"+e).removeClass("open").addClass("closed"),Z("#ac-reply-video-button-"+e).removeClass("active")},resetGifPicker:function(e){Z("#ac-reply-gif-button-"+e).closest(".post-gif").find(".gif-media-search-dropdown").removeClass("open").empty(),Z("#ac-reply-gif-button-"+e).removeClass("active"),Z(".gif-media-search-dropdown-standalone").removeClass("open").empty(),_.isUndefined(this.models[e])||(this.models[e].set("gif_data",{}),Z("#ac-reply-post-gif-"+e).find(".activity-attached-gif-container").removeAttr("style"))},openCommentsMediaUploader:function(e){var l=this,o=Z(e.currentTarget),t=o.data("ac-id"),a=o.closest(".bp-ac-form-container").find("#ac-reply-post-media-uploader-"+t),i=0'+t+""),this.removeFile(e),a.removeClass("media-uploading"))}),l.dropzone_obj.on("removedfile",function(e){if(l.dropzone_media.length)for(var t in l.dropzone_media)if(e.upload.uuid==l.dropzone_media[t].uuid){void 0===l.dropzone_media[t].saved||l.dropzone_media[t].saved||bp.Nouveau.Media.removeAttachment(l.dropzone_media[t].id),l.dropzone_media.splice(t,1);break}var a,i;_.isNull(l.dropzone_obj)||_.isNull(l.dropzone_obj.files)||0!==l.dropzone_obj.files.length?o.closest(".ac-form").addClass("has-content"):(a=o.parents(".ac-reply-toolbar"),(i=o.closest(".ac-form")).removeClass("has-media"),a.find(".ac-reply-document-button")&&a.find(".ac-reply-document-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-video-button")&&a.find(".ac-reply-video-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-gif-button")&&a.find(".ac-reply-gif-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-media-button")&&a.find(".ac-reply-media-button").parents(".post-elements-buttons-item").removeClass("no-click").find(".toolbar-button").removeClass("active"),Z(l.dropzone_obj.element).removeClass("files-uploaded dz-progress-view").find(".dz-global-progress").remove(),l.validateCommentContent(i.find(".ac-textarea").children(".ac-input")))}),l.dropzone_obj.on("complete",function(){0===this.getUploadingFiles().length&&0===this.getQueuedFiles().length&&0'+t+""),this.removeFile(e),a.removeClass("media-uploading"))}),l.dropzone_document_obj.on("removedfile",function(e){if(l.dropzone_document.length)for(var t in l.dropzone_document)if(e.upload.uuid==l.dropzone_document[t].uuid){void 0===l.dropzone_document[t].saved||l.dropzone_document[t].saved||bp.Nouveau.Media.removeAttachment(l.dropzone_document[t].id),l.dropzone_document.splice(t,1);break}var a,i;_.isNull(l.dropzone_document_obj)||_.isNull(l.dropzone_document_obj.files)||0!==l.dropzone_document_obj.files.length?o.closest(".ac-form").addClass("has-content"):(a=o.parents(".ac-reply-toolbar"),(i=o.closest(".ac-form")).removeClass("has-media"),a.find(".ac-reply-media-button")&&a.find(".ac-reply-media-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-video-button")&&a.find(".ac-reply-video-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-gif-button")&&a.find(".ac-reply-gif-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-document-button")&&a.find(".ac-reply-document-button").parents(".post-elements-buttons-item").removeClass("no-click").find(".toolbar-button").removeClass("active"),Z(l.dropzone_document_obj.element).removeClass("files-uploaded dz-progress-view").find(".dz-global-progress").remove(),l.validateCommentContent(i.find(".ac-textarea").children(".ac-input")))}),l.dropzone_document_obj.on("complete",function(){0===this.getUploadingFiles().length&&0===this.getQueuedFiles().length&&0'),Z(e.previewElement).closest(".dz-preview").addClass("dz-has-thumbnail")):bp.Nouveau.getVideoThumb&&bp.Nouveau.getVideoThumb(e,".dz-video-thumbnail")}),l.dropzone_video_obj.on("uploadprogress",function(){o.closest(".ac-form").addClass("media-uploading"),bp.Nouveau.dropZoneGlobalProgress&&bp.Nouveau.dropZoneGlobalProgress(this)}),l.dropzone_video_obj.on("success",function(e,t){if(100===e.upload.progress&&(Z(e.previewElement).find(".dz-progress-ring circle")[0].style.strokeDashoffset=0,Z(e.previewElement).find(".dz-progress-count").text("100% "+BP_Nouveau.video.i18n_strings.video_uploaded_text),Z(e.previewElement).closest(".dz-preview").addClass("dz-complete")),t.data.id)return e.id=t.id,t.data.uuid=e.upload.uuid,t.data.menu_order=Z(e.previewElement).closest(".dropzone").find(e.previewElement).index()-1,t.data.album_id=void 0!==BP_Nouveau.video&&void 0!==BP_Nouveau.video.album_id&&BP_Nouveau.video.album_id,t.data.group_id=void 0!==BP_Nouveau.video&&void 0!==BP_Nouveau.video.group_id&&BP_Nouveau.video.group_id,t.data.saved=!1,t.data.js_preview=Z(e.previewElement).find(".dz-video-thumbnail img").attr("src"),l.dropzone_video.push(t.data),e.previewElement.classList.add("dz-success");var a,i,o,d,s,n=t.data.feedback;for(e.previewElement.classList.add("dz-error"),s=[],i=0,o=(d=e.previewElement.querySelectorAll("[data-dz-errormessage]")).length;i'+t+""),this.removeFile(e),a.removeClass("media-uploading"))}),l.dropzone_video_obj.on("removedfile",function(e){if(l.dropzone_video.length)for(var t in l.dropzone_video)if(e.upload.uuid==l.dropzone_video[t].uuid){void 0===l.dropzone_video[t].saved||l.dropzone_video[t].saved||bp.Nouveau.Media.removeAttachment(l.dropzone_video[t].id),l.dropzone_video.splice(t,1);break}var a,i;_.isNull(l.dropzone_video_obj)||_.isNull(l.dropzone_video_obj.files)||0!==l.dropzone_video_obj.files.length?o.closest(".ac-form").addClass("has-content"):(a=o.parents(".ac-reply-toolbar"),(i=o.closest(".ac-form")).removeClass("has-media"),a.find(".ac-reply-media-button")&&a.find(".ac-reply-media-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-document-button")&&a.find(".ac-reply-document-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-gif-button")&&a.find(".ac-reply-gif-button").parents(".post-elements-buttons-item").removeClass("disable"),a.find(".ac-reply-video-button")&&a.find(".ac-reply-video-button").parents(".post-elements-buttons-item").removeClass("no-click").find(".toolbar-button").removeClass("active"),Z(l.dropzone_video_obj.element).removeClass("files-uploaded dz-progress-view").find(".dz-global-progress").remove(),l.validateCommentContent(i.find(".ac-textarea").children(".ac-input")))}),l.dropzone_video_obj.on("complete",function(){0===this.getUploadingFiles().length&&0===this.getQueuedFiles().length&&0/gi,"\n").replace(/<\/div>/gi,""))).replace(/ /g," ");""!==e.text().trim()||0<=t.indexOf("emojioneemoji")||e.closest("form").hasClass("acomment-edit")?e.closest("form").addClass("has-content"):e.closest("form").removeClass("has-content")},ReactionStatePopupTab:function(e){e.preventDefault(),Z(this).closest(".activity-state-popup").find(".activity-state-popup_tab_panel li a").removeClass("active"),Z(this).addClass("active"),Z(this).closest(".activity-state-popup").find(".activity-state-popup_tab_content .activity-state-popup_tab_item").removeClass("active"),Z(this).closest(".activity-state-popup").find("."+Z(this).data("tab")).addClass("active")},closeActivityState:function(){Z(".activity-state-popup").hide().removeClass("active")},listenCommentInput:function(e){var t,a;0/gi,"\n").replace(/<\/div>/gi,""));t=t.replace(/ /g," "),""!==jQuery(e.currentTarget).text().trim()||0<=t.indexOf("emojioneemoji")?jQuery(e.currentTarget).closest("form").addClass("has-content"):jQuery(e.currentTarget).closest("form").removeClass("has-content")}),Z(t).closest("form").addClass("events-initiated"),this.InitiatedCommentForms.push(a)))},activityRootComment:function(e){var t=Z(e.currentTarget).closest("#activity-modal"),a=t.find(".activity-item").data("bp-activity-id"),e=t.find("#ac-form-"+a);bp.Nouveau.Activity.resetActivityCommentForm(e,"hardReset"),t.find(".acomment-display").removeClass("display-focus"),t.find(".comment-item").removeClass("comment-item-focus"),t.find(".bb-modal-activity-footer").addClass("active").append(e),e.addClass("root"),e.find("#ac-input-"+a).focus(),bp.Nouveau.Activity.clearFeedbackNotice(e)},clearFeedbackNotice:function(e){e.find(".bp-ac-form-container").find(".bp-feedback").length&&e.find(".bp-ac-form-container").find(".bp-feedback").remove()},launchActivityPopup:function(e,t){var a=Z("#activity-"+e),i=Z(".bb-activity-model-wrapper"),o=a[0].outerHTML,d='[data-parent_comment_id="'+t+'"]',t=a.data("activity-popup-title");bp.Nouveau.Activity.activityHasUpdates=!1,bp.Nouveau.Activity.currentActivityId=null,bp.Nouveau.Activity.activityPinHasUpdates=!1,i.closest("body").addClass("acomments-modal-open"),i.show(),i.find("ul.activity-list").html(o),i.find(".bb-modal-activity-header h2").text(t),i.find(".bb-activity-video-elem").each(function(e,t){var o=Z(t);o.find("video").each(function(e,t){var a=Z(t),i=a.attr("id")+Math.floor(1e4*Math.random());a.attr("id",i);t=o.find(".video-action-wrap");a.insertAfter(t),o.find(".video-js").remove(),a.addClass("video-js"),videojs(i,{controls:!0,aspectRatio:"16:9",fluid:!0,playbackRates:[.5,1,1.5,2],fullscreenToggle:!1})})}),a.hasClass("bb-closed-comments")&&i.find("#activity-modal").addClass("bb-closed-comments");t=i.find("#ac-form-"+e);i.find(".acomment-display").removeClass("display-focus"),i.find(".comment-item").removeClass("comment-item-focus"),i.find(".bb-modal-activity-footer").addClass("active").append(t),t.removeClass("not-initialized").addClass("root"),t.find("#ac-input-"+e).focus(),bp.Nouveau.Activity.clearFeedbackNotice(t),t.removeClass("events-initiated");a=i.find(".bb-modal-activity-footer").find(".ac-input[contenteditable]");bp.Nouveau.Activity.listenCommentInput(a),i.find(".bb-activity-more-options-wrap .bb-activity-more-options-action, .bb-pin-action_button, .bb-mute-action_button").attr("data-balloon-pos","left"),i.find(".privacy-wrap").attr("data-bp-tooltip-pos","right"),i.find(d).children(".acomments-view-more").first().trigger("click"),_.isUndefined(BP_Nouveau.media)||_.isUndefined(BP_Nouveau.media.emoji)||bp.Nouveau.Activity.initializeEmojioneArea(!0,"#activity-modal ",e),void 0!==bp.Nouveau&&bp.Nouveau.reportPopUp(),bp.Nouveau.Activity.toggleMultiMediaOptions(t,"",".bb-modal-activity-footer")},viewMoreComments:function(e){e.preventDefault();var t=Z(e.currentTarget).parent(),i=Z(e.currentTarget),o=Z(t).data("activity_id"),d=Z(e.currentTarget).closest(".activity-comments"),s=Z(e.currentTarget).closest(".activity-item"),n=Z(t).data("parent_comment_id"),l="";i.addClass("loading").removeClass("acomments-view-more--hide"),d.addClass("active"),s.addClass("active"),i.html('
            ');var a={action:"activity_loadmore_comments",activity_id:o,parent_comment_id:n,offset:Z(e.currentTarget).parents(".activity-comments").find('ul[data-parent_comment_id ="'+n+'"] > li.comment-item:not(.bb-recent-comment)').length,activity_type_is_blog:1"+e.data.message+"

            ").removeClass("acomments-view-more--hide"),d.removeClass("active"),s.removeClass("active")):void 0!==e.data&&void 0!==e.data.comments&&(t=Z(".bb-internal-model .activity-comments").find("[data-activity_id='"+o+"'][data-parent_comment_id='"+n+"']"),a=Z(Z.parseHTML(e.data.comments)),0"+e.statusText+"

            ").removeClass("acomments-view-more--hide"),d.removeClass("active"),s.removeClass("active")})},autoloadMoreComments:function(){var e,t,a,i,o;0 ul > li.acomments-view-more:not(.loading), .bb-modal-activity-body .activity-comments .activity-actions > ul > li.acomments-view-more:not(.loading)"),o=Z(".bb-activity-model-wrapper .bb-modal-activity-body"),i=Z(".bb-activity-model-wrapper .bb-modal-activity-body").find(".activity-comments:not(.active)"),0a&&Z(e).trigger("click").addClass("loading")),setTimeout(function(){jQuery(window).scroll()},200))},activitySyncOnModalClose:function(e,t){e.preventDefault();var e=(Z(e.currentTarget).is(document)?Z(".bb-activity-model-wrapper"):Z(e.currentTarget).parents(".bb-activity-model-wrapper")).find("ul.activity-list > li").data("bp-activity-id"),e=void 0!==t?t:e,a=Z("#activity-stream li.activity-item[data-bp-activity-id="+e+"]");0 .bb-modal-activity-body .activity-item").data("bp-activity-id");0/gi,"\n").replace(/<\/div>/gi,""));t=t.replace(/ /g," "),""!==e.text()||0<=t.indexOf("emojioneemoji")?e.closest("form").addClass("has-content"):e.closest("form").removeClass("has-content")},picker_show:function(){Z(this.button[0]).closest(".post-emoji").addClass("active"),Z(".emojionearea-theatre").removeClass("hide").addClass("show")},picker_hide:function(){Z(this.button[0]).closest(".post-emoji").removeClass("active"),Z(".emojionearea-theatre").removeClass("show").addClass("hide")}}})}},bp.Nouveau.Activity.start())}((bp,jQuery)); \ No newline at end of file From 876d041164695dfa3b85e1b96e0117736cf17e5f Mon Sep 17 00:00:00 2001 From: Jitendra Banjara Date: Wed, 1 Jan 2025 16:21:54 +0530 Subject: [PATCH 3/3] PROD-8092 - Fix phpcbf --- src/bp-templates/bp-nouveau/js/bb-activity-reacted.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bp-templates/bp-nouveau/js/bb-activity-reacted.js b/src/bp-templates/bp-nouveau/js/bb-activity-reacted.js index 0521e7f529..c14a739bff 100644 --- a/src/bp-templates/bp-nouveau/js/bb-activity-reacted.js +++ b/src/bp-templates/bp-nouveau/js/bb-activity-reacted.js @@ -79,7 +79,7 @@ window.bp = window.bp || {}; if ( '' === $.trim( target.find( '#reaction-content-' + item_id ).html() ) || target.parent().hasClass( 'bb-has-reaction_update' ) ) { if ( '' !== $.trim( target.find( '#reaction-content-' + item_id ).html() ) ) { - target.find( '#reaction-content-' + item_id ).html(''); + target.find( '#reaction-content-' + item_id ).html( '' ); } self.collections[ collection_key ] = new bp.Collections.ActivityReactionCollection(); self.loader[ item_id ] = new bp.Views.ReactionPopup(