forked from rDrama/rDrama
1
0
Fork 0

Merge branch 'frost' of https://github.com/Aevann1/rDrama into frost

master
Aevann1 2022-08-24 23:20:11 +00:00
commit b19650c0c0
2 changed files with 15 additions and 1 deletions

View File

@ -19,7 +19,8 @@ def error_401(e):
path = request.path
qs = urlencode(dict(request.values))
argval = quote(f"{path}?{qs}", safe='')
return redirect(f"/signup?redirect={argval}")
if session.get("history"): return redirect(f"/login?redirect={argval}")
else: return redirect(f"/signup?redirect={argval}")
@app.errorhandler(406)
def error_406(e):

View File

@ -945,4 +945,17 @@
<div id="viewmore-{{offset}}"><button id="viewbtn" class="btn btn-primary" onclick="viewmore({{pid}},'{{sort}}',{{offset}},{{ids}})">VIEW MORE COMMENTS</a></div>
{% endif %}
{% if not ajax and v and v.theme == 'midnight' %}
<script>
const markTemplate = (name) => {
return `<svg xmlns='http://www.w3.org/2000/svg' version='1.1' width='50px' height='50px'><text transform='translate(10, 50) rotate(-45)' fill='rgba(45,45,45,0.1)' font-size='20'>${name}</text></svg>`;
};
const base64Mark = btoa(markTemplate("{{v.id}}"));
var style = document.createElement('style');
style.innerHTML = `#post-text,.comment-section > .comment{background-image:url("data:image/svg+xml;base64,${base64Mark}")}`;
document.getElementsByTagName('head')[0].appendChild(style);
</script>
{% endif %}
</body>