mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00: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)
|
base_data = HelperUsers.get_user(user_id)
|
||||||
up_data = {}
|
up_data = {}
|
||||||
# check if we updated user email. If so we update gravatar
|
# 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"])
|
pfp = self.helper.get_gravatar_image(user_data["email"])
|
||||||
up_data["pfp"] = pfp
|
up_data["pfp"] = pfp
|
||||||
# create sets to store role data
|
# create sets to store role data
|
||||||
|
@ -668,7 +668,7 @@ class Helpers:
|
|||||||
rating = "g"
|
rating = "g"
|
||||||
|
|
||||||
# Get grvatar hash for profile pictures
|
# 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))
|
gravatar = libgravatar.Gravatar(libgravatar.sanitize_email(email))
|
||||||
url = gravatar.get_image(
|
url = gravatar.get_image(
|
||||||
size=80,
|
size=80,
|
||||||
|
@ -196,8 +196,12 @@
|
|||||||
function new_line_handler(data) {
|
function new_line_handler(data) {
|
||||||
$('#virt_console').append(data.line)
|
$('#virt_console').append(data.line)
|
||||||
const elem = document.getElementById('virt_console');
|
const elem = document.getElementById('virt_console');
|
||||||
if (!scrolled) {
|
try{
|
||||||
scrollConsole()
|
if (!scrolled) {
|
||||||
|
scrollConsole();
|
||||||
|
}
|
||||||
|
}catch{
|
||||||
|
scrollConsole();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,7 +302,6 @@
|
|||||||
|
|
||||||
const chkScroll = (e) => {
|
const chkScroll = (e) => {
|
||||||
const elem = $(e.currentTarget);
|
const elem = $(e.currentTarget);
|
||||||
|
|
||||||
if (Math.round(elem[0].scrollHeight - elem.scrollTop()) <= elem.outerHeight()) {
|
if (Math.round(elem[0].scrollHeight - elem.scrollTop()) <= elem.outerHeight()) {
|
||||||
document.getElementById("to-bottom").style.visibility = "hidden";
|
document.getElementById("to-bottom").style.visibility = "hidden";
|
||||||
scrolled = false;
|
scrolled = false;
|
||||||
@ -316,7 +319,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(() => {
|
$(document).ready(() => {
|
||||||
var scrolled;
|
var scrolled = false;
|
||||||
$('#virt_console').on('scroll', chkScroll);
|
$('#virt_console').on('scroll', chkScroll);
|
||||||
$('#to-bottom').on('click', scrollToBottom)
|
$('#to-bottom').on('click', scrollToBottom)
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user