| 1 |
jQuery(document).ready(function(o){function t(t){t.preventDefault();var a=o(this).data("popup"),c=o(this).find("a").attr("href"),n=a.width,e=a.height,i="toolbar=0,scrollbars=1, location=0, width="+n+",height="+e+",left="+(o(window).width()-n)/2+",top="+(o(window).height()-e)/2;window.open(c,"mb-social-share-window",i).focus(),mbSocialTrack()}function a(t,a){var n=mb_ajax.ajaxurl,e=a.share_url,i=a.network,l=a.collection_id,a=(a.nonce,{block_name:"social",block_action:"ajax_get_count",action:"mbpro_collection_block_front",collection_id:l,collection_type:"social",block_data:{share_url:e,network:i}});o.ajax({type:"POST",url:n,data:a,success:function(o){c(o,t)}})}function c(t,a){var c=o.parseJSON(t),n=o(a).data("onload"),e=parseInt(n.count_threshold),i=parseInt(c.data.count);if(i>=e){var l=n.text,r=n.text2;l=(l=l.replace("{count}",i)).replace("{c}",i),r=(r=r.replace("{count}",i)).replace("{c}",i),o(a).find(".mb-text").html(l),o(a).find(".mb-text2").html(r)}}mbSocialTrack=function(o){},function(){if("function"!=typeof o)return void console.log("Maxbuttons : Jquery load conflict.");o(".maxcollection .mb-collection-item[data-popup]").on("click",t),o(".maxcollection .mb-collection-item[data-onload]").each(function(){var t=o(this).parents(".maxcollection").data("collection"),c=o(this).data("onload");c.collection_id=t,a(this,c)})}()}); |