Skip to content

Commit

Permalink
version 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
liyanage committed Feb 18, 2009
1 parent 03dff02 commit 1f61f0e
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 26 deletions.
2 changes: 1 addition & 1 deletion Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<key>WebPluginName</key>
<string>XML View Plugin ${PRODUCT_VERSION}</string>
<key>WebPluginDescription</key>
<string>Displays raw XML data in a more useful way. For more information, visit the &lt;a href="http://www.entropy.ch/software/macosx/xmlviewplugin/">plugin’s website&lt;/a></string>
<string>Displays raw XML data in a useful way. For more information, visit the &lt;a href="http://www.entropy.ch/software/macosx/xmlviewplugin/">plugin’s website&lt;/a></string>
<key>WebPluginMIMETypes</key>
<dict>
<key>application/xml</key>
Expand Down
13 changes: 13 additions & 0 deletions Resources/appcast.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@
<description>Most recent changes with links to updates.</description>
<language>en</language>

<item>
<title>Version 1.3</title>
<sparkle:releaseNotesLink>http://www.entropy.ch/software/macosx/xmlviewplugin/release-notes.html#version-1.3</sparkle:releaseNotesLink>
<pubDate>Wed, 18 Feb 2009 01:14:17 +0100</pubDate>
<enclosure
url="http://www2.entropy.ch/download/xmlviewplugin-1.3.zip"
sparkle:version="1.3"
type="application/octet-stream"
length="1480278"
sparkle:dsaSignature="MCwCFCwp3bVPhvEzg49ru3vbRX8Au9tsAhQjbnx1YXX9yPBCqmHugQZ2ZPyS+w=="
/>
</item>

<item>
<title>Version 1.2</title>
<sparkle:releaseNotesLink>http://www.entropy.ch/software/macosx/xmlviewplugin/release-notes.html#version-1.2</sparkle:releaseNotesLink>
Expand Down
13 changes: 8 additions & 5 deletions Resources/release-notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
}

li {
margin-bottom: 4px;
margin-bottom: 6px;
}

.flag {
Expand All @@ -51,6 +51,10 @@
font-size: 16px;

}

li p {
margin: 0 0 10px 0;
}

</style>
</head>
Expand All @@ -61,10 +65,9 @@
<h1>Version 1.3</h1>

<ul>
<li>The plugin no longer loads the XML data a second time in a separate request.
It reuses the data already loaded by the browser. This is important if requesting the URL
a second time has side effects on the server (which an HTTP GET shouldn’t) or if the URL requires a POST instead of a GET request.</li>
<li>Improved the descriptions of the plugin and the registered MIME types in the list displayed by Help > Installed Plug-ins.</li>
<li>The plugin no longer loads the XML data a second time in a separate HTTP GET request. Instead, it reuses the data already loaded by the browser. This is important if requesting the URL a second time has undesired side effects on the server (which an HTTP GET shouldn’t) or if the URL can only be accessed via a POST instead of a GET request. I didn’t try it but I think the plugin did not handle POST responses before.</li>
<li>The ⌘-E keyboard shortcut for “Use Selection for Find” now works, it didn’t in previous versions. Unfortunately, picking the command form the menu bar with the mouse still doesn’t work because I can’t intercept that event. That is probably not a common use case anyway.</li>
<li>Improved the description of the plugin and its MIME types in the list displayed by Help > Installed Plug-ins.</li>
</ul>

