Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base: 1b1f8a4da4
...
compare: 26ed1c2cd8
  • 2 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
2  xcode/iCPAN/DetailViewController.h
View
@@ -32,5 +32,7 @@
@property (nonatomic, strong) IBOutlet UIBarButtonItem *stopButton;
-(void) configureView;
+-(NSString*)module2url:(Module *)module;
+-(NSString*)url2module:(NSString *)pageName;
@end
43 xcode/iCPAN/DetailViewController.m
View
@@ -48,14 +48,13 @@ - (void)configureView
// This method will only ever be called when the user selects a module from the table
// in the GenericView
- NSString *name = [self.detailItem valueForKey:@"name"];
iCPANAppDelegate *del = [[UIApplication sharedApplication] delegate];
- name = [name stringByReplacingOccurrencesOfString:@"::" withString:@"_"];
- name = [name stringByAppendingString:@".html"];
+ NSString *pageName = [self module2url:detailItem];
+ NSLog(@"pageName %@", pageName);
NSURL *podURL = [[del podURL] URLByAppendingPathComponent:@"/"];
- NSURL *url = [NSURL URLWithString:name relativeToURL:podURL];
+ NSURL *url = [NSURL URLWithString:pageName relativeToURL:podURL];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
@@ -104,6 +103,7 @@ - (void)viewDidLoad {
podViewer.scalesPageToFit = YES;
// Override point for customization after application launch
+ podViewer.delegate = self;
[super viewDidLoad];
}
@@ -120,9 +120,7 @@ - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)
NSLog(@"Offline page view ------------------------------------------");
// This is an offline page view. We need to handle all of the details.
//
- NSString *path = [url lastPathComponent];
- path = [path stringByReplacingOccurrencesOfString:@"_" withString:@"::"];
- path = [path stringByReplacingOccurrencesOfString:@".html" withString:@""];
+ NSString *path = [self url2module:[url lastPathComponent]];
NSLog(@"module to search for: %@", path);
@@ -148,13 +146,18 @@ - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)
Module *module = [results objectAtIndex:0];
NSLog(@"results for single module search %@", module.name );
- self.title = module.name;
-
- NSString *fileName = module.name;
- fileName = [fileName stringByReplacingOccurrencesOfString:@"::" withString:@"_"];
- fileName = [fileName stringByAppendingString:@".html"];
+ NSString *fileName = [self module2url:module];
NSString *podPath = [[del podDir] stringByAppendingPathComponent:fileName];
+ UILabel *label = [[UILabel alloc] init];
+ label.font = [UIFont fontWithName:@"Helvetica-Bold" size: 12.0];
+ // Optional - label.text = @"NavLabel";
+ [label setBackgroundColor:[UIColor clearColor]];
+ [label setTextColor:[UIColor whiteColor]];
+ [label setText:module.name];
+ [label sizeToFit];
+ [self.navigationController.navigationBar.topItem setTitleView:label];
+
if ( ![[NSFileManager defaultManager] fileExistsAtPath:podPath] ) {
NSLog(@"creating file at %@", podPath);
@@ -192,7 +195,6 @@ - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)
NSLog(@"shouldStartLoadWithRequest ends");
-
return TRUE;
}
@@ -201,4 +203,19 @@ - (void)webViewDidStartLoad:(UIWebView *)webView {
forwardButton.enabled = (webView.canGoForward);
}
+-(NSString*)url2module:(NSString *)pageName {
+ // remove after regenerating db
+ pageName = [pageName stringByReplacingOccurrencesOfString:@"-" withString:@"::"];
+ pageName = [pageName stringByReplacingOccurrencesOfString:@"__" withString:@"::"];
+ pageName = [pageName stringByReplacingOccurrencesOfString:@".html" withString:@""];
+ return pageName;
+}
+
+-(NSString*)module2url:(Module *)Module {
+ NSString *name = Module.name;
+ name = [name stringByReplacingOccurrencesOfString:@"::" withString:@"__"];
+ name = [name stringByAppendingString:@".html"];
+ return name;
+}
+
@end
1  xcode/iCPAN/SearchViewController.m
View
@@ -109,6 +109,7 @@ - (void)performSearch {
predicate = [NSCompoundPredicate andPredicateWithSubpredicates:predicateArgs];
if([predicateArgs count] ==1) {
predicate = [NSPredicate predicateWithFormat:@"%K BEGINSWITH[cd] %@", attributeName, searchText];
+ NSLog(@"-------------------------------------> starts with search");
}
else {
// this search will bypass the db index and be very slow
1  xcode/iCPAN/iPhone/DetailViewController_iPhone.m
View
@@ -34,6 +34,7 @@ - (void) addBookmark {
NSLog(@"adding bookmark");
[ModuleBookmark addBookmark:[self.detailItem valueForKey:@"name"]];
[self activateTrashButton];
+ NSLog(@"items %@", self.toolbarItems);
}
12 xcode/iCPAN/iPhone/en.lproj/MainWindow_iPhone.xib
View
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
- <int key="IBDocument.SystemTarget">1280</int>
+ <int key="IBDocument.SystemTarget">1296</int>
<string key="IBDocument.SystemVersion">11D50b</string>
- <string key="IBDocument.InterfaceBuilderVersion">1938</string>
+ <string key="IBDocument.InterfaceBuilderVersion">2182</string>
<string key="IBDocument.AppKitVersion">1138.32</string>
<string key="IBDocument.HIToolboxVersion">568.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="NS.object.0">933</string>
+ <string key="NS.object.0">1181</string>
</object>
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -345,7 +345,7 @@
<string>4.IBPluginDependency</string>
<string>9.IBPluginDependency</string>
</object>
- <object class="NSMutableArray" key="dict.values">
+ <object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>SearchViewController_iPhone</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@@ -394,7 +394,7 @@
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
- <real value="1280" key="NS.object.0"/>
+ <real value="1296" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
@@ -402,6 +402,6 @@
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
- <string key="IBCocoaTouchPluginVersion">933</string>
+ <string key="IBCocoaTouchPluginVersion">1181</string>
</data>
</archive>

No commit comments for this range

Something went wrong with that request. Please try again.