display channel topic

This commit is contained in:
TomatoCake 2024-08-18 07:50:06 +02:00
parent 302341bb99
commit 5d2d0267f9
4 changed files with 17 additions and 4 deletions

View file

@ -628,7 +628,13 @@ class Channel{
this.localuser.channelfocus=this;
const prom=this.infinite.delete();
history.pushState(null, null,"/channels/"+this.guild_id+"/"+this.snowflake);
document.getElementById("channelname").textContent="#"+this.name;
if (this.topic) {
document.getElementById("channelTopic").textContent=this.topic;
document.getElementById("channelTopic").removeAttribute("hidden");
} else document.getElementById("channelTopic").setAttribute("hidden","");
const loading=document.getElementById("loadingdiv");
Channel.regenLoadingMessages();
loading.classList.add("loading");

View file

@ -141,6 +141,7 @@ class Group extends Channel{
this.buildmessages();
history.pushState(null, null,"/channels/"+this.guild_id+"/"+this.snowflake);
document.getElementById("channelname").textContent="@"+this.name;
document.getElementById("channelTopic").setAttribute("hidden","");
document.getElementById("typebox").contentEditable=""+true;
}
messageCreate(messagep){

View file

@ -51,7 +51,9 @@
</div>
<div class="flexttb messageflex">
<div class="servertd channelnamediv">
<span id="mobileback" hidden></span><span id="channelname">Channel</span>
<span id="mobileback" hidden></span>
<span id="channelname">Channel name</span>
<span id="channelTopic" hidden>Channel topic</span>
</div>
<div id="channelw">
<div id="loadingdiv">

View file

@ -384,7 +384,7 @@ div {
max-height: 1.5in;
overflow-y: auto;
flex-grow:1;
}
#realbox{
padding: .05in;
@ -1798,7 +1798,7 @@ form div{
background: var(--textarea-bg);
span{
text-wrap:nowrap;
}
;
display: flex;
@ -1819,7 +1819,7 @@ form div{
border:solid .03in var(--black);
}
.copybutton{
width:.25in;
}
.copycontainer{
@ -1925,3 +1925,7 @@ form div{
border-radius:.1in;
height:17px;
}
#channelTopic {
margin-left: 10px;
}