Skip to content

Commit

Permalink
Fixing merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Bowser committed Nov 4, 2009
2 parents 553752d + 2caef8c commit 307c49f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 76 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.gitignore
.DS_Store
.*.sw?
*.cso
Expand Down
23 changes: 2 additions & 21 deletions javascripts/nokia/contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* @author ryan
*/

<<<<<<< HEAD:javascripts/nokia/contact.js
//var contactsService;

ContactManager.prototype.getAllContacts = function(successCallback, errorCallback, options) {
Expand All @@ -16,25 +15,20 @@ ContactManager.prototype.getAllContacts = function(successCallback, errorCallbac
if (typeof(errorCallback) != 'function')
errorCallback = function() {};

=======
var contactsService = device.getServiceObject("Service.Contact", "IDataSource");

ContactManager.prototype.getAllContacts = function(successCallback, errorCallback, options) {
var criteria = new Object();
criteria.Type = "Contact";

>>>>>>> initial commit of nokia javascript files:javascripts/nokia/contact.js
//need a closure here to bind this method to this instance of the contactmanager object
this.global_success = successCallback;
var obj = this;

try {
//WRT: result.ReturnValue is an iterator of contacts
<<<<<<< HEAD:javascripts/nokia/contact.js
this.contactsService.IDataSource.GetList(criteria, function(transId, eventCode, result){obj.success_callback(result.ReturnValue);});
=======
contactsService.IDataSource.GetList(criteria, function(transId, eventCode, result){obj.success_callback(result.ReturnValue);});
>>>>>>> initial commit of nokia javascript files:javascripts/nokia/contact.js
this.contactsService.IDataSource.GetList(criteria, function(transId, eventCode, result){obj.success_callback(result.ReturnValue);});
} catch (e) {
errorCallback(e);
}
Expand All @@ -49,11 +43,7 @@ ContactManager.prototype.success_callback = function(contacts_iterator) {
var gapContact = new Contact();
gapContact.firstName = ContactManager.GetValue(contact, "FirstName");
gapContact.lastName = ContactManager.GetValue(contact, "LastName");
<<<<<<< HEAD:javascripts/nokia/contact.js
gapContact.name = gapContact.firstName + " " + gapContact.lastName;
=======
gapContact.name = gapContact.firstName + gapContact.lastName;
>>>>>>> initial commit of nokia javascript files:javascripts/nokia/contact.js
gapContact.emails = ContactManager.getEmailsList(contact);
gapContact.phones = ContactManager.getPhonesList(contact);
gapContact.address = ContactManager.getAddress(contact);
Expand All @@ -62,14 +52,9 @@ ContactManager.prototype.success_callback = function(contacts_iterator) {
alert(e.name + ": " + e.message);
}
}
<<<<<<< HEAD:javascripts/nokia/contact.js
this.contacts = gapContacts;
this.global_success();
=======
alert('yo: ' + gapContacts.length + " contacts found");
this.contacts = gapContacts;

>>>>>>> initial commit of nokia javascript files:javascripts/nokia/contact.js
}

ContactManager.getEmailsList = function(contact) {
Expand All @@ -91,11 +76,7 @@ ContactManager.getPhonesList = function(contact) {
try {
list = {
"Home": ContactManager.GetValue(contact, "LandPhoneHome"),
<<<<<<< HEAD:javascripts/nokia/contact.js
"Mobile": ContactManager.GetValue(contact, "MobilePhoneGen"),
=======
"Mobile": ContactManager.GetValue(contact, "MobilePhoneHome"),
>>>>>>> initial commit of nokia javascript files:javascripts/nokia/contact.js
"Fax": ContactManager.GetValue(contact, "FaxNumberHome"),
"Work": ContactManager.GetValue(contact, "LandPhoneWork"),
"WorkMobile": ContactManager.GetValue(contact, "MobilePhoneWork")
Expand Down
13 changes: 0 additions & 13 deletions javascripts/nokia/geolocation.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,8 @@
* The device used for test rarely seemed to return a value for speed, and was flaky with heading.
* Nonetheless, they are included, and we can use whatever data we manage to get.
*/

<<<<<<< HEAD:javascripts/nokia/geolocation.js
// This allows us to override the constructor keeping all the original prototype methods.
/*
=======
// TODO: running this on load of the js file is horrendous. The below solution of overriding the
// constructor is better, but it fails on the device!
var locationService = InitializeLocationServiceObject();
// This allows us to override the constructor keeping all the original prototype methods.
>>>>>>> initial commit of nokia javascript files:javascripts/nokia/geolocation.js
var geoPlaceholder = Geolocation.prototype;
Geolocation = function() {
Expand All @@ -23,7 +13,6 @@ Geolocation = function() {
onLocationChanged: [],
onError: []
};
<<<<<<< HEAD:javascripts/nokia/geolocation.js
this.serviceObj = InitializeLocationServiceObject();
};
Expand All @@ -35,15 +24,13 @@ Geolocation.prototype.getCurrentPosition = function(successCallback, errorCallba
if (!this.serviceObj)
this.serviceObj = InitializeLocationServiceObject();

=======
this.serviceObj = locationService; //InitializeLocationServiceObject();
};
Geolocation.prototype = geoPlaceholder;


Geolocation.prototype.getCurrentPosition = function(successCallback, errorCallback, options) {

>>>>>>> initial commit of nokia javascript files:javascripts/nokia/geolocation.js
//construct the criteria for our location request
var updateOptions = new Object();
// Specify that location information need not be guaranteed. This helps in
Expand Down
42 changes: 0 additions & 42 deletions javascripts/nokia/notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* are a couple of other options that are cleaner. i will leave them for now.
*/

<<<<<<< HEAD:javascripts/nokia/notification.js

Notification.prototype.vibrate = function(mills)
{
Expand Down Expand Up @@ -38,44 +37,3 @@ Notification.embedSysinfoObject = function() {
Notification.getSysinfoObject = function() {
return document.embeds[0];
}
=======
/*
var placeholder = Notification.prototype;
Notification = function () {
var el = document.createElement("embed");
el.setAttribute("type", "application/x-systeminfo-widget");
el.setAttribute("hidden", "yes");
alert(el);
document.getElementsByTagName("head")[0].appendChild(el);
this.sysinfo = document.embeds[0];
alert(this.sysinfo);
}
Notification.prototype = placeholder;
*/

/*
var placeholder = Notification.prototype;
Notification = function () {
this.sysinfo = com.nokia.device.load("", "com.nokia.device.sysinfo", "");
}
Notification.prototype = placeholder;
*/

var sysinfo = document.embeds[0];

Notification.prototype.vibrate = function(mills)
{
//quickfix: couldn't get vibrate to work unless it was called asynchronously
setTimeout('sysinfo.startvibra(2000, 100);',0);
}

//not doing anything
Notification.prototype.beep = function(count, volume)
{
sysinfo.beep(220,2000);
}
>>>>>>> initial commit of nokia javascript files:javascripts/nokia/notification.js

0 comments on commit 307c49f

Please sign in to comment.