• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

BathyScapheで画像のインラインプレビューを可能にするプラグイン


Commit MetaInfo

Revisão7b3eec2b5ea36f57aa4332a1a9f15713924bd97a (tree)
Hora2013-04-15 21:36:48
Autormasakih <masakih@user...>
Commitermasakih

Mensagem de Log

[Fix] BathyScaphe2.3.2で複数選択時のプレビューが出来ない問題を解消

Mudança Sumário

Diff

--- a/BSInlinePreviewer.m
+++ b/BSInlinePreviewer.m
@@ -159,6 +159,28 @@ static NSString *ThumbnailSizeKey = @"com.masakih.BSInlinePreviewer.thumbnailSiz
159159 return YES;
160160 }
161161
162+- (BOOL)isValiableLinkAttr:(id)attr
163+{
164+ if([attr isKindOfClass:NSClassFromString(@"BSInnerLinkValueRep")]) {
165+ attr = [attr stringValue];
166+ } else if(![attr isKindOfClass:[NSString class]]) {
167+ return NO;
168+ }
169+
170+ return attr
171+ && ![attr hasPrefix:@"cmonar"]
172+ && ![attr hasPrefix:@"cmbe"]
173+ && ![attr hasPrefix:@"mailto"];
174+}
175+- (NSString *)URLStringFromAttr:(id)attr
176+{
177+ if([attr isKindOfClass:NSClassFromString(@"BSInnerLinkValueRep")]) {
178+ attr = [attr stringValue];
179+ } else if(![attr isKindOfClass:[NSString class]]) {
180+ return nil;
181+ }
182+ return attr;
183+}
162184 - (BOOL)previewLinks:(NSArray *)urls
163185 {
164186 // get document.
@@ -188,12 +210,9 @@ static NSString *ThumbnailSizeKey = @"com.masakih.BSInlinePreviewer.thumbnailSiz
188210 atIndex:location
189211 longestEffectiveRange:NULL
190212 inRange:range]) ? YES : NO;
191- if(!didChecked && attr
192- && ![attr hasPrefix:@"cmonar"]
193- && ![attr hasPrefix:@"cmbe"]
194- && ![attr hasPrefix:@"mailto"]) {
213+ if(!didChecked && [self isValiableLinkAttr:attr]) {
195214 BSILinkInfomation *link = [[[BSILinkInfomation alloc] init] autorelease];
196- link.urlString = attr;
215+ link.urlString = [self URLStringFromAttr:attr];
197216 link.range = longest;
198217 [links addObject:link];
199218 }