Revision: 7266 http://skim-app.svn.sourceforge.net/skim-app/?rev=7266&view=rev Author: hofman Date: 2011-06-08 11:58:06 +0000 (Wed, 08 Jun 2011)
Log Message: ----------- support search open parameter from fragment of URL Modified Paths: -------------- trunk/SKDocumentController.m Modified: trunk/SKDocumentController.m =================================================================== --- trunk/SKDocumentController.m 2011-06-08 11:38:38 UTC (rev 7265) +++ trunk/SKDocumentController.m 2011-06-08 11:58:06 UTC (rev 7266) @@ -391,10 +391,19 @@ id document = [super openDocumentWithContentsOfURL:absoluteURL display:displayDocument error:outError]; - if ([document isPDFDocument] && [fragment length] > 5 && [fragment compare:@"page=" options:NSAnchoredSearch | NSCaseInsensitiveSearch range:NSMakeRange(0, 5)] == NSOrderedSame) { - NSInteger page = [[fragment substringFromIndex:5] integerValue]; - if (page > 0) - [[document mainWindowController] setPageNumber:page]; + if ([document isPDFDocument] && [fragment length] > 0) { + for (NSString *fragmentItem in [fragment componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"&#"]]) { + if ([fragmentItem length] > 5 && [fragmentItem compare:@"page=" options:NSAnchoredSearch | NSCaseInsensitiveSearch range:NSMakeRange(0, 5)] == NSOrderedSame) { + NSInteger page = [[fragmentItem substringFromIndex:5] integerValue]; + if (page > 0) + [[document mainWindowController] setPageNumber:page]; + break; + } else if ([fragmentItem length] > 7 && [fragmentItem compare:@"search=" options:NSAnchoredSearch | NSCaseInsensitiveSearch range:NSMakeRange(0, 5)] == NSOrderedSame) { + NSString *searchString = [[fragmentItem substringFromIndex:7] stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"\""]]; + if ([searchString length] > 0) + [[document mainWindowController] displaySearchResultsForString:searchString]; + } + } } return document; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev _______________________________________________ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit