Skip to content
Snippets Groups Projects
Commit 110f96df authored by Jakob Sack's avatar Jakob Sack
Browse files

At least dome layout in Contacts

parent b6b00393
Branches
No related tags found
No related merge requests found
...@@ -4,12 +4,12 @@ $(document).ready(function(){ ...@@ -4,12 +4,12 @@ $(document).ready(function(){
return false; return false;
});*/ });*/
$('#contacts_contacts li').live('click',function(){ $('#leftcontent li').live('click',function(){
var id = $(this).data('id'); var id = $(this).data('id');
$.getJSON('ajax/getdetails.php',{'id':id},function(jsondata){ $.getJSON('ajax/getdetails.php',{'id':id},function(jsondata){
if(jsondata.status == 'success'){ if(jsondata.status == 'success'){
$('#contacts_details').data('id',jsondata.data.id); $('#rightcontent').data('id',jsondata.data.id);
$('#contacts_details').html(jsondata.data.page); $('#rightcontent').html(jsondata.data.page);
} }
else{ else{
alert(jsondata.data.message); alert(jsondata.data.message);
...@@ -19,12 +19,12 @@ $(document).ready(function(){ ...@@ -19,12 +19,12 @@ $(document).ready(function(){
}); });
$('#contacts_deletecard').live('click',function(){ $('#contacts_deletecard').live('click',function(){
var id = $('#contacts_details').data('id'); var id = $('#rightcontent').data('id');
$.getJSON('ajax/deletecard.php',{'id':id},function(jsondata){ $.getJSON('ajax/deletecard.php',{'id':id},function(jsondata){
if(jsondata.status == 'success'){ if(jsondata.status == 'success'){
$('#contacts_contacts [data-id="'+jsondata.data.id+'"]').remove(); $('#leftcontent [data-id="'+jsondata.data.id+'"]').remove();
$('#contacts_details').data('id',''); $('#rightcontent').data('id','');
$('#contacts_details').html(''); $('#rightcontent').html('');
} }
else{ else{
alert(jsondata.data.message); alert(jsondata.data.message);
...@@ -34,10 +34,10 @@ $(document).ready(function(){ ...@@ -34,10 +34,10 @@ $(document).ready(function(){
}); });
$('#contacts_addproperty').live('click',function(){ $('#contacts_addproperty').live('click',function(){
var id = $('#contacts_details').data('id'); var id = $('#rightcontent').data('id');
$.getJSON('ajax/showaddproperty.php',{'id':id},function(jsondata){ $.getJSON('ajax/showaddproperty.php',{'id':id},function(jsondata){
if(jsondata.status == 'success'){ if(jsondata.status == 'success'){
$('#contacts_details').append(jsondata.data.page); $('#rightcontent').append(jsondata.data.page);
} }
else{ else{
alert(jsondata.data.message); alert(jsondata.data.message);
...@@ -79,8 +79,8 @@ $(document).ready(function(){ ...@@ -79,8 +79,8 @@ $(document).ready(function(){
$('#contacts_newcontact').click(function(){ $('#contacts_newcontact').click(function(){
$.getJSON('ajax/showaddcard.php',{},function(jsondata){ $.getJSON('ajax/showaddcard.php',{},function(jsondata){
if(jsondata.status == 'success'){ if(jsondata.status == 'success'){
$('#contacts_details').data('id',''); $('#rightcontent').data('id','');
$('#contacts_details').html(jsondata.data.page); $('#rightcontent').html(jsondata.data.page);
} }
else{ else{
alert(jsondata.data.message); alert(jsondata.data.message);
...@@ -92,8 +92,8 @@ $(document).ready(function(){ ...@@ -92,8 +92,8 @@ $(document).ready(function(){
$('#contacts_addcardform input[type="submit"]').live('click',function(){ $('#contacts_addcardform input[type="submit"]').live('click',function(){
$.post('ajax/addcard.php',$('#contacts_addcardform').serialize(),function(jsondata){ $.post('ajax/addcard.php',$('#contacts_addcardform').serialize(),function(jsondata){
if(jsondata.status == 'success'){ if(jsondata.status == 'success'){
$('#contacts_details').data('id',jsondata.data.id); $('#rightcontent').data('id',jsondata.data.id);
$('#contacts_details').html(jsondata.data.page); $('#rightcontent').html(jsondata.data.page);
} }
else{ else{
alert(jsondata.data.message); alert(jsondata.data.message);
...@@ -103,7 +103,7 @@ $(document).ready(function(){ ...@@ -103,7 +103,7 @@ $(document).ready(function(){
}); });
$('.contacts_property [data-use="edit"]').live('click',function(){ $('.contacts_property [data-use="edit"]').live('click',function(){
var id = $('#contacts_details').data('id'); var id = $('#rightcontent').data('id');
var checksum = $(this).parent().parent().data('checksum'); var checksum = $(this).parent().parent().data('checksum');
$.getJSON('ajax/showsetproperty.php',{'id': id, 'checksum': checksum },function(jsondata){ $.getJSON('ajax/showsetproperty.php',{'id': id, 'checksum': checksum },function(jsondata){
if(jsondata.status == 'success'){ if(jsondata.status == 'success'){
...@@ -129,7 +129,7 @@ $(document).ready(function(){ ...@@ -129,7 +129,7 @@ $(document).ready(function(){
}); });
$('.contacts_property [data-use="delete"]').live('click',function(){ $('.contacts_property [data-use="delete"]').live('click',function(){
var id = $('#contacts_details').data('id'); var id = $('#rightcontent').data('id');
var checksum = $(this).parent().parent().data('checksum'); var checksum = $(this).parent().parent().data('checksum');
$.getJSON('ajax/deleteproperty.php',{'id': id, 'checksum': checksum },function(jsondata){ $.getJSON('ajax/deleteproperty.php',{'id': id, 'checksum': checksum },function(jsondata){
if(jsondata.status == 'success'){ if(jsondata.status == 'success'){
......
...@@ -3,13 +3,13 @@ OC_Util::addScript('contacts','interface'); ...@@ -3,13 +3,13 @@ OC_Util::addScript('contacts','interface');
OC_Util::addStyle('contacts','styles'); OC_Util::addStyle('contacts','styles');
?> ?>
<div id="contacts_contacts" class="leftcontent"> <div id="leftcontent" class="leftcontent">
<ul> <ul>
<?php echo $this->inc("part.contacts"); ?> <?php echo $this->inc("part.contacts"); ?>
</ul> </ul>
<a id="contacts_newcontact"><?php echo $l->t('Add Contact'); ?></a> <a id="contacts_newcontact"><?php echo $l->t('Add Contact'); ?></a>
</div> </div>
<div id="contacts_details" class="rightcontent" data-id="<?php echo $_['id']; ?>"> <div id="rightcontent" class="rightcontent" data-id="<?php echo $_['id']; ?>">
<?php echo $this->inc("part.details"); ?> <?php echo $this->inc("part.details"); ?>
</div> </div>
<?php if(count($_['addressbooks']) == 1 ): ?> <?php if(count($_['addressbooks']) == 1 ): ?>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment