diff options
Diffstat (limited to 'js/models/addressBook_model.js.orig')
-rw-r--r-- | js/models/addressBook_model.js.orig | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/js/models/addressBook_model.js.orig b/js/models/addressBook_model.js.orig deleted file mode 100644 index 9a86c62a..00000000 --- a/js/models/addressBook_model.js.orig +++ /dev/null @@ -1,72 +0,0 @@ -angular.module('contactsApp') -.factory('AddressBook', function() -{ - return function AddressBook(data) { - var storageKey = btoa(data.data.href.split('/').splice(-3, 2).join('_')); - angular.extend(this, { - - displayName: '', - contacts: [], - groups: data.data.props.groups, - readOnly: data.data.props.readOnly === '1', -<<<<<<< HEAD - // use only owner and url, convert ''/remote.php/dav/addressbooks/users/admin/Test1/'' to 'admin.Test' - key: data.data.href.split('/').splice(-3, 2).join('_'), - enabled: window.localStorage.getItem('contacts_ab_'+this.key) !== false, -======= - // use only owner and url, convert '/remote.php/dav/addressbooks/users/admin/Test1/' to 'admin.Test' - key: storageKey, - enabled: window.localStorage.getItem('contacts_ab_'+storageKey) !== 'false', // localstorage stores everything as string - - getContact: function(uid) { - for(var i in this.contacts) { - if(this.contacts[i].uid() === uid) { - return this.contacts[i]; - } - } - return undefined; - }, ->>>>>>> Ignore disabled ab on load - - sharedWith: { - users: [], - groups: [] - } - - }); - angular.extend(this, data); - angular.extend(this, { - owner: data.data.props.owner.split('/').slice(-2, -1)[0] - }); - - var shares = this.data.props.invite; - if (typeof shares !== 'undefined') { - for (var j = 0; j < shares.length; j++) { - var href = shares[j].href; - if (href.length === 0) { - continue; - } - var access = shares[j].access; - if (access.length === 0) { - continue; - } - - var readWrite = (typeof access.readWrite !== 'undefined'); - - if (href.startsWith('principal:principals/users/')) { - this.sharedWith.users.push({ - id: href.substr(27), - displayname: href.substr(27), - writable: readWrite - }); - } else if (href.startsWith('principal:principals/groups/')) { - this.sharedWith.groups.push({ - id: href.substr(28), - displayname: href.substr(28), - writable: readWrite - }); - } - } - } - }; -}); |