Delete more remnants of the toolbar
The toolbar was disabled starting on June 26, 2015 (see https://www.reddit.com/wiki/toolbar). There are still some remnants of it hanging around though, so this commit removes various code/CSS/graphics that are no longer used anywhere due to it being gone.
@@ -46,6 +46,7 @@ from r2.lib.csrf import csrf_exempt
|
||||
from r2.lib.utils import (
|
||||
extract_user_mentions,
|
||||
iters,
|
||||
query_string,
|
||||
timeago,
|
||||
to36,
|
||||
trunc_string,
|
||||
|
||||
@@ -27,10 +27,8 @@ from pylons import app_globals as g
|
||||
|
||||
from reddit_base import RedditController
|
||||
from r2.lib import utils
|
||||
from r2.lib.filters import spaceCompress, safemarkdown
|
||||
from r2.lib.menus import CommentSortMenu
|
||||
from r2.lib.pages import *
|
||||
from r2.lib.pages.things import hot_links_by_url_listing, wrap_links
|
||||
from r2.lib.pages.things import hot_links_by_url_listing
|
||||
from r2.lib.template_helpers import add_sr
|
||||
from r2.lib.validator import *
|
||||
from r2.models import *
|
||||
@@ -63,16 +61,6 @@ def demangle_url(path):
|
||||
|
||||
return path
|
||||
|
||||
def match_current_reddit_subdomain(url):
|
||||
# due to X-Frame-Options: SAMEORIGIN headers, we can't frame mismatched
|
||||
# reddit subdomains
|
||||
parsed = UrlParser(url)
|
||||
if parsed.is_reddit_url():
|
||||
parsed.hostname = request.host
|
||||
return parsed.unparse()
|
||||
else:
|
||||
return url
|
||||
|
||||
def force_html():
|
||||
"""Because we can take URIs like /s/http://.../foo.png, and we can
|
||||
guarantee that the toolbar will never be used with a non-HTML
|
||||
|
||||
@@ -131,7 +131,7 @@ from r2.lib.strings import (
|
||||
Score,
|
||||
strings,
|
||||
)
|
||||
from r2.lib.utils import is_subdomain, title_to_url, query_string, UrlParser
|
||||
from r2.lib.utils import is_subdomain, title_to_url, UrlParser
|
||||
from r2.lib.utils import url_links_builder, median, to36
|
||||
from r2.lib.utils import trunc_time, timesince, timeuntil, weighted_lottery
|
||||
from r2.lib.template_helpers import (
|
||||
@@ -242,7 +242,6 @@ class Reddit(Templated):
|
||||
create_reddit_box = True
|
||||
submit_box = True
|
||||
header = True
|
||||
footer = True
|
||||
searchbox = True
|
||||
extension_handling = True
|
||||
enable_login_cover = True
|
||||
@@ -257,8 +256,8 @@ class Reddit(Templated):
|
||||
infotext='', infotext_class=None, infotext_show_icon=False,
|
||||
content=None, short_description='', title='',
|
||||
robots=None, show_sidebar=True, show_chooser=False,
|
||||
header=True, footer=True, srbar=True, page_classes=None,
|
||||
short_title=None, show_wiki_actions=False, extra_js_config=None,
|
||||
header=True, srbar=True, page_classes=None, short_title=None,
|
||||
show_wiki_actions=False, extra_js_config=None,
|
||||
show_locationbar=False,
|
||||
**context):
|
||||
Templated.__init__(self, **context)
|
||||
@@ -273,9 +272,8 @@ class Reddit(Templated):
|
||||
self.show_sidebar = show_sidebar
|
||||
self.space_compress = space_compress
|
||||
self.dnt_enabled = feature.is_enabled("do_not_track")
|
||||
# instantiate a footer
|
||||
self.header = header
|
||||
self.footer = RedditFooter() if footer else None
|
||||
self.footer = RedditFooter()
|
||||
self.debug_footer = DebugFooter()
|
||||
self.supplied_page_classes = page_classes or []
|
||||
|
||||
|
||||
@@ -100,9 +100,6 @@ string_dict = dict(
|
||||
link_info_title = _("%(title)s : %(site)s"),
|
||||
link_info_og_description = _("%(score)s points and %(num_comments)s comments so far on reddit"),
|
||||
|
||||
|
||||
comments_panel_text = _("""The following is a sample of what Reddit users had to say about this page. The full discussion is available [here](%(fd_link)s); you can also get there by clicking the link's title (in the middle of the toolbar, to the right of the comments button)."""),
|
||||
|
||||
submit_link = _("""You are submitting a link. The key to a successful submission is interesting content and a descriptive title."""),
|
||||
submit_text = _("""You are submitting a text-based post. Speak your mind. A title is required, but expanding further in the text field is not. Beginning your title with "vote up if" is violation of intergalactic law."""),
|
||||
submit_link_label = _("Submit a new link"),
|
||||
|
||||
@@ -1794,11 +1794,6 @@ class CommentScoresByLink(tdb_cassandra.View):
|
||||
return {}
|
||||
|
||||
|
||||
class StarkComment(Comment):
|
||||
"""Render class for the comments in the top-comments display in
|
||||
the reddit toolbar"""
|
||||
_nodb = True
|
||||
|
||||
class MoreMessages(Printable):
|
||||
cachable = False
|
||||
display = ""
|
||||
|
||||
|
Before Width: | Height: | Size: 187 B |
|
Before Width: | Height: | Size: 126 B |
|
Before Width: | Height: | Size: 187 B |
|
Before Width: | Height: | Size: 127 B |
@@ -760,12 +760,6 @@ ul.flat-vert {text-align: left;}
|
||||
|
||||
/* thing rendering */
|
||||
|
||||
.preload {
|
||||
position: absolute;
|
||||
top: -1000px;
|
||||
left: -1000px;
|
||||
}
|
||||
|
||||
.arrow {
|
||||
margin: 2px 0px 0px 0px;
|
||||
width: 100%;
|
||||
@@ -4158,43 +4152,6 @@ body.contact-us-page {
|
||||
padding: 0px 2px;
|
||||
}
|
||||
|
||||
.min-body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.min-body .content {
|
||||
margin-top: 0px;
|
||||
border-right: solid #369 1px;
|
||||
min-height: 100%;
|
||||
max-width: 60em;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.min-body .content h1, .min-body .content h2 {
|
||||
padding-left: 13px;
|
||||
display: inline-block;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.min-body .content #noresults {
|
||||
margin: 0 0 0 13px;
|
||||
}
|
||||
|
||||
/* wat is this */
|
||||
|
||||
.starkcomment + .clearleft + .starkcomment {
|
||||
margin-top: 10px
|
||||
}
|
||||
.starkcomment .commentbox {
|
||||
color: black;
|
||||
background-color: #f0f0f0;
|
||||
padding: 5px;
|
||||
margin-left: 0px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.starkcomment .tagline {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* default form styles */
|
||||
|
||||
form .blurb {
|
||||
|
||||
|
Before Width: | Height: | Size: 112 B |
@@ -175,7 +175,7 @@ $.request = function(op, parameters, worker_in, block, type,
|
||||
return
|
||||
}
|
||||
|
||||
if (window != window.top && !r.config.external_frame) {
|
||||
if (window != window.top) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -239,14 +239,6 @@ function hide_thing(elem) {
|
||||
}
|
||||
}
|
||||
|
||||
function toggle_label (elem, callback, cancelback) {
|
||||
$(elem).parent().find(".option").toggle();
|
||||
$(elem)[0].onclick = function() {
|
||||
return(toggle_label(elem, cancelback, callback));
|
||||
}
|
||||
if (callback) callback(elem);
|
||||
}
|
||||
|
||||
function toggle(elem, callback, cancelback) {
|
||||
if (r.access.isLinkRestricted(elem)) {
|
||||
return false;
|
||||
|
||||
|
Before Width: | Height: | Size: 137 B |
|
Before Width: | Height: | Size: 137 B |
|
Before Width: | Height: | Size: 468 B |
@@ -694,26 +694,3 @@
|
||||
<%def name="bylink_button(title, link, sr_path=True)">
|
||||
${plain_link(title, link, _class="bylink", rel="nofollow", _sr_path=sr_path)}
|
||||
</%def>
|
||||
|
||||
<%def name="toggleable_label(class_name,
|
||||
title, alt_title,
|
||||
callback, cancelback,
|
||||
reverse = False)">
|
||||
<%
|
||||
if reverse:
|
||||
callback, cancelback = cancelback, callback
|
||||
title, alt_title = alt_title, title
|
||||
%>
|
||||
<span class="${class_name} toggle">
|
||||
<span class="toggle option active">${title}</span>
|
||||
<span class="toggle option">${alt_title}</span>
|
||||
 (
|
||||
<a href="#"
|
||||
onclick="return toggle_label(this, ${callback}, ${cancelback})"
|
||||
>
|
||||
${_("toggle")}
|
||||
</a>
|
||||
)
|
||||
</span>
|
||||
</%def>
|
||||
|
||||
|
||||
@@ -156,32 +156,29 @@
|
||||
</div>
|
||||
%endif
|
||||
|
||||
%if thing.footer:
|
||||
${thing.footer}
|
||||
|
||||
${thing.footer}
|
||||
|
||||
%if not c.user_is_loggedin and not g.read_only_mode:
|
||||
%if thing.enable_login_cover:
|
||||
<script>
|
||||
var BETA_HOST = 'beta.reddit.com';
|
||||
if (location.host === BETA_HOST) {
|
||||
r.config.https_endpoint = 'https://' + BETA_HOST;
|
||||
}
|
||||
</script>
|
||||
<script id="login-popup" type="text/template">
|
||||
${Login(is_popup=True)}
|
||||
</script>
|
||||
%endif
|
||||
<script id="lang-popup" type="text/template">
|
||||
<%include file="prefoptions.html" />
|
||||
</script>
|
||||
%endif
|
||||
%if thing.show_timeout_modal:
|
||||
<script id="access-popup" type="text/template">
|
||||
${InTimeoutInterstitial(timeout_days_remaining=thing.timeout_days_remaining,
|
||||
hide_message=True)}
|
||||
%if not c.user_is_loggedin and not g.read_only_mode:
|
||||
%if thing.enable_login_cover:
|
||||
<script>
|
||||
var BETA_HOST = 'beta.reddit.com';
|
||||
if (location.host === BETA_HOST) {
|
||||
r.config.https_endpoint = 'https://' + BETA_HOST;
|
||||
}
|
||||
</script>
|
||||
<script id="login-popup" type="text/template">
|
||||
${Login(is_popup=True)}
|
||||
</script>
|
||||
%endif
|
||||
<script id="lang-popup" type="text/template">
|
||||
<%include file="prefoptions.html" />
|
||||
</script>
|
||||
%endif
|
||||
%if thing.show_timeout_modal:
|
||||
<script id="access-popup" type="text/template">
|
||||
${InTimeoutInterstitial(timeout_days_remaining=thing.timeout_days_remaining,
|
||||
hide_message=True)}
|
||||
</script>
|
||||
%endif
|
||||
% if c.secure:
|
||||
## Pixel to pick up HSTS policies from the base domain
|
||||
|
||||