do not automatically show media previews of nsfw posts #300
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
set
and use defaults on cookie getters rather than null checkthe majority of this change is:
'show-preview': SHOW_PREVIEW is same as 'true' and not [entry|post|comment].isAdult
someone mentioned that they wished to see this change once, and I agree with it, you can still preview NSFW media manually, but this doesn't automatically open it on you
I guess perhaps it could also be a user setting, if people do want to browse nsfw mags for instance perhaps they want all to open automatically, this has always been an issue I have had where I feel like there's complete consensus of NSFW vs NSFL yet it always never is implemented (small rant)
the rest is I updated the four components to use
set
vars similar to what @asdfzdfj did for the subscription sidebar. That looked far more readable to me instead of long constants in the middle of the component. I also added defaults for each setting, so for exampleSHOW_MAGAZINE_ICONS
defaults totrue
if not set so the code doesn't need to do the first half of what it was:not SHOW_MAGAZINE_ICONS or SHOW MAGAZINE_ICONS is true
some examples if they make sense, this is just me opening the page with show media preview on for both entries and posts, not clicking anything