Fjalapeno has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/188964

Change subject: Add library license links to about page.
......................................................................

Add library license links to about page.

Added license Text Files to project.
Added License link localization
Created links for licenses and inject in HTML
Added navigation bar logic (back button from Licence)
Restructured about plist to hold license data and placed other values in 
subdictionaries for keyed access.
Replaced inline literal plist and file strings with constants.
Added blockskit to make mapping objects easier
Minor cleanup/refactors:
- Made enum check first in if statement - reduces string comparison logic.
- Made instance method that does not reference "self" a class method.
- Removed dead methods and comments.

Change-Id: I11fc25b890bda25e8556f2a52e03f0ef7fa491b9
---
M Podfile
M Podfile.lock
M Wikipedia.xcodeproj/project.pbxproj
A wikipedia/View Controllers/About/AFNetworkingLicense.txt
M wikipedia/View Controllers/About/AboutViewController.m
M wikipedia/View Controllers/About/AboutViewController.plist
A wikipedia/View Controllers/About/CocoaPodsLicense.txt
A wikipedia/View Controllers/About/HppleLicense.txt
A wikipedia/View Controllers/About/MantleLicense.txt
A wikipedia/View Controllers/About/NSDate-ExtensionsLicense.txt
A wikipedia/View Controllers/About/WikiFontLicense.txt
M wikipedia/View Controllers/Navigation/Top/TopMenuViewController.h
M wikipedia/View Controllers/Navigation/Top/TopMenuViewController.m
M wikipedia/en.lproj/Localizable.strings
M wikipedia/qqq.lproj/Localizable.strings
15 files changed, 299 insertions(+), 55 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia 
refs/changes/64/188964/1

diff --git a/Podfile b/Podfile
index fd18f8a..a5ca967 100644
--- a/Podfile
+++ b/Podfile
@@ -3,6 +3,7 @@
 
 pod 'AFNetworking', '< 2.6'
 pod 'hpple', '< 0.3'
+pod 'blockskit', '<2 .3'
 
 target 'WikipediaUnitTests', :exclusive => false do
   pod 'OCMockito', '< 1.5'
diff --git a/Podfile.lock b/Podfile.lock
index a667c0b..645d914 100644
--- a/Podfile.lock
+++ b/Podfile.lock
@@ -20,6 +20,21 @@
   - AFNetworking/UIKit (2.5.0):
     - AFNetworking/NSURLConnection
     - AFNetworking/NSURLSession
+  - BlocksKit (2.2.5):
+    - BlocksKit/All (= 2.2.5)
+  - BlocksKit/All (2.2.5):
+    - BlocksKit/Core
+    - BlocksKit/DynamicDelegate
+    - BlocksKit/MessageUI
+    - BlocksKit/UIKit
+  - BlocksKit/Core (2.2.5)
+  - BlocksKit/DynamicDelegate (2.2.5)
+  - BlocksKit/MessageUI (2.2.5):
+    - BlocksKit/Core
+    - BlocksKit/DynamicDelegate
+  - BlocksKit/UIKit (2.2.5):
+    - BlocksKit/Core
+    - BlocksKit/DynamicDelegate
   - hpple (0.2.0)
   - OCHamcrest (4.1.1)
   - OCMockito (1.4.0):
@@ -27,12 +42,14 @@
 
 DEPENDENCIES:
   - AFNetworking (< 2.6)
+  - blockskit
   - hpple (< 0.3)
   - OCHamcrest (< 4.2)
   - OCMockito (< 1.5)
 
 SPEC CHECKSUMS:
   AFNetworking: 0f54cb5d16ce38c1b76948faffb8d5fb705021c7
+  BlocksKit: 4439e7f30a9f90743462ca63545a15c1f4304cef
   hpple: f4eb7c21a8db83ec264e5d614ec7509e10e5adec
   OCHamcrest: af1c7c5ea345de69ea6c9c2958f65f3044e5c420
   OCMockito: 991936bb775cc4c27f063d38f5e17b9161fbd21c
