|
|
|
@ -236,6 +236,7 @@ Contacts={ |
|
|
|
|
delete:function() { |
|
|
|
|
$('#contacts_deletecard').tipsy('hide'); |
|
|
|
|
$.getJSON('ajax/deletecard.php',{'id':this.id},function(jsondata){ |
|
|
|
|
console.log('Card.delete: ' + this.id); |
|
|
|
|
if(jsondata.status == 'success'){ |
|
|
|
|
$('#leftcontent [data-id="'+jsondata.data.id+'"]').remove(); |
|
|
|
|
$('#rightcontent').data('id',''); |
|
|
|
@ -1055,6 +1056,7 @@ $(document).ready(function(){ |
|
|
|
|
*/ |
|
|
|
|
$('#leftcontent li').live('click',function(){ |
|
|
|
|
var id = $(this).data('id'); |
|
|
|
|
console.log('Contact ' + id + ' clicked.'); |
|
|
|
|
var oldid = $('#rightcontent').data('id'); |
|
|
|
|
if(oldid != 0){ |
|
|
|
|
$('#leftcontent li[data-id="'+oldid+'"]').removeClass('active'); |
|
|
|
@ -1094,32 +1096,32 @@ $(document).ready(function(){ |
|
|
|
|
/** |
|
|
|
|
* Add and insert a new contact into the list. NOTE: Deprecated |
|
|
|
|
*/ |
|
|
|
|
$('#contacts_addcardform input[type="submit"]').live('click',function(){ |
|
|
|
|
$.post('ajax/addcontact.php',$('#contact_identity').serialize(),function(jsondata){ |
|
|
|
|
if(jsondata.status == 'success'){ |
|
|
|
|
$('#rightcontent').data('id',jsondata.data.id); |
|
|
|
|
$('#rightcontent').html(jsondata.data.page); |
|
|
|
|
$('#leftcontent .active').removeClass('active'); |
|
|
|
|
var item = '<li data-id="'+jsondata.data.id+'" class="active"><a href="index.php?id='+jsondata.data.id+'" style="background: url(thumbnail.php?id='+jsondata.data.id+') no-repeat scroll 0% 0% transparent;">'+jsondata.data.name+'</a></li>'; |
|
|
|
|
var added = false; |
|
|
|
|
$('#leftcontent ul li').each(function(){ |
|
|
|
|
if ($(this).text().toLowerCase() > jsondata.data.name.toLowerCase()) { |
|
|
|
|
$(this).before(item).fadeIn('fast'); |
|
|
|
|
added = true; |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
if(!added) { |
|
|
|
|
$('#leftcontent ul').append(item); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
Contacts.UI.messageBox(t('contacts', 'Error'), jsondata.data.message); |
|
|
|
|
//alert(jsondata.data.message);
|
|
|
|
|
} |
|
|
|
|
}, 'json'); |
|
|
|
|
return false; |
|
|
|
|
}); |
|
|
|
|
// $('#contacts_addcardform input[type="submit"]').live('click',function(){
|
|
|
|
|
// $.post('ajax/addcontact.php',$('#contact_identity').serialize(),function(jsondata){
|
|
|
|
|
// if(jsondata.status == 'success'){
|
|
|
|
|
// $('#rightcontent').data('id',jsondata.data.id);
|
|
|
|
|
// $('#rightcontent').html(jsondata.data.page);
|
|
|
|
|
// $('#leftcontent .active').removeClass('active');
|
|
|
|
|
// var item = '<li data-id="'+jsondata.data.id+'" class="active"><a href="index.php?id='+jsondata.data.id+'" style="background: url(thumbnail.php?id='+jsondata.data.id+') no-repeat scroll 0% 0% transparent;">'+jsondata.data.name+'</a></li>';
|
|
|
|
|
// var added = false;
|
|
|
|
|
// $('#leftcontent ul li').each(function(){
|
|
|
|
|
// if ($(this).text().toLowerCase() > jsondata.data.name.toLowerCase()) {
|
|
|
|
|
// $(this).before(item).fadeIn('fast');
|
|
|
|
|
// added = true;
|
|
|
|
|
// return false;
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// if(!added) {
|
|
|
|
|
// $('#leftcontent ul').append(item);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// else{
|
|
|
|
|
// Contacts.UI.messageBox(t('contacts', 'Error'), jsondata.data.message);
|
|
|
|
|
// //alert(jsondata.data.message);
|
|
|
|
|
// }
|
|
|
|
|
// }, 'json');
|
|
|
|
|
// return false;
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
$('#contacts li').bind('inview', function(event, isInView, visiblePartX, visiblePartY) { |
|
|
|
|
if (isInView) { //NOTE: I've kept all conditions for future reference ;-)
|
|
|
|
|