|
@@ -429,6 +429,8 @@ static NSDictionary* customCertificatesForHost;
|
429
|
429
|
self.opaque = _webView.opaque = (alpha == 1.0);
|
430
|
430
|
_webView.scrollView.backgroundColor = backgroundColor;
|
431
|
431
|
_webView.backgroundColor = backgroundColor;
|
|
432
|
+#else
|
|
433
|
+ // TODO
|
432
|
434
|
#endif // !TARGET_OS_OSX
|
433
|
435
|
}
|
434
|
436
|
|
|
@@ -819,7 +821,11 @@ static NSDictionary* customCertificatesForHost;
|
819
|
821
|
}]];
|
820
|
822
|
[[self topViewController] presentViewController:alert animated:YES completion:NULL];
|
821
|
823
|
#else
|
822
|
|
- // TODO
|
|
824
|
+ NSAlert *alert = [[NSAlert alloc] init];
|
|
825
|
+ [alert setMessageText:message];
|
|
826
|
+ [alert beginSheetModalForWindow:[NSApp keyWindow] completionHandler:^(__unused NSModalResponse response){
|
|
827
|
+ completionHandler();
|
|
828
|
+ }];
|
823
|
829
|
#endif // !TARGET_OS_OSX
|
824
|
830
|
}
|
825
|
831
|
|
|
@@ -837,7 +843,14 @@ static NSDictionary* customCertificatesForHost;
|
837
|
843
|
}]];
|
838
|
844
|
[[self topViewController] presentViewController:alert animated:YES completion:NULL];
|
839
|
845
|
#else
|
840
|
|
- // TODO
|
|
846
|
+ NSAlert *alert = [[NSAlert alloc] init];
|
|
847
|
+ [alert setMessageText:message];
|
|
848
|
+ [alert addButtonWithTitle:NSLocalizedString(@"OK", @"OK button")];
|
|
849
|
+ [alert addButtonWithTitle:NSLocalizedString(@"Cancel", @"Cancel button")];
|
|
850
|
+ void (^callbacksHandlers)(NSModalResponse response) = ^void(NSModalResponse response) {
|
|
851
|
+ completionHandler(response == NSAlertFirstButtonReturn);
|
|
852
|
+ };
|
|
853
|
+ [alert beginSheetModalForWindow:[NSApp keyWindow] completionHandler:callbacksHandlers];
|
841
|
854
|
#endif // !TARGET_OS_OSX
|
842
|
855
|
}
|
843
|
856
|
|
|
@@ -861,7 +874,27 @@ static NSDictionary* customCertificatesForHost;
|
861
|
874
|
alert.preferredAction = okAction;
|
862
|
875
|
[[self topViewController] presentViewController:alert animated:YES completion:NULL];
|
863
|
876
|
#else
|
864
|
|
- // TODO
|
|
877
|
+ NSAlert *alert = [[NSAlert alloc] init];
|
|
878
|
+ [alert setMessageText:prompt];
|
|
879
|
+
|
|
880
|
+ const NSRect RCTSingleTextFieldFrame = NSMakeRect(0.0, 0.0, 275.0, 22.0);
|
|
881
|
+ NSTextField *textField = [[NSTextField alloc] initWithFrame:RCTSingleTextFieldFrame];
|
|
882
|
+ textField.cell.scrollable = YES;
|
|
883
|
+ if (@available(macOS 10.11, *)) {
|
|
884
|
+ textField.maximumNumberOfLines = 1;
|
|
885
|
+ }
|
|
886
|
+ textField.stringValue = defaultText;
|
|
887
|
+ [alert setAccessoryView:textField];
|
|
888
|
+
|
|
889
|
+ [alert addButtonWithTitle:NSLocalizedString(@"OK", @"OK button")];
|
|
890
|
+ [alert addButtonWithTitle:NSLocalizedString(@"Cancel", @"Cancel button")];
|
|
891
|
+ [alert beginSheetModalForWindow:[NSApp keyWindow] completionHandler:^(NSModalResponse response) {
|
|
892
|
+ if (response == NSAlertFirstButtonReturn) {
|
|
893
|
+ completionHandler([textField stringValue]);
|
|
894
|
+ } else {
|
|
895
|
+ completionHandler(nil);
|
|
896
|
+ }
|
|
897
|
+ }];
|
865
|
898
|
#endif // !TARGET_OS_OSX
|
866
|
899
|
}
|
867
|
900
|
|