Browse Source

Fixed whitespace

Tom Underhill 4 years ago
parent
commit
369b9a74ed
1 changed files with 34 additions and 34 deletions
  1. 34
    34
      ios/RNCWebView.m

+ 34
- 34
ios/RNCWebView.m View File

810
 #pragma mark - WKNavigationDelegate methods
810
 #pragma mark - WKNavigationDelegate methods
811
 
811
 
812
 /**
812
 /**
813
-* alert
814
-*/
813
+ * alert
814
+ */
815
 - (void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler
815
 - (void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler
816
 {
816
 {
817
 #if !TARGET_OS_OSX
817
 #if !TARGET_OS_OSX
818
-    UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"" message:message preferredStyle:UIAlertControllerStyleAlert];
819
-    [alert addAction:[UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
820
-        completionHandler();
821
-    }]];
822
-    [[self topViewController] presentViewController:alert animated:YES completion:NULL];
818
+  UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"" message:message preferredStyle:UIAlertControllerStyleAlert];
819
+  [alert addAction:[UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
820
+    completionHandler();
821
+  }]];
822
+  [[self topViewController] presentViewController:alert animated:YES completion:NULL];
823
 #else
823
 #else
824
   NSAlert *alert = [[NSAlert alloc] init];
824
   NSAlert *alert = [[NSAlert alloc] init];
825
   [alert setMessageText:message];
825
   [alert setMessageText:message];
830
 }
830
 }
831
 
831
 
832
 /**
832
 /**
833
-* confirm
834
-*/
833
+ * confirm
834
+ */
835
 - (void)webView:(WKWebView *)webView runJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(BOOL))completionHandler{
835
 - (void)webView:(WKWebView *)webView runJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(BOOL))completionHandler{
836
 #if !TARGET_OS_OSX
836
 #if !TARGET_OS_OSX
837
-    UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"" message:message preferredStyle:UIAlertControllerStyleAlert];
838
-    [alert addAction:[UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
839
-        completionHandler(YES);
840
-    }]];
841
-    [alert addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
842
-        completionHandler(NO);
843
-    }]];
844
-    [[self topViewController] presentViewController:alert animated:YES completion:NULL];
837
+  UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"" message:message preferredStyle:UIAlertControllerStyleAlert];
838
+  [alert addAction:[UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
839
+    completionHandler(YES);
840
+  }]];
841
+  [alert addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
842
+    completionHandler(NO);
843
+  }]];
844
+  [[self topViewController] presentViewController:alert animated:YES completion:NULL];
845
 #else
845
 #else
846
   NSAlert *alert = [[NSAlert alloc] init];
846
   NSAlert *alert = [[NSAlert alloc] init];
847
   [alert setMessageText:message];
847
   [alert setMessageText:message];
855
 }
855
 }
856
 
856
 
857
 /**
857
 /**
858
-* prompt
859
-*/
858
+ * prompt
859
+ */
860
 - (void)webView:(WKWebView *)webView runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)defaultText initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(NSString *))completionHandler{
860
 - (void)webView:(WKWebView *)webView runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)defaultText initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(NSString *))completionHandler{
861
 #if !TARGET_OS_OSX
861
 #if !TARGET_OS_OSX
862
-    UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"" message:prompt preferredStyle:UIAlertControllerStyleAlert];
863
-    [alert addTextFieldWithConfigurationHandler:^(UITextField *textField) {
864
-        textField.text = defaultText;
865
-    }];
866
-    UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
867
-        completionHandler([[alert.textFields lastObject] text]);
868
-    }];
869
-    [alert addAction:okAction];
870
-    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
871
-        completionHandler(nil);
872
-    }];
873
-    [alert addAction:cancelAction];
874
-    alert.preferredAction = okAction;
875
-    [[self topViewController] presentViewController:alert animated:YES completion:NULL];
862
+  UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"" message:prompt preferredStyle:UIAlertControllerStyleAlert];
863
+  [alert addTextFieldWithConfigurationHandler:^(UITextField *textField) {
864
+    textField.text = defaultText;
865
+  }];
866
+  UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
867
+    completionHandler([[alert.textFields lastObject] text]);
868
+  }];
869
+  [alert addAction:okAction];
870
+  UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
871
+    completionHandler(nil);
872
+  }];
873
+  [alert addAction:cancelAction];
874
+  alert.preferredAction = okAction;
875
+  [[self topViewController] presentViewController:alert animated:YES completion:NULL];
876
 #else
876
 #else
877
   NSAlert *alert = [[NSAlert alloc] init];
877
   NSAlert *alert = [[NSAlert alloc] init];
878
   [alert setMessageText:prompt];
878
   [alert setMessageText:prompt];
879
-  
879
+
880
   const NSRect RCTSingleTextFieldFrame = NSMakeRect(0.0, 0.0, 275.0, 22.0);
880
   const NSRect RCTSingleTextFieldFrame = NSMakeRect(0.0, 0.0, 275.0, 22.0);
881
   NSTextField *textField = [[NSTextField alloc] initWithFrame:RCTSingleTextFieldFrame];
881
   NSTextField *textField = [[NSTextField alloc] initWithFrame:RCTSingleTextFieldFrame];
882
   textField.cell.scrollable = YES;
882
   textField.cell.scrollable = YES;