aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPBundleHTMLOutputController.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-12-12 19:20:57 +0000
committerBibiko <bibiko@eva.mpg.de>2010-12-12 19:20:57 +0000
commitb2015bc3974c04557492bb4a698776824ab6689d (patch)
tree4a524f5614e919eb1968a649641371d36c281b36 /Source/SPBundleHTMLOutputController.m
parentafcf7c7886fdd17668fa29b38b491cf6b533b4df (diff)
downloadsequelpro-b2015bc3974c04557492bb4a698776824ab6689d.tar.gz
sequelpro-b2015bc3974c04557492bb4a698776824ab6689d.tar.bz2
sequelpro-b2015bc3974c04557492bb4a698776824ab6689d.zip
• made usage of more constants to avoid double-storing strings
• fixed JavaScript alert and confirm window in HTML output window
Diffstat (limited to 'Source/SPBundleHTMLOutputController.m')
-rw-r--r--Source/SPBundleHTMLOutputController.m25
1 files changed, 17 insertions, 8 deletions
diff --git a/Source/SPBundleHTMLOutputController.m b/Source/SPBundleHTMLOutputController.m
index 1e002ab8..a632a51a 100644
--- a/Source/SPBundleHTMLOutputController.m
+++ b/Source/SPBundleHTMLOutputController.m
@@ -304,19 +304,28 @@
- (void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame
{
- SPBeginAlertSheet(NSLocalizedString(@"JavaScript Alert", @"javascript alert"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [self window], self, nil, nil,
- [message description]);
+ NSAlert *alert = [[NSAlert alloc] init];
+ [alert addButtonWithTitle:NSLocalizedString(@"OK", @"OK button")];
+ [alert setInformativeText:(message)?:@""];
+ [alert setMessageText:@"JavaScript"];
+ [alert runModal];
+ [alert release];
}
- (BOOL)webView:(WebView *)sender runJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame
{
- NSLog(@"confirm");
- return NO;
-}
+ NSAlert *alert = [[NSAlert alloc] init];
+ [alert addButtonWithTitle:NSLocalizedString(@"OK", @"OK button")];
+ [alert addButtonWithTitle:NSLocalizedString(@"Cancel", @"cancel button")];
+ [alert setInformativeText:(message)?:@""];
+ [alert setMessageText:@"JavaScript"];
-- (NSString *)webView:(WebView *)sender runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)defaultText initiatedByFrame:(WebFrame *)frame
-{
- return @"be patient";
+ NSUInteger returnCode = [alert runModal];
+
+ [alert release];
+
+ if(returnCode == NSAlertFirstButtonReturn) return YES;
+ return NO;
}
- (void)webView:(WebView *)sender windowScriptObjectAvailable: (WebScriptObject *)windowScriptObject