forked from rDrama/rDrama
1
0
Fork 0

fdMerge branch 'frost' of https://github.com/Aevann1/Drama into frost

master
Aevann1 2022-03-26 11:38:40 +00:00
commit 545b3e307c
6 changed files with 18 additions and 10 deletions

View File

@ -688,7 +688,7 @@ title_regex = re.compile("[^\w ]", flags=re.A)
based_regex = re.compile("based and (.{1,20}?)(-| )pilled", flags=re.I|re.A)
controversial_regex = re.compile('(/comments/.*?)"', flags=re.A)
controversial_regex = re.compile('["> ](https:\/\/old.reddit.com/r/[a-zA-Z0-9_]{3,20}\/comments\/.*?)["< ]', flags=re.A)
fishylinks_regex = re.compile("https?://\S+", flags=re.A)

View File

@ -119,7 +119,7 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False):
sanitized = strikethrough_regex.sub(r'<del>\1</del>', sanitized)
sanitized = sanitized.replace("\ufeff", "").replace("𒐪","").replace("<script","").replace("script>","").replace('','')
sanitized = sanitized.replace("\ufeff", "").replace("𒐪","").replace("<script","").replace("script>","").replace('','').replace('','')
if alert:
captured = []
@ -328,7 +328,7 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False):
if '#fortune' in sanitized:
sanitized = sanitized.replace('#fortune', '')
sanitized += '\n\n<p>' + random.choice(FORTUNE_REPLIES) + '</p>'
sanitized += '\n\n<p>' + choice(FORTUNE_REPLIES) + '</p>'
signal.alarm(0)

View File

@ -1236,6 +1236,7 @@ def submit_post(v, sub=None):
rev = post.url.replace('https://old.reddit.com/', '')
rev = f"* [unddit.com](https://unddit.com/{rev})\n"
else: rev = ''
newposturl = post.url
if newposturl.startswith('/'): newposturl = f"{SITE_FULL}{newposturl}"
body += f"Snapshots:\n\n{rev}* [archive.org](https://web.archive.org/{newposturl})\n* [archive.ph](https://archive.ph/?url={quote(newposturl)}&run=1) (click to archive)\n\n"

View File

@ -22,7 +22,7 @@
<style>
#chat-window {
max-height: 70vh;
max-height: calc(100vh - 220px);
overflow-y: scroll;
background-color: transparent !important;
}
@ -66,7 +66,7 @@
margin-top: 0.5rem;
}
#chat-window {
max-height: 66vh;
max-height: calc(100vh - 250px);
}
}
@ -91,6 +91,12 @@
overflow: hidden;
margin-left: 27px;
}
.quote {
display: inline-block !important;
padding: 0 0.5rem !important;
margin-bottom: 0.25rem !important;
}
</style>
</head>
@ -120,7 +126,7 @@
<div class="cdiv">
<span class="chat-message text-black text-break"></span>
<span class="text d-none"></span>
<button class="quote-btn btn d-inline-block py-0 mb-1" onclick="quote(this)"><i class="fas fa-reply" aria-hidden="true"></i></button>
<button class="quote btn" onclick="quote(this)"><i class="fas fa-reply" aria-hidden="true"></i></button>
</div>
</div>
</div>
@ -146,7 +152,7 @@
<div class="cdiv">
<span class="chat-message text-black text-break">{{text_html | safe}}</span>
<span class="d-none">{{m['text']}}</span>
<button class="btn d-inline-block py-0" onclick="quote(this)"><i class="fas fa-reply" aria-hidden="true"></i></button>
<button class="quote btn" onclick="quote(this)"><i class="fas fa-reply" aria-hidden="true"></i></button>
</div>
</div>
</div>
@ -178,7 +184,7 @@
<input id="site_name" type="hidden" value="{{SITE_NAME}}">
<input id="slurreplacer" type="hidden" value="{{v.slurreplacer}}">
<script data-cfasync="false" src="/chat.js?v=9"></script>
<script data-cfasync="false" src="/chat.js?v=10"></script>
<script>
box.scrollTo(0, box.scrollHeight)
@ -188,5 +194,6 @@
{% include "expanded_image_modal.html" %}
<script src="/static/assets/js/lozad.js?v=240"></script>
<script src="/static/assets/js/lite-youtube.js?v=240"></script>
</body>

View File

@ -94,4 +94,4 @@
</div>
</div>
<script src="/static/assets/js/emoji_modal.js?v=263"></script>
<script src="/static/assets/js/emoji_modal.js?v=264"></script>

View File

@ -4,7 +4,7 @@
{% set image=sub.sidebar_url %}
{% else %}
{% set path = "assets/images/" + SITE_NAME + "/sidebar" %}
{% set image = "/static/" + path + "/" + listdir('files/' + path)|random() + '?v=36' %}
{% set image = "/static/" + path + "/" + listdir('files/' + path)|random() + '?v=37' %}
{% endif %}
<img class="mb-4" alt="sidebar image" role="button" data-bs-toggle="modal" data-bs-target="#expandImageModal" onclick="expandDesktopImage('{{image}}')" loading="lazy" src="{{image}}" width=100%>