g3.0
This commit is contained in:
1 parent
0218bf6064
commit
6e483c1f3e
6 files changed
+568
-8
No files matched your search
+17
-1
@@ -43,6 +43,8 @@ function showOverlay(id) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
|
||||
return overlay;
|
||||
}
|
||||
function _onOverlayDestroy(elm) {
|
||||
const ori_elm = getId(elm.getAttribute("name"));
|
||||
@@ -367,6 +369,20 @@ async function setUserData(couchDB) {
|
||||
updateAllProfiles(res);
|
||||
return true;
|
||||
}
|
||||
async function updateUserData(couchDB, user) {
|
||||
const res = await couchDB.get("users");
|
||||
if (res == null) return {"type":"error", "message": "CouchDB failed"};
|
||||
|
||||
const name = user["name"];
|
||||
if (!name) return {"type":"error", "message": "Incorrect UserData was presented"};
|
||||
|
||||
const u = { ...user };
|
||||
delete u["name"];
|
||||
res[name] = u;
|
||||
|
||||
return await couchDB.set("users", res);
|
||||
}
|
||||
|
||||
|
||||
function updateAllProfiles(user) {
|
||||
const profiles = document.getElementsByClassName("profile");
|
||||
@@ -417,7 +433,7 @@ function _showProfile(user) {
|
||||
document.body.appendChild(elm);
|
||||
}
|
||||
elm.innerHTML = `
|
||||
<div style="height: 40px; margin-top: 5px; margin-right: 50px;"><b>Profil-Übersicht</b></div>
|
||||
<div class="overlay_title">Profil-Übersicht</div>
|
||||
<span style="display: inline-block; width: 100%; text-align: center;">
|
||||
<div style="border-radius: 50%; width: 80px; height: 80px; display: inline-block; margin-bottom: 10px; background-color: var(--accent_color_bg); background-size: 80px 80px; background-image: url('${user.avatar}');"></div>
|
||||
<br>
|
||||
|
||||
Reference in new issue
Block a user