mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
36db369c8e
19 changed files with 95 additions and 3814 deletions
|
@ -191,7 +191,7 @@ class RedeemCodeForm(forms.Form):
|
|||
if len(gift_code) != 12:
|
||||
raise forms.ValidationError('Your gift code should be 12 characters long.')
|
||||
|
||||
req = requests.get('https://demo.thinkup.com/join/api/bundle/', params={'code': gift_code})
|
||||
req = requests.get('https://www.thinkup.com/join/api/bundle/', params={'code': gift_code})
|
||||
response = req.json()
|
||||
|
||||
is_valid = response.get('is_valid', None)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.newsblur"
|
||||
android:versionCode="77"
|
||||
android:versionName="4.0.0.b7" >
|
||||
android:versionCode="79"
|
||||
android:versionName="4.0.1" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="11"
|
||||
|
|
|
@ -11,10 +11,10 @@
|
|||
android:title="@string/menu_mark_story_as_read" />
|
||||
|
||||
<item android:id="@+id/menu_mark_newer_stories_as_read"
|
||||
android:title="@string/menu_mark_newer_stories_as_read" />
|
||||
android:title="@string/menu_newest_mark_newer_stories_as_read" />
|
||||
|
||||
<item android:id="@+id/menu_mark_older_stories_as_read"
|
||||
android:title="@string/menu_mark_older_stories_as_read" />
|
||||
android:title="@string/menu_newest_mark_older_stories_as_read" />
|
||||
|
||||
<item android:id="@+id/menu_save_story"
|
||||
android:title="@string/menu_save_story" />
|
25
clients/android/NewsBlur/res/menu/context_story_oldest.xml
Normal file
25
clients/android/NewsBlur/res/menu/context_story_oldest.xml
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<item android:id="@+id/menu_shared"
|
||||
android:title="@string/menu_share"/>
|
||||
|
||||
<item android:id="@+id/menu_mark_story_as_unread"
|
||||
android:title="@string/menu_mark_unread" />
|
||||
|
||||
<item android:id="@+id/menu_mark_story_as_read"
|
||||
android:title="@string/menu_mark_story_as_read" />
|
||||
|
||||
<item android:id="@+id/menu_mark_older_stories_as_read"
|
||||
android:title="@string/menu_oldest_mark_older_stories_as_read" />
|
||||
|
||||
<item android:id="@+id/menu_mark_newer_stories_as_read"
|
||||
android:title="@string/menu_oldest_mark_newer_stories_as_read" />
|
||||
|
||||
<item android:id="@+id/menu_save_story"
|
||||
android:title="@string/menu_save_story" />
|
||||
|
||||
<item android:id="@+id/menu_unsave_story"
|
||||
android:title="@string/menu_unsave_story" />
|
||||
|
||||
</menu>
|
|
@ -102,8 +102,10 @@
|
|||
<string name="menu_textsize">Adjust text size</string>
|
||||
<string name="menu_save_story">Save this story</string>
|
||||
<string name="menu_unsave_story">Unsave this story</string>
|
||||
<string name="menu_mark_older_stories_as_read">Mark older as read</string>
|
||||
<string name="menu_mark_newer_stories_as_read">Mark newer as read</string>
|
||||
<string name="menu_newest_mark_older_stories_as_read">\u21E3 Mark older as read</string>
|
||||
<string name="menu_newest_mark_newer_stories_as_read">\u21E1 Mark newer as read</string>
|
||||
<string name="menu_oldest_mark_older_stories_as_read">\u21E1 Mark older as read</string>
|
||||
<string name="menu_oldest_mark_newer_stories_as_read">\u21E3 Mark newer as read</string>
|
||||
<string name="menu_mark_story_as_read">Mark as read</string>
|
||||
<string name="menu_mark_unread">Mark as unread</string>
|
||||
<string name="menu_fullscreen">Full screen</string>
|
||||
|
|
|
@ -31,7 +31,9 @@ import com.newsblur.domain.Story;
|
|||
import com.newsblur.util.DefaultFeedView;
|
||||
import com.newsblur.util.FeedSet;
|
||||
import com.newsblur.util.FeedUtils;
|
||||
import com.newsblur.util.PrefsUtils;
|
||||
import com.newsblur.util.StateFilter;
|
||||
import com.newsblur.util.StoryOrder;
|
||||
|
||||
public abstract class ItemListFragment extends NbFragment implements OnScrollListener, OnCreateContextMenuListener, LoaderManager.LoaderCallbacks<Cursor>, OnItemClickListener {
|
||||
|
||||
|
@ -179,7 +181,11 @@ public abstract class ItemListFragment extends NbFragment implements OnScrollLis
|
|||
@Override
|
||||
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
|
||||
MenuInflater inflater = getActivity().getMenuInflater();
|
||||
inflater.inflate(R.menu.context_story, menu);
|
||||
if (PrefsUtils.getStoryOrder(activity, getFeedSet()) == StoryOrder.NEWEST) {
|
||||
inflater.inflate(R.menu.context_story_newest, menu);
|
||||
} else {
|
||||
inflater.inflate(R.menu.context_story_oldest, menu);
|
||||
}
|
||||
|
||||
Story story = adapter.getStory(((AdapterView.AdapterContextMenuInfo) (menuInfo)).position);
|
||||
if (story.read) {
|
||||
|
|
|
@ -205,6 +205,10 @@
|
|||
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
|
||||
}
|
||||
|
||||
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
|
||||
self.feedTitleGradient.frame = CGRectMake(0, -1, self.view.frame.size.width, 21);
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Story setup
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
BOOL isAnimatedIntoPlace;
|
||||
BOOL waitingForNextUnreadFromServer;
|
||||
UIInterfaceOrientation _orientation;
|
||||
CGFloat scrollPct;
|
||||
}
|
||||
|
||||
@property (nonatomic) IBOutlet NewsBlurAppDelegate *appDelegate;
|
||||
|
|
|
@ -297,16 +297,27 @@
|
|||
}
|
||||
|
||||
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
|
||||
// [self changePage:currentPage.pageIndex animated:YES];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, .01 * NSEC_PER_SEC),
|
||||
dispatch_get_main_queue(), ^
|
||||
{
|
||||
[self reorientPages:fromInterfaceOrientation];
|
||||
|
||||
[appDelegate adjustStoryDetailWebView];
|
||||
|
||||
CGPoint scrollPosition = CGPointMake(0, scrollPct * currentPage.webView.scrollView.contentSize.height);
|
||||
NSLog(@"Scrolling to %2.2f%% of %.0f", scrollPct*100, currentPage.webView.scrollView.contentSize.height);
|
||||
|
||||
[currentPage.webView.scrollView setContentOffset:scrollPosition animated:YES];
|
||||
});
|
||||
}
|
||||
|
||||
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
|
||||
duration:(NSTimeInterval)duration {
|
||||
if (UIInterfaceOrientationIsPortrait(toInterfaceOrientation)) {
|
||||
NSLog(@"Rotate: %f,%f",self.view.frame.size.width,self.view.frame.size.height);
|
||||
NSLog(@"Rotate: %.0f,%.0f",self.view.frame.size.width,self.view.frame.size.height);
|
||||
|
||||
} else if (UIInterfaceOrientationIsLandscape(toInterfaceOrientation)){
|
||||
NSLog(@"Rotate: %f,%f",self.view.frame.size.width,self.view.frame.size.height);
|
||||
NSLog(@"Rotate: %.0f,%.0f",self.view.frame.size.width,self.view.frame.size.height);
|
||||
}
|
||||
|
||||
[self layoutForInterfaceOrientation:toInterfaceOrientation];
|
||||
|
@ -321,7 +332,9 @@
|
|||
// NSLog(@"layout for stories: %@", NSStringFromCGRect(self.view.frame));
|
||||
if (interfaceOrientation != _orientation) {
|
||||
_orientation = interfaceOrientation;
|
||||
[self refreshPages];
|
||||
scrollPct = currentPage.webView.scrollView.contentOffset.y / currentPage.webView.scrollView.contentSize.height;
|
||||
NSLog(@"Current scroll is %2.2f%% (%f.0/%.0f)", scrollPct*100, currentPage.webView.scrollView.contentOffset.y,
|
||||
currentPage.webView.scrollView.contentSize.height);
|
||||
if (currentPage.pageIndex == 0) {
|
||||
previousPage.view.hidden = YES;
|
||||
}
|
||||
|
@ -403,6 +416,20 @@
|
|||
// self.scrollView.contentOffset = CGPointMake(self.scrollView.frame.size.width * currentPage.pageIndex, 0);
|
||||
}
|
||||
|
||||
- (void)reorientPages:(UIInterfaceOrientation)fromOrientation {
|
||||
[self applyNewIndex:currentPage.pageIndex-1 pageController:previousPage];
|
||||
[self applyNewIndex:currentPage.pageIndex+1 pageController:nextPage];
|
||||
[self applyNewIndex:currentPage.pageIndex pageController:currentPage supressRedraw:YES];
|
||||
[self resizeScrollView];
|
||||
|
||||
CGRect frame = self.scrollView.frame;
|
||||
frame.origin.x = frame.size.width * currentPage.pageIndex;
|
||||
frame.origin.y = 0;
|
||||
[self.scrollView scrollRectToVisible:frame animated:NO];
|
||||
|
||||
[MBProgressHUD hideHUDForView:self.view animated:YES];
|
||||
}
|
||||
|
||||
- (void)refreshHeaders {
|
||||
[currentPage setActiveStoryAtIndex:[appDelegate.storiesCollection
|
||||
indexOfStoryId:currentPage.activeStoryId]];
|
||||
|
@ -466,6 +493,12 @@
|
|||
|
||||
- (void)applyNewIndex:(NSInteger)newIndex
|
||||
pageController:(StoryDetailViewController *)pageController {
|
||||
[self applyNewIndex:newIndex pageController:pageController supressRedraw:NO];
|
||||
}
|
||||
|
||||
- (void)applyNewIndex:(NSInteger)newIndex
|
||||
pageController:(StoryDetailViewController *)pageController
|
||||
supressRedraw:(BOOL)suppressRedraw {
|
||||
NSInteger pageCount = [[appDelegate.storiesCollection activeFeedStoryLocations] count];
|
||||
BOOL outOfBounds = newIndex >= pageCount || newIndex < 0;
|
||||
|
||||
|
@ -486,8 +519,11 @@
|
|||
pageController.view.frame = pageFrame;
|
||||
}
|
||||
|
||||
if (suppressRedraw) return;
|
||||
|
||||
NSInteger wasIndex = pageController.pageIndex;
|
||||
pageController.pageIndex = newIndex;
|
||||
// NSLog(@"Applied Index: Was %d, now %d (%d/%d/%d) [%d stories - %d]", wasIndex, newIndex, previousPage.pageIndex, currentPage.pageIndex, nextPage.pageIndex, [appDelegate.activeFeedStoryLocations count], outOfBounds);
|
||||
NSLog(@"Applied Index: Was %d, now %d (%d/%d/%d) [%d stories - %d]", wasIndex, newIndex, previousPage.pageIndex, currentPage.pageIndex, nextPage.pageIndex, [appDelegate.storiesCollection.activeFeedStoryLocations count], outOfBounds);
|
||||
|
||||
if (newIndex > 0 && newIndex >= [appDelegate.storiesCollection.activeFeedStoryLocations count]) {
|
||||
pageController.pageIndex = -2;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#import <SystemConfiguration/SystemConfiguration.h>
|
||||
#import <MobileCoreServices/MobileCoreServices.h>
|
||||
|
||||
//#define DEBUG 1
|
||||
#define DEBUG 1
|
||||
//#define PROD_DEBUG 1
|
||||
|
||||
#ifdef DEBUG
|
||||
|
|
|
@ -388,6 +388,7 @@ static char const * const UINavigationControllerEmbedInPopoverTagKey = "UINaviga
|
|||
result = (w1 * h1);
|
||||
}
|
||||
|
||||
if (value) return result; // Suppress warnings
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1022,6 +1023,7 @@ static float edgeSizeFromCornerRadius(float cornerRadius) {
|
|||
result.left -= self.outerShadowOffset.width;
|
||||
result.right += self.outerShadowOffset.width;
|
||||
|
||||
if (outerShadowInsets.bottom) return result; // Suppress warnings
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1843,6 +1845,7 @@ static WYPopoverTheme *defaultTheme_ = nil;
|
|||
- (BOOL)isPopoverVisible
|
||||
{
|
||||
BOOL result = (overlayView != nil);
|
||||
if (popoverVisible) return result; // Suppress warnings
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
BIN
clients/ios/Resources/header-web.png
Normal file
BIN
clients/ios/Resources/header-web.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 436 KiB |
|
@ -1226,6 +1226,7 @@ a img {
|
|||
padding: 1px 4px 1px 8px;
|
||||
line-height: 14px;
|
||||
margin: 3px 0 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.NB-feedbar .NB-feedbar-options:hover,
|
||||
.NB-feedbar .NB-feedbar-options.NB-active {
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.3 MiB After Width: | Height: | Size: 2.2 MiB |
Binary file not shown.
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 437 KiB |
|
@ -33,7 +33,7 @@
|
|||
};
|
||||
NEWSBLUR.Preferences = {
|
||||
'unread_view' : 0,
|
||||
'lock_mouse_indicator' : 100,
|
||||
'lock_mouse_indicator' : 300,
|
||||
'feed_pane_size' : {% firstof user_profile.feed_pane_size 258 %},
|
||||
'hide_getting_started' : {{ user_profile.hide_getting_started|yesno:"true,false" }},
|
||||
'has_setup_feeds' : {{ user_profile.has_setup_feeds|yesno:"true,false" }},
|
||||
|
|
|
@ -17,7 +17,7 @@ from apps.rss_feeds.icon_importer import IconImporter
|
|||
from apps.push.models import PushSubscription
|
||||
from apps.statistics.models import MAnalyticsFetcher
|
||||
# from utils import feedparser
|
||||
from utils import feedparser_trunk as feedparser
|
||||
from utils import feedparser
|
||||
from utils.story_functions import pre_process_story, strip_tags
|
||||
from utils import log as logging
|
||||
from utils.feed_functions import timelimit, TimeoutError, utf8encode, cache_bust_url
|
||||
|
@ -41,7 +41,7 @@ class FetchFeed:
|
|||
self.options = options
|
||||
self.fpf = None
|
||||
|
||||
@timelimit(20)
|
||||
@timelimit(30)
|
||||
def fetch(self):
|
||||
"""
|
||||
Uses feedparser to download the feed. Will be parsed later.
|
||||
|
|
0
utils/feedparser.py
Executable file → Normal file
0
utils/feedparser.py
Executable file → Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue