From 8f3357c30596ff776636a8e5a8f6d3611d4fa1ba Mon Sep 17 00:00:00 2001 From: Thomas Tanghus <thomas@tanghus.net> Date: Thu, 2 Aug 2012 18:57:03 +0200 Subject: [PATCH] I was a bit too fast in removing methods yesterday... --- apps/contacts/js/contacts.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js index a708352cba..2521a6ce84 100644 --- a/apps/contacts/js/contacts.js +++ b/apps/contacts/js/contacts.js @@ -1499,6 +1499,20 @@ OC.Contacts={ //this.contacts[id] = contact; return contact; }, + addAddressbook:function(name, description, cb) { + $.post(OC.filePath('contacts', 'ajax/addressbook', 'add.php'), { name: name, description: description, active: true }, + function(jsondata) { + if(jsondata.status == 'success'){ + if(cb && typeof cb == 'function') { + console.log('addressbook:', jsondata.data.addressbook); + cb(jsondata.data.addressbook); + } + } else { + OC.dialogs.alert(jsondata.data.message, t('contacts', 'Error')); + return false; + } + }); + }, doImport:function(file, aid){ $.post(OC.filePath('contacts', '', 'import.php'), { id: aid, file: file, fstype: 'OC_FilesystemView' }, function(jsondata){ -- GitLab