For loading new ads, use visibilitychange event if supported (it generally is). This means that, in theory, a new ad should load in one of the following cases:
1. Active tab changes.
2. Browser is minimized then maximized.
3. Browser window is covered up then uncovered.
4. OS goes to sleep/is locked then woken up/unlocked.
This makes a lot more sense than the current trigger, which is just focus.
Unfortunately support for cases 2-4 is spotty, but almost all browsers support
case 1.
Loads a new ad when user re-focuses the window, under the following conditions:
1. Ad must be the active item in the spotlight box.
2. Ad must be visible (in the viewport and not hidden).
3. More than 1.5 seconds must have elapsed since the last ad was loaded.
As reported in reddit/reddit#1291, we've been loading some images in our embed
widgets (the old ones, not the new comment embeds) over http. This causes
warnings in most browsers when the embedding page is loaded over https, since
we dropping down to insecure elements.
Now we're always loading them over https. Alternatively, we could use
protocol-relative urls, but I figure there's no harm in always using https, and
it's simpler and causes fewer weird issues with browsers.
If we can't figure out a good image to hint as a thumbnail for a page via
`og:image`, we set it to the reddit snoo icon. However, we have been making
this a protocol-relative url. This doesn't appear to be against [the spec][0],
but it does create problems for some scrapers.
Now we force it to be an https url, which should resolve some of those issues.
[0]: http://opengraphprotocol.org/#url
Previously, automatic_reddits had two effects: they were added to the
list of default subscriptions, and also always forced to the front page
as long as the user hadn't unsubscribed. This change makes it so that
they are no longer added to the list of defaults, so that we can force
/r/modnews to the front page for mods without also effectively
subscribing every user to it by default.
The VUser way made it too easy to make a mistake. Something like
VUser('password')
wouldn't even check the password unless the `default` kwarg was set!
Hot doesn't make much sense for comments because it was designed for threads.
There are very *very* few people who use it in comments, and we suspect most of
those are on accident - we don't provide good descriptions of what the sorts
are, so it's not obvious which of 'hot', 'best', and 'top' you should choose
when looking at a comment thread (particularly when 'hot' is the default for
submission listings).
Contest mode originally forced the sort to `top` for mods to assist in choosing
winners. However, /u/timotab [pointed out][0] that the ability to use `new` as well
would be useful for moderation.
Now mods are able to use whichever sort method they wish when browsing a thread
in contest mode.
[0]: https://www.reddit.com/r/modnews/comments/2z913o/moderators_new_features_for_testing_before/cpgyzm7
This fixes an unexpected keyword argument error that was introduced in
reddit/reddit@f3147ee. error_style_override and generic_error have not been
specified in the code yet.
Previously, localized_appendices would be ignored in nested
LocalizedModules because the Module.build() step would just call
get_source() on the nested module. This caused the plural forms
expression to not be properly appended to the reddit-init and
reddit-init-legacy modules since they nest the reddit-init-base module.
Thanks to a report by Tim McCormack (/u/phyzome). This fixes an issue
where someone embedding comments on their site could XSS themselves on
*their own* site if the parent post of the comment had HTML in the title.
The strings in timetext.js weren't being extracted. This fixes that and
will allow, after a translation cycle, live timestamps to be properly
translated.