Commit Graph

7876 Commits

Author SHA1 Message Date
Matt Lee
da54902795 reddit.js: Don't submit disabled forms in post_form 2016-10-07 17:48:13 -04:00
Matt Lee
8fb3e9106d errors.js: Add r.errors.create method
Makes creating errors consistent with the formatting of API errors on
the client side easier.
2016-10-07 17:48:13 -04:00
Matt Lee
45b7989556 mixins.less: Add moz and ms prefixes to animation 2016-10-07 17:48:12 -04:00
Matt Lee
f61ba21bc0 POST_fetch_title: Send title in json response data 2016-10-07 17:48:12 -04:00
Matt Lee
d003c3a4fc JS: Add actions.js 2016-10-07 17:48:12 -04:00
Matt Lee
1d467eed70 Add callback to r.analytics.sendEvent 2016-10-07 17:48:12 -04:00
Matt Lee
381d2a0ca3 Events.js - use callback if supplied 2016-10-07 17:48:12 -04:00
Matt Lee
8cb8cd4ca6 Wrap js config in scriptsafe_dumps 2016-10-07 17:48:12 -04:00
Matt Lee
ad69953293 r.syncedSessionStorage: Get values from e.originalEvent
The jQuery event doesn't expose the storage key or newValue attributes.
2016-10-07 17:48:12 -04:00
Matt Lee
e946fa3b58 Use jQuery to bind storage event listener
I suspect that IE8 is throwing some errors here because of this.
2016-10-07 17:48:12 -04:00
Matt Lee
107cf63841 fixup: Prevent error while instantiating r.syncedSessionStorage 2016-10-07 17:48:12 -04:00
Matt Lee
5db40de34f Fix expando events on previews getting wrong provider 2016-10-07 17:48:12 -04:00
Matt Lee
c23a188774 Analytics: Allow defining events outside of analytics.js
Conflicts:
	r2/r2/public/static/js/analytics.js
2016-10-07 17:48:11 -04:00
Matt Lee
ad08159fc8 JS: Add r.syncedSessionStorage 2016-10-07 17:48:11 -04:00
Matt Lee
01ce8b5810 Expando: Use sprites for new expando icons 2016-10-07 17:48:11 -04:00
Matt Lee
95d53d1d79 Sprites: Add support for hdpi sprites to nymph.py
Adds another optional argument to sprites to set the desired pixel
ratio.  HDPI sprites are added to the spritesheet normally, and the
pixel ratio scales the background position and size rules.
2016-10-07 17:48:11 -04:00
Matt Lee
c074762917 Add media_previews feature state to link cache key 2016-10-07 17:48:11 -04:00
Matt Lee
b288e1a787 Screenview Event: Add beta participation field 2016-10-07 17:48:11 -04:00
Matt Lee
a91e867fa3 Expando NSFW Flow: Update styles 2016-10-07 17:48:11 -04:00
Matt Lee
befa39c4af Wrap preview images in link 2016-10-07 17:42:43 -04:00
Matt Lee
acefcc103d Expando: Add media prefs to events 2016-10-07 17:42:43 -04:00
Matt Lee
7d3217a5b0 Expando: Do not float
Expandos got a css rule added to them to support the NSFW interstitial
flow, but this caused some unintended bugs with subreddit CSS.  The
positioning of the interstitial's button on the media preview overlay
is dependent on the floating, so this moves the application of the
float rule to a child element on media previews only so the expando
element itself can remain unfloated.
2016-10-07 17:42:43 -04:00
Matt Lee
7770ad7f9b Expando: Really fix position of new icons 2016-10-07 17:42:43 -04:00
Matt Lee
918a7872dc Expando: Fix position of new icons 2016-10-07 17:42:43 -04:00
Matt Lee
fcee900fe7 Expando: Feature flag nsfw flow 2016-10-07 17:42:43 -04:00
Matt Lee
f9a4bebb2f Expando: New NSFW media flow
Conflicts:
	r2/r2/lib/template_helpers.py
	r2/r2/templates/link.html
2016-10-07 17:42:42 -04:00
Matt Lee
749ee7c22e Expando: Update icons under feature flag 2016-10-07 17:42:42 -04:00
Matt Lee
bfd5a327c1 Media Previews: Show for direct image links 2016-10-07 17:42:42 -04:00
Matt Lee
900ba93e9a Feature flag media previews 2016-10-07 17:42:42 -04:00
Matt Lee
ebac4439f1 Show media preview images 2016-10-07 17:42:42 -04:00
Matt Lee
e0c16b8714 Feature flag auto-expanding media previews
Conflicts:
	r2/r2/models/link.py
