/*=======================================================================*\
|| ###################################################################### ||
|| # vBulletin 5.1.9 Patch Level 4
|| # ------------------------------------------------------------------ # ||
|| # Copyright 2000-2016 vBulletin Solutions Inc. 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 D=[".summary-widget",".blogadmin-widget"];if(!vBulletin.pageHasSelectors(D)){return false}var A=function(){C("#blogSubscribersSeeAll").off("click").on("click",function(E){B(C(this).attr("data-node-id"));E.stopPropagation();return false})};var B=function(G,F,E){if(typeof H=="undefined"){var H=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:H,onPageChanged:function(I,J){B(G,I)}});H.off("click",".blog-subscribers-close").on("click",".blog-subscribers-close",function(){H.dialog("close")});H.off("click",".action_button").on("click",".action_button",function(){if(!C(this).hasClass("subscribepending_button")){var I=C(this);var K=parseInt(I.attr("data-userid"),10);var J="";if(I.hasClass("subscribe_button")){J="add"}else{if(I.hasClass("unsubscribe_button")){J="delete"}}if((typeof (K)=="number")&&J){C.ajax({url:vBulletin.getAjaxBaseurl()+"/profile/follow_button",type:"POST",dataType:"json",data:{"do":J,follower:K,type:"follow_members"},success:function(M){if(M==1||M==2){if(J=="add"){var L=(M==1)?"subscribed":"subscribepending";var N=(M==1)?"following":"following_pending";I.removeClass("subscribe_button special").addClass(L+"_button secondary").text(vBulletin.phrase.get(N))}else{if(J=="delete"){I.removeClass("subscribed_button unsubscribe_button special").addClass("subscribe_button secondary").text(vBulletin.phrase.get("follow"))}}}else{if(M.errors){openAlertDialog({title:vBulletin.phrase.get("profile_guser"),message:vBulletin.phrase.get("error_x",M.errors[0][0]),iconType:"error"})}}},error:function(){openAlertDialog({title:vBulletin.phrase.get("profile_guser"),message:vBulletin.phrase.get("unable_to_contact_server_please_try_again"),iconType:"error"})}})}}})}if(!F){F=1}if(!E){E=10}C.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/render/subscribers_list",type:"POST",data:{nodeid:G,page:F,perpage:E},dataType:"json",success:function(I){if(I&&I.errors){openAlertDialog({title:vBulletin.phrase.get("blog_subscribers"),message:vBulletin.phrase.get(I.errors[0]),iconType:"error"})}else{C(".blog-subscribers-content",H).html(I)}},error:function(){openAlertDialog({title:vBulletin.phrase.get("blog_subscribers"),message:vBulletin.phrase.get("unable_to_contact_server_please_try_again"),iconType:"error"})}});H.dialog("open")};C(document).ready(function(){A();var E;C(".adminmenu_container .admin-mainmenu .mainmenu").off("mouseenter").on("mouseenter",function(F){var G=C(this);E=setTimeout(function(){G.removeClass("pos-top").addClass("hover").closest(".admin-mainmenu").find(".mainmenu .submenu").hide().css("top","");var L={},I=C(".submenu",G).show();if(!vBulletin.isScrolledIntoView(I,L)){var K=C(document).height()-C(window).height(),J=C(document).scrollTop(),H=Math.abs(L.bottom);if(H<=(K-J)){C("html,body").animate({scrollTop:"+="+(J+H)},"slow")}else{I.css("top",-(I.height()+1)).parent().addClass("pos-top");if(!vBulletin.isScrolledIntoView(I,L)){C("html,body").animate({scrollTop:"-="+Math.abs(L.top)},"slow")}}}},200)}).off("mouseleave").on("mouseleave",function(F){clearTimeout(E);C(".submenu",this).hide();C(this).removeClass("hover")})})})(jQuery);