You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2012/09/21 17:16:14 UTC

[4/11] bin/uncrustify.sh --all

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/ecf289cc/CordovaLib/Classes/CDVContacts.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVContacts.h b/CordovaLib/Classes/CDVContacts.h
old mode 100755
new mode 100644
index 9868514..9851950
--- a/CordovaLib/Classes/CDVContacts.h
+++ b/CordovaLib/Classes/CDVContacts.h
@@ -6,9 +6,9 @@
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at
- 
+
  http://www.apache.org/licenses/LICENSE-2.0
- 
+
  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -23,23 +23,21 @@
 #import "CDVPlugin.h"
 #import "CDVContact.h"
 
-@interface CDVContacts : CDVPlugin <ABNewPersonViewControllerDelegate, 
-									   ABPersonViewControllerDelegate,
-									   ABPeoplePickerNavigationControllerDelegate
-									  > 
+@interface CDVContacts : CDVPlugin <ABNewPersonViewControllerDelegate,
+    ABPersonViewControllerDelegate,
+    ABPeoplePickerNavigationControllerDelegate
+    >
 {
-	ABAddressBookRef addressBook;
+    ABAddressBookRef addressBook;
 }
 
-
-
 /*
  * newContact - create a new contact via the GUI
  *
  * arguments:
- *	1: successCallback: this is the javascript function that will be called with the newly created contactId 
+ *	1: successCallback: this is the javascript function that will be called with the newly created contactId
  */
-- (void) newContact:(CDVInvokedUrlCommand*)command;
+- (void)newContact:(CDVInvokedUrlCommand*)command;
 
 /*
  * displayContact  - IN PROGRESS
@@ -51,21 +49,21 @@
  * options:
  *	allowsEditing: set to true to allow the user to edit the contact - currently not supported
  */
-- (void) displayContact:(CDVInvokedUrlCommand*)command;
+- (void)displayContact:(CDVInvokedUrlCommand*)command;
 
 /*
  * chooseContact
- *	
+ *
  * arguments:
  *	1: this is the javascript function that will be called with the contact data as a JSON object (as the first param)
  * options:
  *	allowsEditing: set to true to not choose the contact, but to edit it in the iPhone contact editor
  */
-- (void) chooseContact:(CDVInvokedUrlCommand*)command;
+- (void)chooseContact:(CDVInvokedUrlCommand*)command;
 