<a name="version-1.2"></a>
Expand Down
45 changes: 27 additions & 18 deletions Sources/XMLWebKitPluginView.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ + (NSView *)plugInViewWithArguments:(NSDictionary *)newArguments {

- (id)initWithArguments:(NSDictionary *)newArguments {

#ifdef CONFIGURATION_DEBUG
NSLog(@"arguments: %@", newArguments);
#endif

if (!(self = [super initWithFrame:NSZeroRect])) return nil;
[NSBundle loadNibNamed:@"XMLWebKitUI" owner:self];
Expand Down Expand Up @@ -111,14 +113,12 @@ - (void)setupDefaults {


- (void)setupSubviews {

// toplevel NIB objects start with retain count of 1 so we release them here
[xmlContentView release];
[self addSubview:xmlContentView];

// TODO: crashes if the do the release on this one,
// check for leaks here
// [aboutPanel release];
// TODO: crashes if we do the release on this one, check for leaks here
// [aboutPanel release];

}

Expand Down Expand Up @@ -200,7 +200,7 @@ - (IBAction)updateDataDisplay:(id)sender {
*/

if (!documentData) return;

BOOL shouldPrettyPrint = [[NSUserDefaults standardUserDefaults] boolForKey:@"ch_entropy_xmlViewPlugin_PrettyPrintXml"];
if ([sender isKindOfClass:[NSMenuItem class]]) {
shouldPrettyPrint = ![sender state]; // the state isn't yet updated at the time of action method invocation
Expand All @@ -219,9 +219,7 @@ - (IBAction)updateDataDisplay:(id)sender {
[[tv textStorage] setAttributedString:xmlAttributedString];

[self setupTextViewFont:tv];

[self refreshLayout];

}


Expand All @@ -240,15 +238,28 @@ - (void)setupTextViewFont:(NSTextView *)tv {
}


//takeFindStringFromSelection

#pragma mark find panel actions

// FIXME: this one doesn't work
// This one doesn't work, somehow we never see this on the responder chain
/*
- (IBAction)takeFindStringFromSelection:(id)sender {
NSLog(@"find string action");
tag = NSFindPanelActionSetFindString;
[textView performFindPanelAction:self];
}
*/

// Instead we do this. Because we invoke the superclass version in any case, the
// selection string is used both for Safari's custom search bear as well as in
// our text view's find panel.
- (BOOL)performKeyEquivalent:(NSEvent *)theEvent {
NSLog(@"event chars: %@", [theEvent charactersIgnoringModifiers]);
if ([[theEvent charactersIgnoringModifiers] isEqualToString:@"e"]) {
tag = NSFindPanelActionSetFindString;
[textView performFindPanelAction:self];
}
return [super performKeyEquivalent:theEvent];
}

- (IBAction)showFindPanel:(id)sender {
tag = NSFindPanelActionShowFindPanel;
Expand All @@ -270,6 +281,7 @@ - (NSInteger)tag {
}



/*
- (BOOL)respondsToSelector:(SEL)aSelector {
NSLog(@"selector: %@", NSStringFromSelector(aSelector));
Expand All @@ -278,7 +290,6 @@ - (BOOL)respondsToSelector:(SEL)aSelector {
*/



# pragma mark display / interaction methods

- (void)refreshLayout {
Expand Down Expand Up @@ -312,6 +323,8 @@ - (void)loadDataWithArguments:(NSDictionary *)arguments {
return;
}

NSLog(@"XML View Plugin: WebPlugInShouldLoadMainResourceKey is YES");

if (!documentURL) {
self.notificationMessage = @"Unable to load XML data, no URL";
NSLog(notificationMessage);
Expand Down Expand Up @@ -372,18 +385,14 @@ - (BOOL)respondsToSelector:(SEL)sel {

#pragma mark WebPlugIn informal protocol

//- (void)webPlugInMainResourceDidReceiveResponse:(NSURLResponse *)response {
- (void)webPlugInMainResourceDidReceiveData:(NSData *)data {
// return;
// NSLog(@"webPlugInMainResourceDidReceiveData: %@", data);
// [super webPlugInMainResourceDidReceiveData:data];
self.documentData = data;
// self.documentData = data;
// self.documentData = [[data copy] autorelease];
self.documentData = [NSData dataWithData:data]; // if we don't create a copy but instead just retain, the data suddenly changes to garbage when we look at it again at a later time.
[self updateDataDisplay:self];

}



/*
- (void)webPlugInInitialize
{
Expand Down
9 changes: 7 additions & 2 deletions XMLWebKitPlugin.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -667,15 +667,18 @@
ARCHS = "$(NATIVE_ARCH)";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_ENABLE_OBJC_GC = supported;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = XMLWebKitPlugin_Prefix.pch;
GCC_PREPROCESSOR_DEFINITIONS = CONFIGURATION_DEBUG;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Library/Internet Plug-Ins";
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "";
PRODUCT_NAME = "XML View Plugin";
PRODUCT_SHORTNAME = xmlviewplugin;
PRODUCT_VERSION = "$(PRODUCT_VERSION_BASE)-dev";
PRODUCT_VERSION_BASE = 1.2;
PRODUCT_VERSION_BASE = 1.3;
SDKROOT = macosx10.5;
WARNING_CFLAGS = "-Wall";
WRAPPER_EXTENSION = webplugin;
Expand All @@ -689,14 +692,16 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_ENABLE_OBJC_GC = supported;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = XMLWebKitPlugin_Prefix.pch;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Library/Internet Plug-Ins";
OTHER_CFLAGS = "";
PRODUCT_NAME = "XML View Plugin";
PRODUCT_SHORTNAME = xmlviewplugin;
PRODUCT_VERSION = "$(PRODUCT_VERSION_BASE)";
PRODUCT_VERSION_BASE = 1.2;
PRODUCT_VERSION_BASE = 1.3;
SDKROOT = macosx10.5;
WARNING_CFLAGS = "-Wall";
WRAPPER_EXTENSION = webplugin;
Expand Down
2 changes: 2 additions & 0 deletions notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Known Issues:

- "Use Selection For Find" doesn't work. The takeFindStringFromSelection method never reaches the main view on the responder chain. The text view seems to handle it, but in a way that doesn't actually set the find clipboard.
- gzipped content?
http://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?pageNumber=0&type=Purple+Software&id=289985022&userReviewId=6081223


Todo:
Expand Down

0 comments on commit 1f61f0e

Please sign in to comment.