diff --git a/Wikipedia.xcodeproj/project.pbxproj 
b/Wikipedia.xcodeproj/project.pbxproj
index 24cc092..670bf95 100644
--- a/Wikipedia.xcodeproj/project.pbxproj
+++ b/Wikipedia.xcodeproj/project.pbxproj
@@ -182,6 +182,12 @@
                954BA118838BF8BA6B01C34A /* libPods-WikipediaUnitTests.a in 
Frameworks */ = {isa = PBXBuildFile; fileRef = 8CE61C6963F825760822A28A /* 
libPods-WikipediaUnitTests.a */; };
                BC42735D1A7C73B300068882 /* NSArray+Predicate.m in Sources */ = 
{isa = PBXBuildFile; fileRef = 04CBAC7219A9B786009F3D7E /* NSArray+Predicate.m 
*/; };
                BC42735E1A7C73B300068882 /* NSArray+PredicateTests.m in Sources 
*/ = {isa = PBXBuildFile; fileRef = BC8309C81A7C370B003FC5C7 /* 
NSArray+PredicateTests.m */; };
+               C459B4881A8411B3007031B0 /* MantleLicense.txt in Resources */ = 
{isa = PBXBuildFile; fileRef = C459B4821A8411B3007031B0 /* MantleLicense.txt 
*/; };
+               C459B4891A8411B3007031B0 /* WikiFontLicense.txt in Resources */ 
= {isa = PBXBuildFile; fileRef = C459B4831A8411B3007031B0 /* 
WikiFontLicense.txt */; };
+               C459B48A1A8411B3007031B0 /* CocoaPodsLicense.txt in Resources 
*/ = {isa = PBXBuildFile; fileRef = C459B4841A8411B3007031B0 /* 
CocoaPodsLicense.txt */; };
+               C459B48B1A8411B3007031B0 /* AFNetworkingLicense.txt in 
Resources */ = {isa = PBXBuildFile; fileRef = C459B4851A8411B3007031B0 /* 
AFNetworkingLicense.txt */; };
+               C459B48C1A8411B3007031B0 /* NSDate-ExtensionsLicense.txt in 
Resources */ = {isa = PBXBuildFile; fileRef = C459B4861A8411B3007031B0 /* 
NSDate-ExtensionsLicense.txt */; };
+               C459B48D1A8411B3007031B0 /* HppleLicense.txt in Resources */ = 
{isa = PBXBuildFile; fileRef = C459B4871A8411B3007031B0 /* HppleLicense.txt */; 
};
                C9180EC418AED30C006C1DCA /* WikipediaAppUtils.m in Sources */ = 
{isa = PBXBuildFile; fileRef = C9180EC318AED30C006C1DCA /* WikipediaAppUtils.m 
*/; };
                D401C2C01A659E5000D4D127 /* 
DataMigrationProgressViewController.m in Sources */ = {isa = PBXBuildFile; 
fileRef = D401C2BE1A659E5000D4D127 /* DataMigrationProgressViewController.m */; 
};
                D401C2C11A659E5000D4D127 /* 
DataMigrationProgressViewController.xib in Resources */ = {isa = PBXBuildFile; 
fileRef = D401C2BF1A659E5000D4D127 /* DataMigrationProgressViewController.xib 
*/; };
@@ -583,6 +589,12 @@
                BC4273521A7C736800068882 /* WikipediaUnitTests.xctest */ = {isa 
= PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; 
path = WikipediaUnitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
                BC8309961A7BF935003FC5C7 /* Info.plist */ = {isa = 
PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; 
sourceTree = "<group>"; };
                BC8309C81A7C370B003FC5C7 /* NSArray+PredicateTests.m */ = {isa 
= PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; 
name = "NSArray+PredicateTests.m"; path = "Utilities/NSArray+PredicateTests.m"; 
sourceTree = "<group>"; };
+               C459B4821A8411B3007031B0 /* MantleLicense.txt */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 
MantleLicense.txt; sourceTree = "<group>"; };
+               C459B4831A8411B3007031B0 /* WikiFontLicense.txt */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 
WikiFontLicense.txt; sourceTree = "<group>"; };
+               C459B4841A8411B3007031B0 /* CocoaPodsLicense.txt */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 
CocoaPodsLicense.txt; sourceTree = "<group>"; };
+               C459B4851A8411B3007031B0 /* AFNetworkingLicense.txt */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 
AFNetworkingLicense.txt; sourceTree = "<group>"; };
+               C459B4861A8411B3007031B0 /* NSDate-ExtensionsLicense.txt */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 
"NSDate-ExtensionsLicense.txt"; sourceTree = "<group>"; };
+               C459B4871A8411B3007031B0 /* HppleLicense.txt */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 
HppleLicense.txt; sourceTree = "<group>"; };
                C9180EC218AED30C006C1DCA /* WikipediaAppUtils.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
WikipediaAppUtils.h; sourceTree = "<group>"; };
                C9180EC318AED30C006C1DCA /* WikipediaAppUtils.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= WikipediaAppUtils.m; sourceTree = "<group>"; };
                D401C2BD1A659E5000D4D127 /* 
DataMigrationProgressViewController.h */ = {isa = PBXFileReference; 
fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
DataMigrationProgressViewController.h; path = 
DataMigration/DataMigrationProgressViewController.h; sourceTree = "<group>"; };
@@ -1094,6 +1106,12 @@
                                045D871F19FAD2FA0035C1F9 /* 
AboutViewController.h */,
                                045D872019FAD2FA0035C1F9 /* 
AboutViewController.m */,
                                0484411D19FF15AF00FD26C5 /* 
AboutViewController.plist */,
+                               C459B4821A8411B3007031B0 /* MantleLicense.txt 
*/,
+                               C459B4831A8411B3007031B0 /* WikiFontLicense.txt 
*/,
+                               C459B4841A8411B3007031B0 /* 
CocoaPodsLicense.txt */,
+                               C459B4851A8411B3007031B0 /* 
AFNetworkingLicense.txt */,
+                               C459B4861A8411B3007031B0 /* 
NSDate-ExtensionsLicense.txt */,
+                               C459B4871A8411B3007031B0 /* HppleLicense.txt */,
                        );
                        path = About;
                        sourceTree = "<group>";