-- (void) newPersonViewController:(ABNewPersonViewController *)newPersonViewController didCompleteWithNewPerson:(ABRecordRef)person;
-- (BOOL) personViewController:(ABPersonViewController *)personViewController shouldPerformDefaultActionForPerson:(ABRecordRef)person 
-					 property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifierForValue;
+- (void)newPersonViewController:(ABNewPersonViewController*)newPersonViewController didCompleteWithNewPerson:(ABRecordRef)person;
+- (BOOL)personViewController:(ABPersonViewController*)personViewController shouldPerformDefaultActionForPerson:(ABRecordRef)person
+   property                 :(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifierForValue;
 
 /*
  * search - searchs for contacts.  Only person records are currently supported.
@@ -73,70 +71,67 @@
  * arguments:
  *  1: successcallback - this is the javascript function that will be called with the array of found contacts
  *  2:  errorCallback - optional javascript functiont to be called in the event of an error with an error code.
- * options:  dictionary containing ContactFields and ContactFindOptions 
+ * options:  dictionary containing ContactFields and ContactFindOptions
  *	fields - ContactFields array
  *  findOptions - ContactFindOptions object as dictionary
  *
  */
-- (void) search:(CDVInvokedUrlCommand*)command;
-/* 
+- (void)search:(CDVInvokedUrlCommand*)command;
+
+/*
  * save - saves a new contact or updates and existing contact
  *
  * arguments:
  *  1: success callback - this is the javascript function that will be called with the JSON representation of the saved contact
  *		search calls a fixed navigator.service.contacts._findCallback which then calls the succes callback stored before making the call into obj. c
- *  
+ *
  */
-- (void) save:(CDVInvokedUrlCommand*)command;
+- (void)save:(CDVInvokedUrlCommand*)command;
+
 /*
  * remove - removes a contact from the address book
- * 
+ *
  * arguments:
  *  1:  1: successcallback - this is the javascript function that will be called with a (now) empty contact object
- *  
+ *
  * options:  dictionary containing Contact object to remove
  *	contact - Contact object as dictionary
  */
-- (void) remove:(CDVInvokedUrlCommand*)command;
+- (void)remove:(CDVInvokedUrlCommand*)command;
 
-//- (void) dealloc;
+// - (void) dealloc;
 
 @end
 
 @interface CDVContactsPicker : ABPeoplePickerNavigationController
 {
-	BOOL allowsEditing;
-	NSString* callbackId;
-	NSDictionary *options;
-	NSDictionary *pickedContactDictionary;
+    BOOL allowsEditing;
+    NSString* callbackId;
+    NSDictionary* options;
+    NSDictionary* pickedContactDictionary;
 }
 
 @property BOOL allowsEditing;
 @property (copy) NSString* callbackId;
-@property (nonatomic, strong) NSDictionary *options;
-@property (nonatomic, strong) NSDictionary *pickedContactDictionary;
+@property (nonatomic, strong) NSDictionary* options;
+@property (nonatomic, strong) NSDictionary* pickedContactDictionary;
 
 @end
 
 @interface CDVNewContactsController : ABNewPersonViewController
 {
-	NSString* callbackId;
+    NSString* callbackId;
 }
 @property (copy) NSString* callbackId;
 @end
 
-/* ABPersonViewController does not have any UI to dismiss.  Adding navigationItems to it does not work properly,  thenavigationItems are lost when the app goes into the background.  
+/* ABPersonViewController does not have any UI to dismiss.  Adding navigationItems to it does not work properly,  thenavigationItems are lost when the app goes into the background.
     The solution was to create an empty NavController in front of the ABPersonViewController. This
     causes the ABPersonViewController to have a back button. By subclassing the ABPersonViewController,
     we can override viewWillDisappear and take down the entire NavigationController at that time.
- */ 
+ */
 @interface CDVDisplayContactViewController : ABPersonViewController
-{
-    
-}
-@property (nonatomic,strong) CDVPlugin* contactsPlugin;
-
-
-
+{}
+@property (nonatomic, strong) CDVPlugin* contactsPlugin;
 
 @end

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/ecf289cc/CordovaLib/Classes/CDVContacts.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVContacts.m b/CordovaLib/Classes/CDVContacts.m
old mode 100755
new mode 100644
index 8e9e719..dcab517
--- a/CordovaLib/Classes/CDVContacts.m
+++ b/CordovaLib/Classes/CDVContacts.m
@@ -6,9 +6,9 @@
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at
- 
+
  http://www.apache.org/licenses/LICENSE-2.0
- 
+
  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -17,14 +17,12 @@
  under the License.
  */
 
-
 #import "CDVContacts.h"
 #import <UIKit/UIKit.h>
 #import "NSArray+Comparisons.h"
 #import "NSDictionary+Extensions.h"
 #import "CDVNotification.h"
 
-
 @implementation CDVContactsPicker
 
 @synthesize allowsEditing;
@@ -43,485 +41,474 @@
 
 dispatch_queue_t workQueue = nil;
 
-// no longer used since code gets AddressBook for each operation. 
+// no longer used since code gets AddressBook for each operation.
 // If address book changes during save or remove operation, may get error but not much we can do about it
 // If address book changes during UI creation, display or edit, we don't control any saves so no need for callback
+
 /*void addressBookChanged(ABAddressBookRef addressBook, CFDictionaryRef info, void* context)
 {
-	// note that this function is only called when another AddressBook instance modifies 
-	// the address book, not the current one. For example, through an OTA MobileMe sync
-	Contacts* contacts = (Contacts*)context;
-	[contacts addressBookDirty];
+    // note that this function is only called when another AddressBook instance modifies
+    // the address book, not the current one. For example, through an OTA MobileMe sync
+    Contacts* contacts = (Contacts*)context;
+    [contacts addressBookDirty];
 }*/
-+(void) initialize {
++ (void)initialize
+{
     workQueue = dispatch_queue_create("contacts work queue", DISPATCH_QUEUE_SERIAL);
 }
-+(dispatch_queue_t) getWorkQueue {
+
++ (dispatch_queue_t)getWorkQueue
+{
     return workQueue;
 }
 
--(CDVPlugin*) initWithWebView:(UIWebView*)theWebView
+- (CDVPlugin*)initWithWebView:(UIWebView*)theWebView
 {
     self = (CDVContacts*)[super initWithWebView:(UIWebView*)theWebView];
+
     /*if (self) {
-		addressBook = ABAddressBookCreate();
-		ABAddressBookRegisterExternalChangeCallback(addressBook, addressBookChanged, self);
+        addressBook = ABAddressBookCreate();
+        ABAddressBookRegisterExternalChangeCallback(addressBook, addressBookChanged, self);
     }*/
-	
-	return self;
-}
 
+    return self;
+}
 
 // overridden to clean up Contact statics
--(void)onAppTerminate
+- (void)onAppTerminate
 {
-    //NSLog(@"Contacts::onAppTerminate");
+    // NSLog(@"Contacts::onAppTerminate");
 }
--(void) dealloc
+
+- (void)dealloc
 {
     dispatch_release(workQueue);
 }
 
 // iPhone only method to create a new contact through the GUI
-- (void) newContact:(CDVInvokedUrlCommand*)command
-{	
+- (void)newContact:(CDVInvokedUrlCommand*)command
+{
     NSString* callbackId = command.callbackId;
 
-	CDVNewContactsController* npController = [[CDVNewContactsController alloc] init];
-	
-	ABAddressBookRef ab = ABAddressBookCreate();
-	npController.addressBook = ab; // a CF retaining assign
+    CDVNewContactsController* npController = [[CDVNewContactsController alloc] init];
+
+    ABAddressBookRef ab = ABAddressBookCreate();
+
+    npController.addressBook = ab; // a CF retaining assign
     CFRelease(ab);
-    
-	npController.newPersonViewDelegate = self;
-	npController.callbackId = callbackId;
 
-	UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:npController];
-    
+    npController.newPersonViewDelegate = self;
+    npController.callbackId = callbackId;
+
+    UINavigationController* navController = [[UINavigationController alloc] initWithRootViewController:npController];
+
     if ([self.viewController respondsToSelector:@selector(presentViewController:::)]) {
-        [self.viewController presentViewController:navController animated:YES completion:nil];        
+        [self.viewController presentViewController:navController animated:YES completion:nil];
     } else {
-        [self.viewController presentModalViewController:navController animated:YES ];
-    }              
+        [self.viewController presentModalViewController:navController animated:YES];
+    }
 }
 
-- (void) newPersonViewController:(ABNewPersonViewController*)newPersonViewController didCompleteWithNewPerson:(ABRecordRef)person
+- (void)newPersonViewController:(ABNewPersonViewController*)newPersonViewController didCompleteWithNewPerson:(ABRecordRef)person
 {
+    ABRecordID recordId = kABRecordInvalidID;
+    CDVNewContactsController* newCP = (CDVNewContactsController*)newPersonViewController;
+    NSString* callbackId = newCP.callbackId;
 
-	ABRecordID recordId = kABRecordInvalidID;
-	CDVNewContactsController* newCP = (CDVNewContactsController*) newPersonViewController;
-	NSString* callbackId = newCP.callbackId;
-	
-	if (person != NULL) {
-			//return the contact id
-			recordId = ABRecordGetRecordID(person);
-	}
+    if (person != NULL) {
+        // return the contact id
+        recordId = ABRecordGetRecordID(person);
+    }
 
-    if ([newPersonViewController respondsToSelector:@selector(presentingViewController)]) { 
+    if ([newPersonViewController respondsToSelector:@selector(presentingViewController)]) {
         [[newPersonViewController presentingViewController] dismissViewControllerAnimated:YES completion:nil];
     } else {
         [[newPersonViewController parentViewController] dismissModalViewControllerAnimated:YES];
-    }        
-    
-	CDVPluginResult* result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsInt:  recordId];
-	//jsString = [NSString stringWithFormat: @"%@(%d);", newCP.jsCallback, recordId];
-	[self writeJavascript: [result toSuccessCallbackString:callbackId]];
-	
+    }
+
+    CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:recordId];
+    // jsString = [NSString stringWithFormat: @"%@(%d);", newCP.jsCallback, recordId];
+    [self writeJavascript:[result toSuccessCallbackString:callbackId]];
 }
 
-- (void) displayContact:(CDVInvokedUrlCommand*)command
+- (void)displayContact:(CDVInvokedUrlCommand*)command
 {
     NSString* callbackId = command.callbackId;
-	ABRecordID recordID = [[command.arguments objectAtIndex:0] intValue];
+    ABRecordID recordID = [[command.arguments objectAtIndex:0] intValue];
     NSDictionary* options = [command.arguments objectAtIndex:1 withDefault:[NSNull null]];
-	
-	bool bEdit = [options isKindOfClass:[NSNull class]] ? false : [options existsValue:@"true" forKey:@"allowsEditing"];
-	ABAddressBookRef addrBook = ABAddressBookCreate();	
-	ABRecordRef rec = ABAddressBookGetPersonWithRecordID(addrBook, recordID);
-	if (rec) {
-		CDVDisplayContactViewController* personController = [[CDVDisplayContactViewController alloc] init];
-		personController.displayedPerson = rec;
-		personController.personViewDelegate = self;
-		personController.allowsEditing = NO;
-		
+
+    bool bEdit = [options isKindOfClass:[NSNull class]] ? false :[options existsValue:@"true" forKey:@"allowsEditing"];
+    ABAddressBookRef addrBook = ABAddressBookCreate();
+    ABRecordRef rec = ABAddressBookGetPersonWithRecordID(addrBook, recordID);
+
+    if (rec) {
+        CDVDisplayContactViewController* personController = [[CDVDisplayContactViewController alloc] init];
+        personController.displayedPerson = rec;
+        personController.personViewDelegate = self;
+        personController.allowsEditing = NO;
+
         // create this so DisplayContactViewController will have a "back" button.
         UIViewController* parentController = [[UIViewController alloc] init];
-        UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:parentController];
+        UINavigationController* navController = [[UINavigationController alloc] initWithRootViewController:parentController];
 
         [navController pushViewController:personController animated:YES];
 
         if ([self.viewController respondsToSelector:@selector(presentViewController:::)]) {
-            [self.viewController presentViewController:navController animated:YES completion:nil];        
+            [self.viewController presentViewController:navController animated:YES completion:nil];
         } else {
-            [self.viewController presentModalViewController:navController animated:YES ];
-        }              
+            [self.viewController presentModalViewController:navController animated:YES];
+        }
 
-		if (bEdit) {
+        if (bEdit) {
             // create the editing controller and push it onto the stack
             ABPersonViewController* editPersonController = [[ABPersonViewController alloc] init];
             editPersonController.displayedPerson = rec;
             editPersonController.personViewDelegate = self;
-            editPersonController.allowsEditing = YES; 
+            editPersonController.allowsEditing = YES;
             [navController pushViewController:editPersonController animated:YES];
         }
-	} 
-	else 
-	{
-		// no record, return error
-		CDVPluginResult* result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsInt:  UNKNOWN_ERROR];
-		[self writeJavascript:[result toErrorCallbackString:callbackId]];
-		
-	}
-	CFRelease(addrBook);
+    } else {
+        // no record, return error
+        CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:UNKNOWN_ERROR];
+        [self writeJavascript:[result toErrorCallbackString:callbackId]];
+    }
+    CFRelease(addrBook);
 }
