Skip to content

Commit

Permalink
updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
ccgus committed Apr 26, 2012
1 parent 542c958 commit 4becf4b
Show file tree
Hide file tree
Showing 5 changed files with 282 additions and 237 deletions.
21 changes: 9 additions & 12 deletions plugins-bundle/VPBlog/VPBlog/VPBPaletteController.m
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,16 @@ - (float)minimumWidth {

- (NSTextView*)currentTextView {

id wc = [(id)[VPBlogPlugin currentDocument] topWindowController];
id <VPPluginWindowController>wc = [[VPBlogPlugin currentDocument] mainWindowController];

return [wc textView];
}

- (id<VPData>)currentItem {

id wc = [(id)[VPBlogPlugin currentDocument] topWindowController];
id <VPPluginWindowController>wc = [[VPBlogPlugin currentDocument] mainWindowController];

id item = [wc item];

return item;
return [wc visibleItem];
}

- (void)togglePublishPageAction:(id)sender {
Expand Down Expand Up @@ -198,16 +196,16 @@ - (void)insertBlockquoteAction:(id)sender {

if (r.length == 0) {

[tv insertText:@"<blockquote><# #></blockquote>"];
[tv fmReplaceCharactersInRange:r withString:@"<blockquote><# #></blockquote>"];
[tv setSelectedRange:r]; // move back so we grab the right placeholder.
[tv selectNextTextPlaceholder:sender];
return;
}

NSString *s = [[[tv textStorage] mutableString] substringWithRange:r];

NSString *repace = [NSString stringWithFormat:@"<blockquote>%@</blockquote>", s];
[tv insertText:repace];
NSString *replace = [NSString stringWithFormat:@"<blockquote>%@</blockquote>", s];
[tv fmReplaceCharactersInRange:r withString:replace];
}

- (void)pasteHREFAction:(id)sender {
Expand All @@ -221,17 +219,16 @@ - (void)pasteHREFAction:(id)sender {
NSRange r = [tv selectedRange];

if (r.length == 0) {

[tv insertText:@"[<# link text #>](<# Earl #>)"];
[tv fmReplaceCharactersInRange:r withString:@"[<# link text #>](<# Earl #>)"];
[tv setSelectedRange:r]; // move back so we grab the right placeholder.
[tv selectNextTextPlaceholder:sender];
return;
}

NSString *s = [[[tv textStorage] mutableString] substringWithRange:r];

NSString *repace = [NSString stringWithFormat:@"[%@](<# Earl #>)", s];
[tv insertText:repace];
NSString *replace = [NSString stringWithFormat:@"[%@](<# Earl #>)", s];
[tv fmReplaceCharactersInRange:r withString:replace];

r.length = 0;
[tv setSelectedRange:r]; // move back so we grab the right placeholder.
Expand Down
1 change: 0 additions & 1 deletion plugins-bundle/VPBlog/VPBlog/VPPrivateStuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#import "JSTalk.h"

@interface NSObject (ThingsINeedToOpenUpInVPOrMakeBetter)
- (id)topWindowController;
- (void)setMetaValue:(NSString*)value forKey:(NSString*)aKey;
- (id)store;
- (void)setAttributesForItem:(id)item;
Expand Down
Loading

0 comments on commit 4becf4b

Please sign in to comment.