@@ -2034,18 +2052,24 @@
                                04090A33187F53E400577EDF /* clear.png in 
Resources */,
                                0412362E189C29EA00E0CF8E /* 
abuse-filter-disallowed.png in Resources */,
                                0443961D1A3C134F0081557D /* 
NearbyResultCollectionCell.xib in Resources */,
+                               C459B48C1A8411B3007031B0 /* 
NSDate-ExtensionsLicense.txt in Resources */,
                                04082B5518ADA25A00FAF3D6 /* 
text_field_x_circle_g...@2x.png in Resources */,
                                04C91CF219554B310035ED1B /* logo-onboarding.png 
in Resources */,
                                045A9F0D18F6090E0057EA85 /* assets in Resources 
*/,
                                D47FEE2019C8CB0000B998C8 /* (null) in Resources 
*/,
                                04123638189C29EA00E0CF8E /* 
abuse-filter-flag-wh...@2x.png in Resources */,
                                04C91CEF195520990035ED1B /* 
logo-onboarding-subti...@2x.png in Resources */,
+                               C459B48A1A8411B3007031B0 /* 
CocoaPodsLicense.txt in Resources */,
+                               C459B48B1A8411B3007031B0 /* 
AFNetworkingLicense.txt in Resources */,
+                               C459B4881A8411B3007031B0 /* MantleLicense.txt 
in Resources */,
+                               C459B48D1A8411B3007031B0 /* HppleLicense.txt in 
Resources */,
                                0484411E19FF15AF00FD26C5 /* 
AboutViewController.plist in Resources */,
                                04C91CEE195520990035ED1B /* 
logo-onboarding-subtitle.png in Resources */,
                                045EFF1A19A25FEB00D0EDBB /* 
logo-placeholder-search.png in Resources */,
                                0424874F1A54A93C00A5C905 /* lead-default.png in 
Resources */,
                                04224502197F5E09005DD0BF /* BulletedLabel.xib 
in Resources */,
                                041E588219B2D2C500AC140C /* 
logo-placeholder-saved.png in Resources */,
+                               C459B4891A8411B3007031B0 /* WikiFontLicense.txt 
in Resources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
diff --git a/wikipedia/View Controllers/About/AFNetworkingLicense.txt 
b/wikipedia/View Controllers/About/AFNetworkingLicense.txt
new file mode 100644
index 0000000..22508e7
--- /dev/null
+++ b/wikipedia/View Controllers/About/AFNetworkingLicense.txt
@@ -0,0 +1,19 @@
+Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com/)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wikipedia/View Controllers/About/AboutViewController.m 
b/wikipedia/View Controllers/About/AboutViewController.m
index 9c97c24..d5cabc4 100644
--- a/wikipedia/View Controllers/About/AboutViewController.m
+++ b/wikipedia/View Controllers/About/AboutViewController.m
@@ -6,6 +6,27 @@
 #import "UIViewController+ModalPop.h"
 #import "UIWebView+LoadAssetsHtml.h"
 #import "Defines.h"
+#import <BlocksKit/BlocksKit.h>
+#import "ModalContentViewController.h"
+
+static NSString* const kWMFAboutHTMLFile = @"about.html";
+static NSString* const kWMFAboutPlistName = @"AboutViewController";
+
+static NSString* const kWMFURLsKey = @"urls";
+static NSString* const kWMFURLsFeedbackKey = @"feedback";
+static NSString* const kWMFURLsTranslateWikiKey = @"twn";
+static NSString* const kWMFURLsWikimediaKey = @"wmf";
+static NSString* const kWMFURLsSpecialistGuildKey = @"tsg";
+
+static NSString* const kWMFRepositoriesKey = @"repositories";
+
+static NSString* const kWMFLibrariesKey = @"libraries";
+static NSString* const kWMFLibraryNameKey = @"Name";
+static NSString* const kWMFLibraryURLKey = @"Source URL";
+static NSString* const kWMFLibraryFileNameKey = @"Licence File Name";
+
+static NSString* const kWMFContributorsKey = @"contributors";
+
 
 @interface AboutViewController ()
 
@@ -23,10 +44,10 @@
 - (void)viewDidLoad {
     [super viewDidLoad];
     // Do any additional setup after loading the view.
-    NSString *plistPath = [[NSBundle mainBundle] 
pathForResource:@"AboutViewController" ofType:@"plist"];
+    NSString *plistPath = [[NSBundle mainBundle] 
pathForResource:kWMFAboutPlistName ofType:@"plist"];
     self.data = [NSMutableDictionary dictionaryWithContentsOfFile:plistPath];
     self.webView.delegate = self;
-    [self.webView loadHTMLFromAssetsFile:@"about.html"];
+    [self.webView loadHTMLFromAssetsFile:kWMFAboutHTMLFile];
 }
 
 -(void)viewDidAppear:(BOOL)animated
@@ -56,6 +77,9 @@
         case NAVBAR_BUTTON_X:
             [self popModal];
             break;
+        case NAVBAR_BUTTON_ARROW_LEFT:
+            [self.webView loadHTMLFromAssetsFile:kWMFAboutHTMLFile];
+            break;
         default:
             break;
     }
@@ -63,11 +87,21 @@
 
 -(NavBarMode)navBarMode
 {
+    if([[[[self.webView request] URL] pathExtension] isEqualToString:@"txt"]){
+
+        return NAVBAR_MODE_BACK_WITH_LABEL;
+    }
+    
     return NAVBAR_MODE_X_WITH_LABEL;
 }
 
 -(NSString *)title
 {
+    if([[[[self.webView request] URL] pathExtension] isEqualToString:@"txt"]){
+        
+        return MWLocalizedString(@"about-libraries-license", nil);
+    }
+
     return MWLocalizedString(@"about-title", nil);
 }
 
@@ -78,32 +112,35 @@
 
 -(NSString *)contributors
 {
-    return [self.data[@"contributors"] componentsJoinedByString:@", "];
+    return [self.data[kWMFContributorsKey] componentsJoinedByString:@", "];
 }
 
 -(NSDictionary *)urls
 {
-    return self.data[@"urls"];
+    return self.data[kWMFURLsKey];
 }
 
 -(NSString *)libraryLinks
 {
-    NSMutableDictionary *libraries = (NSMutableDictionary 
*)self.data[@"libraries"];
+    NSArray *libraries = [self.data[kWMFLibrariesKey] bk_map:^id(NSDictionary 
*obj) {
+        
+        NSString* sourceLink = [[self class] 
linkHTMLForURLString:obj[kWMFLibraryURLKey] title:obj[kWMFLibraryNameKey]];
+        
+        NSString* filePath = [[NSBundle mainBundle] 
pathForResource:obj[kWMFLibraryFileNameKey] ofType:@"txt"];
+        NSString* licenseLink = [[self class] linkHTMLForURLString:filePath 
title:MWLocalizedString(@"about-libraries-license", nil)];
+        
+        return [sourceLink stringByAppendingFormat:@" (%@)", licenseLink];
+    }];
     
-    for (NSString *library in libraries.copy) {
-        libraries[library] = [self getLinkHTMLForURL:libraries[library] 
title:library];
-    }
-    
-    NSString *output = [libraries.allValues componentsJoinedByString:@", "];
-    return output;
+    return [libraries componentsJoinedByString:@", "];
 }
 
 -(NSString *)repositoryLinks
 {
-    NSMutableDictionary *repos = (NSMutableDictionary 
*)self.data[@"repositories"];
+    NSMutableDictionary *repos = (NSMutableDictionary 
*)self.data[kWMFRepositoriesKey];
     
-    for (NSString *repo in repos.copy) {
-        repos[repo] = [self getLinkHTMLForURL:repos[repo] title:repo];
+    for (NSString *repo in [repos copy]) {
+        repos[repo] = [[self class] linkHTMLForURLString:repos[repo] 
title:repo];
     }
     
     NSString *output = [repos.allValues componentsJoinedByString:@", "];
@@ -112,18 +149,13 @@
 
 -(NSString *)feedbackURL
 {
-    NSString *feedbackUrl = self.urls[@"feedback"];
+    NSString *feedbackUrl = self.urls[kWMFURLsFeedbackKey];
     feedbackUrl = [feedbackUrl stringByReplacingOccurrencesOfString:@"$1" 
withString:[WikipediaAppUtils versionedUserAgent]];
 
     NSString *encodedUrlString =
     [feedbackUrl 
stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
     
     return encodedUrlString;
-}
-
--(NSString *)getLinkHTMLForURL:(NSString *)url title:(NSString *)title
-{
-    return [NSString stringWithFormat:@"<a href='%@'>%@</a>", url, title];
 }
 
 - (void)webViewDidFinishLoad:(UIWebView *)webView
@@ -156,24 +188,24 @@
     setDivHTML(@"libraries_body", self.libraryLinks);
     setDivHTML(@"repositories_title", MWLocalizedString(@"about-repositories", 
nil));
     setDivHTML(@"repositories_body", self.repositoryLinks);
-    setDivHTML(@"feedback_body", [self getLinkHTMLForURL:self.feedbackURL 
title:MWLocalizedString(@"about-send-feedback", nil)]);
+    setDivHTML(@"feedback_body", [[self class] 
linkHTMLForURLString:self.feedbackURL 
title:MWLocalizedString(@"about-send-feedback", nil)]);
     
-    NSString *twnUrl = self.urls[@"twn"];
-    NSString *translatorsLink = [self getLinkHTMLForURL:twnUrl title:[twnUrl 
substringFromIndex:7]];
+    NSString *twnUrl = self.urls[kWMFURLsTranslateWikiKey];
+    NSString *translatorsLink = [[self class] linkHTMLForURLString:twnUrl 
title:[twnUrl substringFromIndex:7]];
     NSString *translatorDetails =
     [MWLocalizedString(@"about-translators-details", nil) 
stringByReplacingOccurrencesOfString: @"$1"
                                                                                
     withString: translatorsLink];
     setDivHTML(@"translators_body", translatorDetails);
     
-    NSString *tsgUrl = self.urls[@"tsg"];
-    NSString *tsgLink = [self getLinkHTMLForURL:tsgUrl title:[tsgUrl 
substringFromIndex:7]];
+    NSString *tsgUrl = self.urls[kWMFURLsSpecialistGuildKey];
+    NSString *tsgLink = [[self class] linkHTMLForURLString:tsgUrl 
title:[tsgUrl substringFromIndex:7]];
     NSString *tsgDetails =
     [MWLocalizedString(@"about-testers-details", nil) 
stringByReplacingOccurrencesOfString: @"$1"
                                                                                
     withString: tsgLink];
     setDivHTML(@"testers_body", tsgDetails);
     
-    NSString *wmfUrl = self.urls[@"wmf"];
-    NSString *foundation = [self getLinkHTMLForURL:wmfUrl 
title:MWLocalizedString(@"about-wikimedia-foundation", nil)];
+    NSString *wmfUrl = self.urls[kWMFURLsWikimediaKey];
+    NSString *foundation = [[self class] linkHTMLForURLString:wmfUrl 
title:MWLocalizedString(@"about-wikimedia-foundation", nil)];
     NSString *footer =
     [MWLocalizedString(@"about-product-of", nil) 
stringByReplacingOccurrencesOfString: @"$1"
                                                                            
withString: foundation];
@@ -185,40 +217,40 @@
 
     NSString *fontSizeJS = [NSString 
stringWithFormat:@"document.body.style.fontSize = '%f%%'", 
(MENUS_SCALE_MULTIPLIER * 100.0f)];
     [self.webView stringByEvaluatingJavaScriptFromString:fontSizeJS];
+
+    /*
+     HACK: This is pretty terrible. The current VC should not need to know 
about the containing view controller to set its nav bar buttons and title.
+     We really need to change the modal display logic to make sure modal VCs 
can update their navigation bar.
+     That is obviously a pretty big refactor and effects several VCs - so not 
doing that here. In the mean time, we are casting what we know the containing 
VC to be so we can make the needed changes.
+     */
+    [(ModalContentViewController*)self.parentViewController 
setNavBarMode:self.navBarMode];
+    [(ModalContentViewController*)self.parentViewController 
setTopMenuText:self.title];
+
 }
 
