changing around colors, etc for the share

This commit is contained in:
Roy Yang 2012-08-08 13:48:10 -07:00
parent be89609470
commit 981135e09d
11 changed files with 78 additions and 47 deletions

View file

@ -139,14 +139,14 @@
[attrStr setTextColor:UIColorFromRGB(0x333333)];
if (![username isEqualToString:@"You"]){
[attrStr setTextColor:UIColorFromRGB(NEWSBLUR_ORANGE) range:[txtWithTime rangeOfString:username]];
[attrStr setTextColor:UIColorFromRGB(NEWSBLUR_LINK_COLOR) range:[txtWithTime rangeOfString:username]];
[attrStr setTextBold:YES range:[txt rangeOfString:username]];
}
[attrStr setTextColor:UIColorFromRGB(NEWSBLUR_ORANGE) range:[txtWithTime rangeOfString:title]];
[attrStr setTextColor:UIColorFromRGB(NEWSBLUR_LINK_COLOR) range:[txtWithTime rangeOfString:title]];
if(withUserUsername.length) {
[attrStr setTextColor:UIColorFromRGB(NEWSBLUR_ORANGE) range:[txtWithTime rangeOfString:withUserUsername]];
[attrStr setTextColor:UIColorFromRGB(NEWSBLUR_LINK_COLOR) range:[txtWithTime rangeOfString:withUserUsername]];
[attrStr setTextBold:YES range:[txtWithTime rangeOfString:withUserUsername]];
}

View file

@ -114,11 +114,11 @@
}
if (![username isEqualToString:@"You"]){
[attrStr setTextColor:UIColorFromRGB(NEWSBLUR_ORANGE) range:[txtWithTime rangeOfString:username]];
[attrStr setTextColor:UIColorFromRGB(NEWSBLUR_LINK_COLOR) range:[txtWithTime rangeOfString:username]];
[attrStr setTextBold:YES range:[txt rangeOfString:username]];
}
[attrStr setTextColor:UIColorFromRGB(NEWSBLUR_ORANGE) range:[txtWithTime rangeOfString:title]];
[attrStr setTextColor:UIColorFromRGB(NEWSBLUR_LINK_COLOR) range:[txtWithTime rangeOfString:title]];
[attrStr setTextColor:UIColorFromRGB(0x666666) range:[txtWithTime rangeOfString:comment]];
[attrStr setTextColor:UIColorFromRGB(0x999999) range:[txtWithTime rangeOfString:time]];

View file