-								   
-- (BOOL) personViewController:(ABPersonViewController *)personViewController shouldPerformDefaultActionForPerson:(ABRecordRef)person 
-					 property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifierForValue
+
+- (BOOL)personViewController:(ABPersonViewController*)personViewController shouldPerformDefaultActionForPerson:(ABRecordRef)person
+                    property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifierForValue
 {
-	return YES;
+    return YES;
 }
-	
-- (void) chooseContact:(CDVInvokedUrlCommand*)command
+
+- (void)chooseContact:(CDVInvokedUrlCommand*)command
 {
     NSString* callbackId = command.callbackId;
     NSDictionary* options = [command.arguments objectAtIndex:0 withDefault:[NSNull null]];
-	
-	CDVContactsPicker* pickerController = [[CDVContactsPicker alloc] init];
-	pickerController.peoplePickerDelegate = self;
-	pickerController.callbackId = callbackId;
-	pickerController.options = options;
-	pickerController.pickedContactDictionary = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:kABRecordInvalidID], kW3ContactId, nil];
-	pickerController.allowsEditing = (BOOL)[options existsValue:@"true" forKey:@"allowsEditing"];
-	
+
+    CDVContactsPicker* pickerController = [[CDVContactsPicker alloc] init];
+
+    pickerController.peoplePickerDelegate = self;
+    pickerController.callbackId = callbackId;
+    pickerController.options = options;
+    pickerController.pickedContactDictionary = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:kABRecordInvalidID], kW3ContactId, nil];
+    pickerController.allowsEditing = (BOOL)[options existsValue : @"true" forKey : @"allowsEditing"];
+
     if ([self.viewController respondsToSelector:@selector(presentViewController:::)]) {
-        [self.viewController presentViewController:pickerController animated:YES completion:nil];        
+        [self.viewController presentViewController:pickerController animated:YES completion:nil];
     } else {
-        [self.viewController presentModalViewController:pickerController animated:YES ];
-    }              
+        [self.viewController presentModalViewController:pickerController animated:YES];
+    }
 }
 
-- (BOOL) peoplePickerNavigationController:(ABPeoplePickerNavigationController*)peoplePicker 
-	     shouldContinueAfterSelectingPerson:(ABRecordRef)person
+- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController*)peoplePicker
+      shouldContinueAfterSelectingPerson:(ABRecordRef)person
 {
-	
-	CDVContactsPicker* picker = (CDVContactsPicker*)peoplePicker;
-    NSNumber* pickedId =  [NSNumber numberWithInt: ABRecordGetRecordID(person)];
-
-	if (picker.allowsEditing) {
-		
-		ABPersonViewController* personController = [[ABPersonViewController alloc] init];
-		personController.displayedPerson = person;
-		personController.personViewDelegate = self;
-		personController.allowsEditing = picker.allowsEditing;
+    CDVContactsPicker* picker = (CDVContactsPicker*)peoplePicker;
+    NSNumber* pickedId = [NSNumber numberWithInt:ABRecordGetRecordID(person)];
+
+    if (picker.allowsEditing) {
+        ABPersonViewController* personController = [[ABPersonViewController alloc] init];
+        personController.displayedPerson = person;
+        personController.personViewDelegate = self;
+        personController.allowsEditing = picker.allowsEditing;
         // store id so can get info in peoplePickerNavigationControllerDidCancel
         picker.pickedContactDictionary = [NSDictionary dictionaryWithObjectsAndKeys:pickedId, kW3ContactId, nil];
-		
-		[peoplePicker pushViewController:personController animated:YES];
-	} else {
+
+        [peoplePicker pushViewController:personController animated:YES];
+    } else {
         // Retreive and return pickedContact information
         CDVContact* pickedContact = [[CDVContact alloc] initFromABRecord:(ABRecordRef)person];
-        NSArray *fields = [picker.options objectForKey:@"fields"];
-        NSDictionary *returnFields = [[CDVContact class] calcReturnFields: fields];
+        NSArray* fields = [picker.options objectForKey:@"fields"];
+        NSDictionary* returnFields = [[CDVContact class] calcReturnFields:fields];
         picker.pickedContactDictionary = [pickedContact toDictionary:returnFields];
 
-		CDVPluginResult *result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsDictionary: picker.pickedContactDictionary];
-		[self writeJavascript:[result toSuccessCallbackString: picker.callbackId]];
-		
-        if ([picker respondsToSelector:@selector(presentingViewController)]) { 
+        CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:picker.pickedContactDictionary];
+        [self writeJavascript:[result toSuccessCallbackString:picker.callbackId]];
+
+        if ([picker respondsToSelector:@selector(presentingViewController)]) {
             [[picker presentingViewController] dismissViewControllerAnimated:YES completion:nil];
         } else {
             [[picker parentViewController] dismissModalViewControllerAnimated:YES];
-        }        
-	}
-	return NO;
+        }
+    }
+    return NO;
 }
 
-- (BOOL) peoplePickerNavigationController:(ABPeoplePickerNavigationController*)peoplePicker 
-	     shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier
+- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController*)peoplePicker
+      shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier
 {
-	return YES;
+    return YES;
 }
 
-- (void) peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController *)peoplePicker
+- (void)peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController*)peoplePicker
 {
-	// return contactId or invalid if none picked
-	CDVContactsPicker* picker = (CDVContactsPicker*)peoplePicker;
+    // return contactId or invalid if none picked
+    CDVContactsPicker* picker = (CDVContactsPicker*)peoplePicker;
+
     if (picker.allowsEditing) {
         // get the info after possible edit
         ABAddressBookRef addrBook = ABAddressBookCreate();
         ABRecordRef person = ABAddressBookGetPersonWithRecordID(addrBook, [[picker.pickedContactDictionary objectForKey:kW3ContactId] integerValue]);
         CDVContact* pickedContact = [[CDVContact alloc] initFromABRecord:(ABRecordRef)person];
-        NSArray *fields = [picker.options objectForKey:@"fields"];
-        NSDictionary *returnFields = [[CDVContact class] calcReturnFields: fields];
+        NSArray* fields = [picker.options objectForKey:@"fields"];
+        NSDictionary* returnFields = [[CDVContact class] calcReturnFields:fields];
         picker.pickedContactDictionary = [pickedContact toDictionary:returnFields];
         CFRelease(addrBook);
-
     }
-	CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:picker.pickedContactDictionary];
-	[self writeJavascript:[result toSuccessCallbackString:picker.callbackId]];
-	
-    if ([peoplePicker respondsToSelector:@selector(presentingViewController)]) { 
+    CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:picker.pickedContactDictionary];
+    [self writeJavascript:[result toSuccessCallbackString:picker.callbackId]];
+
+    if ([peoplePicker respondsToSelector:@selector(presentingViewController)]) {
         [[peoplePicker presentingViewController] dismissViewControllerAnimated:YES completion:nil];
     } else {
         [[peoplePicker parentViewController] dismissModalViewControllerAnimated:YES];
-    }        
+    }
 }
 
