Файл: InstantSocial/uploud/plugins/p_like/js/p_like.js
Строк: 68
<?php
$(document).ready(function() {
$('.like_href a').each(function() {
var item_id = $(this).attr('item');
var target_id = $(this).attr('target_id');
$(this).qtip({
style: {
width: 215,
padding: 0,
border: {
width: 1,
radius: 2,
color: '#6D8FB3'
},
tip: {size: {x: 20,y: 8},color: '#6D8FB3',corner: 'bottomMiddle'},
},
content: {
url: '/plugins/p_like/load.php',
data: {req: 'prev',i_id: item_id,t_id: target_id},
method: 'post'
},
position: {
corner: {
tooltip: "bottomMiddle",
target: 'topMiddle'
}
},
show: 'mouseover',
hide: {fixed: true,delay: 1000},
classes: {
title: 'tip-title'
} ,
api:{beforeShow:function(){
var count=$('.like_href a[item='+item_id+']').attr('count');
if (count == "") {
return false;
}
}}
});
});
});
function addlike(item, target, title, link, dep) {
$.post('/plugins/p_like/load.php', {req: 'add',i_id: item,t_id: target,des: title,tl: link,dp: dep}, function(resp) {
if (resp!="") {
var api = $('.like_href a[item='+item+']').qtip("api");
api.updateContent(resp.content);
$('.like_href a[item='+item+']').attr('count',resp.count);
if(parseInt($('#item_'+item).text())<parseInt(resp.count)){
$('#item_' + item).animate({top: "10px", opacity: 0.0}, 200)
.animate({top: "-10px"}, 300, function(){$(this).html(resp.count);})
.animate({top: "0px", opacity: 1}, 100)
.animate({top: "0px"} , 300);
}else{
if(resp.count!='nan'){
$('#item_' + item).animate({top: "-10px", opacity: 0.0}, 200)
.animate({top: "10px"}, 300, function(){$(this).html(resp.count);})
.animate({top: "0px", opacity: 1}, 100)
.animate({top: "0px"} , 300);
}else{
$('#item_' + item).html('');
$('.like_href a[item='+item+']').attr('count','');
var api = $('.like_href a[item='+item+']').qtip("api");
api.hide();
}
}
}
},"json");
}
function showAllLike(item,target){
$.post('/plugins/p_like/load.php',{req:'all',i_id:item,t_id:target,page:1},function(resp){
$.modal('<div id="like-modal-win">'+resp+'</div>',{overlayClose:true,minWidth:440,maxWidth:440,minHeight:400});
},'html');
}
function loadPageLike(item,target,page_n){
$('#like-modal-win').load('/plugins/p_like/load.php',{req:'all',i_id:item,t_id:target,page:page_n});
}
?>