diff --git a/files/assets/css/main.scss b/files/assets/css/main.scss index 13ee39a02..f7e14b406 100644 --- a/files/assets/css/main.scss +++ b/files/assets/css/main.scss @@ -3312,8 +3312,29 @@ div.deleted.banned { } .in-comment-image { - max-height: 100px !important; - max-width: 100px !important; + max-height: 150px !important; + max-width: 100% !important; + border-radius: 0.2rem !important; + margin-top: 0.5rem !important; + margin-bottom: 0.5rem !important; +} + +.embedvid { + max-height: 200px !important; + max-width: 100% !important; +} + +.emoji { + height: 30px !important; +} + +.bigemoji { + height: 60px !important; +} + +.spotify { + max-height: 80px !important; + max-width: 100% !important; } .onboarding-card { diff --git a/files/assets/js/gif_modal.js b/files/assets/js/gif_modal.js index 19ed4c651..f492e1165 100644 --- a/files/assets/js/gif_modal.js +++ b/files/assets/js/gif_modal.js @@ -24,7 +24,7 @@ async function getGif(searchTerm) { container.innerHTML = ''; if (searchTerm == undefined) { - container.innerHTML = '
Agree
Laugh
Confused
Sad
Happy
Awesome
Yes
No
Love
Please
Scared
Angry
Awkward
Cringe
OMG
Why
Gross
Meh
' + container.innerHTML = '
Agree
Laugh
Confused
Sad
Happy
Awesome
Yes
No
Love
Please
Scared
Angry
Awkward
Cringe
OMG
Why
Gross
Meh
' backBtn.innerHTML = null; @@ -52,12 +52,12 @@ async function getGif(searchTerm) { } else { for (var i = 0; i < 48; i++) { - gifURL[i] = "https://media.giphy.com/media/" + data[i].id + "/200w_d.webp"; + gifURL[i] = "https://media.giphy.com/media/" + data[i].id + "/giphy.webp"; if (data[i].username==''){ - container.innerHTML += ('
'); + container.innerHTML += ('
'); } else { - container.innerHTML += ('
'); + container.innerHTML += ('
'); } noGIFs.innerHTML = null; loadGIFs.innerHTML = '

Thou've reached the end of the list!

'; diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 57eb92c85..0134b5e60 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -125,14 +125,10 @@ def sanitize(sanitized, noimages=False): for tag in soup.find_all("img"): - url = tag.get("src", "") - if not url: continue - - if "profile-pic-20" not in tag.get("class", ""): + if tag.get("src", "") and "profile-pic-20" not in tag.get("class", ""): tag["rel"] = "nofollow noopener noreferrer" - tag["style"] = "max-height: 100px; max-width: 100%;" - tag["class"] = "in-comment-image rounded-sm my-2" + tag["class"] = "in-comment-image" tag["loading"] = "lazy" tag["data-src"] = tag["src"] tag["src"] = "" @@ -154,24 +150,8 @@ def sanitize(sanitized, noimages=False): if site not in tag["href"]: tag["rel"] = "nofollow noopener noreferrer" if re.match("https?://\S+", str(tag.string)): - try: - tag.string = tag["href"] - except: - tag.string = "" - - for tag in soup.find_all("code"): - tag.contents=[x.string for x in tag.contents if x.string] - - for tag in soup.find_all("img"): - if 'profile-pic-20' not in tag.attrs.get("class",""): - tag.attrs['class']="in-comment-image rounded-sm my-2" - - for tag in soup.find_all("table"): - tag.attrs['class']="table table-striped" - - for tag in soup.find_all("thead"): - tag.attrs['class']="bg-primary text-white" - + try: tag.string = tag["href"] + except: tag.string = "" sanitized = str(soup) @@ -195,13 +175,13 @@ def sanitize(sanitized, noimages=False): if emoji.startswith("!"): emoji = emoji[1:] if path.isfile(f'./files/assets/images/emojis/{emoji}.webp'): - new = re.sub(f'(?', new) + new = re.sub(f'(?', new) if emoji in session["favorite_emojis"]: session["favorite_emojis"][emoji] += 1 else: session["favorite_emojis"][emoji] = 1 elif path.isfile(f'./files/assets/images/emojis/{emoji}.webp'): - new = re.sub(f'(?', new) + new = re.sub(f'(?', new) if emoji in session["favorite_emojis"]: session["favorite_emojis"][emoji] += 1 else: session["favorite_emojis"][emoji] = 1 @@ -214,13 +194,13 @@ def sanitize(sanitized, noimages=False): if emoji.startswith("!"): emoji = emoji[1:] if path.isfile(f'./files/assets/images/emojis/{emoji}.webp'): - sanitized = re.sub(f'(?', sanitized) + sanitized = re.sub(f'(?', sanitized) if emoji in session["favorite_emojis"]: session["favorite_emojis"][emoji] += 1 else: session["favorite_emojis"][emoji] = 1 elif path.isfile(f'./files/assets/images/emojis/{emoji}.webp'): - sanitized = re.sub(f'(?', sanitized) + sanitized = re.sub(f'(?', sanitized) if emoji in session["favorite_emojis"]: session["favorite_emojis"][emoji] += 1 else: session["favorite_emojis"][emoji] = 1 @@ -232,22 +212,22 @@ def sanitize(sanitized, noimages=False): for i in re.finditer('" target="_blank">(https://youtube.com/watch\?v\=.*?)', sanitized): url = i.group(1) replacing = f'{url}' - htmlsource = f'
' + htmlsource = f'' sanitized = sanitized.replace(replacing, htmlsource.replace("watch?v=", "embed/")) for i in re.finditer('{url}' - htmlsource = f'
' + htmlsource = f'' sanitized = sanitized.replace(replacing, htmlsource) for i in re.finditer('

(https:.*?\.mp4)

', sanitized): - sanitized = sanitized.replace(i.group(0), f'

') + sanitized = sanitized.replace(i.group(0), f'

') for i in re.finditer('{url}' - htmlsource = f'' + htmlsource = f'' sanitized = sanitized.replace(replacing, htmlsource) for rd in ["https://reddit.com/", "https://new.reddit.com/", "https://www.reddit.com/", "https://redd.it/"]: diff --git a/files/templates/api.html b/files/templates/api.html index 90f812f2f..d11cf94fa 100644 --- a/files/templates/api.html +++ b/files/templates/api.html @@ -6,7 +6,7 @@ {% endblock %} {% block content %} - +

 
diff --git a/files/templates/authforms.html b/files/templates/authforms.html
index 582465020..fa8b3199e 100644
--- a/files/templates/authforms.html
+++ b/files/templates/authforms.html
@@ -14,10 +14,10 @@
 
 
 				{% if v %}
-			
-			{% if v.agendaposter %}{% elif v.css %}{% endif %}
+			
+			{% if v.agendaposter %}{% elif v.css %}{% endif %}
 		{% else %}
-			
+			
 		{% endif %}
 
 
diff --git a/files/templates/default.html b/files/templates/default.html
index f806fcfb2..88be4090c 100644
--- a/files/templates/default.html
+++ b/files/templates/default.html
@@ -249,10 +249,10 @@
 		{% block stylesheets %}
 
 		{% if v %}
-			
-			{% if v.agendaposter %}{% elif v.css %}{% endif %}
+			
+			{% if v.agendaposter %}{% elif v.css %}{% endif %}
 		{% else %}
-			
+			
 		{% endif %}
 
 		{% endblock %}
diff --git a/files/templates/expanded_image_modal.html b/files/templates/expanded_image_modal.html
index 964e4c582..17a78e74e 100644
--- a/files/templates/expanded_image_modal.html
+++ b/files/templates/expanded_image_modal.html
@@ -4,9 +4,6 @@
 		var linkText = document.getElementById("desktop-expanded-image-link");
 		var imgLink = document.getElementById("desktop-expanded-image-wrap-link");
 
-		var inlineImage = document.getElementById("desktop-expanded-image");
-
-		inlineImage.src = image.replace("200w_d.webp", "giphy.webp");
 		linkText.href = image;
 		imgLink.href=image;
 
diff --git a/files/templates/gif_modal.html b/files/templates/gif_modal.html
index 1a1a46e17..737836438 100644
--- a/files/templates/gif_modal.html
+++ b/files/templates/gif_modal.html
@@ -1,4 +1,4 @@
-
+