From f64c5f02f23c82c092d8ade1367ca7de559d9086 Mon Sep 17 00:00:00 2001 From: MathMan05 Date: Sat, 22 Jun 2024 11:53:06 -0500 Subject: [PATCH] Various fixes I forgot to push --- webpage/audio.js | 4 ++-- webpage/channel.js | 6 ++++-- webpage/dirrect.js | 2 +- webpage/embed.js | 10 ++++------ webpage/login.js | 4 ++-- webpage/style.css | 12 ++++++++---- 6 files changed, 21 insertions(+), 17 deletions(-) diff --git a/webpage/audio.js b/webpage/audio.js index 2300093..3a1f160 100644 --- a/webpage/audio.js +++ b/webpage/audio.js @@ -124,12 +124,12 @@ class voice{ return ["three","zip","square","beep"]; } static setNotificationSound(sound){ - let userinfos=JSON.parse(localStorage.getItem("userinfos")); + let userinfos=getBulkInfo(); userinfos.preferances.notisound=sound; localStorage.setItem("userinfos",JSON.stringify(userinfos)); } static getNotificationSound(){ - let userinfos=JSON.parse(localStorage.getItem("userinfos")); + let userinfos=getBulkInfo(); return userinfos.preferances.notisound; } } diff --git a/webpage/channel.js b/webpage/channel.js index 7fcc06a..675c8bb 100644 --- a/webpage/channel.js +++ b/webpage/channel.js @@ -514,8 +514,10 @@ class channel{ } else if (Notification.permission === "granted") { let noticontent=markdown(message.content).textContent; - noticontent||=message.embeds[0].json.title; - noticontent||=markdown(message.embeds[0].json.description).textContent; + if(message.embeds[0]){ + noticontent||=message.embeds[0].json.title; + noticontent||=markdown(message.embeds[0].json.description).textContent; + } noticontent||="Blank Message"; let imgurl=null; const images=message.getimages(); diff --git a/webpage/dirrect.js b/webpage/dirrect.js index 7bfee3e..2f0a2a3 100644 --- a/webpage/dirrect.js +++ b/webpage/dirrect.js @@ -139,7 +139,7 @@ class group extends channel{ } } notititle(message){ - return message.author.username; + return message.author.username; } unreads(){ const sentdms=document.getElementById("sentdms"); diff --git a/webpage/embed.js b/webpage/embed.js index 12e2074..09eff97 100644 --- a/webpage/embed.js +++ b/webpage/embed.js @@ -74,15 +74,13 @@ class embed{ b.textContent=thing.name; div.append(b); let p; - thing.inline??=false; p=document.createElement("p") p.textContent=thing.value; p.classList.add("embedp"); div.append(p); + + if(thing.inline){div.classList.add("inline");} embed.append(div); - if(thing.inline){ - div.classList.add("inline"); - } } } if(this.json.footer||this.json.timestamp){ @@ -100,8 +98,8 @@ class embed{ footer.append(span); } if(this.json?.footer&&this.json?.timestamp){ - const span=document.createElement("b"); - span.textContent="-"; + const span=document.createElement("span"); + span.textContent="•"; span.classList.add("spaceright"); footer.append(span); } diff --git a/webpage/login.js b/webpage/login.js index 8ef8ec4..ad40880 100644 --- a/webpage/login.js +++ b/webpage/login.js @@ -9,7 +9,7 @@ function setTheme(){ } setTheme(); function getBulkUsers(){ - const json=JSON.parse(localStorage.getItem("userinfos")); + const json=getBulkInfo() for(const thing in json.users){ json.users[thing]=new specialuser(json.users[thing]); } @@ -19,7 +19,7 @@ function getBulkInfo(){ return JSON.parse(localStorage.getItem("userinfos")); } function setDefaults(){ - let userinfos=JSON.parse(localStorage.getItem("userinfos")); + let userinfos=getBulkInfo() if(!userinfos){ localStorage.setItem("userinfos",JSON.stringify({ currentuser:null, diff --git a/webpage/style.css b/webpage/style.css index d295e4b..de29242 100644 --- a/webpage/style.css +++ b/webpage/style.css @@ -240,7 +240,9 @@ p { #channels { background-color: var(--channels-bg); - height: calc(100dvh - .9in); + height: 100dvh; + height: -webkit-fill-available; + height: -moz-available; width: 2.5in; overflow: auto; user-select: none; @@ -584,7 +586,8 @@ textarea { #userdock { background-color: var(--user-dock-bg); width: 100%; - position: relative; + position: absolute; + bottom: 0; } #settings { @@ -848,9 +851,10 @@ span { position:absolute; top:0px; transform: translate(0, -100%); - width:100%; + /* width:100%; */ box-shadow: .00in -.5in 1in #0000006b; border-radius: .05in .05in .0in.0in; + /* max-width: 100%; */ } .accountSwitcher tr{ transition: background .3s; @@ -964,4 +968,4 @@ span { } .spaceright{ margin-right:.1in; -} \ No newline at end of file +}