Change JS to call navigator.contacts instead of navigator.ContactManager, which no longer exists.

This commit is contained in:
Bryce Curtis 2010-09-15 14:38:57 -05:00
parent 705b8f6874
commit 5cd25316fa

View File

@ -256,14 +256,14 @@ public class ContactManager implements Plugin {
// Code for backwards compatibility with the OLD Contacts API // Code for backwards compatibility with the OLD Contacts API
if (all) { if (all) {
this.ctx.sendJavascript("navigator.ContactManager.droidAddContact('" + name + "','" + phoneNumber + "','" + email +"');"); this.ctx.sendJavascript("navigator.contacts.droidFoundContact('" + name + "','" + phoneNumber + "','" + email +"');");
} }
else { else {
this.ctx.sendJavascript("navigator.contacts.droidFoundContact('" + name + "','" + phoneNumber + "','" + email +"');"); this.ctx.sendJavascript("navigator.contacts.droidFoundContact('" + name + "','" + phoneNumber + "','" + email +"');");
} }
} while (cur.moveToNext()); } while (cur.moveToNext());
if (all) { if (all) {
this.ctx.sendJavascript("navigator.ContactManager.droidDone();"); this.ctx.sendJavascript("navigator.contacts.droidDone();");
} }
else { else {
this.ctx.sendJavascript("navigator.contacts.droidDone();"); this.ctx.sendJavascript("navigator.contacts.droidDone();");
@ -272,7 +272,7 @@ public class ContactManager implements Plugin {
else else
{ {
if (all) { if (all) {
this.ctx.sendJavascript("navigator.ContactManager.fail();"); this.ctx.sendJavascript("navigator.contacts.fail('Error');");
} }
else { else {
this.ctx.sendJavascript("navigator.contacts.fail('None found!');"); this.ctx.sendJavascript("navigator.contacts.fail('None found!');");
@ -299,7 +299,7 @@ public class ContactManager implements Plugin {
if(data != null) if(data != null)
{ {
data.email = email; data.email = email;
this.ctx.sendJavascript("navigator.Contacts.droidFoundContact('" + data.name + "','" + data.phone + "','" + data.email +"');"); this.ctx.sendJavascript("navigator.contacts.droidFoundContact('" + data.name + "','" + data.phone + "','" + data.email +"');");
} }
} while (cur.moveToNext()); } while (cur.moveToNext());
this.ctx.sendJavascript("navigator.contacts.droidDoneContacts();"); this.ctx.sendJavascript("navigator.contacts.droidDoneContacts();");