Expando: Feature flag nsfw flow

This commit is contained in:
Matt Lee
2016-02-03 12:54:12 -05:00
parent f9a4bebb2f
commit fcee900fe7
3 changed files with 13 additions and 4 deletions

View File

@@ -598,6 +598,13 @@ module["reddit-init"] = LocalizedModule("reddit-init.js",
wrap=catch_errors,
)
module["expando-nsfw-flow"] = Module("expando-nsfw-flow.js",
TemplateFileSource('ui/formbar.html'),
"ui/formbar.js",
TemplateFileSource('expando/nsfwgate.html'),
"expando/nsfwflow.js",
)
module["reddit"] = LocalizedModule("reddit.js",
"lib/jquery.url.js",
"lib/backbone-1.0.0.js",
@@ -633,10 +640,7 @@ module["reddit"] = LocalizedModule("reddit.js",
"embed.js",
"post-sharing.js",
"expando.js",
TemplateFileSource('ui/formbar.html'),
"ui/formbar.js",
TemplateFileSource('expando/nsfwgate.html'),
"expando/nsfwflow.js",
# inline expando-nsfw-flow.js module here when unflagged
"saved.js",
"cache-poisoning-detection.js",
"messages.js",

View File

@@ -290,6 +290,8 @@ class Reddit(Templated):
if feature.is_enabled("new_expando_icons"):
self.feature_new_expando_icons = True
if feature.is_enabled("expando_nsfw_flow"):
self.feature_expando_nsfw_flow = True
# generate a canonical link for google
canonical_url = UrlParser(canonical_link or request.url)

View File

@@ -127,6 +127,9 @@
<%def name="javascript_bottom()">
<% from r2.lib import js %>
${unsafe(js.use('reddit'))}
%if getattr(thing, "feature_expando_nsfw_flow", False):
${unsafe(js.use("expando-nsfw-flow"))}
%endif
${unsafe(c.js_preload.use())}
</%def>