czx
This commit is contained in:
parent
8c1ac90b10
commit
0677106b21
10 changed files with 24 additions and 31 deletions
|
@ -48,30 +48,21 @@ function popovertrigger() {
|
|||
popovertrigger()
|
||||
|
||||
function popclick(author) {
|
||||
let popfix = document.getElementById("popover-fix")
|
||||
if (popfix) document.body.removeChild(popfix);
|
||||
|
||||
var popover_old = document.getElementsByClassName("popover")[0];
|
||||
var popover_new = document.createElement("DIV");
|
||||
popover_new.innerHTML = popover_old.outerHTML;
|
||||
popover_new.id = "popover-fix";
|
||||
popover = document.getElementsByClassName("popover")[0]
|
||||
|
||||
let badges = ''
|
||||
for (const x of author["badges"]) {
|
||||
badges += `<img alt="badge" width="32" loading="lazy" src="${x}">`
|
||||
}
|
||||
popover_new.getElementsByClassName('pop-banner')[0].src = author["bannerurl"]
|
||||
popover_new.getElementsByClassName('pop-picture')[0].src = author["profile_url"]
|
||||
popover_new.getElementsByClassName('pop-username')[0].innerHTML = author["username"]
|
||||
popover_new.getElementsByClassName('pop-bio')[0].innerHTML = author["bio_html"]
|
||||
popover_new.getElementsByClassName('pop-postcount')[0].innerHTML = author["post_count"]
|
||||
popover_new.getElementsByClassName('pop-commentcount')[0].innerHTML = author["comment_count"]
|
||||
popover_new.getElementsByClassName('pop-coins')[0].innerHTML = author["coins"]
|
||||
popover_new.getElementsByClassName('pop-viewmore')[0].href = author["url"]
|
||||
popover_new.getElementsByClassName('pop-badges')[0].innerHTML = badges
|
||||
|
||||
document.body.appendChild(popover_new);
|
||||
document.body.removeChild(popover_old);
|
||||
popover.getElementsByClassName('pop-banner')[0].src = author["bannerurl"]
|
||||
popover.getElementsByClassName('pop-picture')[0].src = author["profile_url"]
|
||||
popover.getElementsByClassName('pop-username')[0].innerHTML = author["username"]
|
||||
popover.getElementsByClassName('pop-bio')[0].innerHTML = author["bio_html"]
|
||||
popover.getElementsByClassName('pop-postcount')[0].innerHTML = author["post_count"]
|
||||
popover.getElementsByClassName('pop-commentcount')[0].innerHTML = author["comment_count"]
|
||||
popover.getElementsByClassName('pop-coins')[0].innerHTML = author["coins"]
|
||||
popover.getElementsByClassName('pop-viewmore')[0].href = author["url"]
|
||||
popover.getElementsByClassName('pop-badges')[0].innerHTML = badges
|
||||
}
|
||||
|
||||
document.addEventListener("click", function(){
|
||||
|
|
|
@ -34,7 +34,7 @@ class OauthApp(Base):
|
|||
|
||||
@property
|
||||
@lazy
|
||||
def permalink(self): return f"/admin/app/{self.id}"
|
||||
def permalink(self): return f"{SITE_FULL}/admin/app/{self.id}"
|
||||
|
||||
@lazy
|
||||
def idlist(self, page=1):
|
||||
|
|
|
@ -233,10 +233,10 @@ class Comment(Base):
|
|||
@property
|
||||
@lazy
|
||||
def permalink(self):
|
||||
if self.post and self.post.club: return f"/comment/{self.id}?context=9#context"
|
||||
if self.post and self.post.club: return f"{SITE_FULL}/comment/{self.id}?context=9#context"
|
||||
|
||||
if self.post: return f"{self.post.permalink}/{self.id}?context=9#context"
|
||||
else: return f"/comment/{self.id}?context=9#context"
|
||||
if self.post: return f"{SITE_FULL}{self.post.permalink}/{self.id}?context=9#context"
|
||||
else: return f"{SITE_FULL}/comment/{self.id}?context=9#context"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
|
|
|
@ -108,7 +108,7 @@ class ModAction(Base):
|
|||
@property
|
||||
@lazy
|
||||
def permalink(self):
|
||||
return f"/log/{self.id}"
|
||||
return f"{SITE_FULL}/log/{self.id}"
|
||||
|
||||
ACTIONTYPES={
|
||||
"grant_awards": {
|
||||
|
|
|
@ -197,7 +197,7 @@ class Submission(Base):
|
|||
@property
|
||||
@lazy
|
||||
def permalink(self):
|
||||
if self.club: return f"/post/{self.id}"
|
||||
if self.club: return f"{SITE_FULL}/post/{self.id}"
|
||||
|
||||
output = self.title.lower()
|
||||
|
||||
|
@ -210,7 +210,7 @@ class Submission(Base):
|
|||
|
||||
if not output: output = '-'
|
||||
|
||||
return f"/post/{self.id}/{output}"
|
||||
return f"{SITE_FULL}/post/{self.id}/{output}"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
|
|
|
@ -313,7 +313,7 @@ class User(Base):
|
|||
@property
|
||||
@lazy
|
||||
def url(self):
|
||||
return f"/@{self.username}"
|
||||
return f"{SITE_FULL}/@{self.username}"
|
||||
|
||||
def __repr__(self):
|
||||
return f"<User(id={self.id})>"
|
||||
|
|
|
@ -61,5 +61,7 @@ def error_500(e):
|
|||
def allow_nsfw():
|
||||
session["over_18"] = int(time.time()) + 3600
|
||||
redir = request.values.get("redir")
|
||||
if redir and redir.startswith(SITE_FULL) or redir.startswith('/'): return redirect(redir)
|
||||
if redir:
|
||||
if redir.startswith(SITE_FULL): return redirect(redir)
|
||||
if redir.startswith('/'): return redirect(f'{SITE_FULL}{redir}')
|
||||
return redirect(f'{SITE_FULL}/')
|
|
@ -666,7 +666,7 @@ def u_username(username, v=None):
|
|||
|
||||
|
||||
if username != u.username:
|
||||
return redirect(request.full_path.replace(username, u.username))
|
||||
return redirect(SITE_FULL + request.full_path.replace(username, u.username))
|
||||
|
||||
if u.reserved:
|
||||
if request.headers.get("Authorization") or request.headers.get("xhr"): return {"error": f"That username is reserved for: {u.reserved}"}
|
||||
|
|
|
@ -908,7 +908,7 @@
|
|||
|
||||
{% include "expanded_image_modal.html" %}
|
||||
|
||||
<script src="/static/assets/js/comments+submission_listing.js?a=220"></script>
|
||||
<script src="/static/assets/js/comments+submission_listing.js?a=221"></script>
|
||||
<script src="/static/assets/js/comments.js?a=221"></script>
|
||||
|
||||
<script>
|
||||
|
|
|
@ -694,5 +694,5 @@
|
|||
</style>
|
||||
|
||||
<script src="/static/assets/js/clipboard.js?a=220"></script>
|
||||
<script src="/static/assets/js/comments+submission_listing.js?a=220"></script>
|
||||
<script src="/static/assets/js/comments+submission_listing.js?a=221"></script>
|
||||
<script src="/static/assets/js/submission_listing.js?a=220"></script>
|
Loading…
Add table
Add a link
Reference in a new issue