aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-12-11 13:09:07 +0000
committerBibiko <bibiko@eva.mpg.de>2010-12-11 13:09:07 +0000
commitcb2baf9cb4ce1e33e6756969b1f71eb0e011f2c8 (patch)
tree53b4d05748d76b21d699fe87f7ed56dc02b45928
parentf4c56bb02798ebfbbaba7e7f182843b72f276264 (diff)
downloadsequelpro-cb2baf9cb4ce1e33e6756969b1f71eb0e011f2c8.tar.gz
sequelpro-cb2baf9cb4ce1e33e6756969b1f71eb0e011f2c8.tar.bz2
sequelpro-cb2baf9cb4ce1e33e6756969b1f71eb0e011f2c8.zip
• the default behaviour is that 'Show HTML Window' will order front the window but the focus remains at the caller for convenience but under some circumstances it could be useful to make the HTML window the first responder; now this can be done via JavaScript like:
<body onload="window.system.run('_SP_self_makeKeyWindow')">
-rw-r--r--Source/SPBundleHTMLOutputController.m19
1 files changed, 8 insertions, 11 deletions
diff --git a/Source/SPBundleHTMLOutputController.m b/Source/SPBundleHTMLOutputController.m
index c57c79f4..365c15a3 100644
--- a/Source/SPBundleHTMLOutputController.m
+++ b/Source/SPBundleHTMLOutputController.m
@@ -59,22 +59,13 @@
return @"BundleHTMLOutput";
}
-- (void)windowControllerDidLoadNib:(NSWindowController *) aController
-{
- [super windowControllerDidLoadNib:aController];
-
-}
-
- (void)displayHTMLContent:(NSString *)content withOptions:(NSDictionary *)displayOptions
{
[[self window] orderFront:nil];
- NSString *fullContent = @"%@";
- fullContent = [NSString stringWithFormat:fullContent, content];
- [self setInitHTMLSourceString:fullContent];
- [[webView mainFrame] loadHTMLString:@"<html></html>" baseURL:nil];
- [[webView mainFrame] loadHTMLString:fullContent baseURL:nil];
+ [self setInitHTMLSourceString:content];
+ [[webView mainFrame] loadHTMLString:content baseURL:nil];
}
@@ -385,6 +376,12 @@
if(!command) return @"No JavaScript command found.";
+ // Check for internal commands passed via JavaScript
+ if([command isEqualToString:@"_SP_self_makeKeyWindow"]) {
+ [[self window] makeKeyAndOrderFront:nil];
+ return @"";
+ }
+
NSString *output = nil;
if(uuid == nil)
output = [command runBashCommandWithEnvironment:nil atCurrentDirectoryPath:nil error:&err];