/*=======================================================================*\
|| ###################################################################### ||
|| # vBulletin 5.5.2
|| # ------------------------------------------------------------------ # ||
|| # Copyright 2000-2019 MH Sub I, LLC dba vBulletin. All Rights Reserved.  # ||
|| # This file may not be redistributed in whole or significant part.   # ||
|| # ----------------- VBULLETIN IS NOT FREE SOFTWARE ----------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html   # ||
|| ###################################################################### ||
\*========================================================================*/
window.vBulletin=window.vBulletin||{};window.vBulletin.phrase=window.vBulletin.phrase||{};window.vBulletin.phrase.precache=window.vBulletin.phrase.precache||[];window.vBulletin.phrase.precache=$.merge(window.vBulletin.phrase.precache,["blog_subscribers_list","blog_subscribers","unable_to_contact_server_please_try_again"]);(function(C){var E=[".summary-widget",".blogadmin-widget"];if(!vBulletin.pageHasSelectors(E)){return false}var A=function(){C("#blogSubscribersSeeAll").off("click").on("click",function(F){B(C(this).attr("data-node-id"));F.stopPropagation();return false})};var D;var B=function(H,G,F){D=C("#blogSubscribersAll").dialog({title:vBulletin.phrase.get("blog_subscribers_list"),autoOpen:false,modal:true,resizable:false,closeOnEscape:false,showCloseButton:false,width:450,dialogClass:"dialog-container dialog-box blog-subscribers-dialog"});vBulletin.pagination({context:D,onPageChanged:function(I,J){B(H,I)}});D.off("click",".blog-subscribers-close").on("click",".blog-subscribers-close",function(){D.dialog("close")});D.off("click",".action_button").on("click",".action_button",function(){if(!C(this).hasClass("subscribepending_button")){var I=C(this),K=parseInt(I.attr("data-userid"),10),J="";if(I.hasClass("subscribe_button")){J="add"}else{if(I.hasClass("unsubscribe_button")){J="delete"}}if((typeof (K)=="number")&&J){vBulletin.AJAX({call:"/profile/follow-button",data:{"do":J,follower:K,type:"follow_members"},success:function(O){if(O==1||O==2){var N,P,M;if(J=="add"){var L=(O==1)?"subscribed":"subscribepending";N="subscribe_button b-button b-button--special";P=L+"_button b-button b-button--secondary";M=(O==1)?"following":"following_pending";I.attr("disabled","disabled")}else{if(J=="delete"){N="subscribed_button unsubscribe_button b-button b-button--special";P="subscribe_button b-button b-button--secondary";M="follow"}}I.removeClass(N).addClass(P).text(vBulletin.phrase.get(M))}},title_phrase:"profile_guser",error_phrase:"unable_to_contact_server_please_try_again"})}}});if(!G){G=1}if(!F){F=10}vBulletin.AJAX({call:"/ajax/render/subscribers_list",data:{nodeid:H,page:G,perpage:F},success:function(I){D.dialog("close");C(".blog-subscribers-content",D).html(I);D.dialog("open")},title_phrase:"blog_subscribers",error_phrase:"unable_to_contact_server_please_try_again"})};C(document).ready(function(){A()})})(jQuery);