Brion VIBBER has submitted this change and it was merged.
Change subject: Fix for search term highlighting font size and TOC updates.
..
Fix for search term highlighting font size and TOC updates.
When non-lead section of article were retrieved while TOC was
open, there was a regression which caused new sections/images
to not appear in the TOC until it was closed and opened again.
Ran ttfautohint on WikiFont.ttf
Fix for sharing some articles with special characters in
their titles causing app crash.
When you select a search result the top menu switches back
to default chrome.
Returned search result text size - had accidentally shrunken
the result article titles.
Change-Id: I1d96b8f9d01e5077f5091a4ad161a36272ac6112
---
M wikipedia/Categories/Article+Convenience.h
M wikipedia/Categories/Article+Convenience.m
M wikipedia/Defines/Defines.h
M wikipedia/Fonts/WikiFont.ttf
M wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.m
M wikipedia/View Controllers/Navigation/Top/TopMenuViewController.m
M wikipedia/View Controllers/SearchResults/SearchResultsController.m
M wikipedia/View Controllers/WebView/WebViewController.m
8 files changed, 54 insertions(+), 24 deletions(-)
Approvals:
Brion VIBBER: Verified; Looks good to me, approved
diff --git a/wikipedia/Categories/Article+Convenience.h
b/wikipedia/Categories/Article+Convenience.h
index 8c6dac3..ed58405 100644
--- a/wikipedia/Categories/Article+Convenience.h
+++ b/wikipedia/Categories/Article+Convenience.h
@@ -12,4 +12,6 @@
// larger than 99 x 99 px.
- (UIImage *)getThumbnailUsingContext:(NSManagedObjectContext *)context;
+- (NSURL *)desktopURL;
+
@end
diff --git a/wikipedia/Categories/Article+Convenience.m
b/wikipedia/Categories/Article+Convenience.m
index 167ad22..70a22d0 100644
--- a/wikipedia/Categories/Article+Convenience.m
+++ b/wikipedia/Categories/Article+Convenience.m
@@ -5,6 +5,7 @@
#import "ArticleCoreDataObjects.h"
#import "Image+Convenience.h"
#import "Defines.h"
+#import "NSString+Extras.h"
@implementation Article (Convenience)
@@ -88,4 +89,17 @@
return sectionImages;
}
+-(NSURL *)desktopURL
+{
+NSString *titleWithoutSpaces = [self.title wikiTitleWithoutSpaces];
+
+NSString *urlString =
+[NSString stringWithFormat:@"https://%@.%@/wiki/%@";, self.domain,
self.site, titleWithoutSpaces];
+
+NSString *encodedUrlString =
+[urlString
stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
+
+return encodedUrlString ? [NSURL URLWithString:encodedUrlString] : nil;
+}
+
@end
diff --git a/wikipedia/Defines/Defines.h b/wikipedia/Defines/Defines.h
index 2983b1b..01ab479 100644
--- a/wikipedia/Defines/Defines.h
+++ b/wikipedia/Defines/Defines.h
@@ -4,11 +4,14 @@
#define SEARCH_RESULT_HEIGHT 60
#define SEARCH_MAX_RESULTS @"25"
-#define SEARCH_FONT [UIFont systemFontOfSize:14.0]
-#define SEARCH_FONT_COLOR [UIColor colorWithWhite:0.0 alpha:0.85]
+#define SEARCH_TEXT_FIELD_FONT [UIFont systemFontOfSize:14.0]
+#define SEARCH_TEXT_FIELD_HIGHLIGHTED_COLOR [UIColor blackColor]
-#define SEARCH_FONT_HIGHLIGHTED [UIFont boldSystemFontOfSize:16.0]
-#define SEARCH_FONT_HIGHLIGHTED_COLOR [UIColor blackColor]
+#define SEARCH_RESULT_FONT [UIFont systemFontOfSize:16.0]
+#define SEARCH_RESULT_FONT_COLOR [UIColor colorWithWhite:0.0 alpha:0.85]
+
+#define SEARCH_RESULT_FONT_HIGHLIGHTED [UIFont boldSystemFontOfSize:16.0]
+#define SEARCH_RESULT_FONT_HIGHLIGHTED_COLOR [UIColor blackColor]
#define SEARCH_FIELD_PLACEHOLDER_TEXT_COLOR [UIColor colorWithRed:0.7
green:0.7 blue:0.7 alpha:1.0]
diff --git a/wikipedia/Fonts/WikiFont.ttf b/wikipedia/Fonts/WikiFont.ttf
index ab851d0..66ec0c0 100644
--- a/wikipedia/Fonts/WikiFont.ttf
+++ b/wikipedia/Fonts/WikiFont.ttf
Binary files differ
diff --git a/wikipedia/View
Controllers/Navigation/Bottom/BottomMenuViewController.m b/wikipedia/View
Controllers/Navigation/Bottom/BottomMenuViewController.m
index a7ec2b2..b5df308 100644
--- a/wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.m
+++ b/wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.m
@@ -14,6 +14,7 @@
#import "UIViewController+Alert.h"
#import "UIView+TemporaryAnimatedXF.h"
#import "NSString+Extras.h"
+#import "Article+Convenience.h"
typedef NS_ENUM(NSInteger, BottomMenuItemTag) {
BOTTOM_MENU_BUTTON_UNKNOWN = 0,
@@ -108,7 +109,7 @@
- (void)shareButtonPushed
{
NSString *title = @"";
-NSURL *URL = nil;
+NSURL *desktopURL = nil;
NSManagedObjectID *articleID =
[articleDataContext_.mainContext getArticleIDForTitle: [SessionSingleton
sharedInstance].currentArticleTitle
@@ -116,13 +117,18 @@
if (articleID) {
Article *article = (Article *)[articleDataContext_.mainContext
objectWithID:articleID];
if (article) {
-NSString *titleWithoutSpaces = [article.title
wikiTitleWithoutSpaces];
-URL =