Skip to content

Commit

Permalink
Fixing up contacts to match the new spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Bowser committed Dec 1, 2009
1 parent 272ac07 commit 374089c
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions android/js/contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,29 @@ var ContactEmail = function()
this.address = "";
}

var ContactPhoneNumber = function()
{
this.types = [];
this.number = "";
}


var Contacts = function()
{
this.records = [];
}

var Contacts.prototype.find = function(obj, win, fail)
Contacts.prototype.find = function(obj, win, fail)
{
if(obj.name)
if(obj.name != null)
{
ContactHook.search(name, "", "");
}
this.win = win;
this.fail = fail;
}

var Contacts.prototype.droidFoundContact = function(name, npa, email)
Contacts.prototype.droidFoundContact = function(name, npa, email)
{
var contact = new Contact();
contact.name = new ContactName();
Expand All @@ -54,7 +60,11 @@ var Contacts.prototype.droidFoundContact = function(name, npa, email)
this.records.push(contact);
}

var Contacts.prototype.droidDone = function()
Contacts.prototype.droidDone = function()
{
this.win(this.records);
}

PhoneGap.addConstructor(function() {
if(typeof navigator.Contacts == "undefined") navigator.Contacts = new Contacts();
});

0 comments on commit 374089c

Please sign in to comment.