Merge pull request #47 from DEVTomatoCake/jank/channel-topic
display channel topic
This commit is contained in:
commit
22fecfe6ad
4 changed files with 19 additions and 4 deletions
|
@ -11,6 +11,7 @@ import { Role } from "./role.js";
|
||||||
import {InfiniteScroller} from "./infiniteScroller.js";
|
import {InfiniteScroller} from "./infiniteScroller.js";
|
||||||
import { SnowFlake } from "./snowflake.js";
|
import { SnowFlake } from "./snowflake.js";
|
||||||
import { channeljson, messagejson, readyjson } from "./jsontypes.js";
|
import { channeljson, messagejson, readyjson } from "./jsontypes.js";
|
||||||
|
import { MarkDown } from "./markdown.js";
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface NotificationOptions {
|
interface NotificationOptions {
|
||||||
|
@ -656,7 +657,13 @@ class Channel{
|
||||||
this.localuser.channelfocus=this;
|
this.localuser.channelfocus=this;
|
||||||
const prom=this.infinite.delete();
|
const prom=this.infinite.delete();
|
||||||
history.pushState(null, "","/channels/"+this.guild_id+"/"+this.snowflake);
|
history.pushState(null, "","/channels/"+this.guild_id+"/"+this.snowflake);
|
||||||
|
|
||||||
(document.getElementById("channelname") as HTMLSpanElement).textContent="#"+this.name;
|
(document.getElementById("channelname") as HTMLSpanElement).textContent="#"+this.name;
|
||||||
|
if (this.topic) {
|
||||||
|
document.getElementById("channelTopic").innerHTML=new MarkDown(this.topic, this).makeHTML().innerHTML;
|
||||||
|
document.getElementById("channelTopic").removeAttribute("hidden");
|
||||||
|
} else document.getElementById("channelTopic").setAttribute("hidden","");
|
||||||
|
|
||||||
const loading=document.getElementById("loadingdiv") as HTMLDivElement;
|
const loading=document.getElementById("loadingdiv") as HTMLDivElement;
|
||||||
Channel.regenLoadingMessages();
|
Channel.regenLoadingMessages();
|
||||||
loading.classList.add("loading");
|
loading.classList.add("loading");
|
||||||
|
|
|
@ -142,6 +142,7 @@ class Group extends Channel{
|
||||||
this.buildmessages();
|
this.buildmessages();
|
||||||
history.pushState(null, null,"/channels/"+this.guild_id+"/"+this.snowflake);
|
history.pushState(null, null,"/channels/"+this.guild_id+"/"+this.snowflake);
|
||||||
document.getElementById("channelname").textContent="@"+this.name;
|
document.getElementById("channelname").textContent="@"+this.name;
|
||||||
|
document.getElementById("channelTopic").setAttribute("hidden","");
|
||||||
document.getElementById("typebox").contentEditable=""+true;
|
document.getElementById("typebox").contentEditable=""+true;
|
||||||
}
|
}
|
||||||
messageCreate(messagep){
|
messageCreate(messagep){
|
||||||
|
|
|
@ -51,7 +51,9 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="flexttb messageflex">
|
<div class="flexttb messageflex">
|
||||||
<div class="servertd channelnamediv">
|
<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>
|
||||||
<div id="channelw">
|
<div id="channelw">
|
||||||
<div id="loadingdiv">
|
<div id="loadingdiv">
|
||||||
|
|
|
@ -385,7 +385,7 @@ div {
|
||||||
max-height: 1.5in;
|
max-height: 1.5in;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
flex-grow:1;
|
flex-grow:1;
|
||||||
|
|
||||||
}
|
}
|
||||||
#realbox{
|
#realbox{
|
||||||
padding: .05in;
|
padding: .05in;
|
||||||
|
@ -1799,7 +1799,7 @@ form div{
|
||||||
background: var(--textarea-bg);
|
background: var(--textarea-bg);
|
||||||
span{
|
span{
|
||||||
text-wrap:nowrap;
|
text-wrap:nowrap;
|
||||||
|
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -1820,7 +1820,7 @@ form div{
|
||||||
border:solid .03in var(--black);
|
border:solid .03in var(--black);
|
||||||
}
|
}
|
||||||
.copybutton{
|
.copybutton{
|
||||||
|
|
||||||
width:.25in;
|
width:.25in;
|
||||||
}
|
}
|
||||||
.copycontainer{
|
.copycontainer{
|
||||||
|
@ -1926,6 +1926,11 @@ form div{
|
||||||
border-radius:.1in;
|
border-radius:.1in;
|
||||||
height:17px;
|
height:17px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#channelTopic {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
.badge{
|
.badge{
|
||||||
display:flex;
|
display:flex;
|
||||||
color:white;
|
color:white;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue