!function(e){e.lpObj=e.lpObj||{},lpObj.timeoutTimer=null,"function"!=typeof lpObj.jQRef&&"undefined"==typeof lpObj.jQRef&&(lpObj.jQRef=lp_jquery2_0_3),lpObj.jQRef(document).ready(function(){lpObj.jQRef(".like_post_box").show(),lpObj.jQRef(".subject_heading").on("mouseenter",function(e){e.preventDefault();var t=lpObj.jQRef(this).next().html();lpObj.jQRef("
").html(t).appendTo("body").fadeIn("slow")}).on("mouseleave",function(e){e.preventDefault(),lpObj.jQRef(".subject_details").fadeOut("slow"),lpObj.jQRef(".subject_details").remove()}).on("mousemove",function(e){e.preventDefault();var t=e.pageX+20,i=e.pageY+10,a=lpObj.jQRef("#wrapper").width()-t-50;lpObj.jQRef(".subject_details").css({top:i,left:t,width:a+"px"})}),lpObj.jQRef(".like_post_stats_menu a").on("click",function(e){lpObj.likePostsUtils.isNullUndefined(e)||(e.preventDefault(),e.stopPropagation()),lpObj.likePostStats.checkUrl(this.id)})})}(window),function(){function e(){}e.prototype=function(){var e=function(e){return o(e)&&null===lpObj.timeoutTimer?!1:void((null!==lpObj.timeoutTimer||"keyup"==e.type&&27==e.keyCode||"click"==e.type||"touchstart"==e.type)&&(clearTimeout(lpObj.timeoutTimer),lpObj.timeoutTimer=null,lpObj.jQRef(".like_posts_overlay").remove(),lpObj.jQRef(".like_posts_overlay").off("click"),lpObj.jQRef(document).off("click",lpObj.likePostsUtils.removeOverlay),lpObj.jQRef(document).off("keyup",lpObj.likePostsUtils.removeOverlay),lpObj.jQRef(document).off("touchstart",lpObj.likePostsUtils.removeOverlay)))},t=function(e,t){e.preventDefault();var i=lpObj.jQRef(t),a=i.parent();o(i.data("allselected"))?a.find("input").length===a.find("input:checked").length?(a.find("input:checkbox").prop("checked",!1),i.data("allselected",!1)):(a.find("input:checkbox").prop("checked",!0),i.data("allselected",!0)):i.data("allselected")===!1?(a.find("input:checkbox").prop("checked",!0),i.data("allselected",!0)):(a.find("input:checkbox").prop("checked",!1),i.data("allselected",!1))},i=function(){return navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/Windows Phone/i)?!0:!1},a=function(e){return{}.toString.call(e).toLowerCase()},o=function(e,t){var i=!1,o=a(e);switch(o){case"[object array]":0===e.length&&(i=!0);break;case"[object object]":0===Object.keys(e).length&&(i=!0);break;default:"undefined"==typeof e||null===e||""===e||"null"===e||"undefined"===e?i=!0:t&&(0===e||isNaN(e))&&(i=!0)}return i};return{removeOverlay:e,selectInputByLegend:t,isMobileDevice:i,isNullUndefined:o}}(),lpObj.likePostsUtils=e.prototype}(),function(){function e(){}e.prototype=function(){var e=!1,t=function(t,a,o){if(e===!0)return!1;var s=t.target.href.split("#")[1],l=void 0!==a?parseInt(a,10):0,n=void 0!==o?parseInt(o,10):0,r=void 0!==s?parseInt(s,10):0;return isNaN(l)||isNaN(n)?!1:(e=!0,void lpObj.jQRef.ajax({type:"POST",url:smf_scripturl+"?action=likeposts;sa=like_post",dataType:"json",data:{msg:l,rating:r,author:n}}).done(function(e){if(e.response){var t={msgId:l,count:void 0!==e.count?e.count:"",newText:e.newText,likeText:e.likeText,rating:r};i(t)}}).fail(function(e){console.log(e)}).always(function(e){console.log(e)}))},i=function(t){var i=parseInt(t.count,10);if(isNaN(i))return e=!1,!1;var a=lpObj.jQRef("#like_"+t.msgId),o=t.likeText,s=1===t.rating?"#0":"#1";var aq = $('.SF-LIKE-'+ t.msgId);if( aq.hasClass('unlike_link') ) { a.removeClass("unlike_link").addClass("like_link") } else { a.removeClass("like_link").addClass("unlike_link") } var oc = $('.postsayisi-'+ t.msgId); if(t.count > 0) { if( oc.hasClass('likeyok') ) { oc.removeClass("likeyok"); } } else { if(!oc.hasClass('likeyok')) { oc.addClass("likeyok"); } } lpObj.jQRef(a).attr("href",s),lpObj.jQRef(a).animate({left:"0px",opacity:"toggle"},200,"",function(){lpObj.jQRef(a).html(t.newText),lpObj.jQRef(a).animate({left:"0px",opacity:"toggle"},200)}),lpObj.jQRef("#like_count_"+t.msgId).length?""===o?lpObj.jQRef("#like_count_"+t.msgId).fadeOut(200).remove():lpObj.jQRef("#like_count_"+t.msgId).fadeOut(5,function(){lpObj.jQRef(this).html(""+o+"").fadeIn(5)}):lpObj.jQRef(this).html(""+o+"").fadeIn(200),lpObj.timeoutTimer=setTimeout(function(){e=!1,lpObj.likePostsUtils.removeOverlay()},200)},a=function(e){var amk = e;if(document.getElementById('sampbegeni_'+amk)) return $('#sampbegeni_'+amk).remove(); else return isNaN(e)?!1:void lpObj.jQRef.ajax({type:"GET",url:smf_scripturl+"?action=likepostsdata;sa=get_message_like_info",dataType:"json",data:{msg_id:amk}}).done(function(e){if(!e.response)return!1;if(e.data.length<=0)return!1;var t,i=e.data,a=0,o=''+t.member_liked_data.length+" "+o.usersWhoLiked+"
";for(var l=0,r=t.member_liked_data.length;r>l;l++)a+='';a+="'+o.mostPopularTopicSubHeading1+" "+t.msg_data.length+" "+o.mostPopularTopicSubHeading2+"
";for(var l=0,r=t.msg_data.length;r>l;l++){var d=s+".msg"+t.msg_data[l].id_msg;a+=' "}lpObj.jQRef("#like_post_current_tab").text(o.mostLikedTopic),lpObj.jQRef(".like_post_topic_data").html(a).show(),n()},_=function(){var t=i[e],a="",s=smf_scripturl+"?board="+t.id_board;lpObj.jQRef(".like_post_board_data").html(""),a+=''+t.name+" "+o.mostPopularBoardHeading1+" "+t.like_count+" "+o.genricHeading1+"",a+=''+o.mostPopularBoardSubHeading1+" "+t.num_topics+" "+o.mostPopularBoardSubHeading2+" "+t.topics_liked+" "+o.mostPopularBoardSubHeading3+"
",a+=''+o.mostPopularBoardSubHeading4+" "+t.num_posts+" "+o.mostPopularBoardSubHeading5+" "+t.msgs_liked+" "+o.mostPopularBoardSubHeading6+"
";for(var l=0,r=t.topic_data.length;r>l;l++){var d=smf_scripturl+"?topic="+t.topic_data[l].id_topic;a+=' "}lpObj.jQRef("#like_post_current_tab").text(o.mostLikedBoard),lpObj.jQRef(".like_post_board_data").html(a).show(),n()},u=function(){var t=i[e],a="";lpObj.jQRef(".like_post_most_liked_user_data").html(""),a+=''+o.mostPopularUserHeading1+"
";for(var s=0,l=t.topic_data.length;l>s;s++){var r=smf_scripturl+"?topic="+t.topic_data[s].id_topic+".msg"+t.topic_data[s].id_msg;a+=' "}lpObj.jQRef("#like_post_current_tab").text(o.mostLikedMember),lpObj.jQRef(".like_post_most_liked_user_data").html(a).show(),n()},m=function(){var t=i[e],a="";lpObj.jQRef(".like_post_most_likes_given_user_data").html(""),a+=''+o.mostLikeGivenUserHeading1+"
";for(var s=0,l=t.topic_data.length;l>s;s++){var r=smf_scripturl+"?topic="+t.topic_data[s].id_topic+".msg"+t.topic_data[s].id_msg;a+=' "}lpObj.jQRef("#like_post_current_tab").text(o.mostLikeGivingMember),lpObj.jQRef(".like_post_most_likes_given_user_data").html(a).show(),n()},j=function(e){lpObj.jQRef(".like_post_stats_error").html(e.errorMsg).show(),n()};return{init:s,checkUrl:d}}(),lpObj.likePostStats=e.prototype}();