From 5ab93f8741879e655a3a39b8716443aac29c3b8c Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Mon, 23 Nov 2009 10:46:14 -0800 Subject: [PATCH] Removing AddressBook --- js/addressbook.js | 140 ---------------------------------------------- 1 file changed, 140 deletions(-) delete mode 100644 js/addressbook.js diff --git a/js/addressbook.js b/js/addressbook.js deleted file mode 100644 index 1c54a5a7..00000000 --- a/js/addressbook.js +++ /dev/null @@ -1,140 +0,0 @@ -/** - * This overrides existing contact code, and builds proper contacts - * @constructor - */ - -var Contact = function() { - this.givenNames = []; - this.familyName = ""; - this.phones = []; - this.category = ""; - this.companyName = ""; - this.isCompany = false; - this.email = []; - this.addresses = []; - this.uri = []; - this.prefix = ""; - this.jobTitle = ""; - this.birthday = ""; - this.phoneticName = ""; -} - -var Address = function() { - this.street = ""; - this.postalCode = ""; - this.city = ""; - this.region = ""; - this.countryCode = ""; - this.country = ""; - this.building = ""; - this.floor = ""; - this.accessCode = ""; -} - -var PhoneNumber = function() { - this.number = ""; - this.type = ""; -} - -var Email = function() { - this.address = ""; - this.type = ""; -} - -var ImHandle = function() -{ - this.address = ""; - this.type = ""; - this.network = ""; -} - -var Uri = function() { - this.addr = ""; - this.rel = ""; -} - - -var AddressBook = function() { - this.name = ""; - this.resultSet = []; -} - -AddressBook.prototype.addContact = function(newContact, win, fail) -{ - -} - -AddressBook.prototype.removeContact = function(target, win, fail) -{ - -} - -AddressBook.prototype.findContacts = function(filter,win, fail) -{ -} - -PhoneGap.addConstructor(function() { - if (typeof navigator.AddressBook == "undefined") - navigator.AddressBook = new AddressBook(); }); -AddressBook.prototype.addContact = function(newContact, win, fail) -{ - -} - -AddressBook.prototype.removeContact = function(target, win, fail) -{ - -} - -AddressBook.prototype.findContacts = function(filter,win, fail) -{ - this.win = win; - this.fail = fail; - // Zero out the result set for the query - this.resultSet = []; - var name = ""; - var phone = ""; - var email = ""; - - if (filter.givenName) - name = filter.givenName; - if (filter.familyName) - name += filter.familyName; - if (filter.phone) - var phone = filter.phone; - if (filter.email) - var email = filter.email; - ContactHook.search(name, phone, email); -} - -AddressBook.prototype.droidFoundContact = function(name, npa, email) -{ - names = name.split(' '); - personContact = new Contact(); - personContact.givenNames.push(names[0]); - // This is technically wrong, but we can't distinguish right now - if(names.length > 1) - { - personContact.familyName = name[name.length -1]; - } - - telNumber = new PhoneNumber(); - telNumber.number = npa; - personContact.phones.push(telNumber); - - email_addr = new Email(); - email_addr.address = email; - - personContact.email.push(email_addr); - - this.resultSet.push(personContact); - -} - -AddressBook.prototype.droidDoneContacts = function() -{ - if(resultSet.length > 0) - this.win(resultSet); - else - this.fail(); -}