From 8fa3e7f7cfbd87a8cd345ecf65f2fa8260dbdd2b Mon Sep 17 00:00:00 2001 From: Aevann Date: Mon, 27 Feb 2023 03:37:53 +0200 Subject: [PATCH] use fullname in "view source" --- files/assets/js/comments.js | 14 +++++++------- files/assets/js/submission_listing.js | 2 +- files/templates/comments.html | 6 +++--- files/templates/submission.html | 6 +++--- files/templates/submission_listing.html | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/files/assets/js/comments.js b/files/assets/js/comments.js index e5018b8a7..4c14db065 100644 --- a/files/assets/js/comments.js +++ b/files/assets/js/comments.js @@ -2,13 +2,13 @@ function poll_vote_no_v() { showToast(false, "Only logged-in users can vote!"); } -function expandMarkdown(id,type) { - const ta = document.getElementById('markdown-'+id); +function expandMarkdown(fullname) { + const ta = document.getElementById('markdown-'+fullname); ta.classList.toggle('d-none'); - document.getElementsByClassName('text-expand-icon-'+id)[0].classList.toggle('fa-expand-alt'); - document.getElementsByClassName('text-expand-icon-'+id)[0].classList.toggle('fa-compress-alt'); + document.getElementsByClassName('text-expand-icon-'+fullname)[0].classList.toggle('fa-expand-alt'); + document.getElementsByClassName('text-expand-icon-'+fullname)[0].classList.toggle('fa-compress-alt'); - const items = document.getElementsByClassName(`expand-text-${type}-${id}`) + const items = document.getElementsByClassName(`expand-text-${fullname}`) for (let i=0; i < items.length; i++) { const e = items[i] @@ -36,7 +36,7 @@ function collapse_comment(id) { vids[i].pause() } - const ta = document.getElementById('markdown-'+id); + const ta = document.getElementById('markdown-c_'+id); if (!ta.classList.contains('d-none')) - expandMarkdown(id,'c') + expandMarkdown(`c_${id}`) }; diff --git a/files/assets/js/submission_listing.js b/files/assets/js/submission_listing.js index ce33a9958..809d2b11e 100644 --- a/files/assets/js/submission_listing.js +++ b/files/assets/js/submission_listing.js @@ -1,6 +1,6 @@ function expandText(id) { document.getElementById('post-text-'+id).classList.toggle('d-none'); - for (const e of document.getElementsByClassName('text-expand-icon-'+id)) + for (const e of document.getElementsByClassName('text-expand-icon-p_'+id)) { e.classList.toggle('fa-expand-alt'); e.classList.toggle('fa-compress-alt'); diff --git a/files/templates/comments.html b/files/templates/comments.html index 12f4fbd53..0513ef5ae 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -408,7 +408,7 @@ {% elif v and c.body %} - + {% endif %} {% endif %} @@ -492,7 +492,7 @@ {% if v and v.id != c.author_id and c.body %} -
{{c.body.strip()}}
+
{{c.body.strip()}}
{% endif %} {% if c.parent_submission or c.wall_user_id %} @@ -596,7 +596,7 @@ {% else %} {% if c.body %} - + {% endif %} {% if not c.ghost %} diff --git a/files/templates/submission.html b/files/templates/submission.html index 8d7406c75..31ee672dc 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -39,7 +39,7 @@ {% if v.id==p.author_id %} {% elif p.body and v.admin_level < PERMS['POST_EDITING'] %} - + {% endif %} {% include "post_actions_mobile.html" %} @@ -212,7 +212,7 @@ {% if v and v.can_edit(p) %} {% elif v and v.id != p.author_id and p.body and not v_forbid_deleted %} - + {% endif %} {% include 'post_actions.html' %} @@ -292,7 +292,7 @@ {% if v and v.id != p.author_id and p.body and not v_forbid_deleted %} -
{{p.body.strip()}}
+
{{p.body.strip()}}
{% endif %}
diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index 28c92552d..706082ad7 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -116,7 +116,7 @@