-- (void) search:(CDVInvokedUrlCommand*)command
+- (void)search:(CDVInvokedUrlCommand*)command
 {
-
     NSString* callbackId = command.callbackId;
     NSArray* fields = [command.arguments objectAtIndex:0];
     NSDictionary* findOptions = [command.arguments objectAtIndex:1 withDefault:[NSNull null]];
-	
-    dispatch_async([CDVContacts getWorkQueue],^{
-        
-        // from Apple:  Important You must ensure that an instance of ABAddressBookRef is used by only one thread.
-        // which is why ABAddressBookCreate() is done within the dispatch queue.
-        // more details here: http: //blog.byadrian.net/2012/05/05/ios-addressbook-framework-and-gcd/
-        ABAddressBookRef  addrBook = ABAddressBookCreate();
-        
-        NSString* jsString = nil;
-        NSArray*  foundRecords = nil;
-        // get the findOptions values
-        BOOL multiple = NO; // default is false
-        NSString* filter = nil;
-        if (![findOptions isKindOfClass:[NSNull class]]){
-            id value = nil;
-            filter = (NSString*)[findOptions objectForKey:@"filter"];
-            value = [findOptions objectForKey:@"multiple"];
-            if ([value isKindOfClass:[NSNumber class]]){
-                // multiple is a boolean that will come through as an NSNumber
-                multiple = [(NSNumber*)value boolValue];
-                //NSLog(@"multiple is: %d", multiple);
-            }
-        }
-        
-        NSDictionary* returnFields = [[CDVContact class] calcReturnFields: fields];
-        
-        
-        NSMutableArray* matches = nil;
-        if (!filter || [filter isEqualToString:@""]){
-            // get all records
-            foundRecords = (__bridge_transfer NSArray*)ABAddressBookCopyArrayOfAllPeople(addrBook);
-            if (foundRecords && [foundRecords count] > 0){
-                // create Contacts and put into matches array
-                // doesn't make sense to ask for all records when multiple == NO but better check
-                int xferCount = multiple == YES ? [foundRecords count] : 1;
-                matches = [NSMutableArray arrayWithCapacity:xferCount];
-                for(int k = 0; k<xferCount; k++){
-                    CDVContact* xferContact = [[CDVContact alloc] initFromABRecord:(ABRecordRef)[foundRecords objectAtIndex:k]];
-                    [matches addObject:xferContact];
-                    xferContact = nil;
 
+    dispatch_async([CDVContacts getWorkQueue], ^{
+            // from Apple:  Important You must ensure that an instance of ABAddressBookRef is used by only one thread.
+            // which is why ABAddressBookCreate() is done within the dispatch queue.
+            // more details here: http: //blog.byadrian.net/2012/05/05/ios-addressbook-framework-and-gcd/
+            ABAddressBookRef addrBook = ABAddressBookCreate ();
+
+            NSString* jsString = nil;
+            NSArray* foundRecords = nil;
+            // get the findOptions values
+            BOOL multiple = NO; // default is false
+            NSString* filter = nil;
+            if (![findOptions isKindOfClass:[NSNull class]]) {
+                id value = nil;
+                filter = (NSString*)[findOptions objectForKey:@"filter"];
+                value = [findOptions objectForKey:@"multiple"];
+                if ([value isKindOfClass:[NSNumber class]]) {
+                    // multiple is a boolean that will come through as an NSNumber
+                    multiple = [(NSNumber*) value boolValue];
+                    // NSLog(@"multiple is: %d", multiple);
                 }
             }
-        } else {
-            foundRecords = (__bridge_transfer NSArray*)ABAddressBookCopyArrayOfAllPeople(addrBook);
-            matches = [NSMutableArray arrayWithCapacity:1];
-            BOOL bFound = NO;
-            int testCount = [foundRecords count];
-            for(int j=0; j<testCount; j++){
-                CDVContact* testContact = [[CDVContact alloc] initFromABRecord: (ABRecordRef)[foundRecords objectAtIndex:j]];
-                if (testContact){
-                    bFound = [testContact foundValue:filter inFields:returnFields];
-                    if(bFound){
-                        [matches addObject:testContact];
+
+            NSDictionary* returnFields = [[CDVContact class] calcReturnFields:fields];
+
+            NSMutableArray* matches = nil;
+            if (!filter || [filter isEqualToString:@""]) {
+                // get all records
+                foundRecords = (__bridge_transfer NSArray*)ABAddressBookCopyArrayOfAllPeople (addrBook);
+                if (foundRecords && [foundRecords count] > 0) {
+                    // create Contacts and put into matches array
+                    // doesn't make sense to ask for all records when multiple == NO but better check
+                    int xferCount = multiple == YES ?[foundRecords count] : 1;
+                    matches = [NSMutableArray arrayWithCapacity:xferCount];
+
+                    for (int k = 0; k < xferCount; k++) {
+                        CDVContact* xferContact = [[CDVContact alloc] initFromABRecord:(ABRecordRef)[foundRecords objectAtIndex:k]];
+                        [matches addObject:xferContact];
+                        xferContact = nil;
+                    }
+                }
+            } else {
+                foundRecords = (__bridge_transfer NSArray*)ABAddressBookCopyArrayOfAllPeople (addrBook);
+                matches = [NSMutableArray arrayWithCapacity:1];
+                BOOL bFound = NO;
+                int testCount = [foundRecords count];
+
+                for (int j = 0; j < testCount; j++) {
+                    CDVContact* testContact = [[CDVContact alloc] initFromABRecord:(ABRecordRef)[foundRecords objectAtIndex:j]];
+                    if (testContact) {
+                        bFound = [testContact foundValue:filter inFields:returnFields];
+                        if (bFound) {
+                            [matches addObject:testContact];
+                        }
+                        testContact = nil;
                     }
-                    testContact = nil;
                 }
             }
-        }
-        NSMutableArray* returnContacts = [NSMutableArray arrayWithCapacity:1];
-    
-        if (matches != nil && [matches count] > 0){
-            // convert to JS Contacts format and return in callback
-            // - returnFields  determines what properties to return
-            @autoreleasepool {
-                int count = multiple == YES ? [matches count] : 1;
-                for(int i = 0; i<count; i++){
-                    CDVContact* newContact = [matches objectAtIndex:i];
-                    NSDictionary* aContact = [newContact toDictionary: returnFields];
-                    [returnContacts addObject:aContact];
+            NSMutableArray* returnContacts = [NSMutableArray arrayWithCapacity:1];
+
+            if (matches != nil && [matches count] > 0) {
+                // convert to JS Contacts format and return in callback
+                // - returnFields  determines what properties to return
+                @autoreleasepool {
+                    int count = multiple == YES ?[matches count] : 1;
+
+                    for (int i = 0; i < count; i++) {
+                        CDVContact* newContact = [matches objectAtIndex:i];
+                        NSDictionary* aContact = [newContact toDictionary:returnFields];
+                        [returnContacts addObject:aContact];
+                    }
                 }
             }
-        }
-        CDVPluginResult* result = nil;
-        // return found contacts (array is empty if no contacts found)
-        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray: returnContacts];
-        jsString = [result toSuccessCallbackString:callbackId];
-        //NSLog(@"findCallback string: %@", jsString);
-
-        if(jsString){
-            dispatch_async(dispatch_get_main_queue(),^{
-                [self writeJavascript:jsString];
-            });
-        }
-        if(addrBook){
-            CFRelease(addrBook);
-        }
-    }); // end of workQueue block
-    
-	return;
-	
-	
+            CDVPluginResult* result = nil;
+            // return found contacts (array is empty if no contacts found)
+            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:returnContacts];
+            jsString = [result toSuccessCallbackString:callbackId];
+            // NSLog(@"findCallback string: %@", jsString);
+
+            if (jsString) {
+                dispatch_async (dispatch_get_main_queue (), ^{
+                        [self writeJavascript:jsString];
+                    });
+            }
+            if (addrBook) {
+                CFRelease (addrBook);
+            }
+        }); // end of workQueue block
+
+    return;
 }
-- (void) save:(CDVInvokedUrlCommand*)command
+
+- (void)save:(CDVInvokedUrlCommand*)command
 {
     NSString* callbackId = command.callbackId;
     NSDictionary* contactDict = [command.arguments objectAtIndex:0];
 
-    dispatch_async([CDVContacts getWorkQueue],^{
-        NSString* jsString = nil;
-        bool bIsError = FALSE, bSuccess = FALSE;
-        BOOL bUpdate = NO;
-        CDVContactError errCode = UNKNOWN_ERROR;
-        CFErrorRef error;
-        CDVPluginResult* result = nil;
+    dispatch_async([CDVContacts getWorkQueue], ^{
+            NSString* jsString = nil;
+            bool bIsError = FALSE, bSuccess = FALSE;
+            BOOL bUpdate = NO;
+            CDVContactError errCode = UNKNOWN_ERROR;
+            CFErrorRef error;
+            CDVPluginResult* result = nil;
+
+            ABAddressBookRef addrBook = ABAddressBookCreate ();
+            NSNumber* cId = [contactDict valueForKey:kW3ContactId];
+            CDVContact* aContact = nil;
+            ABRecordRef rec = nil;
+            if (cId && ![cId isKindOfClass:[NSNull class]]) {
+                rec = ABAddressBookGetPersonWithRecordID (addrBook, [cId intValue]);
+                if (rec) {
+                    aContact = [[CDVContact alloc] initFromABRecord:rec];
+                    bUpdate = YES;
+                }
+            }
+            if (!aContact) {
+                aContact = [[CDVContact alloc] init];
+            }
 
-        ABAddressBookRef addrBook = ABAddressBookCreate();
-        NSNumber* cId = [contactDict valueForKey:kW3ContactId];
-        CDVContact* aContact = nil;
-        ABRecordRef rec = nil;
-        if (cId && ![cId isKindOfClass:[NSNull class]]){
-            rec = ABAddressBookGetPersonWithRecordID(addrBook, [cId intValue]);
-            if (rec){
-                aContact = [[CDVContact alloc] initFromABRecord: rec ];
-                bUpdate = YES;
+            bSuccess = [aContact setFromContactDict:contactDict asUpdate:bUpdate];
+            if (bSuccess) {
+                if (!bUpdate) {
+                    bSuccess = ABAddressBookAddRecord (addrBook, [aContact record], &error);
+                }
+                if (bSuccess) {
+                    bSuccess = ABAddressBookSave (addrBook, &error);
+                }
+                if (!bSuccess) { // need to provide error codes
+                    bIsError = TRUE;
+                    errCode = IO_ERROR;
+                } else {
+                    // give original dictionary back?  If generate dictionary from saved contact, have no returnFields specified
+                    // so would give back all fields (which W3C spec. indicates is not desired)
+                    // for now (while testing) give back saved, full contact
+                    NSDictionary* newContact = [aContact toDictionary:[CDVContact defaultFields]];
+                    // NSString* contactStr = [newContact JSONRepresentation];
+                    result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:newContact];
+                    jsString = [result toSuccessCallbackString:callbackId];
+                }
+            } else {
+                bIsError = TRUE;
+                errCode = IO_ERROR;
             }
-        }
-        if (!aContact){
-            aContact = [[CDVContact alloc] init];
-        }
+            CFRelease (addrBook);
 
-        bSuccess = [aContact setFromContactDict: contactDict asUpdate: bUpdate];
-        if (bSuccess){
-            if (!bUpdate){
-                bSuccess = ABAddressBookAddRecord(addrBook, [aContact record], &error);
+            if (bIsError) {
+                result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:errCode];
+                jsString = [result toErrorCallbackString:callbackId];
             }
-            if (bSuccess) {
-                bSuccess = ABAddressBookSave(addrBook, &error);
+
+            if (jsString) {
+                dispatch_async (dispatch_get_main_queue (), ^{
+                        [self writeJavascript:jsString];
+                    });
             }
-            if (!bSuccess){  // need to provide error codes
+        }); // end of  queue
+}
+
+- (void)remove:(CDVInvokedUrlCommand*)command
+{
+    NSString* callbackId = command.callbackId;
+    NSNumber* cId = [command.arguments objectAtIndex:0];
+    NSString* jsString = nil;
+    bool bIsError = FALSE, bSuccess = FALSE;
+    CDVContactError errCode = UNKNOWN_ERROR;
+    CFErrorRef error;
+    ABAddressBookRef addrBook = nil;
+    ABRecordRef rec = nil;
+    CDVPluginResult* result = nil;
+
+    // NSMutableDictionary* contactDict = options;
+    addrBook = ABAddressBookCreate();
+    // NSNumber* cId = [contactDict valueForKey:kW3ContactId];
+    if (cId && ![cId isKindOfClass:[NSNull class]] && ([cId intValue] != kABRecordInvalidID)) {
+        rec = ABAddressBookGetPersonWithRecordID(addrBook, [cId intValue]);
+        if (rec) {
+            bSuccess = ABAddressBookRemoveRecord(addrBook, rec, &error);
+            if (!bSuccess) {
                 bIsError = TRUE;
                 errCode = IO_ERROR;
             } else {
-
-                // give original dictionary back?  If generate dictionary from saved contact, have no returnFields specified
-                // so would give back all fields (which W3C spec. indicates is not desired)
-                // for now (while testing) give back saved, full contact
-                NSDictionary* newContact = [aContact toDictionary: [CDVContact defaultFields]];
-                //NSString* contactStr = [newContact JSONRepresentation];
-                result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary: newContact];
-                jsString = [result toSuccessCallbackString:callbackId];
+                bSuccess = ABAddressBookSave(addrBook, &error);
+                if (!bSuccess) {
+                    bIsError = TRUE;
+                    errCode = IO_ERROR;
+                } else {
+                    // set id to null
+                    // [contactDict setObject:[NSNull null] forKey:kW3ContactId];
+                    // result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary: contactDict];
+                    result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
+                    jsString = [result toSuccessCallbackString:callbackId];
+                    // NSString* contactStr = [contactDict JSONRepresentation];
+                }
             }
         } else {
+            // no record found return error
             bIsError = TRUE;
-            errCode = IO_ERROR;
+            errCode = UNKNOWN_ERROR;
         }
-        CFRelease(addrBook);
-		
-        if (bIsError){
-            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt: errCode];
-            jsString = [result toErrorCallbackString:callbackId];
-        }
-
-        if(jsString){
-            dispatch_async(dispatch_get_main_queue(),^{
-                [self writeJavascript:jsString];
-            });
+    } else {
+        // invalid contact id provided
+        bIsError = TRUE;
+        errCode = INVALID_ARGUMENT_ERROR;
+    }
 
-        }
-	});// end of  queue
+    if (addrBook) {
+        CFRelease(addrBook);
+    }
+    if (bIsError) {
+        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:errCode];
+        jsString = [result toErrorCallbackString:callbackId];
+    }
+    if (jsString) {
+        [self writeJavascript:jsString];
+    }
 
-	
-}	
-- (void) remove:(CDVInvokedUrlCommand*)command
-{
-    NSString* callbackId = command.callbackId;
-    NSNumber* cId = [command.arguments objectAtIndex:0];
-	NSString* jsString = nil;
-	bool bIsError = FALSE, bSuccess = FALSE;
-	CDVContactError errCode = UNKNOWN_ERROR;
-	CFErrorRef error;
-	ABAddressBookRef addrBook = nil;
-	ABRecordRef rec = nil;
-	CDVPluginResult* result = nil;
-	
-	//NSMutableDictionary* contactDict = options;
-	addrBook = ABAddressBookCreate();	
-	//NSNumber* cId = [contactDict valueForKey:kW3ContactId];
-	if (cId && ![cId isKindOfClass:[NSNull class]] && [cId intValue] != kABRecordInvalidID){
-		rec = ABAddressBookGetPersonWithRecordID(addrBook, [cId intValue]);
-		if (rec){
-			bSuccess = ABAddressBookRemoveRecord(addrBook, rec, &error);
-			if (!bSuccess){
-				bIsError = TRUE;
-				errCode = IO_ERROR; 
-			} else {
-				bSuccess = ABAddressBookSave(addrBook, &error);
-				if(!bSuccess){
-					bIsError = TRUE;
-					errCode = IO_ERROR;
-				}else {
-					// set id to null
-					//[contactDict setObject:[NSNull null] forKey:kW3ContactId];
-                    //result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary: contactDict];
-                    result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
-					jsString = [result toSuccessCallbackString:callbackId];
-					//NSString* contactStr = [contactDict JSONRepresentation];
-				}
-			}						
-		} else {
-			// no record found return error
-			bIsError = TRUE;
-			errCode = UNKNOWN_ERROR;
-		}
-		
-	} else {
-		// invalid contact id provided
-		bIsError = TRUE;
-		errCode = INVALID_ARGUMENT_ERROR;
-	}
-	
-
-	if (addrBook){
-		CFRelease(addrBook);
-	}
-	if (bIsError){
-		result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt: errCode];
-		 jsString = [result toErrorCallbackString:callbackId];
-	}
-	if (jsString){
-		[self writeJavascript:jsString];
-	}	
-		
-	return;
-		
+    return;
 }
 
-
 @end
 
 /* ABPersonViewController does not have any UI to dismiss.  Adding navigationItems to it does not work properly
  * The navigationItems are lost when the app goes into the background.  The solution was to create an empty
  * NavController in front of the ABPersonViewController. This will cause the ABPersonViewController to have a back button. By subclassing the ABPersonViewController, we can override viewDidDisappear and take down the entire NavigationController.
- */ 
+ */
 @implementation CDVDisplayContactViewController
 @synthesize contactsPlugin;
 
-
-- (void)viewWillDisappear: (BOOL)animated
+- (void)viewWillDisappear:(BOOL)animated
 {
-    [super viewWillDisappear: animated];
-    
-    if ([self respondsToSelector:@selector(presentingViewController)]) { 
+    [super viewWillDisappear:animated];
+
+    if ([self respondsToSelector:@selector(presentingViewController)]) {
         [[self presentingViewController] dismissViewControllerAnimated:YES completion:nil];
     } else {
         [[self parentViewController] dismissModalViewControllerAnimated:YES];
-    }        
-    
+    }
 }
 
 @end
-

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/ecf289cc/CordovaLib/Classes/CDVCordovaView.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVCordovaView.h b/CordovaLib/Classes/CDVCordovaView.h
index 53e9f01..6318b21 100644
--- a/CordovaLib/Classes/CDVCordovaView.h
+++ b/CordovaLib/Classes/CDVCordovaView.h
@@ -6,9 +6,9 @@
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at
- 
+
  http://www.apache.org/licenses/LICENSE-2.0
- 
+
  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -19,9 +19,5 @@
 
 #import <UIKit/UIKit.h>
 
-
-@interface CDVCordovaView : UIWebView {
-	
-
-}
+@interface CDVCordovaView : UIWebView {}
 @end

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/ecf289cc/CordovaLib/Classes/CDVCordovaView.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVCordovaView.m b/CordovaLib/Classes/CDVCordovaView.m
index 426ece1..3dff80a 100644
--- a/CordovaLib/Classes/CDVCordovaView.m
+++ b/CordovaLib/Classes/CDVCordovaView.m
@@ -6,9 +6,9 @@
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at
- 
+
  http://www.apache.org/licenses/LICENSE-2.0
- 
+
  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -19,13 +19,11 @@
 
 #import "CDVCordovaView.h"
 
-
 @implementation CDVCordovaView
 
-
-- (void)loadRequest:(NSURLRequest *)request
+- (void)loadRequest:(NSURLRequest*)request
 {
-	[super loadRequest:request];
+    [super loadRequest:request];
 }
 
 /*
@@ -36,9 +34,4 @@
 }
 */
 
-
-
-
-
-
 @end

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/ecf289cc/CordovaLib/Classes/CDVDebug.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVDebug.h b/CordovaLib/Classes/CDVDebug.h
index 78e7778..8d77f59 100644
--- a/CordovaLib/Classes/CDVDebug.h
+++ b/CordovaLib/Classes/CDVDebug.h
@@ -6,9 +6,9 @@
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at
- 
+
  http://www.apache.org/licenses/LICENSE-2.0
- 
+
  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -18,8 +18,8 @@
  */
 
 #ifdef DEBUG
-#    define DLog(...) NSLog(__VA_ARGS__)
+    #define DLog(...) NSLog(__VA_ARGS__)
 #else
-#    define DLog(...) /* */
+    #define DLog(...) /* */
 #endif
 #define ALog(...) NSLog(__VA_ARGS__)

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/ecf289cc/CordovaLib/Classes/CDVDebugConsole.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVDebugConsole.h b/CordovaLib/Classes/CDVDebugConsole.h
index 44e49da..6a0a185 100644
--- a/CordovaLib/Classes/CDVDebugConsole.h
+++ b/CordovaLib/Classes/CDVDebugConsole.h
@@ -6,9 +6,9 @@
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at
- 
+
  http://www.apache.org/licenses/LICENSE-2.0
- 
+
  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -21,9 +21,7 @@
 #import <UIKit/UIKit.h>
 #import "CDVPlugin.h"
 
-
-@interface CDVDebugConsole : CDVPlugin {
-}
+@interface CDVDebugConsole : CDVPlugin {}
 
 - (void)log:(CDVInvokedUrlCommand*)command;
 

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/ecf289cc/CordovaLib/Classes/CDVDebugConsole.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVDebugConsole.m b/CordovaLib/Classes/CDVDebugConsole.m
index decf7ae..29cbb91 100644
--- a/CordovaLib/Classes/CDVDebugConsole.m
+++ b/CordovaLib/Classes/CDVDebugConsole.m
@@ -6,9 +6,9 @@
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at
- 
+
  http://www.apache.org/licenses/LICENSE-2.0
- 
+
  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -26,8 +26,10 @@
     NSString* message = [command.arguments objectAtIndex:0];
     NSDictionary* options = [command.arguments objectAtIndex:1];
     NSString* log_level = @"INFO";
-    if ([options objectForKey:@"logLevel"])
+
+    if ([options objectForKey:@"logLevel"]) {
         log_level = [options objectForKey:@"logLevel"];
+    }
 
     NSLog(@"[%@] %@", log_level, message);
 }

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/ecf289cc/CordovaLib/Classes/CDVDevice.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVDevice.h b/CordovaLib/Classes/CDVDevice.h
index 394f5fc..fd6ea12 100644
--- a/CordovaLib/Classes/CDVDevice.h
+++ b/CordovaLib/Classes/CDVDevice.h
@@ -6,9 +6,9 @@
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at
- 
+
  http://www.apache.org/licenses/LICENSE-2.0
- 
+
  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -21,13 +21,10 @@
 #import "CDVPlugin.h"
 
 @interface CDVDevice : CDVPlugin
-{
-}
+{}
 
-+ (NSString*) cordovaVersion;
++ (NSString*)cordovaVersion;
 
 - (void)getDeviceInfo:(CDVInvokedUrlCommand*)command;
 
 @end
-
-

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/ecf289cc/CordovaLib/Classes/CDVDevice.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVDevice.m b/CordovaLib/Classes/CDVDevice.m
index d0a4b43..d6cc7e4 100644
--- a/CordovaLib/Classes/CDVDevice.m
+++ b/CordovaLib/Classes/CDVDevice.m
@@ -6,9 +6,9 @@
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at
- 
+
  http://www.apache.org/licenses/LICENSE-2.0
- 
+
  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -17,62 +17,59 @@
  under the License.
  */
 
-
 #import "CDV.h"
 
-@interface CDVDevice () {
-}
+@interface CDVDevice () {}
 @end
 
-
 @implementation CDVDevice
 
 - (void)getDeviceInfo:(CDVInvokedUrlCommand*)command
 {
     NSString* cbId = command.callbackId;
-	NSDictionary *deviceProperties = [self deviceProperties];
+    NSDictionary* deviceProperties = [self deviceProperties];
     NSMutableString* result = [[NSMutableString alloc] initWithFormat:@""];
     CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:deviceProperties];
-    
+
     /* Settings.plist
      * Read the optional Settings.plist file and push these user-defined settings down into the web application.
      * This can be useful for supplying build-time configuration variables down to the app to change its behaviour,
      * such as specifying Full / Lite version, or localization (English vs German, for instance).
      */
     // TODO: turn this into an iOS only plugin
-    NSDictionary *temp = [CDVViewController getBundlePlist:@"Settings"];
+    NSDictionary* temp = [CDVViewController getBundlePlist:@"Settings"];
+
     if ([temp respondsToSelector:@selector(JSONString)]) {
         [result appendFormat:@"\nwindow.Settings = %@;", [temp cdvjk_JSONString]];
     }
-    
+
     NSString* jsResult = [self.webView stringByEvaluatingJavaScriptFromString:result];
     // if jsResult is not nil nor empty, an error
-    if (jsResult != nil && [jsResult length] > 0) {
+    if ((jsResult != nil) && ([jsResult length] > 0)) {
         NSLog(@"%@", jsResult);
     }
 
     [self success:pluginResult callbackId:cbId];
-
 }
 
-- (NSDictionary*) deviceProperties
+- (NSDictionary*)deviceProperties
 {
-    UIDevice *device = [UIDevice currentDevice];
-    NSMutableDictionary *devProps = [NSMutableDictionary dictionaryWithCapacity:4];
+    UIDevice* device = [UIDevice currentDevice];
+    NSMutableDictionary* devProps = [NSMutableDictionary dictionaryWithCapacity:4];
+
     [devProps setObject:[device model] forKey:@"platform"];
     [devProps setObject:[device systemVersion] forKey:@"version"];
     [devProps setObject:[device uniqueAppInstanceIdentifier] forKey:@"uuid"];
     [devProps setObject:[device name] forKey:@"name"];
     [devProps setObject:[[self class] cordovaVersion] forKey:@"cordova"];
-    
-    NSDictionary *devReturn = [NSDictionary dictionaryWithDictionary:devProps];
+
+    NSDictionary* devReturn = [NSDictionary dictionaryWithDictionary:devProps];
     return devReturn;
 }
 
-+ (NSString*) cordovaVersion
++ (NSString*)cordovaVersion
 {
     return CDV_VERSION;
 }
 
-
 @end

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/ecf289cc/CordovaLib/Classes/CDVEcho.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVEcho.h b/CordovaLib/Classes/CDVEcho.h
index b3a626a..76a4a96 100644
--- a/CordovaLib/Classes/CDVEcho.h
+++ b/CordovaLib/Classes/CDVEcho.h
@@ -6,9 +6,9 @@
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at
- 
+
  http://www.apache.org/licenses/LICENSE-2.0
- 
+
  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/ecf289cc/CordovaLib/Classes/CDVEcho.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVEcho.m b/CordovaLib/Classes/CDVEcho.m
index 152b16e..b8cc7fc 100644
--- a/CordovaLib/Classes/CDVEcho.m
+++ b/CordovaLib/Classes/CDVEcho.m
@@ -6,9 +6,9 @@
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at
- 
+
  http://www.apache.org/licenses/LICENSE-2.0
- 
+
  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -17,7 +17,6 @@
  under the License.
  */
 
-
 #import "CDVEcho.h"
 #import "CDV.h"
 
@@ -26,6 +25,7 @@
 - (void)echo:(CDVInvokedUrlCommand*)command
 {
     CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:[command.arguments objectAtIndex:0]];
+
     [self success:pluginResult callbackId:command.callbackId];
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/ecf289cc/CordovaLib/Classes/CDVFile.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVFile.h b/CordovaLib/Classes/CDVFile.h
index ca2de05..a822c14 100644
--- a/CordovaLib/Classes/CDVFile.h
+++ b/CordovaLib/Classes/CDVFile.h
@@ -6,9 +6,9 @@
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at
- 
+
  http://www.apache.org/licenses/LICENSE-2.0
- 
+
  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -21,7 +21,7 @@
 #import "CDVPlugin.h"
 
 enum CDVFileError {
-	NOT_FOUND_ERR = 1,
+    NOT_FOUND_ERR = 1,
     SECURITY_ERR = 2,
     ABORT_ERR = 3,
     NOT_READABLE_ERR = 4,
@@ -37,78 +37,75 @@ enum CDVFileError {
 typedef int CDVFileError;
 
 enum CDVFileSystemType {
-	TEMPORARY = 0,
-	PERSISTENT = 1
+    TEMPORARY = 0,
+    PERSISTENT = 1
 };
 typedef int CDVFileSystemType;
 
 @interface CDVFile : CDVPlugin {
-	
-	NSString *appDocsPath;	
-	NSString *appLibraryPath;	
-	NSString *appTempPath;
-	NSString *persistentPath;
-	NSString *temporaryPath;
-	
-	BOOL userHasAllowed;
+    NSString* appDocsPath;
+    NSString* appLibraryPath;
+    NSString* appTempPath;
+    NSString* persistentPath;
+    NSString* temporaryPath;
 
+    BOOL userHasAllowed;
 }
-- (NSNumber*) checkFreeDiskSpace: (NSString*) appPath;
--(NSString*) getAppPath: (NSString*)pathFragment;
-//-(NSString*) getFullPath: (NSString*)pathFragment;
-- (void) requestFileSystem:(CDVInvokedUrlCommand*)command;
--(NSDictionary*) getDirectoryEntry: (NSString*) fullPath isDirectory: (BOOL) isDir;
-- (void) resolveLocalFileSystemURI:(CDVInvokedUrlCommand*)command;
-- (void) getDirectory:(CDVInvokedUrlCommand*)command;
-- (void) getFile:(CDVInvokedUrlCommand*)command;
-- (void) getParent:(CDVInvokedUrlCommand*)command;
-- (void) getMetadata:(CDVInvokedUrlCommand*)command;
-- (void) removeRecursively:(CDVInvokedUrlCommand*)command;
-- (void) remove:(CDVInvokedUrlCommand*)command;
-- (NSString*) doRemove:(NSString*)fullPath callback: (NSString*)callbackId;
-- (void) copyTo:(CDVInvokedUrlCommand*)command;
-- (void) moveTo:(CDVInvokedUrlCommand*)command;
--(BOOL) canCopyMoveSrc: (NSString*) src ToDestination: (NSString*) dest;
-- (void) doCopyMove:(CDVInvokedUrlCommand*)command isCopy:(BOOL)bCopy;
-//- (void) toURI:(CDVInvokedUrlCommand*)command;
-- (void) getFileMetadata:(CDVInvokedUrlCommand*)command;
-- (void) readEntries:(CDVInvokedUrlCommand*)command;
-
-// DEPRECATED 
-- (void) readFile:(CDVInvokedUrlCommand*)command __attribute__((deprecated));
-// DEPRECATED 
+- (NSNumber*)checkFreeDiskSpace:(NSString*)appPath;
+- (NSString*)getAppPath:(NSString*)pathFragment;
+// -(NSString*) getFullPath: (NSString*)pathFragment;
+- (void)requestFileSystem:(CDVInvokedUrlCommand*)command;
+- (NSDictionary*)getDirectoryEntry:(NSString*)fullPath isDirectory:(BOOL)isDir;
+- (void)resolveLocalFileSystemURI:(CDVInvokedUrlCommand*)command;
+- (void)getDirectory:(CDVInvokedUrlCommand*)command;
+- (void)getFile:(CDVInvokedUrlCommand*)command;
+- (void)getParent:(CDVInvokedUrlCommand*)command;
+- (void)getMetadata:(CDVInvokedUrlCommand*)command;
+- (void)removeRecursively:(CDVInvokedUrlCommand*)command;
+- (void)remove:(CDVInvokedUrlCommand*)command;
+- (NSString*)doRemove:(NSString*)fullPath callback:(NSString*)callbackId;
+- (void)copyTo:(CDVInvokedUrlCommand*)command;
+- (void)moveTo:(CDVInvokedUrlCommand*)command;
+- (BOOL)canCopyMoveSrc:(NSString*)src ToDestination:(NSString*)dest;
+- (void)doCopyMove:(CDVInvokedUrlCommand*)command isCopy:(BOOL)bCopy;
+// - (void) toURI:(CDVInvokedUrlCommand*)command;
+- (void)getFileMetadata:(CDVInvokedUrlCommand*)command;
+- (void)readEntries:(CDVInvokedUrlCommand*)command;
 
-- (void) readAsText:(CDVInvokedUrlCommand*)command;
-- (void) readAsDataURL:(CDVInvokedUrlCommand*)command;
--(NSString*) getMimeTypeFromPath: (NSString*) fullPath;
-- (void) write:(CDVInvokedUrlCommand*)command;
-- (void) testFileExists:(CDVInvokedUrlCommand*)command;
-- (void) testDirectoryExists:(CDVInvokedUrlCommand*)command;
-//- (void) createDirectory:(CDVInvokedUrlCommand*)command;
-//- (void) deleteDirectory:(CDVInvokedUrlCommand*)command;
-//- (void) deleteFile:(CDVInvokedUrlCommand*)command;
-- (void) getFreeDiskSpace:(CDVInvokedUrlCommand*)command;
-// DEPRECATED 
-- (void) truncateFile:(CDVInvokedUrlCommand*)command __attribute__((deprecated));
-// DEPRECATED 
-- (void) truncate:(CDVInvokedUrlCommand*)command;
+// DEPRECATED
+- (void)readFile:(CDVInvokedUrlCommand*)command __attribute__((deprecated));
 
+// DEPRECATED
 
+- (void)readAsText:(CDVInvokedUrlCommand*)command;
+- (void)readAsDataURL:(CDVInvokedUrlCommand*)command;
+- (NSString*)getMimeTypeFromPath:(NSString*)fullPath;
+- (void)write:(CDVInvokedUrlCommand*)command;
+- (void)testFileExists:(CDVInvokedUrlCommand*)command;
+- (void)testDirectoryExists:(CDVInvokedUrlCommand*)command;
+// - (void) createDirectory:(CDVInvokedUrlCommand*)command;
+// - (void) deleteDirectory:(CDVInvokedUrlCommand*)command;
+// - (void) deleteFile:(CDVInvokedUrlCommand*)command;
+- (void)getFreeDiskSpace:(CDVInvokedUrlCommand*)command;
+// DEPRECATED
+- (void)truncateFile:(CDVInvokedUrlCommand*)command __attribute__((deprecated));
 
-//- (BOOL) fileExists:(NSString*)fileName;
-//- (BOOL) directoryExists:(NSString*)dirName;
-- (void) writeToFile:(NSString*)fileName withData:(NSString*)data append:(BOOL)shouldAppend callback: (NSString*) callbackId;
-- (unsigned long long) truncateFile:(NSString*)filePath atPosition:(unsigned long long)pos;
+// DEPRECATED
+- (void)truncate:(CDVInvokedUrlCommand*)command;
 
+// - (BOOL) fileExists:(NSString*)fileName;
+// - (BOOL) directoryExists:(NSString*)dirName;
+- (void)writeToFile:(NSString*)fileName withData:(NSString*)data append:(BOOL)shouldAppend callback:(NSString*)callbackId;
+- (unsigned long long)truncateFile:(NSString*)filePath atPosition:(unsigned long long)pos;
 
-@property (nonatomic, strong)NSString *appDocsPath;
-@property (nonatomic, strong)NSString *appLibraryPath;
-@property (nonatomic, strong)NSString *appTempPath;
-@property (nonatomic, strong)NSString *persistentPath;
-@property (nonatomic, strong)NSString *temporaryPath;
+@property (nonatomic, strong) NSString* appDocsPath;
+@property (nonatomic, strong) NSString* appLibraryPath;
+@property (nonatomic, strong) NSString* appTempPath;
+@property (nonatomic, strong) NSString* persistentPath;
+@property (nonatomic, strong) NSString* temporaryPath;
 @property BOOL userHasAllowed;
 
 @end
 
 #define kW3FileTemporary @"temporary"
-#define kW3FilePersistent @"persistent"
\ No newline at end of file
+#define kW3FilePersistent @"persistent"