mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-31 13:35:58 +00:00
Merge branch 'master' into offline
# By Samuel Clay (3) and others # Via Samuel Clay (3) and ojiikun (3) * master: Turning off forked mongoengine for now. Fixing j/k keyboard shortcuts when story titles are hidden. Fixing middleware to activate users. Faulty paths resulted in paths that had a / not being recognized. Thanks to @subglass! Make AllStories and FolderStories views match. Have the All Stories view query by wildcard, not ID list. Moved the URL schema (http://) into NEWSBLUR_URL Introduced NEWSBLUR_HOST for couple of cases where NEWSBLUR_URL was being used as a hostname Switched default URL to https://
This commit is contained in:
commit
1f1aec0b53
29 changed files with 88 additions and 92 deletions
|
@ -10,7 +10,9 @@ from django.template import Template, Context
|
|||
|
||||
class LastSeenMiddleware(object):
|
||||
def process_response(self, request, response):
|
||||
if ((request.path in ('/', '/reader/refresh_feeds', '/reader/load_feeds'))
|
||||
if ((request.path == '/' or
|
||||
request.path.startswith('/reader/refresh_feeds') or
|
||||
request.path.startswith('/reader/load_feeds'))
|
||||
and hasattr(request, 'user')
|
||||
and request.user.is_authenticated()):
|
||||
hour_ago = datetime.datetime.utcnow() - datetime.timedelta(minutes=60)
|
||||
|
|
4
fabfile.py
vendored
4
fabfile.py
vendored
|
@ -173,7 +173,7 @@ def setup_common():
|
|||
setup_hosts()
|
||||
config_pgbouncer()
|
||||
setup_mongoengine_repo()
|
||||
setup_forked_mongoengine()
|
||||
# setup_forked_mongoengine()
|
||||
setup_pymongo_repo()
|
||||
setup_logrotate()
|
||||
setup_nginx()
|
||||
|
@ -548,7 +548,7 @@ def setup_node():
|
|||
def configure_node():
|
||||
sudo('rm -fr /etc/supervisor/conf.d/node.conf')
|
||||
put('config/supervisor_node_unread.conf', '/etc/supervisor/conf.d/node_unread.conf', use_sudo=True)
|
||||
put('config/supervisor_node_unread_ssl.conf', '/etc/supervisor/conf.d/node_unread_ssl.conf', use_sudo=True)
|
||||
# put('config/supervisor_node_unread_ssl.conf', '/etc/supervisor/conf.d/node_unread_ssl.conf', use_sudo=True)
|
||||
put('config/supervisor_node_favicons.conf', '/etc/supervisor/conf.d/node_favicons.conf', use_sudo=True)
|
||||
sudo('supervisorctl reload')
|
||||
|
||||
|
|
|
@ -34,10 +34,6 @@
|
|||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingLeft="2dp"
|
||||
android:paddingRight="2dp"
|
||||
android:layout_toRightOf="@id/row_item_sidebar" />
|
||||
|
||||
<TextView
|
||||
|
@ -50,7 +46,7 @@
|
|||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/darkgray"
|
||||
android:textSize="11dp" />
|
||||
android:textSize="14dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/row_item_title"
|
||||
|
|
|
@ -31,8 +31,8 @@
|
|||
|
||||
<ImageView
|
||||
android:id="@+id/row_item_feedicon"
|
||||
android:layout_width="17dp"
|
||||
android:layout_height="17dp"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_toRightOf="@id/row_item_sidebar" />
|
||||
|
||||
|
@ -40,6 +40,7 @@
|
|||
android:id="@+id/row_item_feedtitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_toRightOf="@id/row_item_feedicon"
|
||||
android:layout_alignBottom="@id/row_item_feedicon"
|
||||
android:ellipsize="end"
|
||||
|
|
|
@ -28,7 +28,6 @@ import com.newsblur.util.StoryOrder;
|
|||
|
||||
public class AllStoriesItemsList extends ItemsList {
|
||||
|
||||
private ArrayList<String> feedIds;
|
||||
private APIManager apiManager;
|
||||
private ContentResolver resolver;
|
||||
|
||||
|
@ -38,15 +37,9 @@ public class AllStoriesItemsList extends ItemsList {
|
|||
|
||||
setTitle(getResources().getString(R.string.all_stories));
|
||||
|
||||
feedIds = new ArrayList<String>();
|
||||
apiManager = new APIManager(this);
|
||||
resolver = getContentResolver();
|
||||
|
||||
Cursor cursor = resolver.query(FeedProvider.FEEDS_URI, null, DatabaseConstants.getStorySelectionFromState(currentState), null, null);
|
||||
|
||||
while (cursor.moveToNext()) {
|
||||
feedIds.add(cursor.getString(cursor.getColumnIndex(DatabaseConstants.FEED_ID)));
|
||||
}
|
||||
|
||||
itemListFragment = (AllStoriesItemListFragment) fragmentManager.findFragmentByTag(FeedItemListFragment.FRAGMENT_TAG);
|
||||
if (itemListFragment == null) {
|
||||
|
@ -78,10 +71,7 @@ public class AllStoriesItemsList extends ItemsList {
|
|||
final Intent intent = new Intent(Intent.ACTION_SYNC, null, this, SyncService.class);
|
||||
intent.putExtra(SyncService.EXTRA_STATUS_RECEIVER, syncFragment.receiver);
|
||||
intent.putExtra(SyncService.SYNCSERVICE_TASK, SyncService.EXTRA_TASK_MULTIFEED_UPDATE);
|
||||
|
||||
String[] feeds = new String[feedIds.size()];
|
||||
feedIds.toArray(feeds);
|
||||
intent.putExtra(SyncService.EXTRA_TASK_MULTIFEED_IDS, feeds);
|
||||
intent.putExtra(SyncService.EXTRA_TASK_MULTIFEED_IDS, new String[0]); // the API will return all feeds if no IDs are passed
|
||||
intent.putExtra(SyncService.EXTRA_TASK_PAGE_NUMBER, Integer.toString(page));
|
||||
intent.putExtra(SyncService.EXTRA_TASK_ORDER, getStoryOrder());
|
||||
intent.putExtra(SyncService.EXTRA_TASK_READ_FILTER, PrefsUtils.getReadFilterForFolder(this, PrefConstants.ALL_STORIES_FOLDER_NAME));
|
||||
|
@ -107,9 +97,7 @@ public class AllStoriesItemsList extends ItemsList {
|
|||
values.put(DatabaseConstants.FEED_NEGATIVE_COUNT, 0);
|
||||
values.put(DatabaseConstants.FEED_NEUTRAL_COUNT, 0);
|
||||
values.put(DatabaseConstants.FEED_POSITIVE_COUNT, 0);
|
||||
for (String feedId : feedIds) {
|
||||
resolver.update(FeedProvider.FEEDS_URI.buildUpon().appendPath(feedId).build(), values, null, null);
|
||||
}
|
||||
resolver.update(FeedProvider.FEEDS_URI, values, null, null);
|
||||
setResult(RESULT_OK);
|
||||
Toast.makeText(AllStoriesItemsList.this, R.string.toast_marked_all_stories_as_read, Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
|
|
|
@ -583,6 +583,8 @@ public class FeedProvider extends ContentProvider {
|
|||
final SQLiteDatabase db = databaseHelper.getWritableDatabase();
|
||||
|
||||
switch (uriMatcher.match(uri)) {
|
||||
case ALL_FEEDS:
|
||||
return db.update(DatabaseConstants.FEED_TABLE, values, null, null);
|
||||
case INDIVIDUAL_FEED:
|
||||
return db.update(DatabaseConstants.FEED_TABLE, values, DatabaseConstants.FEED_ID + " = ?", new String[] { uri.getLastPathSegment() });
|
||||
case INDIVIDUAL_SOCIAL_FEED:
|
||||
|
|
|
@ -105,7 +105,7 @@
|
|||
feedId = [activity objectForKey:@"story_feed_id"];
|
||||
}
|
||||
if (feedId && [feedId class] != [NSNull class]) {
|
||||
NSString *faviconUrl = [NSString stringWithFormat:@"http://%@/rss_feeds/icon/%i",
|
||||
NSString *faviconUrl = [NSString stringWithFormat:@"%@/rss_feeds/icon/%i",
|
||||
NEWSBLUR_URL,
|
||||
[feedId intValue]];
|
||||
[self.faviconView setImageWithURL:[NSURL URLWithString:faviconUrl]
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
self.pageFetching = YES;
|
||||
self.appDelegate = (NewsBlurAppDelegate *)[[UIApplication sharedApplication] delegate];
|
||||
NSString *urlString = [NSString stringWithFormat:@
|
||||
"http://%@/social/activities?user_id=%@&page=%i&limit=10"
|
||||
"%@/social/activities?user_id=%@&page=%i&limit=10"
|
||||
"&category=signup&category=star&category=feedsub&category=follow&category=comment_reply&category=comment_like&category=sharedstory",
|
||||
NEWSBLUR_URL,
|
||||
[appDelegate.dictSocialProfile objectForKey:@"user_id"],
|
||||
|
|
|
@ -199,7 +199,7 @@
|
|||
}
|
||||
|
||||
[self.siteActivityIndicator startAnimating];
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/rss_feeds/feed_autocomplete?term=%@&v=2",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/rss_feeds/feed_autocomplete?term=%@&v=2",
|
||||
NEWSBLUR_URL, [phrase stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
ASIFormDataRequest *request = [ASIHTTPRequest requestWithURL:url];
|
||||
|
@ -259,7 +259,7 @@
|
|||
[self.addingLabel setText:@"Adding site..."];
|
||||
[self.errorLabel setHidden:YES];
|
||||
[self.activityIndicator startAnimating];
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/reader/add_url",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/reader/add_url",
|
||||
NEWSBLUR_URL];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
} else if ([type isEqualToString:@"appdotnet"]) {
|
||||
self.navigationItem.title = @"App.net";
|
||||
}
|
||||
NSString *urlAddress = [NSString stringWithFormat:@"http://%@%@", NEWSBLUR_URL, url];
|
||||
NSString *urlAddress = [NSString stringWithFormat:@"%@%@", NEWSBLUR_URL, url];
|
||||
NSURL *fullUrl = [NSURL URLWithString:urlAddress];
|
||||
NSURLRequest *requestObj = [NSURLRequest requestWithURL:fullUrl];
|
||||
[self.webView loadRequest:requestObj];
|
||||
|
@ -83,7 +83,7 @@
|
|||
NSString *URLString = [[request URL] absoluteString];
|
||||
NSLog(@"URL STRING IS %@", URLString);
|
||||
|
||||
if ([URLString isEqualToString:[NSString stringWithFormat:@"http://%@/", NEWSBLUR_URL]]) {
|
||||
if ([URLString isEqualToString:[NSString stringWithFormat:@"%@/", NEWSBLUR_URL]]) {
|
||||
NSString *error = [self.webView stringByEvaluatingJavaScriptFromString:@"NEWSBLUR.error"];
|
||||
|
||||
if (self.fromStory) {
|
||||
|
@ -121,7 +121,7 @@
|
|||
}
|
||||
|
||||
// // for failed google reader authorization
|
||||
// if ([URLString hasPrefix:[NSString stringWithFormat:@"http://%@/import/callback", NEWSBLUR_URL]]) {
|
||||
// if ([URLString hasPrefix:[NSString stringWithFormat:@"%@/import/callback", NEWSBLUR_URL]]) {
|
||||
// [self.navigationController popViewControllerAnimated:YES];
|
||||
// [appDelegate.firstTimeUserAddSitesViewController importFromGoogleReaderFailed];
|
||||
// return NO;
|
||||
|
|
|
@ -321,12 +321,12 @@
|
|||
[storyTitlesTable scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:YES];
|
||||
}
|
||||
if (appDelegate.isSocialView) {
|
||||
theFeedDetailURL = [NSString stringWithFormat:@"http://%@/social/stories/%@/?page=%d",
|
||||
theFeedDetailURL = [NSString stringWithFormat:@"%@/social/stories/%@/?page=%d",
|
||||
NEWSBLUR_URL,
|
||||
[appDelegate.activeFeed objectForKey:@"user_id"],
|
||||
self.feedPage];
|
||||
} else {
|
||||
theFeedDetailURL = [NSString stringWithFormat:@"http://%@/reader/feed/%@/?page=%d",
|
||||
theFeedDetailURL = [NSString stringWithFormat:@"%@/reader/feed/%@/?page=%d",
|
||||
NEWSBLUR_URL,
|
||||
[appDelegate.activeFeed objectForKey:@"id"],
|
||||
self.feedPage];
|
||||
|
@ -455,24 +455,24 @@
|
|||
if (appDelegate.isSocialRiverView) {
|
||||
if ([appDelegate.activeFolder isEqualToString:@"river_global"]) {
|
||||
theFeedDetailURL = [NSString stringWithFormat:
|
||||
@"http://%@/social/river_stories/?global_feed=true&page=%d",
|
||||
@"%@/social/river_stories/?global_feed=true&page=%d",
|
||||
NEWSBLUR_URL,
|
||||
self.feedPage];
|
||||
|
||||
} else {
|
||||
theFeedDetailURL = [NSString stringWithFormat:
|
||||
@"http://%@/social/river_stories/?page=%d",
|
||||
@"%@/social/river_stories/?page=%d",
|
||||
NEWSBLUR_URL,
|
||||
self.feedPage];
|
||||
}
|
||||
} else if ([appDelegate.activeFolder isEqual:@"saved_stories"]) {
|
||||
theFeedDetailURL = [NSString stringWithFormat:
|
||||
@"http://%@/reader/starred_stories/?page=%d",
|
||||
@"%@/reader/starred_stories/?page=%d",
|
||||
NEWSBLUR_URL,
|
||||
self.feedPage];
|
||||
} else {
|
||||
theFeedDetailURL = [NSString stringWithFormat:
|
||||
@"http://%@/reader/river_stories/?feeds=%@&page=%d",
|
||||
@"%@/reader/river_stories/?feeds=%@&page=%d",
|
||||
NEWSBLUR_URL,
|
||||
[appDelegate.activeFolderFeeds componentsJoinedByString:@"&feeds="],
|
||||
self.feedPage];
|
||||
|
@ -1022,7 +1022,7 @@
|
|||
if (appDelegate.isRiverView && includeHidden &&
|
||||
[appDelegate.activeFolder isEqualToString:@"everything"]) {
|
||||
// Mark folder as read
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/reader/mark_all_as_read",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/reader/mark_all_as_read",
|
||||
NEWSBLUR_URL];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
|
||||
|
@ -1032,7 +1032,7 @@
|
|||
[appDelegate markActiveFolderAllRead];
|
||||
} else if (appDelegate.isRiverView && includeHidden) {
|
||||
// Mark folder as read
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/reader/mark_feed_as_read",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/reader/mark_feed_as_read",
|
||||
NEWSBLUR_URL];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
|
||||
|
@ -1045,7 +1045,7 @@
|
|||
[appDelegate markActiveFolderAllRead];
|
||||
} else if (!appDelegate.isRiverView && includeHidden) {
|
||||
// Mark feed as read
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/reader/mark_feed_as_read",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/reader/mark_feed_as_read",
|
||||
NEWSBLUR_URL];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
|
||||
|
@ -1058,7 +1058,7 @@
|
|||
} else {
|
||||
// Mark visible stories as read
|
||||
NSDictionary *feedsStories = [appDelegate markVisibleStoriesRead];
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/reader/mark_feed_stories_as_read",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/reader/mark_feed_stories_as_read",
|
||||
NEWSBLUR_URL];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
|
||||
|
@ -1257,7 +1257,7 @@
|
|||
MBProgressHUD *HUD = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
||||
HUD.labelText = @"Deleting...";
|
||||
|
||||
NSString *theFeedDetailURL = [NSString stringWithFormat:@"http://%@/reader/delete_feed",
|
||||
NSString *theFeedDetailURL = [NSString stringWithFormat:@"%@/reader/delete_feed",
|
||||
NEWSBLUR_URL];
|
||||
NSURL *urlFeedDetail = [NSURL URLWithString:theFeedDetailURL];
|
||||
|
||||
|
@ -1284,7 +1284,7 @@
|
|||
MBProgressHUD *HUD = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
||||
HUD.labelText = @"Deleting...";
|
||||
|
||||
NSString *theFeedDetailURL = [NSString stringWithFormat:@"http://%@/reader/delete_folder",
|
||||
NSString *theFeedDetailURL = [NSString stringWithFormat:@"%@/reader/delete_folder",
|
||||
NEWSBLUR_URL];
|
||||
NSURL *urlFeedDetail = [NSURL URLWithString:theFeedDetailURL];
|
||||
|
||||
|
@ -1352,7 +1352,7 @@
|
|||
|
||||
- (void)instafetchFeed {
|
||||
NSString *urlString = [NSString
|
||||
stringWithFormat:@"http://%@/reader/refresh_feed/%@",
|
||||
stringWithFormat:@"%@/reader/refresh_feed/%@",
|
||||
NEWSBLUR_URL,
|
||||
[appDelegate.activeFeed objectForKey:@"id"]];
|
||||
[self cancelRequests];
|
||||
|
@ -1403,7 +1403,7 @@
|
|||
|
||||
NSString *feedIdsQuery = [NSString stringWithFormat:@"?feed_ids=%@",
|
||||
[[keys valueForKey:@"description"] componentsJoinedByString:@"&feed_ids="]];
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/reader/favicons%@",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/reader/favicons%@",
|
||||
NEWSBLUR_URL,
|
||||
feedIdsQuery];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
|
|
|
@ -140,7 +140,7 @@
|
|||
return;
|
||||
}
|
||||
if (buttonIndex == 1) {
|
||||
NSString *urlS = [NSString stringWithFormat:@"http://%@/reader/login_as?user=%@",
|
||||
NSString *urlS = [NSString stringWithFormat:@"%@/reader/login_as?user=%@",
|
||||
NEWSBLUR_URL, alertTextField.text];
|
||||
NSURL *url = [NSURL URLWithString:urlS];
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
#pragma mark Check Social
|
||||
|
||||
- (void)connectToSocial {
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/social/load_user_friends",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/social/load_user_friends",
|
||||
NEWSBLUR_URL];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
|
||||
|
@ -196,7 +196,7 @@
|
|||
UISwitch *button = (UISwitch *)sender;
|
||||
|
||||
NSURL *preferenceURL = [NSURL URLWithString:
|
||||
[NSString stringWithFormat:@"http://%@/profile/set_preference",
|
||||
[NSString stringWithFormat:@"%@/profile/set_preference",
|
||||
NEWSBLUR_URL]];
|
||||
|
||||
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:preferenceURL];
|
||||
|
|
|
@ -105,7 +105,7 @@
|
|||
#pragma mark Add Site
|
||||
|
||||
- (void)addPopular {
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/social/follow/",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/social/follow/",
|
||||
NEWSBLUR_URL];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
|
||||
|
@ -118,7 +118,7 @@
|
|||
}
|
||||
|
||||
- (void)addSite:(NSString *)siteUrl {
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/reader/add_url/",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/reader/add_url/",
|
||||
NEWSBLUR_URL];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
|
||||
|
|
|
@ -118,7 +118,7 @@
|
|||
[appDelegate.ftuxNavigationController pushViewController:appDelegate.firstTimeUserAddFriendsViewController animated:YES];
|
||||
|
||||
if (self.selectedCategories_.count) {
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/categories/subscribe",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/categories/subscribe",
|
||||
NEWSBLUR_URL];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
|
||||
|
@ -167,7 +167,7 @@
|
|||
self.instructionLabel.text = @"This might take a minute.\nFeel free to continue...";
|
||||
[self.googleReaderButton addSubview:self.activityIndicator];
|
||||
[self.activityIndicator startAnimating];
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/import/import_from_google_reader/",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/import/import_from_google_reader/",
|
||||
NEWSBLUR_URL];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
|
||||
|
@ -267,7 +267,7 @@
|
|||
#pragma mark Add Site
|
||||
|
||||
- (void)addSite:(NSString *)siteUrl {
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/reader/add_url",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/reader/add_url",
|
||||
NEWSBLUR_URL];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
|
||||
|
|
|
@ -110,7 +110,7 @@
|
|||
}
|
||||
|
||||
- (void)loadFriendsList:(NSString *)query {
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/social/find_friends?query=%@&limit=10",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/social/find_friends?query=%@&limit=10",
|
||||
NEWSBLUR_URL,
|
||||
query];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
|
@ -123,7 +123,7 @@
|
|||
}
|
||||
|
||||
- (void)loadSuggestedFriendsList {
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/social/load_user_friends",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/social/load_user_friends",
|
||||
NEWSBLUR_URL];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@
|
|||
self.pageFetching = YES;
|
||||
|
||||
NSString *urlString = [NSString stringWithFormat:@
|
||||
"http://%@/social/interactions?user_id=%@&page=%i&limit=10"
|
||||
"%@/social/interactions?user_id=%@&page=%i&limit=10"
|
||||
"&category=follow&category=comment_reply&category=comment_like&category=reply_reply&category=story_reshare",
|
||||
NEWSBLUR_URL,
|
||||
[appDelegate.dictSocialProfile objectForKey:@"user_id"],
|
||||
|
|
|
@ -180,7 +180,7 @@
|
|||
MBProgressHUD *HUD = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
||||
HUD.labelText = @"Authenticating";
|
||||
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/api/login",
|
||||
NSString *urlString = [NSString stringWithFormat:@"https://%@/api/login",
|
||||
NEWSBLUR_URL];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
[[NSHTTPCookieStorage sharedHTTPCookieStorage]
|
||||
|
@ -230,7 +230,7 @@
|
|||
MBProgressHUD *HUD = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
||||
HUD.labelText = @"Registering...";
|
||||
[self.errorLabel setHidden:YES];
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/api/signup",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/api/signup",
|
||||
NEWSBLUR_URL];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
[[NSHTTPCookieStorage sharedHTTPCookieStorage]
|
||||
|
|
|
@ -131,7 +131,7 @@
|
|||
[self.movingLabel setText:@"Moving site..."];
|
||||
[self.errorLabel setHidden:YES];
|
||||
[self.activityIndicator startAnimating];
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/reader/move_feed_to_folder",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/reader/move_feed_to_folder",
|
||||
NEWSBLUR_URL];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
|
||||
|
@ -180,7 +180,7 @@
|
|||
[self.movingLabel setText:@"Moving Folder..."];
|
||||
[self.errorLabel setHidden:YES];
|
||||
[self.activityIndicator startAnimating];
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/reader/move_folder_to_folder",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/reader/move_folder_to_folder",
|
||||
NEWSBLUR_URL];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
|
||||
|
|
|
@ -270,7 +270,7 @@
|
|||
}
|
||||
|
||||
- (void)setupReachability {
|
||||
Reachability* reach = [Reachability reachabilityWithHostname:NEWSBLUR_URL];
|
||||
Reachability* reach = [Reachability reachabilityWithHostname:NEWSBLUR_HOST];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(reachabilityChanged:)
|
||||
name:kReachabilityChangedNotification
|
||||
|
@ -639,7 +639,7 @@
|
|||
}
|
||||
|
||||
- (void)refreshUserProfile:(void(^)())callback {
|
||||
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://%@/social/load_user_profile",
|
||||
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/social/load_user_profile",
|
||||
NEWSBLUR_URL]];
|
||||
ASIHTTPRequest *_request = [ASIHTTPRequest requestWithURL:url];
|
||||
__weak ASIHTTPRequest *request = _request;
|
||||
|
@ -672,7 +672,7 @@
|
|||
return;
|
||||
} else {
|
||||
NSLog(@"Logging out...");
|
||||
NSString *urlS = [NSString stringWithFormat:@"http://%@/reader/logout?api=1",
|
||||
NSString *urlS = [NSString stringWithFormat:@"%@/reader/logout?api=1",
|
||||
NEWSBLUR_URL];
|
||||
NSURL *url = [NSURL URLWithString:urlS];
|
||||
|
||||
|
@ -1851,7 +1851,7 @@
|
|||
[self.storyPageControl refreshHeaders];
|
||||
[self.trainerViewController refresh];
|
||||
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/classifier/save",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/classifier/save",
|
||||
NEWSBLUR_URL];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
__block ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
|
||||
|
@ -1894,7 +1894,7 @@
|
|||
[self.storyPageControl refreshHeaders];
|
||||
[self.trainerViewController refresh];
|
||||
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/classifier/save",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/classifier/save",
|
||||
NEWSBLUR_URL];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
__block ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
|
||||
|
@ -1941,7 +1941,7 @@
|
|||
[self.storyPageControl refreshHeaders];
|
||||
[self.trainerViewController refresh];
|
||||
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/classifier/save",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/classifier/save",
|
||||
NEWSBLUR_URL];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
__block ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
|
||||
|
@ -1983,7 +1983,7 @@
|
|||
[self.storyPageControl refreshHeaders];
|
||||
[self.trainerViewController refresh];
|
||||
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/classifier/save",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/classifier/save",
|
||||
NEWSBLUR_URL];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
__block ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
|
||||
|
@ -2024,7 +2024,7 @@
|
|||
- (void)createDatabaseConnection {
|
||||
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
|
||||
NSString *docsPath = [paths objectAtIndex:0];
|
||||
NSString *dbName = [NSString stringWithFormat:@"%@.sqlite", NEWSBLUR_URL];
|
||||
NSString *dbName = [NSString stringWithFormat:@"%@.sqlite", NEWSBLUR_HOST];
|
||||
NSString *path = [docsPath stringByAppendingPathComponent:dbName];
|
||||
|
||||
database = [FMDatabaseQueue databaseQueueWithPath:path];
|
||||
|
@ -2080,7 +2080,7 @@
|
|||
|
||||
- (void)fetchUnreadHashes {
|
||||
|
||||
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://%@/reader/unread_story_hashes?include_timestamps=true",
|
||||
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/reader/unread_story_hashes?include_timestamps=true",
|
||||
NEWSBLUR_URL]];
|
||||
ASIHTTPRequest *_request = [ASIHTTPRequest requestWithURL:url];
|
||||
__weak ASIHTTPRequest *request = _request;
|
||||
|
@ -2185,7 +2185,7 @@
|
|||
return;
|
||||
}
|
||||
|
||||
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://%@/reader/river_stories?page=0&h=%@",
|
||||
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/reader/river_stories?page=0&h=%@",
|
||||
NEWSBLUR_URL, [hashes componentsJoinedByString:@"&h="]]];
|
||||
ASIHTTPRequest *_request = [ASIHTTPRequest requestWithURL:url];
|
||||
__weak ASIHTTPRequest *request = _request;
|
||||
|
@ -2268,7 +2268,7 @@
|
|||
}
|
||||
|
||||
- (void)syncQueuedReadStories:(FMDatabase *)db withStories:(NSDictionary *)hashes withCallback:(void(^)())callback {
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/reader/mark_feed_stories_as_read",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/reader/mark_feed_stories_as_read",
|
||||
NEWSBLUR_URL];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
NSMutableArray *completedHashes = [NSMutableArray array];
|
||||
|
|
|
@ -419,11 +419,11 @@ static const CGFloat kFolderTitleHeight = 28;
|
|||
|
||||
if (self.inPullToRefresh_) {
|
||||
urlFeedList = [NSURL URLWithString:
|
||||
[NSString stringWithFormat:@"http://%@/reader/feeds?flat=true&update_counts=true",
|
||||
[NSString stringWithFormat:@"%@/reader/feeds?flat=true&update_counts=true",
|
||||
NEWSBLUR_URL]];
|
||||
} else {
|
||||
urlFeedList = [NSURL URLWithString:
|
||||
[NSString stringWithFormat:@"http://%@/reader/feeds?flat=true&update_counts=false",
|
||||
[NSString stringWithFormat:@"%@/reader/feeds?flat=true&update_counts=false",
|
||||
NEWSBLUR_URL]];
|
||||
}
|
||||
|
||||
|
@ -1303,7 +1303,7 @@ heightForHeaderInSection:(NSInteger)section {
|
|||
|
||||
|
||||
- (void)loadFavicons {
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/reader/favicons",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/reader/favicons",
|
||||
NEWSBLUR_URL];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
|
||||
|
@ -1392,10 +1392,10 @@ heightForHeaderInSection:(NSInteger)section {
|
|||
// refresh the feed
|
||||
NSString *urlString;
|
||||
if (feedId) {
|
||||
urlString = [NSString stringWithFormat:@"http://%@/reader/feed_unread_count?feed_id=%@",
|
||||
urlString = [NSString stringWithFormat:@"%@/reader/feed_unread_count?feed_id=%@",
|
||||
NEWSBLUR_URL, feedId];
|
||||
} else {
|
||||
urlString = [NSString stringWithFormat:@"http://%@/reader/refresh_feeds",
|
||||
urlString = [NSString stringWithFormat:@"%@/reader/refresh_feeds",
|
||||
NEWSBLUR_URL];
|
||||
}
|
||||
NSURL *urlFeedList = [NSURL URLWithString:urlString];
|
||||
|
|
|
@ -203,7 +203,7 @@
|
|||
NSURL* url = [NSURL URLWithString:urlString];
|
||||
|
||||
if (!url.scheme) {
|
||||
NSString* modifiedURLString = [NSString stringWithFormat:@"http://%@", urlString];
|
||||
NSString* modifiedURLString = [NSString stringWithFormat:@"%@", urlString];
|
||||
url = [NSURL URLWithString:modifiedURLString];
|
||||
}
|
||||
if ([self.webView isLoading]) {
|
||||
|
|
|
@ -306,10 +306,10 @@
|
|||
[self.activityIndicator startAnimating];
|
||||
|
||||
if ([self.followButton.currentTitle isEqualToString:@"Follow"]) {
|
||||
urlString = [NSString stringWithFormat:@"http://%@/social/follow",
|
||||
urlString = [NSString stringWithFormat:@"%@/social/follow",
|
||||
NEWSBLUR_URL];
|
||||
} else {
|
||||
urlString = [NSString stringWithFormat:@"http://%@/social/unfollow",
|
||||
urlString = [NSString stringWithFormat:@"%@/social/unfollow",
|
||||
NEWSBLUR_URL];
|
||||
}
|
||||
|
||||
|
|
|
@ -304,7 +304,7 @@
|
|||
|
||||
- (IBAction)doShareThisStory:(id)sender {
|
||||
[appDelegate.storyPageControl showShareHUD:@"Sharing"];
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/social/share_story",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/social/share_story",
|
||||
NEWSBLUR_URL];
|
||||
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
|
@ -378,7 +378,7 @@
|
|||
}
|
||||
|
||||
// NSLog(@"REPLY TO COMMENT, %@", appDelegate.activeComment);
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/social/save_comment_reply",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/social/save_comment_reply",
|
||||
NEWSBLUR_URL];
|
||||
|
||||
NSString *feedIdStr = [NSString stringWithFormat:@"%@", [appDelegate.activeStory objectForKey:@"story_feed_id"]];
|
||||
|
|
|
@ -1123,10 +1123,10 @@ shouldStartLoadWithRequest:(NSURLRequest *)request
|
|||
[appDelegate.storyPageControl showShareHUD:@"Favoriting"];
|
||||
NSString *urlString;
|
||||
if (likeComment) {
|
||||
urlString = [NSString stringWithFormat:@"http://%@/social/like_comment",
|
||||
urlString = [NSString stringWithFormat:@"%@/social/like_comment",
|
||||
NEWSBLUR_URL];
|
||||
} else {
|
||||
urlString = [NSString stringWithFormat:@"http://%@/social/remove_like_comment",
|
||||
urlString = [NSString stringWithFormat:@"%@/social/remove_like_comment",
|
||||
NEWSBLUR_URL];
|
||||
}
|
||||
|
||||
|
@ -1248,7 +1248,7 @@ shouldStartLoadWithRequest:(NSURLRequest *)request
|
|||
|
||||
- (void)subscribeToBlurblog {
|
||||
[appDelegate.storyPageControl showShareHUD:@"Following"];
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/social/follow",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/social/follow",
|
||||
NEWSBLUR_URL];
|
||||
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
|
@ -1409,7 +1409,7 @@ shouldStartLoadWithRequest:(NSURLRequest *)request
|
|||
MBProgressHUD *HUD = [MBProgressHUD showHUDAddedTo:self.webView animated:YES];
|
||||
HUD.labelText = @"Fetching text...";
|
||||
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/rss_feeds/original_text",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/rss_feeds/original_text",
|
||||
NEWSBLUR_URL];
|
||||
ASIFormDataRequest *request = [self formRequestWithURL:urlString];
|
||||
[request addPostValue:[appDelegate.activeStory objectForKey:@"id"] forKey:@"story_id"];
|
||||
|
|
|
@ -722,10 +722,10 @@
|
|||
|
||||
NSString *urlString;
|
||||
if (appDelegate.isSocialView || appDelegate.isSocialRiverView) {
|
||||
urlString = [NSString stringWithFormat:@"http://%@/reader/mark_social_stories_as_read",
|
||||
urlString = [NSString stringWithFormat:@"%@/reader/mark_social_stories_as_read",
|
||||
NEWSBLUR_URL];
|
||||
} else {
|
||||
urlString = [NSString stringWithFormat:@"http://%@/reader/mark_story_as_read",
|
||||
urlString = [NSString stringWithFormat:@"%@/reader/mark_story_as_read",
|
||||
NEWSBLUR_URL];
|
||||
}
|
||||
|
||||
|
@ -812,7 +812,7 @@
|
|||
}
|
||||
|
||||
- (void)markStoryAsSaved {
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/reader/mark_story_as_starred",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/reader/mark_story_as_starred",
|
||||
NEWSBLUR_URL];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
|
||||
|
@ -842,7 +842,7 @@
|
|||
- (void)markStoryAsUnsaved {
|
||||
// [appDelegate markActiveStoryUnread];
|
||||
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/reader/mark_story_as_unstarred",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/reader/mark_story_as_unstarred",
|
||||
NEWSBLUR_URL];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
|
||||
|
@ -874,7 +874,7 @@
|
|||
|
||||
- (void)markStoryAsUnread {
|
||||
if ([[appDelegate.activeStory objectForKey:@"read_status"] intValue] == 1) {
|
||||
NSString *urlString = [NSString stringWithFormat:@"http://%@/reader/mark_story_as_unread",
|
||||
NSString *urlString = [NSString stringWithFormat:@"%@/reader/mark_story_as_unread",
|
||||
NEWSBLUR_URL];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
HUD.labelText = @"Profiling...";
|
||||
[self.profileBadge initProfile];
|
||||
NSString *urlString = [NSString stringWithFormat:@
|
||||
"http://%@/social/profile?user_id=%@"
|
||||
"%@/social/profile?user_id=%@"
|
||||
"&category=follow&category=comment_reply&category=comment_like&category=sharedstory",
|
||||
NEWSBLUR_URL,
|
||||
appDelegate.activeUserProfileId];
|
||||
|
|
|
@ -14,7 +14,8 @@
|
|||
#define BACKGROUND_REFRESH_SECONDS -10*60
|
||||
|
||||
// #define NEWSBLUR_URL [NSString stringWithFormat:@"nb.local.com"]
|
||||
#define NEWSBLUR_URL [NSString stringWithFormat:@"www.newsblur.com"]
|
||||
#define NEWSBLUR_URL [NSString stringWithFormat:@"https://www.newsblur.com"]
|
||||
#define NEWSBLUR_HOST [NSString stringWithFormat:@"www.newsblur.com"]
|
||||
|
||||
#define NEWSBLUR_LINK_COLOR 0x405BA8
|
||||
#define NEWSBLUR_HIGHLIGHT_COLOR 0xd2e6fd
|
||||
|
|
|
@ -10,6 +10,7 @@ NEWSBLUR.Views.StoryListView = Backbone.View.extend({
|
|||
this.collection.bind('add', this.reset_story_positions, this);
|
||||
this.collection.bind('no_more_stories', this.show_no_more_stories, this);
|
||||
this.collection.bind('change:selected', this.show_only_selected_story, this);
|
||||
this.collection.bind('change:selected', this.check_feed_view_scrolled_to_bottom, this);
|
||||
this.$el.bind('mousemove', _.bind(this.handle_mousemove_feed_view, this));
|
||||
this.$el.scroll(_.bind(this.handle_scroll_feed_view, this));
|
||||
this.reset_flags();
|
||||
|
@ -308,6 +309,11 @@ NEWSBLUR.Views.StoryListView = Backbone.View.extend({
|
|||
check_feed_view_scrolled_to_bottom: function() {
|
||||
if (!NEWSBLUR.assets.flags['no_more_stories']) {
|
||||
var last_story = NEWSBLUR.assets.stories.last();
|
||||
if (last_story.get('selected')) {
|
||||
NEWSBLUR.reader.load_page_of_feed_stories();
|
||||
return;
|
||||
}
|
||||
|
||||
var $last_story = last_story.story_view.$el;
|
||||
var container_offset = this.$el.position().top;
|
||||
var full_height = ($last_story.length && $last_story.offset().top) + $last_story.height() - container_offset;
|
||||
|
|
Loading…
Add table
Reference in a new issue