forked from rDrama/rDrama
parent
fdb13d18d4
commit
f08c728692
|
@ -1,5 +1,9 @@
|
|||
@charset "UTF-8";
|
||||
|
||||
.visited img {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.fa-align-left:before{content:"\f036"}
|
||||
.fa-long-arrow-left:before{content:"\f177"}
|
||||
.fa-arrow-right:before{content:"\f061"}
|
||||
|
|
|
@ -8,6 +8,7 @@ for (let twoattrs of document.getElementsByClassName("twoattrs")) {
|
|||
pcc = twoattrs[1]
|
||||
const lastCount = comments[pid]
|
||||
if (lastCount) {
|
||||
document.getElementById(`${pid}-title`).classList.add('visited')
|
||||
const newComments = pcc - lastCount.c
|
||||
if (newComments > 0) {
|
||||
const elems = document.getElementsByClassName(`${pid}-new-comments`)
|
||||
|
|
|
@ -696,7 +696,7 @@ def allowed_attributes_emojis(tag, name, value):
|
|||
|
||||
|
||||
@with_sigalrm_timeout(2)
|
||||
def filter_emojis_only(title, golden=True, count_emojis=False, graceful=False, is_post_title=False):
|
||||
def filter_emojis_only(title, golden=True, count_emojis=False, graceful=False):
|
||||
|
||||
title = title.replace("\n", "").replace("\r", "").replace("\t", "").replace('<','<').replace('>','>')
|
||||
|
||||
|
@ -720,11 +720,6 @@ def filter_emojis_only(title, golden=True, count_emojis=False, graceful=False, i
|
|||
|
||||
title = title.strip()
|
||||
|
||||
if is_post_title:
|
||||
soup = BeautifulSoup(title, 'lxml')
|
||||
text = soup.html.body.text.strip()
|
||||
if not text: title = f'### {title} ###'
|
||||
|
||||
return title
|
||||
|
||||
def is_whitelisted(domain, k):
|
||||
|
|
|
@ -432,7 +432,7 @@ def submit_post(v, sub=None):
|
|||
if SITE == 'rdrama.net' and v.id == 10947:
|
||||
sub = 'mnn'
|
||||
|
||||
title_html = filter_emojis_only(title, graceful=True, count_emojis=True, is_post_title=True)
|
||||
title_html = filter_emojis_only(title, graceful=True, count_emojis=True)
|
||||
|
||||
if v.marseyawarded and not marseyaward_title_regex.fullmatch(title_html):
|
||||
abort(400, "You can only type marseys!")
|
||||
|
@ -990,7 +990,7 @@ def edit_post(pid, v):
|
|||
|
||||
|
||||
if title != p.title:
|
||||
title_html = filter_emojis_only(title, golden=False, is_post_title=True)
|
||||
title_html = filter_emojis_only(title, golden=False)
|
||||
|
||||
if v.id == p.author_id and v.marseyawarded and not marseyaward_title_regex.fullmatch(title_html):
|
||||
abort(403, "You can only type marseys!")
|
||||
|
|
Loading…
Reference in New Issue