fgd
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 128 KiB |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 56 KiB |
Before Width: | Height: | Size: 211 KiB After Width: | Height: | Size: 210 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.5 KiB |
|
@ -10,11 +10,17 @@ function hide_image() {
|
|||
}
|
||||
|
||||
document.onpaste = function(event) {
|
||||
f=document.getElementById('file-upload');
|
||||
files = event.clipboardData.files
|
||||
filename = files[0].name.toLowerCase()
|
||||
|
||||
if (filename.endsWith(".jpg") || filename.endsWith(".jpeg") || filename.endsWith(".png") || filename.endsWith(".webp") || filename.endsWith(".gif"))
|
||||
{
|
||||
if (document.activeElement.id == 'post-text') {
|
||||
document.getElementById('file-upload-submit').files = files;
|
||||
document.getElementById('filename-show-submit').textContent = filename;
|
||||
}
|
||||
else {
|
||||
f=document.getElementById('file-upload');
|
||||
f.files = files;
|
||||
document.getElementById('filename-show').textContent = filename;
|
||||
document.getElementById('urlblock').classList.add('d-none');
|
||||
|
@ -22,6 +28,7 @@ document.onpaste = function(event) {
|
|||
fileReader.readAsDataURL(f.files[0]);
|
||||
fileReader.addEventListener("load", function () {document.getElementById('image-preview').setAttribute('src', this.result);});
|
||||
document.getElementById('file-upload').setAttribute('required', 'false');
|
||||
}
|
||||
checkForRequired();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -100,6 +100,8 @@ allowed_styles = ['color', 'background-color', 'font-weight', 'transform', '-web
|
|||
|
||||
def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False):
|
||||
|
||||
if sanitized.count(':') > 100: abort(418)
|
||||
|
||||
sanitized = markdown(sanitized)
|
||||
|
||||
sanitized = sanitized.replace("\ufeff", "").replace("𒐪","").replace("<script","").replace('','')
|
||||
|
|
|
@ -5,6 +5,7 @@ import time
|
|||
from files.__main__ import app, limiter
|
||||
|
||||
|
||||
|
||||
@app.errorhandler(400)
|
||||
def error_400(e):
|
||||
if request.headers.get("Authorization") or request.headers.get("xhr"): return {"error": "400 Bad Request"}, 400
|
||||
|
@ -20,7 +21,6 @@ def error_401(e):
|
|||
argval = quote(f"{path}?{qs}", safe='')
|
||||
return redirect(f"{SITE_FULL}/login?redirect={argval}")
|
||||
|
||||
|
||||
@app.errorhandler(403)
|
||||
def error_403(e):
|
||||
if request.headers.get("Authorization") or request.headers.get("xhr"): return {"error": "403 Forbidden"}, 403
|
||||
|
@ -32,17 +32,19 @@ def error_404(e):
|
|||
if request.headers.get("Authorization") or request.headers.get("xhr"): return {"error": "404 Not Found"}, 404
|
||||
else: return render_template('errors/404.html', err=True), 404
|
||||
|
||||
|
||||
@app.errorhandler(405)
|
||||
def error_405(e):
|
||||
if request.headers.get("Authorization") or request.headers.get("xhr"): return {"error": "405 Method Not Allowed"}, 405
|
||||
else: return render_template('errors/405.html', err=True), 405
|
||||
|
||||
|
||||
@app.errorhandler(413)
|
||||
def error_413(e):
|
||||
return {"error": "Max file size is 4 MB (8 MB for paypigs)"}, 413
|
||||
|
||||
@app.errorhandler(418)
|
||||
def error_418(e):
|
||||
return {"error": "Too many emojis!"}, 418
|
||||
|
||||
@app.errorhandler(429)
|
||||
def error_429(e):
|
||||
if request.headers.get("Authorization") or request.headers.get("xhr"): return {"error": "429 Too Many Requests"}, 429
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
<label class="custom-control-label" for="{{badge.id}}"></label>
|
||||
</div>
|
||||
</td>
|
||||
<td><label for="badge-{{badge.id}}"><img alt="{{badge.name}}" loading="lazy" src="/static/assets/images/badges/{{badge.id}}.webp?a=1010" width=64.16 height=70></label></td>
|
||||
<td><label for="badge-{{badge.id}}"><img alt="{{badge.name}}" loading="lazy" src="/static/assets/images/badges/{{badge.id}}.webp?a=1011" width=64.16 height=70></label></td>
|
||||
<td>{{badge.name}}</td>
|
||||
<td>{{badge.description}}</td>
|
||||
</tr>
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
<label class="custom-control-label" for="{{badge.id}}"></label>
|
||||
</div>
|
||||
</td>
|
||||
<td><label for="badge-{{badge.id}}"><img alt="{{badge.name}}" loading="lazy" src="/static/assets/images/badges/{{badge.id}}.webp?a=1010" width=64.16 height=70></label></td>
|
||||
<td><label for="badge-{{badge.id}}"><img alt="{{badge.name}}" loading="lazy" src="/static/assets/images/badges/{{badge.id}}.webp?a=1011" width=64.16 height=70></label></td>
|
||||
<td>{{badge.name}}</td>
|
||||
<td>{{badge.description}}</td>
|
||||
</tr>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<tr>
|
||||
<td style="font-weight:bold">{{loop.index}}</td>
|
||||
<td>{{badge.name}}</td>
|
||||
<td><img alt="{{badge.name}}" loading="lazy" src="/static/assets/images/badges/{{badge.id}}.webp?a=1010" width=45.83 height=50>
|
||||
<td><img alt="{{badge.name}}" loading="lazy" src="/static/assets/images/badges/{{badge.id}}.webp?a=1011" width=45.83 height=50>
|
||||
<td>{{badge.description}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<td style="font-weight:bold;">{{loop.index}}</td>
|
||||
<td><a style="color:#{{u.namecolor}}; font-weight:bold;" href="/@{{u.username}}"><img alt="@{{u.username}}'s profile picture" loading="lazy" src="{{u.profile_url}}" class="pp20"><span {% if u.patron %}class="patron" style="background-color:#{{u.namecolor}}"{% endif %}>{{u.username}}</span></a></td>
|
||||
|
||||
<td><img alt="2{{u.patron}}" loading="lazy" width=29.33 height=32 src="/static/assets/images/badges/2{{u.patron}}.webp?a=1010"></td>
|
||||
<td><img alt="2{{u.patron}}" loading="lazy" width=29.33 height=32 src="/static/assets/images/badges/2{{u.patron}}.webp?a=1011"></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
|
|
@ -258,7 +258,7 @@
|
|||
|
||||
<script src="/static/assets/js/marked.js?a=240"></script>
|
||||
<script src="/static/assets/js/formatting.js?a=240"></script>
|
||||
<script src="/static/assets/js/submit.js?a=242"></script>
|
||||
<script src="/static/assets/js/submit.js?a=243"></script>
|
||||
{% include "emoji_modal.html" %}
|
||||
{% include "gif_modal.html" %}
|
||||
|
||||
|
|