mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-26 23:39:11 -05:00
Make links in comments and submitter/subreddit button links open in new tab based on preference
This commit is contained in:
committed by
bsimpson63
parent
714f4481b7
commit
1088fe73db
@@ -158,7 +158,8 @@ ${parent.thing_css_class(what)} ${"over18" if thing.over_18 else ""}
|
||||
|
||||
<%def name="subreddit()" buffered="True">
|
||||
${plain_link(thing.subreddit.name, thing.subreddit_path, sr_path = False,
|
||||
cname = False, _class = "subreddit hover")}
|
||||
cname = False, _class = "subreddit hover",
|
||||
target='_blank' if thing.newwindow else '')}
|
||||
<script type="text/javascript">
|
||||
reddit.sr['${thing._fullname}'] = '${thing.subreddit._fullname}';
|
||||
</script>
|
||||
|
||||
@@ -40,7 +40,8 @@
|
||||
<td class="button">${thing.button}</td>
|
||||
<td class="description">${thing.text} 
|
||||
%if hasattr(thing, 'target_text'):
|
||||
${plain_link(thing.target_text, thing.target_path, title=thing.target_title, sr_path=False, cname=False, _class="subreddit hover")} 
|
||||
${plain_link(thing.target_text, thing.target_path, title=thing.target_title, sr_path=False, cname=False, _class="subreddit hover",
|
||||
target='_blank' if c.user.pref_newwindow else '')} 
|
||||
%elif hasattr(thing, 'target_wrapped_user'):
|
||||
${thing.target_wrapped_user} 
|
||||
%endif
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<div class="usertext-body">
|
||||
% if not thing.expunged:
|
||||
${unsafe(safemarkdown(thing.text, nofollow = thing.nofollow,
|
||||
target = thing.target))}
|
||||
target = '_blank' if c.user.pref_newwindow else thing.target))}
|
||||
% else:
|
||||
<em>${_("[removed]")}</em> 
|
||||
% endif
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
%>
|
||||
${plain_link(thing.name + thing.karma, "/user/%s" % thing.name,
|
||||
_class = ' '.join(classes),
|
||||
_sr_path = False, target=target, title=thing.author_title)}
|
||||
_sr_path = False, target='_blank' if c.user.pref_newwindow else target, title=thing.author_title)}
|
||||
%if thing.flair_position == 'right':
|
||||
${flair(thing, enabled=thing.force_show_flair)}
|
||||
%endif
|
||||
|
||||
Reference in New Issue
Block a user