aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-11-22 19:41:01 +0000
committerBibiko <bibiko@eva.mpg.de>2010-11-22 19:41:01 +0000
commit5a26675cdc8f6f93162d6753f03508a57ff3112f (patch)
tree2d4240c8d389b9c6adddb7bff5b2dc22914114e5
parent6e3ce5d93bfab8ea0c83b2757144cd805f2388b2 (diff)
downloadsequelpro-5a26675cdc8f6f93162d6753f03508a57ff3112f.tar.gz
sequelpro-5a26675cdc8f6f93162d6753f03508a57ff3112f.tar.bz2
sequelpro-5a26675cdc8f6f93162d6753f03508a57ff3112f.zip
• Bundle Editor
- added output action "Show as HTML" • Bundle HTML output - finished implementation - added print support (eg for printing reports) - added text size resizing - added link support - added new window support
-rw-r--r--Interfaces/English.lproj/BundleHTMLOutput.xib88
-rw-r--r--Source/SPBundleEditorController.m9
-rw-r--r--Source/SPBundleHTMLOutputController.h10
-rw-r--r--Source/SPBundleHTMLOutputController.m186
-rw-r--r--Source/SPConstants.h1
-rw-r--r--Source/SPConstants.m1
-rw-r--r--Source/SPCopyTable.m6
-rw-r--r--Source/SPTextView.m6
-rw-r--r--Source/SPTextViewAdditions.m6
-rw-r--r--Source/SPWindowAdditions.m19
10 files changed, 277 insertions, 55 deletions
diff --git a/Interfaces/English.lproj/BundleHTMLOutput.xib b/Interfaces/English.lproj/BundleHTMLOutput.xib
index 152463dc..5db10cdd 100644
--- a/Interfaces/English.lproj/BundleHTMLOutput.xib
+++ b/Interfaces/English.lproj/BundleHTMLOutput.xib
@@ -57,6 +57,7 @@
<string key="NSWindowClass">NSWindow</string>
<nil key="NSViewClass"/>
<string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
+ <string key="NSWindowContentMinSize">{50, 50}</string>
<object class="NSView" key="NSWindowView" id="1006">
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
@@ -92,20 +93,20 @@
<string key="FrameName"/>
<string key="GroupName"/>
<object class="WebPreferences" key="Preferences">
- <string key="Identifier"/>
+ <string key="Identifier">Sequel Pro BundleHTMLOutput</string>
<object class="NSMutableDictionary" key="Values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
- <string>WebKitDefaultFixedFontSize</string>
- <string>WebKitDefaultFontSize</string>
- <string>WebKitMinimumFontSize</string>
+ <string>Sequel Pro BundleHTMLOutputWebKitFixedFont</string>
+ <string>Sequel Pro BundleHTMLOutputWebKitMinimumFontSize</string>
+ <string>Sequel Pro BundleHTMLOutputWebKitStandardFont</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="12"/>
- <integer value="12"/>
- <integer value="1"/>
+ <string>Monaco</string>
+ <integer value="5"/>
+ <string>Lucida Grande</string>
</object>
</object>
</object>
@@ -117,7 +118,9 @@
<reference key="NSSuperview"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
+ <string key="NSMinSize">{50, 72}</string>
<string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
+ <string key="NSFrameAutosaveName">SPBundleHTMLOutputWindow</string>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
@@ -133,14 +136,6 @@
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
- <string key="label">wevView</string>
- <reference key="source" ref="1001"/>
- <reference key="destination" ref="472558256"/>
- </object>
- <int key="connectionID">9</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="1005"/>
<reference key="destination" ref="1001"/>
@@ -163,6 +158,38 @@
</object>
<int key="connectionID">13</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">webView</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="472558256"/>
+ </object>
+ <int key="connectionID">14</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">downloadDelegate</string>
+ <reference key="source" ref="472558256"/>
+ <reference key="destination" ref="1001"/>
+ </object>
+ <int key="connectionID">15</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">frameLoadDelegate</string>
+ <reference key="source" ref="472558256"/>
+ <reference key="destination" ref="1001"/>
+ </object>
+ <int key="connectionID">16</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">resourceLoadDelegate</string>
+ <reference key="source" ref="472558256"/>
+ <reference key="destination" ref="1001"/>
+ </object>
+ <int key="connectionID">17</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -229,6 +256,8 @@
<string>1.NSWindowTemplate.visibleAtLaunch</string>
<string>1.WindowOrigin</string>
<string>1.editorWindowContentRectSynchronizationRect</string>
+ <string>1.windowTemplate.hasMinSize</string>
+ <string>1.windowTemplate.minSize</string>
<string>2.IBPluginDependency</string>
<string>3.IBPluginDependency</string>
</object>
@@ -237,12 +266,14 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{99, 355}, {480, 270}}</string>
+ <string>{{109, 486}, {480, 270}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{99, 355}, {480, 270}}</string>
+ <string>{{109, 486}, {480, 270}}</string>
<boolean value="NO"/>
<string>{196, 240}</string>
<string>{{357, 418}, {480, 270}}</string>
+ <boolean value="YES"/>
+ <string>{50, 50}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.WebKitIBPlugin</string>
</object>
@@ -263,7 +294,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">13</int>
+ <int key="maxID">24</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.1+">
@@ -271,15 +302,26 @@
<object class="IBPartialClassDescription">
<string key="className">SPBundleHTMLOutputController</string>
<string key="superclassName">NSWindowController</string>
- <object class="NSMutableDictionary" key="outlets">
- <string key="NS.key.0">wevView</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">printDocument:</string>
<string key="NS.object.0">id</string>
</object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <string key="NS.key.0">printDocument:</string>
+ <object class="IBActionInfo" key="NS.object.0">
+ <string key="name">printDocument:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="outlets">
+ <string key="NS.key.0">webView</string>
+ <string key="NS.object.0">WebView</string>
+ </object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
- <string key="NS.key.0">wevView</string>
+ <string key="NS.key.0">webView</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
- <string key="name">wevView</string>
- <string key="candidateClassName">id</string>
+ <string key="name">webView</string>
+ <string key="candidateClassName">WebView</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
diff --git a/Source/SPBundleEditorController.m b/Source/SPBundleEditorController.m
index 8587082b..1f9a9732 100644
--- a/Source/SPBundleEditorController.m
+++ b/Source/SPBundleEditorController.m
@@ -99,9 +99,9 @@
inputEditorScopeArray = [[NSArray arrayWithObjects:SPBundleInputSourceNone, SPBundleInputSourceSelectedText, SPBundleInputSourceEntireContent, nil] retain];
inputInputFieldScopeArray = [[NSArray arrayWithObjects:SPBundleInputSourceNone, SPBundleInputSourceSelectedText, SPBundleInputSourceEntireContent, nil] retain];
inputDataTableScopeArray = [[NSArray arrayWithObjects:SPBundleInputSourceNone, SPBundleInputSourceSelectedTableRowsAsTab, SPBundleInputSourceSelectedTableRowsAsCsv, SPBundleInputSourceSelectedTableRowsAsSqlInsert, SPBundleInputSourceTableRowsAsTab, SPBundleInputSourceTableRowsAsCsv, SPBundleInputSourceTableRowsAsSqlInsert, nil] retain];
- outputEditorScopeArray = [[NSArray arrayWithObjects:SPBundleOutputActionNone, SPBundleOutputActionInsertAsText, SPBundleOutputActionInsertAsSnippet, SPBundleOutputActionReplaceSelection, SPBundleOutputActionReplaceContent, SPBundleOutputActionShowAsTextTooltip, SPBundleOutputActionShowAsHTMLTooltip, nil] retain];
- outputInputFieldScopeArray = [[NSArray arrayWithObjects:SPBundleOutputActionNone, SPBundleOutputActionInsertAsText, SPBundleOutputActionReplaceSelection, SPBundleOutputActionReplaceContent, SPBundleOutputActionShowAsTextTooltip, SPBundleOutputActionShowAsHTMLTooltip, nil] retain];
- outputDataTableScopeArray = [[NSArray arrayWithObjects:SPBundleOutputActionNone, SPBundleOutputActionShowAsTextTooltip, SPBundleOutputActionShowAsHTMLTooltip, nil] retain];
+ outputEditorScopeArray = [[NSArray arrayWithObjects:SPBundleOutputActionNone, SPBundleOutputActionInsertAsText, SPBundleOutputActionInsertAsSnippet, SPBundleOutputActionReplaceSelection, SPBundleOutputActionReplaceContent, SPBundleOutputActionShowAsTextTooltip, SPBundleOutputActionShowAsHTMLTooltip, SPBundleOutputActionShowAsHTML, nil] retain];
+ outputInputFieldScopeArray = [[NSArray arrayWithObjects:SPBundleOutputActionNone, SPBundleOutputActionInsertAsText, SPBundleOutputActionReplaceSelection, SPBundleOutputActionReplaceContent, SPBundleOutputActionShowAsTextTooltip, SPBundleOutputActionShowAsHTMLTooltip, SPBundleOutputActionShowAsHTML, nil] retain];
+ outputDataTableScopeArray = [[NSArray arrayWithObjects:SPBundleOutputActionNone, SPBundleOutputActionShowAsTextTooltip, SPBundleOutputActionShowAsHTMLTooltip, SPBundleOutputActionShowAsHTML, nil] retain];
inputFallbackEditorScopeArray = [[NSArray arrayWithObjects:SPBundleInputSourceNone, SPBundleInputSourceCurrentWord, SPBundleInputSourceCurrentLine, SPBundleInputSourceCurrentQuery, SPBundleInputSourceEntireContent, nil] retain];
inputFallbackInputFieldScopeArray = [[NSArray arrayWithObjects:SPBundleInputSourceNone, SPBundleInputSourceCurrentWord, SPBundleInputSourceCurrentLine, SPBundleInputSourceEntireContent, nil] retain];
@@ -137,15 +137,18 @@
NSLocalizedString(@"Replace Entire Content", @"replace entire content item label"),
NSLocalizedString(@"Show as Text Tooltip", @"show as text tooltip item label"),
NSLocalizedString(@"Show as HTML Tooltip", @"show as html tooltip item label"),
+ NSLocalizedString(@"Show as HTML", @"show as html item label"),
NSLocalizedString(@"None", @"none menu item label"),
NSLocalizedString(@"Insert as Text", @"insert as text item label"),
NSLocalizedString(@"Replace Selection", @"replace selection item label"),
NSLocalizedString(@"Replace Entire Content", @"replace entire content item label"),
NSLocalizedString(@"Show as Text Tooltip", @"show as text tooltip item label"),
NSLocalizedString(@"Show as HTML Tooltip", @"show as html tooltip item label"),
+ NSLocalizedString(@"Show as HTML", @"show as html item label"),
NSLocalizedString(@"None", @"none menu item label"),
NSLocalizedString(@"Show as Text Tooltip", @"show as text tooltip item label"),
NSLocalizedString(@"Show as HTML Tooltip", @"show as html tooltip item label"),
+ NSLocalizedString(@"Show as HTML", @"show as html item label"),
NSLocalizedString(@"None", @"none menu item label"),
NSLocalizedString(@"Current Word", @"current word item label"),
NSLocalizedString(@"Current Line", @"current line item label"),
diff --git a/Source/SPBundleHTMLOutputController.h b/Source/SPBundleHTMLOutputController.h
index 9965aec9..1ac550a7 100644
--- a/Source/SPBundleHTMLOutputController.h
+++ b/Source/SPBundleHTMLOutputController.h
@@ -29,10 +29,18 @@
IBOutlet WebView *webView;
- WebPreferences *webPreferences;
+ NSString *docTitle;
+ NSString *initHTMLSourceString;
+ WebPreferences *webPreferences;
}
+@property(readwrite,retain) NSString *docTitle;
+@property(readwrite,retain) NSString *initHTMLSourceString;
+
+- (IBAction)printDocument:(id)sender;
+
- (void)displayHTMLContent:(NSString *)content withOptions:(NSDictionary *)displayOptions;
+- (void)displayURLString:(NSString *)url withOptions:(NSDictionary *)displayOptions;
@end
diff --git a/Source/SPBundleHTMLOutputController.m b/Source/SPBundleHTMLOutputController.m
index 3b10380d..0501dba9 100644
--- a/Source/SPBundleHTMLOutputController.m
+++ b/Source/SPBundleHTMLOutputController.m
@@ -26,15 +26,19 @@
#import "SPBundleHTMLOutputController.h"
+
@implementation SPBundleHTMLOutputController
+@synthesize docTitle;
+@synthesize initHTMLSourceString;
+
/**
* Initialisation
*/
- (id)init
{
- if ((self = [super initWithWindowNibName:@"BundleHTMLOutput"])) {
+ if (self = [super initWithWindowNibName:@"BundleHTMLOutput"]) {
;
@@ -44,28 +48,192 @@
}
+- (NSString *)windowNibName
+{
+ return @"BundleHTMLOutput";
+}
+
+- (void)windowControllerDidLoadNib:(NSWindowController *) aController
+{
+ [super windowControllerDidLoadNib:aController];
+
+ [webView setContinuousSpellCheckingEnabled:NO];
+ [webView setGroupName:@"SequelProBundleHTMLOutput"];
+ [webView setDrawsBackground:YES];
+ [webView setEditable:NO];
+ [webView setShouldCloseWithWindow:YES];
+ [webView setShouldUpdateWhileOffscreen:YES];
+
+}
+
- (void)displayHTMLContent:(NSString *)content withOptions:(NSDictionary *)displayOptions
{
+
+ [[self window] makeKeyAndOrderFront:nil];
+
NSString *fullContent = @"%@";
fullContent = [NSString stringWithFormat:fullContent, content];
+
+ [self setInitHTMLSourceString:fullContent];
[[webView mainFrame] loadHTMLString:fullContent baseURL:nil];
+
+}
+
+- (void)displayURLString:(NSString *)url withOptions:(NSDictionary *)displayOptions
+{
+
[[self window] makeKeyAndOrderFront:nil];
+ [[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
}
-// - (void)webView:(WebView *)webView decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id<WebPolicyDecisionListener>)listener
-// {
-// }
-//
-// - (void)webView:(WebView*)sender didFinishLoadForFrame:(WebFrame*)frame;
-// {
-// }
+- (id)webView
+{
+ return webView;
+}
+
+- (void)updateWindow
+{
+ if (docTitle != nil)
+ [[webView window] setTitle:docTitle];
+ else
+ [[webView window] setTitle:@""];
+}
+
+- (BOOL)canMakeTextLarger
+{
+ return YES;
+}
+
+- (BOOL)canMakeTextSmaller
+{
+ return YES;
+}
- (void)dealloc
{
- [webView release];
+ if(webView) [webView release];
if(webPreferences) [webPreferences release];
[super dealloc];
}
+- (void) keyDown:(NSEvent *)theEvent
+{
+ long allFlags = (NSShiftKeyMask|NSControlKeyMask|NSAlternateKeyMask|NSCommandKeyMask);
+
+ NSString *characters = [theEvent characters];
+ NSString *charactersIgnMod = [theEvent charactersIgnoringModifiers];
+ unichar insertedCharacter = [characters characterAtIndex:0];
+ long curFlags = ([theEvent modifierFlags] & allFlags);
+
+ if(curFlags & NSCommandKeyMask) {
+ if([charactersIgnMod isEqualToString:@"+"] || [charactersIgnMod isEqualToString:@"="]) // increase text size by 1; ⌘+, ⌘=, and ⌘ numpad +
+ {
+ [webView makeTextLarger:nil];
+ return;
+ }
+ if([charactersIgnMod isEqualToString:@"-"]) // decrease text size by 1; ⌘- and numpad -
+ {
+ [webView makeTextSmaller:nil];
+ return;
+ }
+ if([theEvent keyCode] == 123) // goBack
+ {
+ if([webView canGoBack])
+ [webView goBack:nil];
+ else
+ [[webView mainFrame] loadHTMLString:[self initHTMLSourceString] baseURL:nil];
+ return;
+ }
+ if([theEvent keyCode] == 124) // goForward
+ {
+ [webView goForward:nil];
+ return;
+ }
+ }
+
+ [super keyDown: theEvent];
+
+}
+
+- (IBAction)printDocument:(id)sender
+{
+ [[[[webView mainFrame] frameView] documentView] print:sender];
+}
+
+#pragma mark -
+
+- (void)windowShouldClose:(NSNotification *)notification
+{
+ [webView close];
+}
+
+#pragma mark -
+
+- (WebView *)webView:(WebView *)sender createWebViewWithRequest:(NSURLRequest *)request
+{
+ if(request != nil) {
+ SPBundleHTMLOutputController *c = [[SPBundleHTMLOutputController alloc] init];
+ [c displayURLString:[[request URL] absoluteString] withOptions:nil];
+ return [c webView];
+ }
+ return nil;
+}
+
+- (void)webViewShow:(WebView *)sender
+{
+ id newWebView = [[NSDocumentController sharedDocumentController] documentForWindow:[sender window]];
+ [newWebView showWindows];
+}
+
+- (void)webView:(WebView *)webView decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id<WebPolicyDecisionListener>)listener
+{
+ NSInteger navigationType = [[actionInformation objectForKey:WebActionNavigationTypeKey] integerValue];
+
+ switch(navigationType) {
+ case WebNavigationTypeLinkClicked:
+ [[webView mainFrame] loadRequest:request];
+ [listener use];
+ break;
+ case WebNavigationTypeReload:
+ [[webView mainFrame] loadHTMLString:[self initHTMLSourceString] baseURL:nil];
+ break;
+ default:
+ [listener use];
+ }
+}
+
+- (void)webView:(WebView *)sender didReceiveTitle:(NSString *)title forFrame:(WebFrame *)frame
+{
+ // Only report feedback for the main frame.
+ if (frame == [sender mainFrame]) {
+ [self setDocTitle:title];
+ [self updateWindow];
+ }
+}
+
+- (void)webView:(WebView*)sender didFinishLoadForFrame:(WebFrame*)frame;
+{
+ // Only report feedback for the main frame.
+ if (frame == [sender mainFrame]) {
+ [self updateWindow];
+ }
+}
+
+#pragma mark -
+#pragma mark multi-touch trackpad support
+
+/**
+ * Trackpad two-finger zooming gesture for in/decreasing the font size
+ */
+- (void)magnifyWithEvent:(NSEvent *)anEvent
+{
+
+ if([anEvent deltaZ]>2.0)
+ [webView makeTextLarger:nil];
+ else if([anEvent deltaZ]<-2.0)
+ [webView makeTextSmaller:nil];
+
+}
+
@end
diff --git a/Source/SPConstants.h b/Source/SPConstants.h
index d6544549..8f164749 100644
--- a/Source/SPConstants.h
+++ b/Source/SPConstants.h
@@ -447,6 +447,7 @@ extern NSString *SPBundleOutputActionReplaceSelection;
extern NSString *SPBundleOutputActionReplaceContent;
extern NSString *SPBundleOutputActionShowAsTextTooltip;
extern NSString *SPBundleOutputActionShowAsHTMLTooltip;
+extern NSString *SPBundleOutputActionShowAsHTML;
extern NSString *SPBundleFileCommandKey;
extern NSString *SPBundleFileScopeKey;
extern NSString *SPBundleFileNameKey;
diff --git a/Source/SPConstants.m b/Source/SPConstants.m
index 212f3add..2c99a531 100644
--- a/Source/SPConstants.m
+++ b/Source/SPConstants.m
@@ -266,6 +266,7 @@ NSString *SPBundleOutputActionReplaceSelection = @"replaceselection
NSString *SPBundleOutputActionReplaceContent = @"replacecontent";
NSString *SPBundleOutputActionShowAsTextTooltip = @"showastexttooltip";
NSString *SPBundleOutputActionShowAsHTMLTooltip = @"showashtmltooltip";
+NSString *SPBundleOutputActionShowAsHTML = @"showashtml";
NSString *SPBundleFileCommandKey = @"command";
NSString *SPBundleFileScopeKey = @"scope";
NSString *SPBundleFileNameKey = @"name";
diff --git a/Source/SPCopyTable.m b/Source/SPCopyTable.m
index 1bfc2277..77dd14f6 100644
--- a/Source/SPCopyTable.m
+++ b/Source/SPCopyTable.m
@@ -33,6 +33,7 @@
#import "SPTextAndLinkCell.h"
#import "SPTooltip.h"
#import "SPAlertSheets.h"
+#import "SPBundleHTMLOutputController.h"
NSInteger MENU_EDIT_COPY = 2001;
NSInteger MENU_EDIT_COPY_WITH_COLUMN = 2002;
@@ -909,6 +910,11 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2003;
else if([action isEqualToString:SPBundleOutputActionShowAsHTMLTooltip]) {
[SPTooltip showWithObject:output atLocation:pos ofType:@"html"];
}
+
+ else if([action isEqualToString:SPBundleOutputActionShowAsHTML]) {
+ SPBundleHTMLOutputController *c = [[SPBundleHTMLOutputController alloc] init];
+ [c displayHTMLContent:output withOptions:nil];
+ }
}
} else {
NSString *errorMessage = [err localizedDescription];
diff --git a/Source/SPTextView.m b/Source/SPTextView.m
index b7e39a39..ef581a8f 100644
--- a/Source/SPTextView.m
+++ b/Source/SPTextView.m
@@ -32,6 +32,7 @@
#import "SPNavigatorController.h"
#import "SPAlertSheets.h"
#import "RegexKitLite.h"
+#import "SPBundleHTMLOutputController.h"
#pragma mark -
#pragma mark lex init
@@ -3559,6 +3560,11 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
else if([action isEqualToString:SPBundleOutputActionShowAsHTMLTooltip]) {
[SPTooltip showWithObject:output ofType:@"html"];
}
+
+ else if([action isEqualToString:SPBundleOutputActionShowAsHTML]) {
+ SPBundleHTMLOutputController *c = [[SPBundleHTMLOutputController alloc] init];
+ [c displayHTMLContent:output withOptions:nil];
+ }
}
} else {
NSString *errorMessage = [err localizedDescription];
diff --git a/Source/SPTextViewAdditions.m b/Source/SPTextViewAdditions.m
index ae07d289..a33d80e4 100644
--- a/Source/SPTextViewAdditions.m
+++ b/Source/SPTextViewAdditions.m
@@ -24,6 +24,7 @@
#import "SPAlertSheets.h"
#import "SPTooltip.h"
+#import "SPBundleHTMLOutputController.h"
@implementation NSTextView (SPTextViewAdditions)
@@ -621,6 +622,11 @@
else if([action isEqualToString:SPBundleOutputActionShowAsHTMLTooltip]) {
[SPTooltip showWithObject:output ofType:@"html"];
}
+
+ else if([action isEqualToString:SPBundleOutputActionShowAsHTML]) {
+ SPBundleHTMLOutputController *c = [[SPBundleHTMLOutputController alloc] init];
+ [c displayHTMLContent:output withOptions:nil];
+ }
}
} else {
NSString *errorMessage = [err localizedDescription];
diff --git a/Source/SPWindowAdditions.m b/Source/SPWindowAdditions.m
index 7fd7a780..4514ac48 100644
--- a/Source/SPWindowAdditions.m
+++ b/Source/SPWindowAdditions.m
@@ -69,23 +69,4 @@
[self setFrame:frame display:YES animate:YES];
}
-/**
- * Three finger multi-touch right/left swipe event to go back/forward in table history.
- */
-- (void)swipeWithEvent:(NSEvent *)anEvent
-{
-
- if(![[self delegate] isKindOfClass:[SPWindowController class]] || ![[[self delegate] documents] count]) return;
-
- id frontDoc = [[self delegate] selectedTableDocument];
-
- if( frontDoc && [frontDoc isKindOfClass:[SPDatabaseDocument class]]
- && [frontDoc valueForKeyPath:@"spHistoryControllerInstance"]
- && ![frontDoc isWorking])
- if([anEvent deltaX] == -1.0f)
- [[frontDoc valueForKeyPath:@"spHistoryControllerInstance"] valueForKey:@"goForwardInHistory"];
- else if([anEvent deltaX] == 1.0f)
- [[frontDoc valueForKeyPath:@"spHistoryControllerInstance"] valueForKey:@"goBackInHistory"];
-}
-
@end