aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2011-01-28 08:12:59 +0000
committerBibiko <bibiko@eva.mpg.de>2011-01-28 08:12:59 +0000
commit5b680d16c49428e768eb70c49bc41ec0cdd174b2 (patch)
treeb5ba993dec74c28f50f6e43c64c05c9051140134
parent05ac3cbd9c3eb6559ee1ca6ee7d4ff4e510e6542 (diff)
downloadsequelpro-5b680d16c49428e768eb70c49bc41ec0cdd174b2.tar.gz
sequelpro-5b680d16c49428e768eb70c49bc41ec0cdd174b2.tar.bz2
sequelpro-5b680d16c49428e768eb70c49bc41ec0cdd174b2.zip
• changed in HTML output window the link behaviour of file:// URL scheme; now it will be handled by the webview since it can be an HTML file
- in addition introduced URL scheme sp-reveal-file:// which reveals the passed file in Finder and sp-open-file:// which opens the passed file with the default application
-rw-r--r--Source/SPBundleHTMLOutputController.m12
1 files changed, 9 insertions, 3 deletions
diff --git a/Source/SPBundleHTMLOutputController.m b/Source/SPBundleHTMLOutputController.m
index 3c47964a..9fee7358 100644
--- a/Source/SPBundleHTMLOutputController.m
+++ b/Source/SPBundleHTMLOutputController.m
@@ -263,6 +263,7 @@
- (void)webView:(WebView *)webView decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id<WebPolicyDecisionListener>)listener
{
+
NSInteger navigationType = [[actionInformation objectForKey:WebActionNavigationTypeKey] integerValue];
// sequelpro:// handler
@@ -270,9 +271,14 @@
[[NSApp delegate] handleEventWithURL:[request URL]];
[listener ignore];
}
- // file://a_file_path opens the reveal the file in Finder
- else if([[[request URL] scheme] isEqualToString:@"file"] && navigationType == WebNavigationTypeLinkClicked) {
- [[NSWorkspace sharedWorkspace] selectFile:[[[request mainDocumentURL] absoluteString] substringFromIndex:6] inFileViewerRootedAtPath:nil];
+ // sp-reveal-file://a_file_path reveals the file in Finder
+ else if([[[request URL] scheme] isEqualToString:@"sp-reveal-file"] && navigationType == WebNavigationTypeLinkClicked) {
+ [[NSWorkspace sharedWorkspace] selectFile:[[[request mainDocumentURL] absoluteString] substringFromIndex:16] inFileViewerRootedAtPath:nil];
+ [listener ignore];
+ }
+ // sp-open-file://a_file_path opens the file with the default
+ else if([[[request URL] scheme] isEqualToString:@"sp-open-file"] && navigationType == WebNavigationTypeLinkClicked) {
+ [[NSWorkspace sharedWorkspace] openFile:[[[request mainDocumentURL] absoluteString] substringFromIndex:14]];
[listener ignore];
}
else {