@ -1050,7 +1050,7 @@
- (UIView *)makeFeedTitleGradient:(NSDictionary *)feed withRect:(CGRect)rect {
UIView *gradientView;
if (self.isRiverView || self.isSocialView) {
if (self.isRiverView || self.isSocialView || self.isSocialRiverView) {
gradientView = [NewsBlurAppDelegate
makeGradientView:rect
startColor:[feed objectForKey:@"favicon_fade"]

View file

@ -44,6 +44,7 @@
[MBProgressHUD hideHUDForView:self.webView animated:YES];
MBProgressHUD *HUD = [MBProgressHUD showHUDAddedTo:self.webView animated:YES];
HUD.labelText = @"On its way...";
[HUD hide:YES afterDelay:2];
}
- (void)viewWillDisappear:(BOOL)animated {

View file

@ -19,7 +19,6 @@
@property (nonatomic) IBOutlet UIButton *facebookButton;
@property (nonatomic) IBOutlet UIButton *twitterButton;
@property (nonatomic) IBOutlet UIBarButtonItem *submitButton;
@property (nonatomic) IBOutlet UIBarButtonItem *toolbarTitle;
@property (nonatomic) NSString * activeReplyId;
- (void)setSiteInfo:(NSString *)type setUserId:(NSString *)userId setUsername:(NSString *)username setReplyId:(NSString *)commentIndex;

View file

@ -19,7 +19,6 @@
@synthesize facebookButton;
@synthesize twitterButton;
@synthesize submitButton;
@synthesize toolbarTitle;
@synthesize commentField;
@synthesize appDelegate;
@synthesize activeReplyId;
@ -37,11 +36,21 @@
- (void)viewDidLoad
{
// For textField1
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(onTextChange:)
name:UITextViewTextDidChangeNotification
object:self.commentField];
UIBarButtonItem *cancel = [[UIBarButtonItem alloc] initWithTitle:@"Cancel" style:UIBarButtonSystemItemCancel target:self action:@selector(doCancelButton:)];
self.navigationItem.leftBarButtonItem = cancel;
UIBarButtonItem *submit = [[UIBarButtonItem alloc] initWithTitle:@"Post" style:UIBarButtonSystemItemDone target:self action:@selector(doShareThisStory:)];
self.submitButton = submit;
self.submitButton.tintColor = UIColorFromRGB(0x217412);
self.navigationItem.rightBarButtonItem = submit;
@ -62,13 +71,16 @@
[super viewDidLoad];
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (void)viewDidUnload
{
[self setCommentField:nil];
[self setFacebookButton:nil];
[self setTwitterButton:nil];
[self setSubmitButton:nil];
[self setToolbarTitle:nil];
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
@ -133,7 +145,7 @@
[submitButton setTitle:@"Save"];
facebookButton.hidden = YES;
twitterButton.hidden = YES;
[toolbarTitle setTitle:[NSString stringWithFormat:@"Edit Your Reply"]];
self.navigationItem.title = @"Edit Your Reply";
[submitButton setAction:(@selector(doReplyToComment:))];
self.activeReplyId = replyId;
@ -157,7 +169,7 @@
[submitButton setTitle:@"Reply"];
facebookButton.hidden = YES;
twitterButton.hidden = YES;
[toolbarTitle setTitle:[NSString stringWithFormat:@"Reply to %@", username]];
self.navigationItem.title = [NSString stringWithFormat:@"Reply to %@", username];
[submitButton setAction:(@selector(doReplyToComment:))];
self.commentField.text = @"";
} else if ([type isEqualToString: @"edit-share"]) {
@ -168,10 +180,10 @@
self.commentField.text = [self stringByStrippingHTML:[appDelegate.activeComment objectForKey:@"comments"]];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
[toolbarTitle setTitle:@"Edit Your Comment"];
self.navigationItem.title = @"Edit Your Comment";
[submitButton setTitle:@"Save"];
} else {
[toolbarTitle setTitle:@"Edit Comment"];
self.navigationItem.title = @"Edit Comment";
[submitButton setTitle:@"Save"];
}
[submitButton setAction:(@selector(doShareThisStory:))];
@ -179,10 +191,10 @@
facebookButton.hidden = NO;
twitterButton.hidden = NO;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
[toolbarTitle setTitle:@"Post to Blurblog"];
[submitButton setTitle:@"Share this Story"];
self.navigationItem.title = @"Post to Blurblog";
[submitButton setTitle:@"Share"];
} else {
[toolbarTitle setTitle:@"Post to Blurblog"];
self.navigationItem.title = @"Post";
[submitButton setTitle:@"Share"];
}
[submitButton setAction:(@selector(doShareThisStory:))];
@ -340,4 +352,19 @@
return s;
}
-(void)onTextChange:(NSNotification*)notification {
NSString *text = self.commentField.text;
if ([self.submitButton.title isEqualToString:@"Share"] ||
[self.submitButton.title isEqualToString:@"Share Comment"]) {
NSLog(@"text.length is %i", text.length);
if (text.length) {
self.submitButton.title = @"Share Comment";
} else {
self.submitButton.title = @"Share";
}
}
}
@end

View file

@ -404,7 +404,7 @@
userLikeButton = [NSString stringWithFormat:@
"<div class=\"NB-story-comment-like-button NB-button selected\">"
"<a href=\"http://ios.newsblur.com/unlike-comment/%@\"><div class=\"NB-story-comment-like-button-wrapper\">"
"Favorited"
"<span class=\"NB-favorite-icon\"></span>Favorited"
"</div></a>"
"</div>",
commentUserId];
@ -412,7 +412,7 @@
userLikeButton = [NSString stringWithFormat:@
"<div class=\"NB-story-comment-like-button NB-button\">"
"<a href=\"http://ios.newsblur.com/like-comment/%@\"><div class=\"NB-story-comment-like-button-wrapper\">"
"Favorite"
"<span class=\"NB-favorite-icon\"></span>Favorite"
"</div></a>"
"</div>",
commentUserId];
@ -647,7 +647,7 @@
"<div class='NB-share-wrapper'><div class='NB-share-inner-wrapper'>"
"<div id=\"NB-share-button-id\" class='NB-share-button NB-button'>"
"<a href=\"http://ios.newsblur.com/share\"><div>"
"Post to Blurblog"
"<span class=\"NB-share-icon\"></span>Post to Blurblog"
"</div></a>"
"</div>"
"</div></div>"];
@ -729,7 +729,7 @@
[appDelegate.activeStory
objectForKey:@"story_feed_id"]];
if (appDelegate.isSocialView) {
if (appDelegate.isSocialView || appDelegate.isSocialRiverView) {
feed = [appDelegate.dictActiveFeeds objectForKey:feedIdStr];
// this is to catch when a user is already subscribed
if (!feed) {

View file

@ -18,6 +18,6 @@
// #define NEWSBLUR_URL [NSString stringWithFormat:@"nb.local.host"]
#define NEWSBLUR_URL [NSString stringWithFormat:@"dev.newsblur.com"]
#define NEWSBLUR_ORANGE 0xAE5D15
#define NEWSBLUR_LINK_COLOR 0x405BA8
#endif

View file

@ -10,6 +10,7 @@
line-height: 20px;
overflow: hidden;
min-height: 72px;
box-shadow: inset 1px 1px 1px rgba(255, 255, 255, 1);shar
}
#story_pane .NB-story-comment .NB-user-avatar {
position: absolute;

File diff suppressed because one or more lines are too long

View file

@ -73,9 +73,6 @@
left: 98px;
}
/**
* iPad Narrow Style
*/
@ -139,7 +136,7 @@
body {
text-rendering: optimizeLegibility;
margin: 0;
background: #f6f6f6;
-webkit-text-size-adjust: none;
font-size: 14px;
line-height: 120%;
@ -457,19 +454,41 @@ a.NB-show-profile {
}
.NB-button.NB-share-button div {
padding: 8px 14px;
padding: 8px 40px 8px 14px;
border-radius: 5px;
text-align: center;
background: -webkit-gradient(
linear, left top, left bottom,
from(#42aaff),
to(#003366));
padding-left: 40px;
}
.NB-button .nb-story-comment-like-button-wrapper a {
.NB-button.NB-share-button div span {
background: url("data:image/png;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACGUlEQVR42o2TTUsbYRSFZ+MvcNn/0EU1rSCCgkSxVRCLFgyiqFSE1tDSpNKoEaQJiAvBryDZGCVQKWIpWIeAFMHWL1qKjUJ3KRQSNUgSJzPR5PieMRMqjuLibAaec+577xkJwJ30p0jqEloXiglpQlmh3F3AaaEogWhnMw6dPTgafIljtx3i262gTSgSKbuPQ8dzxEfsSEw6kHBV4NRThrOVAaSd0o2wX0iJdj9D3PMaJ/1WKF4LtMlHyExf6jw0CO2dZAovCmWOBl4gMeFAyv0AmTyoLVRCXa1H+nsLtMgUktslpsmZ46E+JGedUMcsl2CwCumvTVD22qAcdOjS/vmQ3LVce7PCZMLa+EMdVj/XQflp06G/ezZ8/NYAV6gKUz+GcM8vXTGI8M0c20hW5QYo4XacCnhxox5dK+Wo+1SKmuUSeHdcKJ6VrpwqF3//Cqnh0kIy4djvNoyuVeNJHmwNONDrCyIg/8LjN0sFgyhPlfK/5cL4Zo7NZB2uFWDjh6fonQliXg5jQd7H3JcwDQoNy/LOPBXT9YXlx2YyYXcgpIPe+S10emTCqtAmDdbZMJaEd+apuG0ujG/m2EwmbB9fM0CrsTsaxFhPNozpvDPTuW0ujG/m2EwmbID/G2jsNutJA5aEBjyVnu7T042xrWYGWf4Y7DbryYaxJLwzT8Vtc2FGuplBTog/BrvNerJhLAnvTNDQppnBBZHZrv4ITeFuAAAAAElFTkSuQmCC") no-repeat 0 0px;
width: 23px;
display: inline-block;
height: 16px;
margin-bottom: -2px;
}
.NB-iphone .NB-button .NB-story-comment-like-button-wrapper,
.NB-button .NB-story-comment-like-button-wrapper {
padding-left: 22px;
position: relative;
}
.NB-button .NB-story-comment-like-button-wrapper span {
background: transparent url("data:image/png;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAGmSURBVCiRbZG/axRBHMXfzO7tbvYua+IFJQa0sRBs1IiQFIEIgvgDEUSs7CSFCJLaA1MJYjrFI5VgmkBiCDYWNgZJlaB/wgknxOT0Lnt7s7Mz852xOgzxXvne98OXxwMG6PXm3PSbzblbgzJ21Kit3mcT4ye34NyI0AeT87PvxeGcHwVGj0d34lJyJQ6Gz1myDwZ+eLpxOapGp8Y95lVPVM4sDUdjF8kSOmK3sZ81HhpGP4XMfi3e3eqx+tcnzyM/ngVjlzjjlcgvIy1aUEaiHIwg110oynNjzXep0h1OVjeMVTNJWK34Xoh2vous6ECoA7R6TRhSiEvJEFk1Rc40+OOZ+rtU7l9r9ZopA1BoAecsHIBcZ/B4CZ18L8uK9r3a9Y+LHADmry5/TmXrmabCDQUJFEkYKhD6EcgZ9FT77cKNT2sA4PfbO7jMWA3OfBwLxwDmILUAOQ1jSPbv/gHOnvdZiWlXQFulyGrle0GFgUFJOj0ImPgtmhCq+6or/6wbp1TIyzc9imq6oNH/AHJmZS/78fLF7S/fDu20/ah+4UMcJGf7xl8kb9PTscP82wAAAABJRU5ErkJggg==") no-repeat left 1px;
padding-left: 16px;
height: 20px;
width: 16px;
position: absolute;
height: 16px;
top: 3px;
left: 6px;
}
.NB-iphone .NB-button .NB-story-comment-like-button-wrapper span {
top: 2px;
}
.NB-button.hover div,
@ -478,11 +497,6 @@ a.NB-show-profile {
box-shadow: none;
}
.NB-button.hover .nb-story-comment-like-button-wrapper a
.NB-button.selected .nb-story-comment-like-button-wrapper a {
background: transparent url("data:image/png;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAFkSURBVCiRbZC/6xNBFMTn7e1mDVyhWIlgZSFYqSBEEsEQCUTBxsLKv0TBWrQWrGwtjFU603oEFP0T0ljYyt1lf+TNWgXCl5ty5g0f5gEDaprmQdM0T4cyuWhst1up6/o7gMs553vT6bQ/z83Fgvf+mXPuvnPuFskXg4TNZnNpPB5fE5GrdV1/9N7fIYkQwr5t25cA/qSU/q5Wq052u90ba+0jAHdFpLbWIsYIVcVoNELOGap6IPk75/zTkNyTfOi9r6uqwuFwQEoJKSV0XQeScM6NSU5KKXszmUw+hRAe933/DwBUFaUUAMDxeISIIITQppSez+fz9wYAZrPZtxjjK1UtzjmoKkiiqiqUUpBS+rBYLL4AgD2tL6W0JCEi8N7jnEYyDL31tjFGAIBkUtXWGAMRgareOB2dE673fY+c87sY41eSyVr7REReq+qVocLnruveLpfLX2fUH+v1eu2cu3ky/gOHFMgsTjV4FQAAAABJRU5ErkJggg==") no-repeat left 1px;
}
.NB-button a {
display: block;
padding-top: 1px;
@ -498,7 +512,7 @@ a.NB-show-profile {
.NB-button.NB-share-button a {
color: #FFF;
text-shadow: none;
font-size: 11px;
font-size: 14px;
}
.NB-button.hover a,