-// Force web view links to open in Safari.
-// From: http://stackoverflow.com/a/2532884
 -(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest 
*)request navigationType:(UIWebViewNavigationType)navigationType;
 {
     NSURL *requestURL = [request URL];
+    
     if (
+        (navigationType == UIWebViewNavigationTypeLinkClicked)
+        &&
         (
          [[requestURL scheme] isEqualToString:@"http"]
          ||
          [[requestURL scheme] isEqualToString:@"https"]
          ||
          [[requestURL scheme] isEqualToString:@"mailto"])
-        && (navigationType == UIWebViewNavigationTypeLinkClicked)
         ) {
         return ![[UIApplication sharedApplication] openURL:requestURL];
     }
     return YES;
 }
 
-- (void)didReceiveMemoryWarning {
-    [super didReceiveMemoryWarning];
-    // Dispose of any resources that can be recreated.
++ (NSString *)linkHTMLForURLString:(NSString *)url title:(NSString *)title
+{
+    return [NSString stringWithFormat:@"<a href='%@'>%@</a>", url, title];
 }
 
-/*
- #pragma mark - Navigation
- 
- // In a storyboard-based application, you will often want to do a little 
preparation before navigation
- - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
- // Get the new view controller using [segue destinationViewController].
- // Pass the selected object to the new view controller.
- }
- */
 
 @end
diff --git a/wikipedia/View Controllers/About/AboutViewController.plist 
b/wikipedia/View Controllers/About/AboutViewController.plist
index 813cd82..5aedf95 100644
--- a/wikipedia/View Controllers/About/AboutViewController.plist
+++ b/wikipedia/View Controllers/About/AboutViewController.plist
@@ -13,19 +13,6 @@
                <key>wmf</key>
                <string>http://wikimediafoundation.org</string>
        </dict>
-       <key>libraries</key>
-       <dict>
-               <key>WikiFont</key>
-               <string>https://github.com/munmay/WikiFont</string>
-               <key>HPPLE</key>
-               <string>https://github.com/topfunky/hpple</string>
-               <key>NSDate-Extensions</key>
-               <string>https://github.com/erica/NSDate-Extensions</string>
-               <key>AFNetworking</key>
-               <string>https://github.com/AFNetworking/AFNetworking</string>
-               <key>CocoaPods</key>
-               <string>http://cocoapods.org</string>
-       </dict>
        <key>repositories</key>
        <dict>
                <key>GitHub</key>
@@ -33,6 +20,57 @@
                <key>Gerrit</key>
                
<string>https://gerrit.wikimedia.org/r/#/q/project:apps/ios/wikipedia,n,z</string>
        </dict>
+       <key>libraries</key>
+       <array>
+               <dict>
+                       <key>Name</key>
+                       <string>WikiFont</string>
+                       <key>Source URL</key>
+                       <string>https://github.com/munmay/WikiFont</string>
+                       <key>Licence File Name</key>
+                       <string>WikiFontLicense</string>
+               </dict>
+               <dict>
+                       <key>Name</key>
+                       <string>Hpple</string>
+                       <key>Source URL</key>
+                       <string>https://github.com/topfunky/hpple</string>
+                       <key>Licence File Name</key>
+                       <string>HppleLicense</string>
+               </dict>
+               <dict>
+                       <key>Name</key>
+                       <string>NSDate-Extensions</string>
+                       <key>Source URL</key>
+                       
<string>https://github.com/erica/NSDate-Extensions</string>
+                       <key>Licence File Name</key>
+                       <string>NSDate-ExtensionsLicense</string>
+               </dict>
+               <dict>
+                       <key>Name</key>
+                       <string>AFNetworking</string>
+                       <key>Source URL</key>
+                       
<string>https://github.com/AFNetworking/AFNetworking</string>
+                       <key>Licence File Name</key>
+                       <string>AFNetworkingLicense</string>
+               </dict>
+               <dict>
+                       <key>Name</key>
+                       <string>CocoaPods</string>
+                       <key>Source URL</key>
+                       <string>https://github.com/CocoaPods/CocoaPods</string>
+                       <key>Licence File Name</key>
+                       <string>CocoaPodsLicense</string>
+               </dict>
+               <dict>
+                       <key>Name</key>
+                       <string>Mantle</string>
+                       <key>Source URL</key>
+                       <string>https://github.com/Mantle/Mantle</string>
+                       <key>Licence File Name</key>
+                       <string>MantleLicense</string>
+               </dict>
+       </array>
        <key>contributors</key>
        <array>
                <string>Adam Baso</string>
diff --git a/wikipedia/View Controllers/About/CocoaPodsLicense.txt 
b/wikipedia/View Controllers/About/CocoaPodsLicense.txt
new file mode 100644
index 0000000..b1c4b00
--- /dev/null
+++ b/wikipedia/View Controllers/About/CocoaPodsLicense.txt
@@ -0,0 +1,22 @@
+This project is licensed under the MIT license.
+
+Copyright (c) 2011 - 2014 Eloy DurĂ¡n <eloy.de.en...@gmail.com>
+Copyright (c) 2012 - 2014 Fabio Pelosin <fabiopelo...@gmail.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wikipedia/View Controllers/About/HppleLicense.txt b/wikipedia/View 
Controllers/About/HppleLicense.txt
new file mode 100644
index 0000000..8adbad2
--- /dev/null
+++ b/wikipedia/View Controllers/About/HppleLicense.txt
@@ -0,0 +1,22 @@
+Copyright (c) 2009 Topfunky Corporation, http://topfunky.com
+
+MIT LICENSE
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wikipedia/View Controllers/About/MantleLicense.txt 
b/wikipedia/View Controllers/About/MantleLicense.txt
new file mode 100644
index 0000000..9d6e782
--- /dev/null
+++ b/wikipedia/View Controllers/About/MantleLicense.txt
@@ -0,0 +1,15 @@
+Copyright (c) 2012 - 2014, GitHub, Inc. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy 
of this software and associated documentation files (the "Software"), to deal 
in the Software without restriction, including without limitation the rights to 
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
of the Software, and to permit persons to whom the Software is furnished to do 
so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all 
copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
SOFTWARE.
+
+This project uses portions of code from the Proton framework. Proton is 
copyright (c) 2012, Bitswift, Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without 
modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this 
list of conditions and the following disclaimer.
+Neither the name of the Bitswift, Inc. nor the names of its contributors may 
be used to endorse or promote products derived from this software without 
specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/wikipedia/View Controllers/About/NSDate-ExtensionsLicense.txt 
b/wikipedia/View Controllers/About/NSDate-ExtensionsLicense.txt
new file mode 100644
index 0000000..2bc9498
--- /dev/null
+++ b/wikipedia/View Controllers/About/NSDate-ExtensionsLicense.txt
@@ -0,0 +1,23 @@
+Copyright (c) 2015, Erica Sadun
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+  list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/wikipedia/View Controllers/About/WikiFontLicense.txt 
b/wikipedia/View Controllers/About/WikiFontLicense.txt
new file mode 100644
index 0000000..2d095e5
--- /dev/null
+++ b/wikipedia/View Controllers/About/WikiFontLicense.txt
@@ -0,0 +1,24 @@
+Copyright (c) 2014, github.com/munmay
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of the Wikimedia Foundation nor the
+      names of its contributors may be used to endorse or promote products
+      derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/wikipedia/View Controllers/Navigation/Top/TopMenuViewController.h 
b/wikipedia/View Controllers/Navigation/Top/TopMenuViewController.h
index b4ad6d1..85d48af 100644
--- a/wikipedia/View Controllers/Navigation/Top/TopMenuViewController.h
+++ b/wikipedia/View Controllers/Navigation/Top/TopMenuViewController.h
@@ -38,6 +38,7 @@
     NAVBAR_MODE_SEARCH,
     NAVBAR_MODE_X_WITH_LABEL,
     NAVBAR_MODE_X_WITH_TEXT_FIELD,
+    NAVBAR_MODE_BACK_WITH_LABEL,
     NAVBAR_MODE_PAGES_HISTORY,
     NAVBAR_MODE_PAGES_SAVED
 } NavBarMode;
