mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-19 09:45:28 +01:00
Merge branch 'bug/gravatar-logical' into 'dev'
Gravatar/Terminal Tweaks for v4.0.13 See merge request crafty-controller/crafty-4!465
This commit is contained in:
commit
476025a370
@ -157,7 +157,7 @@ class UsersController:
|
||||
base_data = HelperUsers.get_user(user_id)
|
||||
up_data = {}
|
||||
# check if we updated user email. If so we update gravatar
|
||||
if user_data["email"]:
|
||||
if user_data["email"] != base_data["email"]:
|
||||
pfp = self.helper.get_gravatar_image(user_data["email"])
|
||||
up_data["pfp"] = pfp
|
||||
# create sets to store role data
|
||||
|
@ -668,7 +668,7 @@ class Helpers:
|
||||
rating = "g"
|
||||
|
||||
# Get grvatar hash for profile pictures
|
||||
if not self.check_internet() or email != "default@example.com" or email != "":
|
||||
if self.check_internet() and email != "default@example.com" and email:
|
||||
gravatar = libgravatar.Gravatar(libgravatar.sanitize_email(email))
|
||||
url = gravatar.get_image(
|
||||
size=80,
|
||||
|
@ -196,8 +196,12 @@
|
||||
function new_line_handler(data) {
|
||||
$('#virt_console').append(data.line)
|
||||
const elem = document.getElementById('virt_console');
|
||||
if (!scrolled) {
|
||||
scrollConsole()
|
||||
try{
|
||||
if (!scrolled) {
|
||||
scrollConsole();
|
||||
}
|
||||
}catch{
|
||||
scrollConsole();
|
||||
}
|
||||
}
|
||||
|
||||
@ -298,7 +302,6 @@
|
||||
|
||||
const chkScroll = (e) => {
|
||||
const elem = $(e.currentTarget);
|
||||
|
||||
if (Math.round(elem[0].scrollHeight - elem.scrollTop()) <= elem.outerHeight()) {
|
||||
document.getElementById("to-bottom").style.visibility = "hidden";
|
||||
scrolled = false;
|
||||
@ -316,7 +319,7 @@
|
||||
}
|
||||
|
||||
$(document).ready(() => {
|
||||
var scrolled;
|
||||
var scrolled = false;
|
||||
$('#virt_console').on('scroll', chkScroll);
|
||||
$('#to-bottom').on('click', scrollToBottom)
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user