The styling for the compact register page got messed up with our changes to the
login/register flow. Eventually perhaps we'll restyle them, but for now leave
them be.
This is building on f752c15, which did the same for login.
[Reported by][0] /u/shamelessguy.
[0]: http://redd.it/2pwite
Switching to unitless variables for all font-size, line-height, padding and margin
styles requires assigning those variables a unit when using (e.g. @var * 1px). I
failed to do this in a couple spots, causing the selftext box to lose its padding and
look totally weird.
Also raises the left padding on lists. Numbers on ordered lists were falling outside
of the comment's container, and getting clipped off. This also looked totally weird.
This does _not_ bump the version number of react, it just uses the version
with addons bundled in. These are mostly utility features, but the main
reason is for the animations addon. Trying to add CSS transitions to elements
entering or exiting the DOM _without_ this addon would be a major pain.
Commit 8f1ab15 addressed an issue we were seeing where some subreddit had
huge font sizes with the new markdown styles applied. The solution was to
structure the styles such that <p> elements had a default font-size of 1em,
which worked well. Unfortunately, because of the way that the sidebar styles
are structured (and because I kind of forgot about them in that solution),
this caused the opposite problem for some subreddits' sidebars: tiny text.
This applies the same solution to the sidebar text, and does a little bit
of refactoring along the way.
This replaces most references to absolute numbers with variable references.
A scale of font sizes, line heights, and margins used are defined at the top
of the file, and pretty much everything references those (except for small
stuff like borders.). I thought this was slightly easier to reason about than
doing `font-size: @base + 2;` kind of stuff, but it might be a little
overboard.
Some subreddits use tables for special layout purposes, and the new default
background colors for rows often needs to be overridden. Since the effect is
pretty subtle anyways, its probably better to just remove it altogether.
If a subreddit wants to change the default text color (e.g. for a dark theme)
they'd need to override the color for the .md element and each header tag
(h1-h6) individually. This makes it so the header tags inherit from the .md
element to make this less painful.
This makes the fast cache key safe for the memcache ASCII protocol.
NOTE: This will need to be rolled out in a safe manner (usually a downtime) in order to avoid any data integrity issues.
This function is meant to allow all of our Relation code to use the same
key, making it easier to change. It also required a refactor of the
_fast_cache code a bit to operate on cache keys instead of tuples.
Even though the site generally normalizes domains to lowercase in most
other places, visiting /domain/EXAMPLE.COM (or any other capitalization)
would not show any results, the only working address would be
/domain/example.com. This forces to lowercase, regardless of how the
domain was capitalized in the url visited.
Fixes a bug introduced in dd9e045 that prevents messages from collapsing
in modmail. This was due to the markup change, combined with some overly
specific CSS.
Inbox messages display with a tiny font size when viewing with the new markdown
styles. This is due to a change introduced in e8d0ce7.
<longwindedexplaination>
The idea behind that change was to make the default font-size for `.md`
elements `14px` while still using relative font sizes (using `ems` and
keywords). This lets us continue to respect browser preferences _and_
makes the styles a _little_ harder to break via custom css (before this,
increasing the font size of `.md` could drastically increase a subreddit's
font size).
In order to do this, you actually have to use two elements, because
browsers only provide a limited set of absolute font sizes that respect
user preferences (via keywords). The outer element uses a keyword font size
to reset the base font size to the nearest keyword value `small (13px)`,
and the inner `.md` element scales that up to the desired default font size
using `ems`. I thought that using `.wiki-page-content` for wiki pages and
`usertext-body` for everything else covered it, but it turns out that
message pages don't wrap message with `UserText`, so the `.md` text there
is getting scaled up from the site default size of `x-small (10px)`.
The end result is that we can use `p { font-size: 1em; }`, so if some
stylesheet author decides they want to set
`.md { font-size: <whatever>px }`, that's what they'll get.
</longwindedexplaination>
Rather than adding _another_ css rule trying to target the messages page (which
I don't think is possible without side effects anyway), I did two things:
first, I added an extra css class _specifically_ for this purpose
(`.md-container`) and applied to both the `wiki-page-content` and
`usertext-body` elements; and second, wrapped the offending markdown on the
inbox page with an element of that class.
Thanks to Hamid Ashraf (/u/hamihax) for the report! A lot of
user-agents allow windows and tabs to navigate their openers through
`window.opener.location`.
This creates a potential phishing risk where a victim with the
"open links in a new window" pref clicks a link submitted by an
attacker. The attacker's page may then navigate the reddit page that
opened it. When the user closes the tab with the attacker's submitted
content, they'll be greeted with an attacker controlled page, and
they would be less likely to notice since the tab previously contained
a page served by reddit.
IMO this is really a flaw in same-origin policy, but the behaviour is
present in a number of browsers.
When a user reports a message, we've been checking to make sure it's actually
sent to them. However, when a message is sent to a subreddit's moderation
team, any member of the mod team should be able to report the message, despite
it not being sent to *them*, directly.
We now extend the check to also check for moderator status if necessary.
[Reported][0] by /u/psdtwk.
[0]: https://www.reddit.com/r/bugs/comments/2p6m56/i/cmuw61w
While looking at reddit/reddit#1043, I was reminded that the work in
reddit/reddit@d2e2cef was incomplete, so I did a bit of `ack`ing and came up
with this set of changes. This should be a pretty good set of changing login,
logged in, log out, logged out, etc. to the "sign out" equivalents, and
"register an account" and friends to "create an account".
There are a bunch of variable names and endpoints around that I didn't touch,
because that would break all sorts of things. This *should* be only including
text directly shown to users (usually passed through `_()`) or indirectly shown
via the API docs.