diff --git a/wikipedia/View Controllers/Navigation/Top/TopMenuViewController.m 
b/wikipedia/View Controllers/Navigation/Top/TopMenuViewController.m
index ce5ddfa..1f1b9d3 100644
--- a/wikipedia/View Controllers/Navigation/Top/TopMenuViewController.m
+++ b/wikipedia/View Controllers/Navigation/Top/TopMenuViewController.m
@@ -470,6 +470,10 @@
             self.navBarSubViewsHorizontalVFLString =
             @"H:|-(6)-[NAVBAR_BUTTON_X(50)][NAVBAR_LABEL]-(56)-|";
             break;
+        case NAVBAR_MODE_BACK_WITH_LABEL:
+            self.navBarSubViewsHorizontalVFLString =
+            
@"H:|-(4)-[NAVBAR_BUTTON_ARROW_LEFT(50)]-(10)-[NAVBAR_LABEL]-(56)-|";
+            break;
         case NAVBAR_MODE_PAGES_HISTORY:
         case NAVBAR_MODE_PAGES_SAVED:
             self.navBarSubViewsHorizontalVFLString =
diff --git a/wikipedia/en.lproj/Localizable.strings 
b/wikipedia/en.lproj/Localizable.strings
index 8807bea..5a51845 100644
--- a/wikipedia/en.lproj/Localizable.strings
+++ b/wikipedia/en.lproj/Localizable.strings
@@ -177,6 +177,7 @@
 "about-translators" = "translators";
 "about-translators-details" = "Translated by volunteers at $1";
 "about-libraries" = "libraries used";
