Merge branch 'master' into mistletoe
This commit is contained in:
commit
a72b823f6d
31 changed files with 240 additions and 272 deletions
|
@ -1793,7 +1793,7 @@ a.badge:hover, a.badge:focus {
|
|||
}
|
||||
a.badge-secondary:hover, a.badge-secondary:focus {
|
||||
color: #fff;
|
||||
background-color: #545b62;
|
||||
background-color: var(--primary);
|
||||
}
|
||||
a.badge-secondary:focus, a.badge-secondary.focus {
|
||||
outline: 0;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
window.onload = function () {
|
||||
window.addEventListener("load",function(event) {
|
||||
var prevScrollpos = window.pageYOffset;
|
||||
window.onscroll = function () {
|
||||
var currentScrollPos = window.pageYOffset;
|
||||
|
@ -43,4 +43,4 @@ window.onload = function () {
|
|||
}
|
||||
prevScrollpos = currentScrollPos;
|
||||
}
|
||||
}
|
||||
})
|
|
@ -1,4 +1,4 @@
|
|||
window.onload = function() {
|
||||
window.addEventListener("load",function(event) {
|
||||
function eventasdf(value){
|
||||
var content_id = value.getAttributeNode("data-content-id").value;
|
||||
value.addEventListener("click", function(){jhkj(content_id)});
|
||||
|
@ -29,8 +29,9 @@ window.onload = function() {
|
|||
document.body.removeChild(popover_shit);
|
||||
}
|
||||
|
||||
|
||||
var usernames = document.querySelectorAll("a.user-name");
|
||||
usernames.forEach(eventasdf);
|
||||
|
||||
document.addEventListener("click", function(e){dfgh(e)});
|
||||
};
|
||||
});
|
|
@ -13,8 +13,8 @@ from .flags import CommentFlag
|
|||
from random import randint
|
||||
|
||||
site = environ.get("DOMAIN").strip()
|
||||
if site == 'pcmemes.net': cc = "splash mountain"
|
||||
else: cc = "country club"
|
||||
if site == 'pcmemes.net': cc = "SPLASH MOUNTAIN"
|
||||
else: cc = "COUNTRY CLUB"
|
||||
|
||||
class Comment(Base):
|
||||
|
||||
|
@ -305,7 +305,7 @@ class Comment(Base):
|
|||
return data
|
||||
|
||||
def realbody(self, v):
|
||||
if self.post and self.post.club and not (v and v.paid_dues): return f"<p>{cc} ONLY</p>"
|
||||
if self.post and self.post.club and not (v and v.paid_dues) and not (v and v.id == self.author_id): return f"<p>{cc} ONLY</p>"
|
||||
|
||||
body = self.body_html
|
||||
|
||||
|
@ -342,7 +342,7 @@ class Comment(Base):
|
|||
return body
|
||||
|
||||
def plainbody(self, v):
|
||||
if self.post and self.post.club and not (v and v.paid_dues): return f"<p>{cc} ONLY</p>"
|
||||
if self.post and self.post.club and not (v and v.paid_dues) and not (v and v.id == self.author_id): return f"<p>{cc} ONLY</p>"
|
||||
|
||||
body = self.body
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ from files.helpers.lazy import lazy
|
|||
from os import environ
|
||||
|
||||
site = environ.get("DOMAIN").strip()
|
||||
if site == 'pcmemes.net': cc = "splash mountain"
|
||||
else: cc = "country club"
|
||||
if site == 'pcmemes.net': cc = "SPLASH MOUNTAIN"
|
||||
else: cc = "COUNTRY CLUB"
|
||||
|
||||
class ModAction(Base):
|
||||
__tablename__ = "modactions"
|
||||
|
@ -82,7 +82,7 @@ class ModAction(Base):
|
|||
@lazy
|
||||
def string(self):
|
||||
|
||||
output = ACTIONTYPES[self.kind]["str"].format(self=self, cc=cc)
|
||||
output = ACTIONTYPES[self.kind]["str"].format(self=self)
|
||||
|
||||
if self.note: output += f" <i>({self.note})</i>"
|
||||
|
||||
|
@ -93,7 +93,7 @@ class ModAction(Base):
|
|||
def target_link(self):
|
||||
if self.target_user: return f'<a href="{self.target_user.url}">{self.target_user.username}</a>'
|
||||
elif self.target_post:
|
||||
if self.target_post.club: return f'<a href="{self.target_post.permalink}">{cc.upper()} ONLY</a>'
|
||||
if self.target_post.club: return f'<a href="{self.target_post.permalink}">{cc} ONLY</a>'
|
||||
return f'<a href="{self.target_post.permalink}">{self.target_post.title.replace("<","").replace(">","")}</a>'
|
||||
elif self.target_comment_id: return f'<a href="/comment/{self.target_comment_id}?context=9#context">comment</a>'
|
||||
|
||||
|
|
|
@ -1016,8 +1016,7 @@ def api_ban_comment(c_id, v):
|
|||
def api_unban_comment(c_id, v):
|
||||
|
||||
comment = g.db.query(Comment).filter_by(id=c_id).first()
|
||||
if not comment:
|
||||
abort(404)
|
||||
if not comment: abort(404)
|
||||
g.db.add(comment)
|
||||
|
||||
if comment.is_banned:
|
||||
|
@ -1037,26 +1036,20 @@ def api_unban_comment(c_id, v):
|
|||
|
||||
|
||||
@app.post("/distinguish_comment/<c_id>")
|
||||
@auth_required
|
||||
@admin_level_required(1)
|
||||
def admin_distinguish_comment(c_id, v):
|
||||
|
||||
if v.admin_level == 0: abort(403)
|
||||
|
||||
comment = get_comment(c_id, v=v)
|
||||
|
||||
if comment.author_id != v.id:
|
||||
abort(403)
|
||||
if comment.author_id != v.id: abort(403)
|
||||
|
||||
comment.distinguish_level = 0 if comment.distinguish_level else v.admin_level
|
||||
|
||||
g.db.add(comment)
|
||||
html=render_template(
|
||||
"comments.html",
|
||||
v=v,
|
||||
comments=[comment],
|
||||
)
|
||||
html = render_template("comments.html", v=v, comments=[comment])
|
||||
|
||||
html=str(BeautifulSoup(html, features="html.parser").find(id=f"comment-{comment.id}-only"))
|
||||
html = str(BeautifulSoup(html, features="html.parser").find(id=f"comment-{comment.id}-only"))
|
||||
|
||||
g.db.commit()
|
||||
|
||||
|
|
|
@ -646,17 +646,13 @@ def u_username_comments(username, v=None):
|
|||
if request.headers.get("Authorization"): return {"error": "That userpage is private"}
|
||||
else: return render_template("userpage_private.html", time=int(time.time()), u=u, v=v)
|
||||
|
||||
if hasattr(u, 'is_blocking') and u.is_blocking and (not v or v.admin_level < 2):
|
||||
if v and hasattr(u, 'is_blocking') and u.is_blocking:
|
||||
if request.headers.get("Authorization"): return {"error": f"You are blocking @{u.username}."}
|
||||
else: return render_template("userpage_blocking.html",
|
||||
u=u,
|
||||
v=v)
|
||||
else: return render_template("userpage_blocking.html", u=u, v=v)
|
||||
|
||||
if hasattr(u, 'is_blocked') and u.is_blocked and (not v or v.admin_level < 2):
|
||||
if v and v.admin_level < 2 and hasattr(u, 'is_blocked') and u.is_blocked:
|
||||
if request.headers.get("Authorization"): return {"error": "This person is blocking you."}
|
||||
else: return render_template("userpage_blocked.html",
|
||||
u=u,
|
||||
v=v)
|
||||
else: return render_template("userpage_blocked.html", u=u, v=v)
|
||||
|
||||
|
||||
page = int(request.values.get("page", "1"))
|
||||
|
|
|
@ -12,28 +12,27 @@
|
|||
|
||||
{% block fixedMobileBarJS %}
|
||||
<script>
|
||||
window.onload = function() {
|
||||
var prevScrollpos = window.pageYOffset;
|
||||
window.onscroll = function () {
|
||||
var currentScrollPos = window.pageYOffset;
|
||||
if (prevScrollpos > currentScrollPos) {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "48px";
|
||||
document.getElementById("navbar").classList.remove("shadow");
|
||||
window.addEventListener("load",function(event) {
|
||||
var prevScrollpos = window.pageYOffset;
|
||||
window.onscroll = function () {
|
||||
var currentScrollPos = window.pageYOffset;
|
||||
if (prevScrollpos > currentScrollPos) {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "48px";
|
||||
document.getElementById("navbar").classList.remove("shadow");
|
||||
}
|
||||
else if (currentScrollPos <= 125) {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "48px";
|
||||
document.getElementById("navbar").classList.remove("shadow");
|
||||
}
|
||||
else {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "-48px";
|
||||
document.getElementById("dropdownMenuSortBy").classList.remove('show');
|
||||
document.getElementById("dropdownMenuFrom").classList.remove('show');
|
||||
document.getElementById("navbar").classList.add("shadow");
|
||||
}
|
||||
prevScrollpos = currentScrollPos;
|
||||
}
|
||||
else if (currentScrollPos <= 125) {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "48px";
|
||||
document.getElementById("navbar").classList.remove("shadow");
|
||||
}
|
||||
else {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "-48px";
|
||||
document.getElementById("dropdownMenuSortBy").classList.remove('show');
|
||||
document.getElementById("dropdownMenuFrom").classList.remove('show');
|
||||
document.getElementById("navbar").classList.add("shadow");
|
||||
}
|
||||
prevScrollpos = currentScrollPos;
|
||||
}
|
||||
|
||||
};
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -40,28 +40,27 @@
|
|||
|
||||
{% block fixedMobileBarJS %}
|
||||
<script>
|
||||
window.onload = function() {
|
||||
var prevScrollpos = window.pageYOffset;
|
||||
window.onscroll = function () {
|
||||
var currentScrollPos = window.pageYOffset;
|
||||
if (prevScrollpos > currentScrollPos) {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "48px";
|
||||
document.getElementById("navbar").classList.remove("shadow");
|
||||
window.addEventListener("load",function(event) {
|
||||
var prevScrollpos = window.pageYOffset;
|
||||
window.onscroll = function () {
|
||||
var currentScrollPos = window.pageYOffset;
|
||||
if (prevScrollpos > currentScrollPos) {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "48px";
|
||||
document.getElementById("navbar").classList.remove("shadow");
|
||||
}
|
||||
else if (currentScrollPos <= 125) {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "48px";
|
||||
document.getElementById("navbar").classList.remove("shadow");
|
||||
}
|
||||
else {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "-48px";
|
||||
document.getElementById("dropdownMenuSortBy").classList.remove('show');
|
||||
document.getElementById("dropdownMenuFrom").classList.remove('show');
|
||||
document.getElementById("navbar").classList.add("shadow");
|
||||
}
|
||||
prevScrollpos = currentScrollPos;
|
||||
}
|
||||
else if (currentScrollPos <= 125) {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "48px";
|
||||
document.getElementById("navbar").classList.remove("shadow");
|
||||
}
|
||||
else {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "-48px";
|
||||
document.getElementById("dropdownMenuSortBy").classList.remove('show');
|
||||
document.getElementById("dropdownMenuFrom").classList.remove('show');
|
||||
document.getElementById("navbar").classList.add("shadow");
|
||||
}
|
||||
prevScrollpos = currentScrollPos;
|
||||
}
|
||||
|
||||
};
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=131"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=124">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=132"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=124">
|
||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=124">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=131"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=124">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=132"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=124">
|
||||
{% endif %}
|
||||
|
||||
</head>
|
||||
|
|
|
@ -1,30 +1,27 @@
|
|||
|
||||
<script>
|
||||
window.onload = function() {
|
||||
const banModal = function(link, id, name) {
|
||||
document.getElementById("banModalTitle").innerHTML = `Ban @${name}`;
|
||||
document.getElementById("ban-modal-link").value = link;
|
||||
document.getElementById("banUserButton").innerHTML = `Ban @${name}`;
|
||||
const banModal = function(link, id, name) {
|
||||
document.getElementById("banModalTitle").innerHTML = `Ban @${name}`;
|
||||
document.getElementById("ban-modal-link").value = link;
|
||||
document.getElementById("banUserButton").innerHTML = `Ban @${name}`;
|
||||
|
||||
document.getElementById("banUserButton").onclick = function() {
|
||||
let fd = new FormData(document.getElementById("banModalForm"));
|
||||
fd.append("formkey", formkey());
|
||||
document.getElementById("banUserButton").onclick = function() {
|
||||
let fd = new FormData(document.getElementById("banModalForm"));
|
||||
fd.append("formkey", formkey());
|
||||
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", `/ban_user/${id}?form`, true);
|
||||
xhr.withCredentials = true;
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", `/ban_user/${id}?form`, true);
|
||||
xhr.withCredentials = true;
|
||||
|
||||
xhr.onload = function(){
|
||||
var myToast = new bootstrap.Toast(document.getElementById('toast-post-success'));
|
||||
myToast.show();
|
||||
document.getElementById('toast-post-success-text').innerHTML = `@${name} banned`;
|
||||
}
|
||||
|
||||
xhr.send(fd);
|
||||
xhr.onload = function(){
|
||||
var myToast = new bootstrap.Toast(document.getElementById('toast-post-success'));
|
||||
myToast.show();
|
||||
document.getElementById('toast-post-success-text').innerHTML = `@${name} banned`;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
xhr.send(fd);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="banModal" tabindex="-1" role="dialog" aria-labelledby="banModalTitle" aria-hidden="true">
|
||||
|
|
|
@ -2,8 +2,7 @@
|
|||
<script defer src="/assets/js/twitter.js" charset="utf-8">
|
||||
</script>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
document.getElementById('twitter-widget-0').setAttribute('sandbox','')
|
||||
|
||||
};
|
||||
window.addEventListener("load",function(event) {
|
||||
document.getElementById('twitter-widget-0').setAttribute('sandbox','')
|
||||
};
|
||||
</script>
|
|
@ -2,8 +2,7 @@
|
|||
<script defer src="https://platform.twitter.com/widgets.js" charset="utf-8">
|
||||
</script>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
document.getElementById('twitter-widget-0').setAttribute('sandbox','')
|
||||
|
||||
};
|
||||
window.addEventListener("load",function(event) {
|
||||
document.getElementById('twitter-widget-0').setAttribute('sandbox','')
|
||||
});
|
||||
</script>
|
|
@ -84,7 +84,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<script defer src="/assets/js/emoji_modal.js?v=123"></script>
|
||||
<script defer src="/assets/js/emoji_modal.js?v=124"></script>
|
||||
|
||||
<style>
|
||||
a.emojitab {
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
{% extends "default.html" %}
|
||||
{% block content %}
|
||||
<script>
|
||||
window.onload = function() {
|
||||
function removeFollower(event, username) {
|
||||
post_toast('/remove_follow/' + username);
|
||||
let table = document.getElementById("followers-table");
|
||||
table.removeChild(event.target.parentElement.parentElement);
|
||||
}
|
||||
|
||||
};
|
||||
window.addEventListener("load",function(event) {
|
||||
function removeFollower(event, username) {
|
||||
post_toast('/remove_follow/' + username);
|
||||
let table = document.getElementById("followers-table");
|
||||
table.removeChild(event.target.parentElement.parentElement);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<pre>
|
||||
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
{% extends "default.html" %}
|
||||
{% block content %}
|
||||
<script>
|
||||
window.onload = function() {
|
||||
function removeFollower(event, username) {
|
||||
post_toast('/unfollow/' + username);
|
||||
let table = document.getElementById("followers-table");
|
||||
table.removeChild(event.target.parentElement.parentElement);
|
||||
}
|
||||
|
||||
};
|
||||
window.addEventListener("load",function(event) {
|
||||
function removeFollower(event, username) {
|
||||
post_toast('/unfollow/' + username);
|
||||
let table = document.getElementById("followers-table");
|
||||
table.removeChild(event.target.parentElement.parentElement);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<pre>
|
||||
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
{% block content %}
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=131"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=124">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=132"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=124">
|
||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=124">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=131"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=124">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=132"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=124">
|
||||
{% endif %}
|
||||
|
||||
<div class="row justify-content-around">
|
||||
|
|
|
@ -114,7 +114,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<title>2-Step Login - {{'SITE_NAME' | app_config}}</title>
|
||||
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=131"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=124">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=132"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=124">
|
||||
|
||||
</head>
|
||||
|
||||
|
|
|
@ -36,10 +36,10 @@
|
|||
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=131"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=124">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=132"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=124">
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=131"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=124">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=132"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=124">
|
||||
{% endif %}
|
||||
|
||||
<link href="/assets/css/fa.css?v=52" rel="stylesheet">
|
||||
|
@ -168,7 +168,7 @@
|
|||
{% block scripts %}
|
||||
{% endblock %}
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
<script>
|
||||
function formkey() {return '{{v.formkey}}';}
|
||||
|
|
|
@ -6,42 +6,41 @@
|
|||
|
||||
|
||||
<script>
|
||||
window.onload = function() {
|
||||
block_user=function() {
|
||||
window.addEventListener("load",function(event) {
|
||||
block_user=function() {
|
||||
|
||||
var exileForm = document.getElementById("exile-form");
|
||||
var exileForm = document.getElementById("exile-form");
|
||||
|
||||
var usernameField = document.getElementById("exile-username");
|
||||
var usernameField = document.getElementById("exile-username");
|
||||
|
||||
var isValidUsername = usernameField.checkValidity();
|
||||
var isValidUsername = usernameField.checkValidity();
|
||||
|
||||
username = usernameField.value;
|
||||
username = usernameField.value;
|
||||
|
||||
if (isValidUsername) {
|
||||
if (isValidUsername) {
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("post", "/settings/block");
|
||||
xhr.withCredentials=true;
|
||||
f=new FormData();
|
||||
f.append("username", username);
|
||||
f.append("formkey", formkey());
|
||||
xhr.onload=function(){
|
||||
if (xhr.status<300) {
|
||||
location.reload(true);
|
||||
}
|
||||
else {
|
||||
var myToast = new bootstrap.Toast(document.getElementById('toast-post-success'));
|
||||
myToast.hide();
|
||||
var myToast = new bootstrap.Toast(document.getElementById('toast-post-error'));
|
||||
myToast.show();
|
||||
document.getElementById("toast-error-message").textContent = "Error. Please try again later.";
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("post", "/settings/block");
|
||||
xhr.withCredentials=true;
|
||||
f=new FormData();
|
||||
f.append("username", username);
|
||||
f.append("formkey", formkey());
|
||||
xhr.onload=function(){
|
||||
if (xhr.status<300) {
|
||||
location.reload(true);
|
||||
}
|
||||
else {
|
||||
var myToast = new bootstrap.Toast(document.getElementById('toast-post-success'));
|
||||
myToast.hide();
|
||||
var myToast = new bootstrap.Toast(document.getElementById('toast-post-error'));
|
||||
myToast.show();
|
||||
document.getElementById("toast-error-message").textContent = "Error. Please try again later.";
|
||||
}
|
||||
}
|
||||
xhr.send(f)
|
||||
}
|
||||
xhr.send(f)
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="row">
|
||||
|
|
|
@ -38,15 +38,15 @@
|
|||
</div>
|
||||
{% if v.agendaposter %}
|
||||
<script>
|
||||
window.onload = function() {
|
||||
const flip = (e) => {
|
||||
e.preventDefault();
|
||||
document.getElementsByTagName("body")[0].setAttribute("style", "-moz-transform: scale(-1, -1);-o-transform: scale(-1, -1);-webkit-transform: scale(-1, -1);transform: scale(-1, -1);");
|
||||
};
|
||||
window.addEventListener("load",function(event) {
|
||||
const flip = (e) => {
|
||||
e.preventDefault();
|
||||
document.getElementsByTagName("body")[0].setAttribute("style", "-moz-transform: scale(-1, -1);-o-transform: scale(-1, -1);-webkit-transform: scale(-1, -1);transform: scale(-1, -1);");
|
||||
};
|
||||
|
||||
document.getElementById("submit-btn").onclick = flip;
|
||||
document.getElementById("submit-btn").onclick = flip;
|
||||
|
||||
};
|
||||
});
|
||||
</script>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
|
|
@ -5,16 +5,14 @@
|
|||
{% block content %}
|
||||
|
||||
<script>
|
||||
window.addEventListener('DOMContentLoaded', function() {
|
||||
document.getElementById('new_email').addEventListener('input', function () {
|
||||
document.getElementById("email-password").classList.remove("d-none");
|
||||
document.getElementById("email-password-label").classList.remove("d-none");
|
||||
document.getElementById("emailpasswordRequired").classList.remove("d-none");
|
||||
window.addEventListener("load",function(event) {
|
||||
document.getElementById('new_email').addEventListener('input', function () {
|
||||
document.getElementById("email-password").classList.remove("d-none");
|
||||
document.getElementById("email-password-label").classList.remove("d-none");
|
||||
document.getElementById("emailpasswordRequired").classList.remove("d-none");
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
const twoStepModal = new bootstrap.Modal(document.getElementById('2faModal'))
|
||||
const twoStepModal = new bootstrap.Modal(document.getElementById('2faModal'))
|
||||
</script>
|
||||
|
||||
<div class="row">
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600&display=swap" rel="stylesheet">
|
||||
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=131"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=124">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=132"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=124">
|
||||
|
||||
</head>
|
||||
|
||||
|
@ -146,7 +146,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
<script defer src="/assets/js/signup.js?v=63"></script>
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600&display=swap" rel="stylesheet">
|
||||
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=131"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=124">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=132"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=124">
|
||||
|
||||
</head>
|
||||
|
||||
|
@ -96,7 +96,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<input type="submit" value="{% if p.stickied %}Un-sticky{% else %}Pin{% endif %}">
|
||||
</form>
|
||||
{% endif %}
|
||||
{% if v.admin_level > 1 and v.id==p.author_id %}
|
||||
{% if v.admin_level > 0 and v.id==p.author_id %}
|
||||
<form action="/distinguish/{{p.id}}" method="post">
|
||||
<input type="hidden" name="formkey", value="{{v.formkey}}">
|
||||
<input type="submit" value="{% if p.distinguish_level %}Un-distinguish{% else %}Distinguish{% endif %}">
|
||||
|
|
|
@ -23,11 +23,11 @@
|
|||
{% block stylesheets %}
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=131"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=124">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=132"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=124">
|
||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=124">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=131">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=132">
|
||||
<link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=124">
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
@ -173,7 +173,7 @@
|
|||
</div>
|
||||
{% endblock %}
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/marked@3.0.8/lib/marked.min.js"></script>
|
||||
|
||||
<script defer src="/assets/js/submit.js?v=72"></script>
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
|
||||
{% if v %}
|
||||
<script>
|
||||
window.onload = function() {
|
||||
const TRANSFER_TAX = {% if v.patron or u.patron %}0{% else %}0.03{% endif %};
|
||||
|
||||
function updateTax(mobile=false) {
|
||||
|
@ -67,45 +66,39 @@ window.onload = function() {
|
|||
|
||||
setTimeout(_ => t.disabled = false, 2000);
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
{% if u.song %}
|
||||
<script>
|
||||
window.onload = function() {
|
||||
var audio = new Audio('/songs/{{u.id}}');
|
||||
audio.loop=true;
|
||||
window.addEventListener("load",function(event) {
|
||||
var audio = new Audio('/songs/{{u.id}}');
|
||||
audio.loop=true;
|
||||
|
||||
{% if not u.unmutable %}
|
||||
function pause() {
|
||||
audio.pause();
|
||||
document.getElementById("pause1").classList.toggle("d-none");
|
||||
document.getElementById("play1").classList.toggle("d-none");
|
||||
document.getElementById("pause2").classList.toggle("d-none");
|
||||
document.getElementById("play2").classList.toggle("d-none");
|
||||
}
|
||||
{% if not u.unmutable %}
|
||||
function pause() {
|
||||
audio.pause();
|
||||
document.getElementById("pause1").classList.toggle("d-none");
|
||||
document.getElementById("play1").classList.toggle("d-none");
|
||||
document.getElementById("pause2").classList.toggle("d-none");
|
||||
document.getElementById("play2").classList.toggle("d-none");
|
||||
}
|
||||
|
||||
function play() {
|
||||
audio.play();
|
||||
document.getElementById("pause1").classList.toggle("d-none");
|
||||
document.getElementById("play1").classList.toggle("d-none");
|
||||
document.getElementById("pause2").classList.toggle("d-none");
|
||||
document.getElementById("play2").classList.toggle("d-none");
|
||||
}
|
||||
{% endif %}
|
||||
function play() {
|
||||
audio.play();
|
||||
document.getElementById("pause1").classList.toggle("d-none");
|
||||
document.getElementById("play1").classList.toggle("d-none");
|
||||
document.getElementById("pause2").classList.toggle("d-none");
|
||||
document.getElementById("play2").classList.toggle("d-none");
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
window.addEventListener( 'load', function() {
|
||||
audio.play();
|
||||
document.getElementById('userpage').addEventListener('click', () => {
|
||||
if (audio.paused) audio.play();
|
||||
}, {once : true});
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
</script>
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
<div class="row d-none d-md-block">
|
||||
|
|
|
@ -4,28 +4,27 @@
|
|||
|
||||
{% block fixedMobileBarJS %}
|
||||
<script>
|
||||
window.onload = function() {
|
||||
var prevScrollpos = window.pageYOffset;
|
||||
window.onscroll = function () {
|
||||
var currentScrollPos = window.pageYOffset;
|
||||
if (prevScrollpos > currentScrollPos) {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "48px";
|
||||
document.getElementById("navbar").classList.remove("shadow");
|
||||
window.addEventListener("load",function(event) {
|
||||
var prevScrollpos = window.pageYOffset;
|
||||
window.onscroll = function () {
|
||||
var currentScrollPos = window.pageYOffset;
|
||||
if (prevScrollpos > currentScrollPos) {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "48px";
|
||||
document.getElementById("navbar").classList.remove("shadow");
|
||||
}
|
||||
else if (currentScrollPos <= 125) {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "48px";
|
||||
document.getElementById("navbar").classList.remove("shadow");
|
||||
}
|
||||
else {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "-48px";
|
||||
document.getElementById("dropdownMenuSortBy").classList.remove('show');
|
||||
document.getElementById("dropdownMenuFrom").classList.remove('show');
|
||||
document.getElementById("navbar").classList.add("shadow");
|
||||
}
|
||||
prevScrollpos = currentScrollPos;
|
||||
}
|
||||
else if (currentScrollPos <= 125) {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "48px";
|
||||
document.getElementById("navbar").classList.remove("shadow");
|
||||
}
|
||||
else {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "-48px";
|
||||
document.getElementById("dropdownMenuSortBy").classList.remove('show');
|
||||
document.getElementById("dropdownMenuFrom").classList.remove('show');
|
||||
document.getElementById("navbar").classList.add("shadow");
|
||||
}
|
||||
prevScrollpos = currentScrollPos;
|
||||
}
|
||||
|
||||
};
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -4,28 +4,27 @@
|
|||
|
||||
{% block fixedMobileBarJS %}
|
||||
<script>
|
||||
window.onload = function() {
|
||||
var prevScrollpos = window.pageYOffset;
|
||||
window.onscroll = function () {
|
||||
var currentScrollPos = window.pageYOffset;
|
||||
if (prevScrollpos > currentScrollPos) {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "48px";
|
||||
document.getElementById("navbar").classList.remove("shadow");
|
||||
window.addEventListener("load",function(event) {
|
||||
var prevScrollpos = window.pageYOffset;
|
||||
window.onscroll = function () {
|
||||
var currentScrollPos = window.pageYOffset;
|
||||
if (prevScrollpos > currentScrollPos) {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "48px";
|
||||
document.getElementById("navbar").classList.remove("shadow");
|
||||
}
|
||||
else if (currentScrollPos <= 125) {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "48px";
|
||||
document.getElementById("navbar").classList.remove("shadow");
|
||||
}
|
||||
else {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "-48px";
|
||||
document.getElementById("dropdownMenuSortBy").classList.remove('show');
|
||||
document.getElementById("dropdownMenuFrom").classList.remove('show');
|
||||
document.getElementById("navbar").classList.add("shadow");
|
||||
}
|
||||
prevScrollpos = currentScrollPos;
|
||||
}
|
||||
else if (currentScrollPos <= 125) {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "48px";
|
||||
document.getElementById("navbar").classList.remove("shadow");
|
||||
}
|
||||
else {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "-48px";
|
||||
document.getElementById("dropdownMenuSortBy").classList.remove('show');
|
||||
document.getElementById("dropdownMenuFrom").classList.remove('show');
|
||||
document.getElementById("navbar").classList.add("shadow");
|
||||
}
|
||||
prevScrollpos = currentScrollPos;
|
||||
}
|
||||
|
||||
};
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -4,28 +4,27 @@
|
|||
|
||||
{% block fixedMobileBarJS %}
|
||||
<script>
|
||||
window.onload = function() {
|
||||
var prevScrollpos = window.pageYOffset;
|
||||
window.onscroll = function () {
|
||||
var currentScrollPos = window.pageYOffset;
|
||||
if (prevScrollpos > currentScrollPos) {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "48px";
|
||||
document.getElementById("navbar").classList.remove("shadow");
|
||||
window.addEventListener("load",function(event) {
|
||||
var prevScrollpos = window.pageYOffset;
|
||||
window.onscroll = function () {
|
||||
var currentScrollPos = window.pageYOffset;
|
||||
if (prevScrollpos > currentScrollPos) {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "48px";
|
||||
document.getElementById("navbar").classList.remove("shadow");
|
||||
}
|
||||
else if (currentScrollPos <= 125) {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "48px";
|
||||
document.getElementById("navbar").classList.remove("shadow");
|
||||
}
|
||||
else {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "-48px";
|
||||
document.getElementById("dropdownMenuSortBy").classList.remove('show');
|
||||
document.getElementById("dropdownMenuFrom").classList.remove('show');
|
||||
document.getElementById("navbar").classList.add("shadow");
|
||||
}
|
||||
prevScrollpos = currentScrollPos;
|
||||
}
|
||||
else if (currentScrollPos <= 125) {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "48px";
|
||||
document.getElementById("navbar").classList.remove("shadow");
|
||||
}
|
||||
else {
|
||||
document.getElementById("fixed-bar-mobile").style.top = "-48px";
|
||||
document.getElementById("dropdownMenuSortBy").classList.remove('show');
|
||||
document.getElementById("dropdownMenuFrom").classList.remove('show');
|
||||
document.getElementById("navbar").classList.add("shadow");
|
||||
}
|
||||
prevScrollpos = currentScrollPos;
|
||||
}
|
||||
|
||||
};
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue