mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Text view now behind paywall.
This commit is contained in:
parent
cc82787e8d
commit
098f2ca780
5 changed files with 53 additions and 2 deletions
|
@ -369,6 +369,7 @@
|
|||
NSString *customStyle = @"";
|
||||
NSString *fontSizeClass = @"NB-";
|
||||
NSString *lineSpacingClass = @"NB-line-spacing-";
|
||||
NSString *premiumOnlyClass = (self.inTextView && !appDelegate.isPremium) ? @"NB-premium-only" : @"";
|
||||
NSString *storyContent = [self.activeStory objectForKey:@"story_content"];
|
||||
if (self.inTextView && [self.activeStory objectForKey:@"original_text"]) {
|
||||
storyContent = [self.activeStory objectForKey:@"original_text"];
|
||||
|
@ -376,6 +377,9 @@
|
|||
|
||||
NSUserDefaults *userPreferences = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
NSString *premiumTextString = [NSString stringWithFormat:@"<div class=\"NB-feed-story-premium-only-divider\"></div>"
|
||||
"<div class=\"NB-feed-story-premium-only-text\">The full Text view is a <a href=\"http://ios.newsblur.com/premium\">premium feature</a>.</div>"];
|
||||
|
||||
fontStyleClass = [userPreferences stringForKey:@"fontStyle"];
|
||||
if (!fontStyleClass) {
|
||||
fontStyleClass = @"GothamNarrow-Book";
|
||||
|
@ -470,6 +474,7 @@
|
|||
"<html>"
|
||||
"<head>%@</head>" // header string
|
||||
"<body id=\"story_pane\" class=\"%@ %@\">"
|
||||
" <div class=\"%@\" id=\"NB-premium-check\">"
|
||||
" <div class=\"%@\" id=\"NB-font-style\"%@>"
|
||||
" <div class=\"%@\" id=\"NB-font-size\">"
|
||||
" <div class=\"%@\" id=\"NB-line-spacing\">"
|
||||
|
@ -478,6 +483,7 @@
|
|||
headerString,
|
||||
contentWidthClass,
|
||||
riverClass,
|
||||
premiumOnlyClass,
|
||||
fontStyleClass,
|
||||
customStyle,
|
||||
fontSizeClass,
|
||||
|
@ -490,6 +496,7 @@
|
|||
" </div>" // line-spacing
|
||||
" </div>" // font-size
|
||||
" </div>" // font-style
|
||||
" </div>" // premium check
|
||||
"</body>"
|
||||
"</html>"
|
||||
];
|
||||
|
@ -497,6 +504,7 @@
|
|||
NSString *htmlContent = [NSString stringWithFormat:@
|
||||
"%@" // header
|
||||
" <div id=\"NB-story\" class=\"NB-story\">%@</div>"
|
||||
" <div class=\"NB-text-view-premium-only\">%@</div>"
|
||||
" <div id=\"NB-sideoptions-container\">%@</div>"
|
||||
" <div id=\"NB-comments-wrapper\">"
|
||||
" %@" // friends comments
|
||||
|
@ -505,6 +513,7 @@
|
|||
"%@", // footer
|
||||
htmlTop,
|
||||
storyContent,
|
||||
premiumTextString,
|
||||
sharingHtmlString,
|
||||
commentString,
|
||||
footerString,
|
||||
|
@ -1543,6 +1552,9 @@ shouldStartLoadWithRequest:(NSURLRequest *)request
|
|||
NSString *tag = [NSString stringWithFormat:@"%@", [urlComponents objectAtIndex:2]];
|
||||
[self.appDelegate toggleTagClassifier:tag feedId:feedId];
|
||||
return NO;
|
||||
} else if ([action isEqualToString:@"premium"]) {
|
||||
[self.appDelegate showPremiumDialog];
|
||||
return NO;
|
||||
} else if ([action isEqualToString:@"show-profile"] && [urlComponents count] > 6) {
|
||||
appDelegate.activeUserProfileId = [NSString stringWithFormat:@"%@", [urlComponents objectAtIndex:2]];
|
||||
|
||||
|
|
|
@ -447,6 +447,7 @@
|
|||
FFA0484419CA73B700618DC4 /* UIView+ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FFA0484319CA73B700618DC4 /* UIView+ViewController.m */; };
|
||||
FFAD4971144A386100BA6919 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = FFAD4970144A386100BA6919 /* libz.dylib */; };
|
||||
FFAD89C218AC45A100D68567 /* StoriesCollection.m in Sources */ = {isa = PBXBuildFile; fileRef = FFAD89C118AC45A100D68567 /* StoriesCollection.m */; };
|
||||
FFB1F69D1FBD1B2D001DA171 /* white_fade.png in Resources */ = {isa = PBXBuildFile; fileRef = FFB1F69C1FBD1B2D001DA171 /* white_fade.png */; };
|
||||
FFB5F50B17187B6F00C8B432 /* big_world.png in Resources */ = {isa = PBXBuildFile; fileRef = FFB5F50A17187B6F00C8B432 /* big_world.png */; };
|
||||
FFB7050A1925921F0052101C /* line_spacing_l.png in Resources */ = {isa = PBXBuildFile; fileRef = FFB705051925921F0052101C /* line_spacing_l.png */; };
|
||||
FFB7050B1925921F0052101C /* line_spacing_m.png in Resources */ = {isa = PBXBuildFile; fileRef = FFB705061925921F0052101C /* line_spacing_m.png */; };
|
||||
|
@ -1203,6 +1204,7 @@
|
|||
FFAD4970144A386100BA6919 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
|
||||
FFAD89C018AC45A100D68567 /* StoriesCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StoriesCollection.h; sourceTree = "<group>"; };
|
||||
FFAD89C118AC45A100D68567 /* StoriesCollection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StoriesCollection.m; sourceTree = "<group>"; };
|
||||
FFB1F69C1FBD1B2D001DA171 /* white_fade.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = white_fade.png; sourceTree = "<group>"; };
|
||||
FFB5F50A17187B6F00C8B432 /* big_world.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = big_world.png; sourceTree = "<group>"; };
|
||||
FFB705051925921F0052101C /* line_spacing_l.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = line_spacing_l.png; sourceTree = "<group>"; };
|
||||
FFB705061925921F0052101C /* line_spacing_m.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = line_spacing_m.png; sourceTree = "<group>"; };
|
||||
|
@ -1737,6 +1739,7 @@
|
|||
431B857615A132B600DCE497 /* Images */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
FFB1F69C1FBD1B2D001DA171 /* white_fade.png */,
|
||||
FF9D59331FBC08DB00823C10 /* Shiloh.jpg */,
|
||||
FF3FA8941BB26B6A001F7C32 /* copy_link@2x.png */,
|
||||
FF83FF121FB54692008DAC0F /* g_icn_buffer.png */,
|
||||
|
@ -2843,6 +2846,7 @@
|
|||
FF3FA8951BB26B6A001F7C32 /* copy_link@2x.png in Resources */,
|
||||
17C5BA6D1CA39EA400F5961C /* unread_green_icn@3x.png in Resources */,
|
||||
FFC486B519CA41AE00F4758F /* logo_87.png in Resources */,
|
||||
FFB1F69D1FBD1B2D001DA171 /* white_fade.png in Resources */,
|
||||
FFCDD8F617F4BCB4000C6483 /* Default-portrait.png in Resources */,
|
||||
FF67D3C1168A708D0057A7DA /* storyDetailView.css in Resources */,
|
||||
FFCDD8F317F4BCB4000C6483 /* Default-568h@2x.png in Resources */,
|
||||
|
|
BIN
clients/ios/Resources/white_fade.png
Normal file
BIN
clients/ios/Resources/white_fade.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 335 B |
|
@ -1227,4 +1227,37 @@ a.NB-show-profile {
|
|||
display: none;
|
||||
}
|
||||
|
||||
.NB-premium-only .NB-story {
|
||||
max-height: 500px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.NB-text-view-premium-only {
|
||||
display: none;
|
||||
border-top: 1px solid #C0C0C0;
|
||||
font-size: 13px;
|
||||
text-align: center;
|
||||
padding: 12px 0;
|
||||
font-weight: bold;
|
||||
margin: -32px 0 0;
|
||||
background-color: white;
|
||||
cursor: default;
|
||||
max-width: 700px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.NB-premium-only .NB-text-view-premium-only {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.NB-text-view-premium-only .NB-feed-story-premium-only-divider {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
background: transparent url('white_fade.png') repeat-x 0 0;
|
||||
top: -51px;
|
||||
left: 0;
|
||||
background-size: 25px 50px;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -3247,11 +3247,13 @@ body {
|
|||
/* = Text View = */
|
||||
/* ============= */
|
||||
|
||||
#story_pane .NB-text-view-detail .NB-feed-story-content {
|
||||
#story_pane .NB-text-view-detail .NB-feed-story-content,
|
||||
#story_titles .NB-text-view-detail .NB-feed-story-content {
|
||||
min-height: 120px;
|
||||
}
|
||||
|
||||
#story_pane .NB-premium-only .NB-text-view-detail .NB-feed-story-content {
|
||||
#story_pane .NB-premium-only .NB-feed-story-content,
|
||||
#story_titles .NB-premium-only .NB-feed-story-content {
|
||||
max-height: 300px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue