[MediaWiki-commits] [Gerrit] Added "today" to main menu. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/147676 Change subject: Added "today" to main menu. .. Added "today" to main menu. Change-Id: I32ce96203cb4d4e4f4982bd9fbd2f3ae4b973874 --- M wikipedia/View Controllers/Navigation/Primary/PrimaryMenuViewController.m M wikipedia/en.lproj/Localizable.strings M wikipedia/qqq.lproj/Localizable.strings 3 files changed, 34 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/76/147676/1 diff --git a/wikipedia/View Controllers/Navigation/Primary/PrimaryMenuViewController.m b/wikipedia/View Controllers/Navigation/Primary/PrimaryMenuViewController.m index 9e99225..fc76834 100644 --- a/wikipedia/View Controllers/Navigation/Primary/PrimaryMenuViewController.m +++ b/wikipedia/View Controllers/Navigation/Primary/PrimaryMenuViewController.m @@ -24,12 +24,13 @@ #import "UIViewController+ModalPop.h" typedef NS_ENUM(NSInteger, PrimaryMenuItemTag) { -PRIMARY_MENU_ITEM_UNKNOWN = 0, -PRIMARY_MENU_ITEM_LOGIN = 1, -PRIMARY_MENU_ITEM_RANDOM = 2, -PRIMARY_MENU_ITEM_RECENT = 3, -PRIMARY_MENU_ITEM_SAVEDPAGES = 4, -PRIMARY_MENU_ITEM_MORE = 6 +PRIMARY_MENU_ITEM_UNKNOWN, +PRIMARY_MENU_ITEM_LOGIN, +PRIMARY_MENU_ITEM_RANDOM, +PRIMARY_MENU_ITEM_RECENT, +PRIMARY_MENU_ITEM_SAVEDPAGES, +PRIMARY_MENU_ITEM_MORE, +PRIMARY_MENU_ITEM_TODAY }; @interface PrimaryMenuViewController () @@ -156,6 +157,10 @@ [self.tableData addObjectsFromArray: @[ @{ +@"title": MWLocalizedString(@"main-menu-show-today", nil), +@"tag": @(PRIMARY_MENU_ITEM_TODAY) +}.mutableCopy, +@{ @"title": MWLocalizedString(@"main-menu-random", nil), @"tag": @(PRIMARY_MENU_ITEM_RANDOM) }.mutableCopy, @@ -263,6 +268,12 @@ [self popModal]; } break; +case PRIMARY_MENU_ITEM_TODAY: { +//[self showAlert:MWLocalizedString(@"fetching-today-article", nil)]; +[self fetchTodaysArticle]; +[self popModal]; +} +break; case PRIMARY_MENU_ITEM_RECENT: [self performModalSequeWithID: @"modal_segue_show_history" transitionStyle: UIModalTransitionStyleCoverVertical @@ -283,6 +294,21 @@ } } +-(void)fetchTodaysArticle +{ +NSString *mainArticleTitle = [SessionSingleton sharedInstance].domainMainArticleTitle; +if (mainArticleTitle) { +MWPageTitle *pageTitle = [MWPageTitle titleWithString:mainArticleTitle]; +// Invalidate cache so present day main page article is always retrieved. +[NAV loadArticleWithTitle: pageTitle + domain: [SessionSingleton sharedInstance].domain + animated: YES + discoveryMethod: DISCOVERY_METHOD_SEARCH +invalidatingCache: YES + popToWebVC: NO]; +} +} + -(void)fetchRandomArticle { [[QueuesSingleton sharedInstance].randomArticleQ cancelAllOperations]; diff --git a/wikipedia/en.lproj/Localizable.strings b/wikipedia/en.lproj/Localizable.strings index 7de1a32..a58f959 100644 --- a/wikipedia/en.lproj/Localizable.strings +++ b/wikipedia/en.lproj/Localizable.strings @@ -102,6 +102,7 @@ "main-menu-rate-app" = "Rate app"; "main-menu-heading-zero" = "Wikipedia Zero"; "main-menu-heading-legal" = "Mumbo jumbo"; +"main-menu-show-today" = "Today"; "saved-pages-title" = "Saved pages"; "page-history-title" = "Article history"; diff --git a/wikipedia/qqq.lproj/Localizable.strings b/wikipedia/qqq.lproj/Localizable.strings index e3af9a5..add9162 100644 --- a/wikipedia/qqq.lproj/Localizable.strings +++ b/wikipedia/qqq.lproj/Localizable.strings @@ -158,3 +158,4 @@ "main-menu-privacy-policy" = "Button text for showing privacy policy"; "main-menu-rate-app" = "Button text for showing the app in the app store so user can rate the app"; "main-menu-terms-of-use" = "Button text for showing site terms of use"; +"main-menu-show-today" = "Button text for showing mobile version of main page"; -- To view, visit https://gerrit.wikimedia.org/r/147676 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I32ce96203cb4d4e4f4982bd9fbd2f3ae4b973874 Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Added "today" to main menu. - change (apps...wikipedia)
Brion VIBBER has submitted this change and it was merged. Change subject: Added "today" to main menu. .. Added "today" to main menu. Change-Id: I32ce96203cb4d4e4f4982bd9fbd2f3ae4b973874 --- M wikipedia/View Controllers/Navigation/Primary/PrimaryMenuViewController.m M wikipedia/en.lproj/Localizable.strings M wikipedia/qqq.lproj/Localizable.strings 3 files changed, 34 insertions(+), 6 deletions(-) Approvals: Brion VIBBER: Verified; Looks good to me, approved Siebrand: Looks good to me, but someone else must approve diff --git a/wikipedia/View Controllers/Navigation/Primary/PrimaryMenuViewController.m b/wikipedia/View Controllers/Navigation/Primary/PrimaryMenuViewController.m index 9e99225..fc76834 100644 --- a/wikipedia/View Controllers/Navigation/Primary/PrimaryMenuViewController.m +++ b/wikipedia/View Controllers/Navigation/Primary/PrimaryMenuViewController.m @@ -24,12 +24,13 @@ #import "UIViewController+ModalPop.h" typedef NS_ENUM(NSInteger, PrimaryMenuItemTag) { -PRIMARY_MENU_ITEM_UNKNOWN = 0, -PRIMARY_MENU_ITEM_LOGIN = 1, -PRIMARY_MENU_ITEM_RANDOM = 2, -PRIMARY_MENU_ITEM_RECENT = 3, -PRIMARY_MENU_ITEM_SAVEDPAGES = 4, -PRIMARY_MENU_ITEM_MORE = 6 +PRIMARY_MENU_ITEM_UNKNOWN, +PRIMARY_MENU_ITEM_LOGIN, +PRIMARY_MENU_ITEM_RANDOM, +PRIMARY_MENU_ITEM_RECENT, +PRIMARY_MENU_ITEM_SAVEDPAGES, +PRIMARY_MENU_ITEM_MORE, +PRIMARY_MENU_ITEM_TODAY }; @interface PrimaryMenuViewController () @@ -156,6 +157,10 @@ [self.tableData addObjectsFromArray: @[ @{ +@"title": MWLocalizedString(@"main-menu-show-today", nil), +@"tag": @(PRIMARY_MENU_ITEM_TODAY) +}.mutableCopy, +@{ @"title": MWLocalizedString(@"main-menu-random", nil), @"tag": @(PRIMARY_MENU_ITEM_RANDOM) }.mutableCopy, @@ -263,6 +268,12 @@ [self popModal]; } break; +case PRIMARY_MENU_ITEM_TODAY: { +//[self showAlert:MWLocalizedString(@"fetching-today-article", nil)]; +[self fetchTodaysArticle]; +[self popModal]; +} +break; case PRIMARY_MENU_ITEM_RECENT: [self performModalSequeWithID: @"modal_segue_show_history" transitionStyle: UIModalTransitionStyleCoverVertical @@ -283,6 +294,21 @@ } } +-(void)fetchTodaysArticle +{ +NSString *mainArticleTitle = [SessionSingleton sharedInstance].domainMainArticleTitle; +if (mainArticleTitle) { +MWPageTitle *pageTitle = [MWPageTitle titleWithString:mainArticleTitle]; +// Invalidate cache so present day main page article is always retrieved. +[NAV loadArticleWithTitle: pageTitle + domain: [SessionSingleton sharedInstance].domain + animated: YES + discoveryMethod: DISCOVERY_METHOD_SEARCH +invalidatingCache: YES + popToWebVC: NO]; +} +} + -(void)fetchRandomArticle { [[QueuesSingleton sharedInstance].randomArticleQ cancelAllOperations]; diff --git a/wikipedia/en.lproj/Localizable.strings b/wikipedia/en.lproj/Localizable.strings index 7de1a32..a58f959 100644 --- a/wikipedia/en.lproj/Localizable.strings +++ b/wikipedia/en.lproj/Localizable.strings @@ -102,6 +102,7 @@ "main-menu-rate-app" = "Rate app"; "main-menu-heading-zero" = "Wikipedia Zero"; "main-menu-heading-legal" = "Mumbo jumbo"; +"main-menu-show-today" = "Today"; "saved-pages-title" = "Saved pages"; "page-history-title" = "Article history"; diff --git a/wikipedia/qqq.lproj/Localizable.strings b/wikipedia/qqq.lproj/Localizable.strings index e3af9a5..add9162 100644 --- a/wikipedia/qqq.lproj/Localizable.strings +++ b/wikipedia/qqq.lproj/Localizable.strings @@ -158,3 +158,4 @@ "main-menu-privacy-policy" = "Button text for showing privacy policy"; "main-menu-rate-app" = "Button text for showing the app in the app store so user can rate the app"; "main-menu-terms-of-use" = "Button text for showing site terms of use"; +"main-menu-show-today" = "Button text for showing mobile version of main page"; -- To view, visit https://gerrit.wikimedia.org/r/147676 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I32ce96203cb4d4e4f4982bd9fbd2f3ae4b973874 Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Mhurd Gerrit-Reviewer: Brion VIBBER Gerrit-Reviewer: Siebrand ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits