mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Finish look and feel of ios training for both story and feed. Just need to send requests, redraw intelligence, recount and reclassify stories, and update scores. All already written to support inline training.
This commit is contained in:
parent
f3edf21500
commit
a5652da4f1
17 changed files with 272 additions and 5212 deletions
|
@ -432,7 +432,7 @@
|
|||
}
|
||||
|
||||
.NB-modal .NB-fieldset {
|
||||
background-color: #F0F0FF;
|
||||
background-color: #EFF3F6;
|
||||
border-bottom: 1px solid #D0D0D9;
|
||||
margin: 16px 0 0;
|
||||
overflow: hidden;
|
||||
|
|
|
@ -1993,7 +1993,7 @@ background: transparent;
|
|||
font-size: 9px;
|
||||
padding: 0px 4px 1px;
|
||||
margin: 0 2px 2px;
|
||||
background-color: #DBDBDB;
|
||||
background-color: #D8DEE2;
|
||||
color: #9D9A95;
|
||||
text-shadow: 0 1px 0 #E9E9E9;
|
||||
border-radius: 4px;
|
||||
|
@ -2039,7 +2039,7 @@ background: transparent;
|
|||
}
|
||||
#story_pane .NB-feed-story-tag.NB-score-now-0:hover {
|
||||
/* Grey, active */
|
||||
background-color: #DBDBDB;
|
||||
background-color: #D8DEE2;
|
||||
color: #9D9A95;
|
||||
text-shadow: 0 1px 0 #E9E9E9;
|
||||
opacity: 1;
|
||||
|
@ -4163,7 +4163,7 @@ form.opml_import_form input {
|
|||
padding: 0 30px 0 26px;
|
||||
font-size: 12px;
|
||||
text-transform: uppercase;
|
||||
background-color: #F5CD09;
|
||||
background-color: #D8DEE2;
|
||||
position: relative;
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
@ -4183,13 +4183,13 @@ form.opml_import_form input {
|
|||
}
|
||||
|
||||
.NB-classifiers .NB-classifier label b {
|
||||
color: #957D09;
|
||||
color: rgba(0,0,0,.4);
|
||||
text-shadow: none;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.NB-classifiers .NB-classifier label span {
|
||||
text-shadow: 1px 1px 0 #F4E576;
|
||||
text-shadow: 1px 1px 0 rgba(255,255,255,0.5);
|
||||
}
|
||||
|
||||
.NB-classifiers .NB-classifier.NB-classifier-facet-disabled {
|
||||
|
@ -4264,7 +4264,7 @@ form.opml_import_form input {
|
|||
.NB-classifiers .NB-classifier.NB-classifier-like label span,
|
||||
.NB-classifiers .NB-classifier.NB-classifier-hover-like label span {
|
||||
color: white;
|
||||
text-shadow: 1px 1px 0 #254E18;
|
||||
text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
.NB-classifiers .NB-classifier.NB-classifier-like .NB-classifier-icon-dislike,
|
||||
.NB-classifiers .NB-classifier.NB-classifier-hover-like .NB-classifier-icon-dislike {
|
||||
|
@ -4320,7 +4320,7 @@ form.opml_import_form input {
|
|||
.NB-classifiers .NB-classifier.NB-classifier-dislike label span,
|
||||
.NB-classifiers .NB-classifier.NB-classifier-hover-dislike label span {
|
||||
color: white;
|
||||
text-shadow: 1px 1px 0 #7F1012;
|
||||
text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
/* =================== */
|
||||
/* = Mouse Indicator = */
|
||||
|
|
|
@ -222,6 +222,8 @@
|
|||
[self.storyTitlesTable reloadData];
|
||||
[storyTitlesTable scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:YES];
|
||||
appDelegate.activeClassifiers = [NSMutableDictionary dictionary];
|
||||
appDelegate.activePopularAuthors = [NSArray array];
|
||||
appDelegate.activePopularTags = [NSArray array];
|
||||
|
||||
if (appDelegate.isRiverView) {
|
||||
[self fetchRiverPage:1 withCallback:nil];
|
||||
|
@ -400,7 +402,8 @@
|
|||
options:kNilOptions
|
||||
error:&error];
|
||||
id feedId = [results objectForKey:@"feed_id"];
|
||||
|
||||
NSString *feedIdStr = [NSString stringWithFormat:@"%@",feedId];
|
||||
|
||||
if (!(appDelegate.isRiverView || appDelegate.isSocialView || appDelegate.isSocialRiverView)
|
||||
&& request.tag != [feedId intValue]) {
|
||||
return;
|
||||
|
@ -422,9 +425,10 @@
|
|||
[appDelegate.activeClassifiers setObject:[newClassifiers objectForKey:key] forKey:key];
|
||||
}
|
||||
} else {
|
||||
NSString *feedIdStr = [NSString stringWithFormat:@"%@",feedId];
|
||||
[appDelegate.activeClassifiers setObject:newClassifiers forKey:feedIdStr];
|
||||
}
|
||||
appDelegate.activePopularAuthors = [results objectForKey:@"feed_authors"];
|
||||
appDelegate.activePopularTags = [results objectForKey:@"feed_tags"];
|
||||
|
||||
NSArray *newStories = [results objectForKey:@"stories"];
|
||||
NSMutableArray *confirmedNewStories = [[NSMutableArray alloc] init];
|
||||
|
|
|
@ -127,7 +127,7 @@
|
|||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||
{
|
||||
return 6;
|
||||
return 7;
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
|
@ -136,9 +136,9 @@
|
|||
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIndentifier];
|
||||
|
||||
if (indexPath.row == 4) {
|
||||
if (indexPath.row == 5) {
|
||||
return [self makeFontSelectionTableCell];
|
||||
} else if (indexPath.row == 5) {
|
||||
} else if (indexPath.row == 6) {
|
||||
return [self makeFontSizeTableCell];
|
||||
}
|
||||
|
||||
|
@ -168,6 +168,9 @@
|
|||
cell.textLabel.text = [@"Send to..." uppercaseString];
|
||||
cell.imageView.image = [UIImage imageNamed:@"email"];
|
||||
} else if (indexPath.row == 3) {
|
||||
cell.textLabel.text = [@"Train this story" uppercaseString];
|
||||
cell.imageView.image = [UIImage imageNamed:@"bricks"];
|
||||
} else if (indexPath.row == 4) {
|
||||
cell.textLabel.text = [@"Share this story" uppercaseString];
|
||||
cell.imageView.image = [UIImage imageNamed:@"rainbow"];
|
||||
}
|
||||
|
@ -180,7 +183,7 @@
|
|||
}
|
||||
|
||||
- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
if (indexPath.row >= 4) {
|
||||
if (indexPath.row >= 5) {
|
||||
return nil;
|
||||
}
|
||||
return indexPath;
|
||||
|
@ -206,6 +209,8 @@
|
|||
} else if (indexPath.row == 2) {
|
||||
[appDelegate.storyPageControl openSendToDialog];
|
||||
} else if (indexPath.row == 3) {
|
||||
[appDelegate openTrainStory];
|
||||
} else if (indexPath.row == 4) {
|
||||
[appDelegate.storyPageControl.currentPage openShareDialog];
|
||||
}
|
||||
|
||||
|
|
|
@ -298,7 +298,7 @@
|
|||
popoverController.delegate = self;
|
||||
|
||||
|
||||
[popoverController setPopoverContentSize:CGSizeMake(240, 228)];
|
||||
[popoverController setPopoverContentSize:CGSizeMake(240, 38*7)];
|
||||
// UIBarButtonItem *settingsButton = [[UIBarButtonItem alloc]
|
||||
// initWithCustomView:sender];
|
||||
[popoverController presentPopoverFromBarButtonItem:sender
|
||||
|
|
|
@ -91,6 +91,8 @@
|
|||
NSString *tryFeedStoryId;
|
||||
NSDictionary * activeFeed;
|
||||
NSMutableDictionary * activeClassifiers;
|
||||
NSArray * activePopularTags;
|
||||
NSArray * activePopularAuthors;
|
||||
NSString * activeFolder;
|
||||
NSDictionary * activeComment;
|
||||
NSString * activeShareType;
|
||||
|
@ -175,6 +177,8 @@
|
|||
@property (nonatomic, readwrite) BOOL inStoryDetail;
|
||||
@property (readwrite) NSDictionary * activeFeed;
|
||||
@property (strong, readwrite) NSMutableDictionary * activeClassifiers;
|
||||
@property (strong, readwrite) NSArray * activePopularTags;
|
||||
@property (strong, readwrite) NSArray * activePopularAuthors;
|
||||
@property (readwrite) NSString * activeFolder;
|
||||
@property (readwrite) NSDictionary * activeComment;
|
||||
@property (readwrite) NSString * activeShareType;
|
||||
|
@ -224,6 +228,7 @@
|
|||
- (void)showAddSiteModal:(id)sender;
|
||||
- (void)showMoveSite;
|
||||
- (void)openTrainSite;
|
||||
- (void)openTrainStory;
|
||||
- (void)loadFeedDetailView;
|
||||
- (void)loadTryFeedDetailView:(NSString *)feedId withStory:(NSString *)contentId isSocial:(BOOL)social withUser:(NSDictionary *)user showFindingStory:(BOOL)showHUD;
|
||||
- (void)loadRiverFeedDetailView;
|
||||
|
|
|
@ -95,6 +95,8 @@
|
|||
|
||||
@synthesize activeFeed;
|
||||
@synthesize activeClassifiers;
|
||||
@synthesize activePopularTags;
|
||||
@synthesize activePopularAuthors;
|
||||
@synthesize activeFolder;
|
||||
@synthesize activeFolderFeeds;
|
||||
@synthesize activeFeedStories;
|
||||
|
@ -408,6 +410,8 @@
|
|||
|
||||
- (void)openTrainSite {
|
||||
UINavigationController *navController = self.navigationController;
|
||||
trainerViewController.feedTrainer = YES;
|
||||
trainerViewController.storyTrainer = NO;
|
||||
|
||||
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
|
||||
trainerViewController.modalPresentationStyle=UIModalPresentationFormSheet;
|
||||
|
@ -417,6 +421,18 @@
|
|||
}
|
||||
}
|
||||
|
||||
- (void)openTrainStory {
|
||||
UINavigationController *navController = self.navigationController;
|
||||
trainerViewController.feedTrainer = NO;
|
||||
trainerViewController.storyTrainer = YES;
|
||||
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
|
||||
trainerViewController.modalPresentationStyle=UIModalPresentationFormSheet;
|
||||
[navController presentModalViewController:trainerViewController animated:YES];
|
||||
} else {
|
||||
[navController presentModalViewController:trainerViewController animated:YES];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)reloadFeedsView:(BOOL)showLoader {
|
||||
[feedsViewController fetchFeedList:showLoader];
|
||||
[loginViewController dismissModalViewControllerAnimated:NO];
|
||||
|
|
|
@ -842,7 +842,7 @@
|
|||
if ([self.popoverController respondsToSelector:@selector(setContainerViewProperties:)]) {
|
||||
[self.popoverController setContainerViewProperties:[self improvedContainerViewProperties]];
|
||||
}
|
||||
[self.popoverController setPopoverContentSize:CGSizeMake(240, 226)];
|
||||
[self.popoverController setPopoverContentSize:CGSizeMake(240, 38*7-2)];
|
||||
[self.popoverController presentPopoverFromBarButtonItem:self.fontSettingsButton
|
||||
permittedArrowDirections:UIPopoverArrowDirectionAny
|
||||
animated:YES];
|
||||
|
|
|
@ -25,19 +25,26 @@
|
|||
IBOutlet UIBarButtonItem * closeButton;
|
||||
TrainerWebView *webView;
|
||||
UINavigationBar *navBar;
|
||||
|
||||
BOOL feedTrainer;
|
||||
BOOL storyTrainer;
|
||||
}
|
||||
|
||||
@property (nonatomic) IBOutlet NewsBlurAppDelegate *appDelegate;
|
||||
@property (nonatomic) IBOutlet UIBarButtonItem *closeButton;
|
||||
@property (nonatomic) IBOutlet TrainerWebView *webView;
|
||||
@property (nonatomic) IBOutlet UINavigationBar *navBar;
|
||||
@property (nonatomic, assign) BOOL feedTrainer;
|
||||
@property (nonatomic, assign) BOOL storyTrainer;
|
||||
|
||||
- (NSString *)makeTrainerSections;
|
||||
- (NSString *)makeAuthor;
|
||||
- (NSString *)makeTags;
|
||||
- (NSString *)makeStoryAuthor;
|
||||
- (NSString *)makeFeedAuthors;
|
||||
- (NSString *)makeStoryTags;
|
||||
- (NSString *)makeFeedTags;
|
||||
- (NSString *)makePublisher;
|
||||
- (NSString *)makeTitle;
|
||||
- (NSString *)makeClassifier:(NSString *)classifierName withType:(NSString *)classifierType;
|
||||
- (NSString *)makeClassifier:(NSString *)classifierName withType:(NSString *)classifierType score:(int)score;
|
||||
|
||||
- (IBAction)doCloseDialog:(id)sender;
|
||||
- (void)changeTitle:(id)sender;
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
@synthesize webView;
|
||||
@synthesize navBar;
|
||||
@synthesize appDelegate;
|
||||
@synthesize feedTrainer;
|
||||
@synthesize storyTrainer;
|
||||
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
|
||||
{
|
||||
|
@ -73,9 +75,9 @@
|
|||
#pragma mark Story layout
|
||||
|
||||
- (NSString *)makeTrainerSections {
|
||||
NSString *storyAuthor = [self makeAuthor];
|
||||
NSString *storyTags = [self makeTags];
|
||||
NSString *storyTitle = [self makeTitle];
|
||||
NSString *storyAuthor = self.feedTrainer ? [self makeFeedAuthors] : [self makeStoryAuthor];
|
||||
NSString *storyTags = self.feedTrainer ? [self makeFeedTags] : [self makeStoryTags];
|
||||
NSString *storyTitle = self.feedTrainer ? @"" : [self makeTitle];
|
||||
NSString *storyPublisher = [self makePublisher];
|
||||
|
||||
int contentWidth = self.view.frame.size.width;
|
||||
|
@ -126,10 +128,11 @@
|
|||
return htmlString;
|
||||
}
|
||||
|
||||
- (NSString *)makeAuthor {
|
||||
- (NSString *)makeStoryAuthor {
|
||||
NSString *feedId = [NSString stringWithFormat:@"%@", [appDelegate.activeStory
|
||||
objectForKey:@"story_feed_id"]];
|
||||
NSString *storyAuthor = @"";
|
||||
|
||||
if ([[appDelegate.activeStory objectForKey:@"story_authors"] class] != [NSNull class] &&
|
||||
[[appDelegate.activeStory objectForKey:@"story_authors"] length]) {
|
||||
NSString *author = [NSString stringWithFormat:@"%@",
|
||||
|
@ -142,22 +145,62 @@
|
|||
" <div class=\"NB-trainer-section-title\">Story Authors</div>"
|
||||
" <div class=\"NB-trainer-section-body\">"
|
||||
" <a href=\"http://ios.newsblur.com/classify-author/%@\" "
|
||||
" class=\"NB-story-author %@\" id=\"NB-story-author\"><div class=\"NB-highlight\"></div>%@</a>"
|
||||
" class=\"NB-story-author %@\">%@</a>"
|
||||
" </div>"
|
||||
"</div>",
|
||||
author,
|
||||
authorScore > 0 ? @"NB-story-author-positive" : authorScore < 0 ? @"NB-story-author-negative" : @"",
|
||||
[self makeClassifier:author withType:@"Author"]];
|
||||
[self makeClassifier:author withType:@"Author" score:authorScore]];
|
||||
}
|
||||
}
|
||||
return storyAuthor;
|
||||
}
|
||||
|
||||
- (NSString *)makeTags {
|
||||
- (NSString *)makeFeedAuthors {
|
||||
NSString *feedId = [NSString stringWithFormat:@"%@", [appDelegate.activeFeed objectForKey:@"id"]];
|
||||
NSString *feedAuthors = @"";
|
||||
NSArray *authorArray = appDelegate.activePopularAuthors;
|
||||
|
||||
if ([authorArray count] > 0) {
|
||||
NSMutableArray *authorStrings = [NSMutableArray array];
|
||||
for (NSArray *authorObj in authorArray) {
|
||||
NSString *author = [authorObj objectAtIndex:0];
|
||||
int authorCount = [[authorObj objectAtIndex:1] intValue];
|
||||
int authorScore = [[[[appDelegate.activeClassifiers objectForKey:feedId]
|
||||
objectForKey:@"authors"]
|
||||
objectForKey:author] intValue];
|
||||
NSString *authorHtml = [NSString stringWithFormat:@"<div class=\"NB-classifier-container\">"
|
||||
" <a href=\"http://ios.newsblur.com/classify-author/%@\" "
|
||||
" class=\"NB-story-author %@\">%@</a>"
|
||||
" <span class=\"NB-classifier-count\">× %d</span>"
|
||||
"</div>",
|
||||
author,
|
||||
authorScore > 0 ? @"NB-story-author-positive" : authorScore < 0 ? @"NB-story-author-negative" : @"",
|
||||
[self makeClassifier:author withType:@"author" score:authorScore],
|
||||
authorCount];
|
||||
[authorStrings addObject:authorHtml];
|
||||
}
|
||||
feedAuthors = [NSString
|
||||
stringWithFormat:@"<div class=\"NB-trainer-section-inner\">"
|
||||
" <div class=\"NB-trainer-section-title\">Authors</div>"
|
||||
" <div class=\"NB-trainer-section-body\">"
|
||||
" <div class=\"NB-story-authors\">"
|
||||
" %@"
|
||||
" </div>"
|
||||
" </div>"
|
||||
"</div>",
|
||||
[authorStrings componentsJoinedByString:@""]];
|
||||
}
|
||||
|
||||
return feedAuthors;
|
||||
}
|
||||
|
||||
|
||||
- (NSString *)makeStoryTags {
|
||||
NSString *feedId = [NSString stringWithFormat:@"%@", [appDelegate.activeStory
|
||||
objectForKey:@"story_feed_id"]];
|
||||
|
||||
NSString *storyTags = @"";
|
||||
|
||||
if ([appDelegate.activeStory objectForKey:@"story_tags"]) {
|
||||
NSArray *tagArray = [appDelegate.activeStory objectForKey:@"story_tags"];
|
||||
if ([tagArray count] > 0) {
|
||||
|
@ -166,20 +209,20 @@
|
|||
int tagScore = [[[[appDelegate.activeClassifiers objectForKey:feedId]
|
||||
objectForKey:@"tags"]
|
||||
objectForKey:tag] intValue];
|
||||
NSString *tagHtml = [NSString stringWithFormat:@"<div class=\"NB-trainer-tag\">"
|
||||
NSString *tagHtml = [NSString stringWithFormat:@"<div class=\"NB-classifier-container\">"
|
||||
" <a href=\"http://ios.newsblur.com/classify-tag/%@\" "
|
||||
" class=\"NB-story-tag %@\"><div class=\"NB-highlight\"></div>%@</a>"
|
||||
" class=\"NB-story-tag %@\">%@</a>"
|
||||
"</div>",
|
||||
tag,
|
||||
tagScore > 0 ? @"NB-story-tag-positive" : tagScore < 0 ? @"NB-story-tag-negative" : @"",
|
||||
[self makeClassifier:tag withType:@"Tag"]];
|
||||
[self makeClassifier:tag withType:@"Tag" score:tagScore]];
|
||||
[tagStrings addObject:tagHtml];
|
||||
}
|
||||
storyTags = [NSString
|
||||
stringWithFormat:@"<div class=\"NB-trainer-section-inner\">"
|
||||
" <div class=\"NB-trainer-section-title\">Story Tags</div>"
|
||||
" <div class=\"NB-trainer-section-body\">"
|
||||
" <div id=\"NB-story-tags\" class=\"NB-story-tags\">"
|
||||
" <div class=\"NB-story-tags\">"
|
||||
" %@"
|
||||
" </div>"
|
||||
" </div>"
|
||||
|
@ -190,18 +233,73 @@
|
|||
|
||||
return storyTags;
|
||||
}
|
||||
|
||||
- (NSString *)makeFeedTags {
|
||||
NSString *feedId = [NSString stringWithFormat:@"%@", [appDelegate.activeFeed objectForKey:@"id"]];
|
||||
NSString *feedTags = @"";
|
||||
NSArray *tagArray = appDelegate.activePopularTags;
|
||||
|
||||
if ([tagArray count] > 0) {
|
||||
NSMutableArray *tagStrings = [NSMutableArray array];
|
||||
for (NSArray *tagObj in tagArray) {
|
||||
NSString *tag = [tagObj objectAtIndex:0];
|
||||
int tagCount = [[tagObj objectAtIndex:1] intValue];
|
||||
int tagScore = [[[[appDelegate.activeClassifiers objectForKey:feedId]
|
||||
objectForKey:@"tags"]
|
||||
objectForKey:tag] intValue];
|
||||
NSString *tagHtml = [NSString stringWithFormat:@"<div class=\"NB-classifier-container\">"
|
||||
" <a href=\"http://ios.newsblur.com/classify-tag/%@\" "
|
||||
" class=\"NB-story-tag %@\">%@</a>"
|
||||
" <span class=\"NB-classifier-count\">× %d</span>"
|
||||
"</div>",
|
||||
tag,
|
||||
tagScore > 0 ? @"NB-story-tag-positive" : tagScore < 0 ? @"NB-story-tag-negative" : @"",
|
||||
[self makeClassifier:tag withType:@"Tag" score:tagScore],
|
||||
tagCount];
|
||||
[tagStrings addObject:tagHtml];
|
||||
}
|
||||
feedTags = [NSString
|
||||
stringWithFormat:@"<div class=\"NB-trainer-section-inner\">"
|
||||
" <div class=\"NB-trainer-section-title\">Story Tags</div>"
|
||||
" <div class=\"NB-trainer-section-body\">"
|
||||
" <div class=\"NB-story-tags\">"
|
||||
" %@"
|
||||
" </div>"
|
||||
" </div>"
|
||||
"</div>",
|
||||
[tagStrings componentsJoinedByString:@""]];
|
||||
}
|
||||
|
||||
return feedTags;
|
||||
}
|
||||
|
||||
- (NSString *)makePublisher {
|
||||
NSString *feedId = [NSString stringWithFormat:@"%@", [appDelegate.activeStory
|
||||
objectForKey:@"story_feed_id"]];
|
||||
NSString *feedTitle = [[appDelegate.dictFeeds objectForKey:feedId] objectForKey:@"feed_title"];
|
||||
NSString *feedId;
|
||||
NSString *feedTitle;
|
||||
|
||||
if (self.feedTrainer) {
|
||||
feedId = [NSString stringWithFormat:@"%@", [appDelegate.activeFeed objectForKey:@"id"]];
|
||||
feedTitle = [appDelegate.activeFeed objectForKey:@"feed_title"];
|
||||
} else {
|
||||
feedId = [NSString stringWithFormat:@"%@", [appDelegate.activeStory
|
||||
objectForKey:@"story_feed_id"]];
|
||||
feedTitle = [[appDelegate.dictFeeds objectForKey:feedId] objectForKey:@"feed_title"];
|
||||
}
|
||||
int publisherScore = [[[[appDelegate.activeClassifiers objectForKey:feedId]
|
||||
objectForKey:@"feeds"] objectForKey:feedId] intValue];
|
||||
|
||||
NSString *storyPublisher = [NSString stringWithFormat:@"<div class=\"NB-trainer-section-inner\">"
|
||||
" <div class=\"NB-trainer-section-title\">Publisher</div>"
|
||||
" <div class=\"NB-trainer-section-body\">"
|
||||
" %@"
|
||||
" <div class=\"NB-classifier-container\">"
|
||||
" <a href=\"http://ios.newsblur.com/classify-publisher/%@\" "
|
||||
" class=\"NB-story-publisher %@\">%@</a>"
|
||||
" </div>"
|
||||
" </div>"
|
||||
"</div",
|
||||
[self makeClassifier:feedTitle withType:@"Publisher"]];
|
||||
feedId,
|
||||
publisherScore > 0 ? @"NB-story-publisher-positive" : publisherScore < 0 ? @"NB-story-publisher-negative" : @"",
|
||||
[self makeClassifier:feedTitle withType:@"publisher" score:publisherScore]];
|
||||
|
||||
return storyPublisher;
|
||||
}
|
||||
|
@ -231,15 +329,15 @@
|
|||
NSString *titleTrainer = [NSString stringWithFormat:@"<div class=\"NB-trainer-section-inner\">"
|
||||
" <div class=\"NB-trainer-section-title\">Story Title</div>"
|
||||
" <div class=\"NB-trainer-section-body NB-title\">"
|
||||
" <div class=\"NB-title-info\">Tap and hold the title below</div>"
|
||||
" <div class=\"NB-title-trainer\">%@</div>"
|
||||
" <div class=\"NB-title-info\">Tap and hold the title</div>"
|
||||
" </div>"
|
||||
"</div>", storyTitle];
|
||||
return titleTrainer;
|
||||
}
|
||||
|
||||
- (NSString *)makeClassifier:(NSString *)classifierName withType:(NSString *)classifierType {
|
||||
NSString *classifier = [NSString stringWithFormat:@"<span class=\"NB-classifier NB-classifier-%@\">"
|
||||
- (NSString *)makeClassifier:(NSString *)classifierName withType:(NSString *)classifierType score:(int)score {
|
||||
NSString *classifier = [NSString stringWithFormat:@"<span class=\"NB-classifier NB-classifier-%@ NB-classifier-%@\">"
|
||||
"<div class=\"NB-classifier-icon-like\"></div>"
|
||||
"<div class=\"NB-classifier-icon-dislike\">"
|
||||
" <div class=\"NB-classifier-icon-dislike-inner\"></div>"
|
||||
|
@ -247,6 +345,7 @@
|
|||
"<label><b>%@: </b><span>%@</span></label>"
|
||||
"</span>",
|
||||
classifierType,
|
||||
score > 0 ? @"like" : score < 0 ? @"dislike" : @"",
|
||||
classifierType,
|
||||
classifierName];
|
||||
|
||||
|
@ -269,7 +368,8 @@
|
|||
}
|
||||
|
||||
- (void)changeTitle:(id)sender {
|
||||
NSLog(@"changeTitle: %@", sender);
|
||||
NSString *selectedTitle = [self.webView stringByEvaluatingJavaScriptFromString:@"window.getSelection().toString()"];
|
||||
NSLog(@"Selected: %@", selectedTitle);
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -16,19 +16,6 @@
|
|||
landmarkName = "-applyNewIndex:pageController:"
|
||||
landmarkType = "5">
|
||||
</FileBreakpoint>
|
||||
<FileBreakpoint
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Classes/TrainerViewController.m"
|
||||
timestampString = "378184717.887918"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "272"
|
||||
endingLineNumber = "272"
|
||||
landmarkName = "-changeTitle:"
|
||||
landmarkType = "5">
|
||||
</FileBreakpoint>
|
||||
</FileBreakpoints>
|
||||
<SymbolicBreakpoints>
|
||||
<SymbolicBreakpoint
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
// #define BACKGROUND_REFRESH_SECONDS -5
|
||||
#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:@"nb.local.com"]
|
||||
// #define NEWSBLUR_URL [NSString stringWithFormat:@"www.newsblur.com"]
|
||||
|
||||
#define NEWSBLUR_LINK_COLOR 0x405BA8
|
||||
#define NEWSBLUR_HIGHLIGHT_COLOR 0xd2e6fd
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -64,6 +64,18 @@ function attachFastClick() {
|
|||
Array.prototype.slice.call(tags, 0).forEach(function(tag) {
|
||||
new NoClickDelay(tag);
|
||||
});
|
||||
var authors = document.getElementsByClassName("NB-story-author");
|
||||
Array.prototype.slice.call(authors, 0).forEach(function(author) {
|
||||
new NoClickDelay(author);
|
||||
});
|
||||
var publishers = document.getElementsByClassName("NB-story-publisher");
|
||||
Array.prototype.slice.call(publishers, 0).forEach(function(publisher) {
|
||||
new NoClickDelay(publisher);
|
||||
});
|
||||
var titles = document.getElementsByClassName("NB-story-title");
|
||||
Array.prototype.slice.call(titles, 0).forEach(function(title) {
|
||||
new NoClickDelay(title);
|
||||
});
|
||||
|
||||
var author = document.getElementById("NB-story-author");
|
||||
if (author) {
|
||||
|
|
|
@ -33,14 +33,14 @@
|
|||
padding: 4px 12px;
|
||||
background-color: #F0F8F2;
|
||||
|
||||
padding: 8px 12px 6px;
|
||||
padding: 8px 12px 8px;
|
||||
background-color: #E3ECF8;
|
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#E3ECF8), to(#CBDBF5));
|
||||
text-shadow: 0 1px 0 #F2F6FE;
|
||||
border-top: 1px solid #D1DAF7;
|
||||
border-bottom: 1px solid #A1A9CF;
|
||||
color: #505050;
|
||||
font-family: "Gill Sans", "Lucida Sans", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif, inherit;
|
||||
font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif, inherit;
|
||||
font-weight: normal;
|
||||
position: relative;
|
||||
}
|
||||
|
@ -48,13 +48,14 @@
|
|||
.NB-trainer-section-body {
|
||||
padding: 12px 12px;
|
||||
overflow: hidden;
|
||||
background-color: #F0F0FF;
|
||||
background-color: #EFF3F6;
|
||||
border-bottom: 1px solid #D0D0D9;
|
||||
}
|
||||
|
||||
.NB-trainer-title .NB-title-trainer {
|
||||
padding: 12px 0;
|
||||
line-height: 20px;
|
||||
font-size: 18px;
|
||||
line-height: 22px;
|
||||
-webkit-user-select: auto;
|
||||
-webkit-touch-callout: default;
|
||||
-webkit-highlight: auto;
|
||||
|
@ -78,6 +79,12 @@
|
|||
text-shadow: 0 1px 0 #F6E9E9;
|
||||
}
|
||||
|
||||
.NB-classifier-container {
|
||||
white-space: nowrap;
|
||||
float: left;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/*
|
||||
* Classifiers
|
||||
*/
|
||||
|
@ -92,7 +99,7 @@
|
|||
padding: 0 8px 0 26px;
|
||||
font-size: 12px;
|
||||
text-transform: uppercase;
|
||||
background-color: #F5CD09;
|
||||
background-color: #D8DEE2;
|
||||
position: relative;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 12px;
|
||||
|
@ -113,13 +120,13 @@
|
|||
}
|
||||
|
||||
.NB-classifier label b {
|
||||
color: #957D09;
|
||||
color: rgba(0,0,0,.4);
|
||||
text-shadow: none;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.NB-classifier label span {
|
||||
text-shadow: 1px 1px 0 #F4E576;
|
||||
text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
.NB-classifier.NB-classifier-facet-disabled {
|
||||
|
@ -145,13 +152,24 @@
|
|||
top: 2px;
|
||||
opacity: .2;
|
||||
}
|
||||
.pressed .NB-classifier .NB-classifier-icon-like,
|
||||
.pressed .NB-classifier.NB-classifier-dislike .NB-classifier-icon-like {
|
||||
opacity: 1;
|
||||
}
|
||||
.pressed .NB-classifier.NB-classifier-like .NB-classifier-icon-like {
|
||||
opacity: 0;
|
||||
}
|
||||
.pressed .NB-classifier.NB-classifier-dislike .NB-classifier-icon-like {
|
||||
opacity: .2;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.NB-classifier .NB-classifier-icon-dislike {
|
||||
width: 27px;
|
||||
height: 22px;
|
||||
position: absolute;
|
||||
top: -1px;
|
||||
left: 6px;
|
||||
top: -2px;
|
||||
left: 2px;
|
||||
background: transparent url('data:image/png;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAUCAMAAACK2/weAAAAWlBMVEX////+/v79/f3x8fHw8PD97Nj76tb66dX56NT35M/2487u3Mfl1MDaybbRwa/QwK+/v7++vr62tra1tbW+sJ+1qJi0p5ezppd7e3t6enp4eHgCAgIBAQEAAABkZKaJAAAAHnRSTlMA///////////////////////////////////////0OBo3AAAAaklEQVR42rXMyRKDMAwDUIe2kELLFhqWSP//myQmOfbIO3ik0YzlPjsgKEToHP1PLalOM1cfLTrjOXLoo++na2M1D7bvBCSFVcWmziA4DKxNWdcNkBCaC0QFa3d9nKHOscwv7f/m/Kag3hMwawmoH/Rk6gAAAABJRU5ErkJggg==') no-repeat 5px -1px;
|
||||
display: none;
|
||||
}
|
||||
|
@ -160,9 +178,7 @@
|
|||
margin: 4px 4px 0 0;
|
||||
width: 18px;
|
||||
height: 13px;
|
||||
border-left: 1px solid #EBEBE1;
|
||||
}
|
||||
|
||||
.NB-classifier.NB-classifier-like {
|
||||
background-color: #34912E;
|
||||
border: 1px solid #202020;
|
||||
|
@ -178,12 +194,58 @@
|
|||
box-shadow: 1px 1px 1px #BDC0D7;
|
||||
}
|
||||
|
||||
.NB-classifier.NB-classifier-like .NB-classifier-icon-like {
|
||||
opacity: 1;
|
||||
}
|
||||
.NB-classifier.NB-classifier-dislike .NB-classifier-icon-like {
|
||||
display: none;
|
||||
}
|
||||
.NB-classifier.NB-classifier-dislike .NB-classifier-icon-dislike {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.NB-classifier.NB-classifier-like label b,
|
||||
.pressed .NB-classifier label b {
|
||||
color: white;
|
||||
}
|
||||
.NB-classifier.NB-classifier-like label span,
|
||||
.pressed .NB-classifier label span {
|
||||
color: white;
|
||||
text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
.pressed .NB-classifier.NB-classifier-like .NB-classifier-icon-like,
|
||||
.pressed .NB-classifier.NB-classifier-dislike .NB-classifier-icon-dislike {
|
||||
display: none;
|
||||
}
|
||||
.pressed .NB-classifier.NB-classifier-like .NB-classifier-icon-dislike,
|
||||
.pressed .NB-classifier.NB-classifier-like .NB-classifier-icon-like {
|
||||
display: block;
|
||||
}
|
||||
.pressed .NB-classifier {
|
||||
background-color: #54A54E;
|
||||
border: 1px solid transparent;
|
||||
box-shadow: none;
|
||||
}
|
||||
.pressed .NB-classifier.NB-classifier-like {
|
||||
background-color: #C92123;
|
||||
border: 1px solid transparent;
|
||||
box-shadow: none;
|
||||
}
|
||||
.pressed .NB-classifier.NB-classifier-dislike {
|
||||
border: 1px solid transparent;
|
||||
background-color: #C6C6C6;
|
||||
box-shadow: none;
|
||||
}
|
||||
.NB-classifier.NB-classifier-dislike label b,
|
||||
.pressed .NB-classifier.NB-classifier-like label b {
|
||||
color: white;
|
||||
}
|
||||
.NB-classifier.NB-classifier-dislike label span,
|
||||
.pressed .NB-classifier.NB-classifier-like label span {
|
||||
color: white;
|
||||
text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.NB-classifier-count {
|
||||
font-size: 10px;
|
||||
margin: 0 6px 0 -2px;
|
||||
line-height: 26px;
|
||||
color: #A0A0A0;
|
||||
}
|
Loading…
Add table
Reference in a new issue