+"about-libraries-license" = "License";
 "about-repositories" = "repositories";
 "about-send-feedback" = "Send app feedback";
 "about-product-of" = "A product of the $1";
diff --git a/wikipedia/qqq.lproj/Localizable.strings 
b/wikipedia/qqq.lproj/Localizable.strings
index fe84937..e655bf5 100644
--- a/wikipedia/qqq.lproj/Localizable.strings
+++ b/wikipedia/qqq.lproj/Localizable.strings
@@ -166,6 +166,7 @@
 "about-translators" = "Header text for translators section of the about page. 
Is not capitalised for aesthetic reasons, but could be capitalised in 
translations.\n{{Identical|Translator}}";
 "about-translators-details" = "Description of volunteer translation. $1 is 
translatewiki url.";
 "about-libraries" = "Header text for libraries section (as in a collection of 
subprograms used to develop software) of the about page. Is not capitalised for 
aesthetic reasons, but could be capitalised in translations.";
+"about-libraries-license" = "About page link title that will display a license 
for a library used in the app";
 "about-repositories" = "Header text for repositories section of the about 
page. Is not capitalised for aesthetic reasons, but could be capitalised in 
translations. \n{{Identical|Repository}}";
 "about-send-feedback" = "Link text for sending app feedback";
 "about-product-of" = "Description of who produced the app. $1 is the message 
{{msg-wikimedia|wikipedia-ios-about-wikimedia-foundation}}.";

-- 
To view, visit https://gerrit.wikimedia.org/r/188964
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I11fc25b890bda25e8556f2a52e03f0ef7fa491b9
Gerrit-PatchSet: 1
Gerrit-Project: apps/ios/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Fjalapeno <cfl...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to