diff --git a/files/assets/css/main.css b/files/assets/css/main.css index d52401371..66af6cee1 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -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"} diff --git a/files/assets/js/new_comments.js b/files/assets/js/new_comments.js index 95948436c..d8faff604 100644 --- a/files/assets/js/new_comments.js +++ b/files/assets/js/new_comments.js @@ -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`) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 39b17f22f..daa761873 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -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): diff --git a/files/routes/posts.py b/files/routes/posts.py index fe9412485..a5d4c0a54 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -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!")