2016-10-07 17:42:42 -04:00
Matt Lee
2fba350079 Add preferences for auto-expanding media previews
Conflicts:
	r2/r2/models/link.py
2016-10-07 17:42:42 -04:00
Neil Williams
64813ada66 Update baseplate integrations
This syncs with the changes in baseplate to diagnostics for OpenTracing
consistency.
2016-10-06 16:49:24 -07:00
Brian Simpson
21ee09a107 RavenErrorReporter: set user and oauth data in user_context 2016-10-06 13:40:47 -07:00
Chad Birch
414f9535b0 Remove multiple-sticky transitional code
Subreddit sticky posts (announcements) were originally implemented with
only allowing a single sticky to be set. When we added support for a
second sticky, there was some transitional code added that would handle
automatically converting the old single sticky to the new storage format
for multiple.

Everything's been long converted now, so this is no longer necessary to
keep around.
2016-10-06 13:10:36 -06:00
Brian Simpson
fd17945edf Delete log_q 2016-10-04 13:45:11 -07:00
Brian Simpson
5d75e3e5b9 Delete log_text()
This fed non-Exception events into /admin/errors. None of these have been
actively monitored for years. If we do care about monitoring stuff like
this we should use graphite or Sentry.
2016-10-04 13:44:37 -07:00
Brian Simpson
d82a63a88a Delete AdminErrorLog.
It has been replaced by Sentry.
2016-10-04 13:35:46 -07:00
Brian Simpson
5afcdd5f0a RavenErrorReporter: Add "app" query param to tags context 2016-10-04 13:35:40 -07:00
Brian Simpson
2c4af10784 RavenErrorReporter: Add HTTP and reddit context 2016-10-04 13:35:30 -07:00
Brian Simpson
d2c91349f6 RavenErrorReporter: Set culprit to controller.action 2016-10-04 13:35:06 -07:00
Brian Simpson
396ef71a9b RavenErrorReporter: move repository hashes to "modules" 2016-10-04 13:35:00 -07:00
Brian Simpson
681d82749f install_apt.sh: Add python-raven 2016-10-04 13:34:46 -07:00
Brian Simpson
24d71d7a87 Add RavenErrorReporter to report exceptions to Sentry 2016-10-04 13:34:41 -07:00
Brian Simpson
1b19ccc5a0 WikiPage.create: Be careful when creating to avoid duplicates 2016-10-04 13:33:32 -07:00
Chad Birch
ae17de114c OAuth2Client: fix definition for .deleted
The deleted property previously wasn't defined as a bool, so setting it
to True or False ended up with the strings "True" or "False" being saved
to the backing CF. This meant that trying to explicitly set a client as
not deleted would only work if you set the value as an empty string (or
completely removed the property), since attempting to set it as False
would save a string that still evaluates as True in a boolean context.

As part of this change, I also ran a backfill script that went through
and converted all existing .deleted values in the database. Anything
with a value of "True" was converted to "1" (since that's the only value
that something defined in _bool_props will accept as True), and it just
removed the property from anything with empty strings as values.

In addition, this adds .deleted to OAuth2Client._defaults so that it's
not necessary to use getattr() all the time to access it.
2016-10-03 16:24:42 -06:00
Chad Birch
dde200de98 POST_wiki_revision_revert: fix special page check
Reverting a special page that isn't stored as an attr on the Subreddit
(the automod config or the stylesheet) currently causes a crash here
(but with no other adverse side effects).
2016-10-03 16:24:37 -06:00
Chad Birch
1d9b5c8500 VCanDistinguish: 404 if invalid thing_name
Currently if the VByName call returns None, this validator will just
crash.
2016-10-03 16:24:27 -06:00
Chad Birch
23e0b21cd2 POST_unfriend: abort if no specified user 2016-10-03 16:24:11 -06:00
Chad Birch
92b6e2fee2 AutoMod: fix bug with int account threshold checks
It should be valid to define a check for one of the account thresholds
similar to:

    author:
        comment_karma: 0

to check for exactly that value. However, since this is parsed in as an
int, trying to do a regex match on it (to check for the presence of an
operator - equal/greater-than/less-than sign) crashes.

This ensures that the comparison value is converted to a string so that
the rest of the code can handle it.
2016-10-03 16:24:05 -06:00