diff --git a/webpage/channel.js b/webpage/channel.js index 3cc8f74..d363007 100644 --- a/webpage/channel.js +++ b/webpage/channel.js @@ -109,17 +109,17 @@ class channel{ const decdiv=document.createElement("div"); const decoration=document.createElement("b"); - decoration.innerText="▼" + decoration.textContent="▼" decdiv.appendChild(decoration) const myhtml=document.createElement("p2"); - myhtml.innerText=this.name; + myhtml.textContent=this.name; decdiv.appendChild(myhtml); caps.appendChild(decdiv); const childrendiv=document.createElement("div"); if(admin){ const addchannel=document.createElement("span"); - addchannel.innerText="+"; + addchannel.textContent="+"; addchannel.classList.add("addchannel"); caps.appendChild(addchannel); addchannel.onclick=function(){ @@ -142,12 +142,12 @@ class channel{ childrendiv.classList.add("channels"); setTimeout(_=>{childrendiv.style.height = childrendiv.scrollHeight + 'px';},100) decdiv.onclick=function(){ - if(decoration.innerText==="▼"){// - decoration.innerText="▲"; + if(decoration.textContent==="▼"){// + decoration.textContent="▲"; //childrendiv.classList.add("colapsediv"); childrendiv.style.height = '0px'; }else{ - decoration.innerText="▼"; + decoration.textContent="▼"; //childrendiv.classList.remove("colapsediv") childrendiv.style.height = childrendiv.scrollHeight + 'px'; } @@ -162,20 +162,20 @@ class channel{ if(admin){this.coatDropDiv(div,this);} div.all=this; const myhtml=document.createElement("span"); - myhtml.innerText=this.name; + myhtml.textContent=this.name; if(this.type===0){ const decoration=document.createElement("b"); - decoration.innerText="#" + decoration.textContent="#" div.appendChild(decoration) decoration.classList.add("space"); }else if(this.type===2){// const decoration=document.createElement("b"); - decoration.innerText="🕪" + decoration.textContent="🕪" div.appendChild(decoration) decoration.classList.add("spacee"); }else if(this.type===5){// const decoration=document.createElement("b"); - decoration.innerText="📣" + decoration.textContent="📣" div.appendChild(decoration) decoration.classList.add("spacee"); }else{ @@ -344,7 +344,7 @@ class channel{ this.owner.owner.channelfocus=this.id; this.putmessages(); history.pushState(null, null,"/channels/"+this.guild_id+"/"+this.id); - document.getElementById("channelname").innerText="#"+this.name; + document.getElementById("channelname").textContent="#"+this.name; } putmessages(){ const out=this; diff --git a/webpage/contextmenu.js b/webpage/contextmenu.js index 3672a59..932fc0c 100644 --- a/webpage/contextmenu.js +++ b/webpage/contextmenu.js @@ -18,7 +18,7 @@ class contextmenu{ intext.disabled=!thing[4](); textb.button=intext; intext.classList.add("contextbutton") - intext.innerText=thing[0] + intext.textContent=thing[0] textb.appendChild(intext) console.log(thing) intext.onclick=thing[1].bind(addinfo,obj); diff --git a/webpage/dirrect.js b/webpage/dirrect.js index fa5be35..bf81ca4 100644 --- a/webpage/dirrect.js +++ b/webpage/dirrect.js @@ -81,7 +81,7 @@ class group extends channel{ const div=document.createElement("div") div.classList.add("channeleffects"); const myhtml=document.createElement("span"); - myhtml.innerText=this.name; + myhtml.textContent=this.name; div.appendChild(this.user.buildpfp()); div.appendChild(myhtml); div.myinfo=this; @@ -95,7 +95,7 @@ class group extends channel{ this.owner.owner.channelfocus=this.id; this.putmessages(); history.pushState(null, null,"/channels/"+this.guild_id+"/"+this.id); - document.getElementById("channelname").innerText="@"+this.name; + document.getElementById("channelname").textContent="@"+this.name; } messageCreate(messagep,focus){ const messagez=new cmessage(messagep.d,this); @@ -137,12 +137,12 @@ class group extends channel{ } } if(this.hasunreads){ - if(current){current.noti.innerText=this.mentions;return;} + if(current){current.noti.textContent=this.mentions;return;} const div=document.createElement("div"); div.classList.add("servernoti"); const noti=document.createElement("div"); noti.classList.add("unread","notiunread","pinged"); - noti.innerText=this.mentions; + noti.textContent=this.mentions; console.log(this.mentions) div.noti=noti; div.append(noti) diff --git a/webpage/embed.js b/webpage/embed.js index 3e50078..6c811db 100644 --- a/webpage/embed.js +++ b/webpage/embed.js @@ -32,16 +32,16 @@ class embed{ embed.classList.add("embed"); div.append(embed); const title=document.createElement("h3"); - title.innerText=this.json.title; + title.textContent=this.json.title; embed.append(title); embed.append(document.createElement("br")); for(const thing of this.json.fields){ const b=document.createElement("b"); - b.innerText=thing.name; + b.textContent=thing.name; embed.append(b); embed.append(document.createElement("br")); const p=document.createElement("p") - p.innerText=thing.value; + p.textContent=thing.value; p.classList.add("embedp") embed.append(p); } @@ -77,7 +77,7 @@ class embed{ const td=document.createElement("td"); const a=document.createElement("a"); a.href=this.json.url; - a.innerText=this.json.title; + a.textContent=this.json.title; td.append(a); trtop.append(td); } @@ -96,7 +96,7 @@ class embed{ const bottomtr=document.createElement("tr"); const td=document.createElement("td"); const span=document.createElement("span"); - span.innerText=this.json.description; + span.textContent=this.json.description; td.append(span); bottomtr.append(td); table.append(bottomtr) @@ -112,15 +112,15 @@ class embed{ div.classList.add("embed"); const providor=document.createElement("p"); providor.classList.add("provider"); - providor.innerText=this.json.provider.name; + providor.textContent=this.json.provider.name; div.append(providor); const a=document.createElement("a"); a.href=this.json.url; - a.innerText=this.json.title; + a.textContent=this.json.title; div.append(a); const description=document.createElement("p"); - description.innerText=this.json.description; + description.textContent=this.json.description; div.append(description); { diff --git a/webpage/fullscreen.js b/webpage/fullscreen.js index 1939b53..60cf256 100644 --- a/webpage/fullscreen.js +++ b/webpage/fullscreen.js @@ -54,7 +54,7 @@ class fullscreen{ div.appendChild(checkbox) const label=document.createElement("span"); checkbox.value=array[2]; - label.innerText=array[1]; + label.textContent=array[1]; div.appendChild(label); checkbox.addEventListener("change",array[3]); checkbox.type = "checkbox"; @@ -66,8 +66,8 @@ class fullscreen{ const input = document.createElement('button'); const label=document.createElement("span"); - input.innerText=array[2]; - label.innerText=array[1]; + input.textContent=array[2]; + label.textContent=array[1]; div.appendChild(label); div.appendChild(input) input.addEventListener("click",array[3]); @@ -79,7 +79,7 @@ class fullscreen{ const input=document.createElement("textarea"); input.value=array[2]; const label=document.createElement("span"); - label.innerText=array[1]; + label.textContent=array[1]; input.addEventListener("input",array[3]); div.appendChild(label); div.appendChild(document.createElement("br")); @@ -93,7 +93,7 @@ class fullscreen{ input.value=array[2]; input.type="text"; const label=document.createElement("span"); - label.innerText=array[1]; + label.textContent=array[1]; console.log(array[3]) input.addEventListener("input",array[3]); div.appendChild(label); @@ -106,7 +106,7 @@ class fullscreen{ const input=document.createElement("input"); input.type="file"; const label=document.createElement("span"); - label.innerText=array[1]; + label.textContent=array[1]; div.appendChild(label); div.appendChild(input); input.addEventListener("change",array[2]); @@ -115,13 +115,13 @@ class fullscreen{ } case "text":{ const span =document.createElement("span"); - span.innerText=array[1]; + span.textContent=array[1]; return span; } case "title":{ const span =document.createElement("span"); span.classList.add("title") - span.innerText=array[1]; + span.textContent=array[1]; return span; } case "radio":{ @@ -140,7 +140,7 @@ class fullscreen{ } }); const legend=document.createElement("legend"); - legend.innerText=array[1]; + legend.textContent=array[1]; fieldset.appendChild(legend); let i=0; for(const thing of array[2]){ @@ -157,7 +157,7 @@ class fullscreen{ label.appendChild(input); const span=document.createElement("span"); - span.innerText=thing; + span.textContent=thing; label.appendChild(span); div.appendChild(label); fieldset.appendChild(div); @@ -174,12 +174,12 @@ class fullscreen{ const label=document.createElement("label"); const select=document.createElement("select"); - label.innerText=array[1]; + label.textContent=array[1]; div.append(label); div.appendChild(select); for(const thing of array[2]){ const option = document.createElement("option"); - option.innerText=thing; + option.textContent=thing; select.appendChild(option); } select.selectedIndex=array[4]; @@ -201,7 +201,7 @@ class fullscreen{ for(const thing of array[1]){ const button=document.createElement("button"); - button.innerText=thing[0]; + button.textContent=thing[0]; td.appendChild(button); diff --git a/webpage/guild.js b/webpage/guild.js index 936183a..52f25b2 100644 --- a/webpage/guild.js +++ b/webpage/guild.js @@ -191,7 +191,7 @@ class guild{ for(const char of this.properties.name.split(" ")){ build+=char[0]; } - div.innerText=build; + div.textContent=build; div.classList.add("blankserver","servericon") divy.appendChild(div) div.onclick=()=>{ diff --git a/webpage/index.js b/webpage/index.js index 138b156..b8a1f6d 100644 --- a/webpage/index.js +++ b/webpage/index.js @@ -207,16 +207,16 @@ function buildprofile(x,y,user,type="author"){ userbody.classList.add("infosection"); div.appendChild(userbody); const usernamehtml=document.createElement("h2"); - usernamehtml.innerText=nickname; + usernamehtml.textContent=nickname; userbody.appendChild(usernamehtml); const discrimatorhtml=document.createElement("h3"); discrimatorhtml.classList.add("tag"); - discrimatorhtml.innerText=username+"#"+discriminator; + discrimatorhtml.textContent=username+"#"+discriminator; userbody.appendChild(discrimatorhtml) const pronounshtml=document.createElement("p"); - pronounshtml.innerText=pronouns; + pronounshtml.textContent=pronouns; pronounshtml.classList.add("pronouns"); userbody.appendChild(pronounshtml) @@ -360,10 +360,10 @@ function createunknown(fname,fsize,src){ if(src){ const a=document.createElement("a"); a.href=src; - a.innerText=fname; + a.textContent=fname; nametd.append(a); }else{ - nametd.innerText=fname; + nametd.textContent=fname; } nametd.classList.add("filename"); @@ -371,7 +371,7 @@ function createunknown(fname,fsize,src){ const sizetr=document.createElement("tr"); const size=document.createElement("td"); sizetr.append(size); - size.innerText="Size:"+filesizehuman(fsize); + size.textContent="Size:"+filesizehuman(fsize); size.classList.add("filesize"); div.appendChild(sizetr) return div; @@ -503,7 +503,7 @@ if(mobile){ document.getElementById("servertd").classList.add("collapse"); document.getElementById("servers").classList.add("collapse"); } - document.getElementById("mobileback").innerText="#"; + document.getElementById("mobileback").textContent="#"; document.getElementById("mobileback").onclick=function(){ document.getElementById("channels").parentNode.classList.remove("collapse"); document.getElementById("servertd").classList.remove("collapse"); diff --git a/webpage/localuser.js b/webpage/localuser.js index c3c3c4b..9a49cb8 100644 --- a/webpage/localuser.js +++ b/webpage/localuser.js @@ -239,9 +239,9 @@ class localuser{ this.buildservers(); } loaduser(){ - document.getElementById("username").innerText=this.user.username + document.getElementById("username").textContent=this.user.username document.getElementById("userpfp").src=this.user.getpfpsrc() - document.getElementById("status").innerText=this.status; + document.getElementById("status").textContent=this.status; } isAdmin(){ return this.lookingguild.isAdmin(); @@ -252,7 +252,7 @@ class localuser{ guild=this.guildids["@me"]; } this.lookingguild=guild; - document.getElementById("serverName").innerText=guild.properties.name; + document.getElementById("serverName").textContent=guild.properties.name; //console.log(this.guildids,id) document.getElementById("channels").innerHTML=""; document.getElementById("channels").appendChild(guild.getHTML()); @@ -262,7 +262,7 @@ class localuser{ const serverlist=document.getElementById("servers");// const div=document.createElement("div"); - div.innerText="⌂"; + div.textContent="⌂"; div.classList.add("home","servericon") div.all=this.guildids["@me"]; serverlist.appendChild(div) @@ -293,7 +293,7 @@ class localuser{ br.id="bottomseperator"; const div=document.createElement("div"); - div.innerText="+"; + div.textContent="+"; div.classList.add("addserver","servericon") serverlist.appendChild(div) div.onclick=_=>{ @@ -337,7 +337,7 @@ class localuser{ }).then(r=>r.json()).then(_=>{ console.log(_); if(_.message){ - error.innerText=_.message; + error.textContent=_.message; } }) } @@ -450,7 +450,7 @@ class localuser{ console.log(typingtext.classList); if(showing){ typingtext.classList.remove("hidden"); - document.getElementById("typingtext").innerText=build; + document.getElementById("typingtext").textContent=build; }else{ typingtext.classList.add("hidden"); } diff --git a/webpage/login.js b/webpage/login.js index c8517af..df99e21 100644 --- a/webpage/login.js +++ b/webpage/login.js @@ -89,26 +89,26 @@ const instancein=document.getElementById("instancein"); let timeout=0; async function checkInstance(e){ try{ - verify.innerText="Checking Instance"; + verify.textContent="Checking Instance"; instanceinfo=await setInstance(instancein.value); localStorage.setItem("instanceinfo",JSON.stringify(instanceinfo)); - verify.innerText="Instance is all good" + verify.textContent="Instance is all good" if(checkInstance.alt){checkInstance.alt();} setTimeout(_=>{ - console.log(verify.innerText) - verify.innerText=""; + console.log(verify.textContent) + verify.textContent=""; },3000); }catch(e){ console.log("catch") - verify.innerText="Invalid Instance, try again" + verify.textContent="Invalid Instance, try again" } } if(instancein){ console.log(instancein) instancein.addEventListener("keydown",e=>{ const verify=document.getElementById("verify"); - verify.innerText="Waiting to check Instance" + verify.textContent="Waiting to check Instance" clearTimeout(timeout); timeout=setTimeout(checkInstance,1000); }); @@ -179,7 +179,7 @@ async function check(e){ e.preventDefault(); let h=await login(e.srcElement[1].value,e.srcElement[2].value); - document.getElementById("wrong").innerText=h; + document.getElementById("wrong").textContent=h; console.log(h); } if(document.getElementById("form")){ diff --git a/webpage/markdown.js b/webpage/markdown.js index 2f3cab0..b92b894 100644 --- a/webpage/markdown.js +++ b/webpage/markdown.js @@ -118,7 +118,7 @@ function markdown(txt,keep=false){ } if(count!==3){ const samp=document.createElement("samp"); - samp.innerText=build; + samp.textContent=build; span.appendChild(samp); }else{ const pre=document.createElement("pre"); @@ -128,7 +128,7 @@ function markdown(txt,keep=false){ if(txt[i]==="\n"){ i++ } - pre.innerText=build; + pre.textContent=build; span.appendChild(pre); } i--; @@ -305,7 +305,7 @@ function markdown(txt,keep=false){ continue; } } - current.innerText+=txt[i]; + current.textContent+=txt[i]; } appendcurrent(); return span; diff --git a/webpage/message.js b/webpage/message.js index 84b6a55..7c56e03 100644 --- a/webpage/message.js +++ b/webpage/message.js @@ -82,7 +82,7 @@ class cmessage{ minipfp.src=author.getpfpsrc() profileclick(minipfp,author) - username.innerText=author.username; + username.textContent=author.username; profileclick(username,author) }); div.appendChild(replyline); @@ -124,17 +124,17 @@ class cmessage{ const username=document.createElement("span"); username.classList.add("username") profileclick(username,this.author); - username.innerText=this.author.username; + username.textContent=this.author.username; const userwrap=document.createElement("tr") userwrap.appendChild(username) if(this.author.bot){ const username=document.createElement("span"); username.classList.add("bot") - username.innerText="BOT"; + username.textContent="BOT"; userwrap.appendChild(username) } const time=document.createElement("span"); - time.innerText=" "+formatTime(new Date(this.timestamp)); + time.textContent=" "+formatTime(new Date(this.timestamp)); time.classList.add("timestamp") userwrap.appendChild(time); @@ -186,12 +186,12 @@ class cmessage{ const messaged=document.createElement("p"); div.txt=messaged; - messaged.innerText="welcome: "+this.author.username; + messaged.textContent="welcome: "+this.author.username; const messagedwrap=document.createElement("tr") messagedwrap.appendChild(messaged); const time=document.createElement("span"); - time.innerText=" "+formatTime(new Date(this.timestamp)); + time.textContent=" "+formatTime(new Date(this.timestamp)); time.classList.add("timestamp"); messagedwrap.append(time); diff --git a/webpage/register.js b/webpage/register.js index f2d541e..383fda6 100644 --- a/webpage/register.js +++ b/webpage/register.js @@ -8,7 +8,7 @@ async function registertry(e){ const email=elements[1].value; const username=elements[2].value; if(elements[3].value!==elements[4].value){ - document.getElementById("wrong").innerText="Passwords don't match"; + document.getElementById("wrong").textContent="Passwords don't match"; return; } const password=elements[3].value; @@ -31,14 +31,14 @@ async function registertry(e){ e.json().then(e=>{ if(!e.token){ console.log(e); - document.getElementById("wrong").innerText=e.errors[Object.keys(e.errors)[0]]._errors[0].message; + document.getElementById("wrong").textContent=e.errors[Object.keys(e.errors)[0]]._errors[0].message; }else{ localStorage.setItem("token",e.token); window.location.href = '/channels/@me'; } }) }) - //document.getElementById("wrong").innerText=h; + //document.getElementById("wrong").textContent=h; // console.log(h); } let TOSa=document.getElementById("TOSa"); @@ -50,7 +50,7 @@ async function tosLogic(){ TOSa=document.getElementById("TOSa"); TOSa.href=tosPage; }else{ - document.getElementById("TOSbox").innerText="This instance has no TOS, accept TOS anyways:"; + document.getElementById("TOSbox").textContent="This instance has no TOS, accept TOS anyways:"; TOSa=null; } console.log(tosPage); diff --git a/webpage/themes.css b/webpage/themes.css index fabeef6..5f5e9df 100644 --- a/webpage/themes.css +++ b/webpage/themes.css @@ -46,11 +46,9 @@ } .WHITE-theme { color-scheme: light; - --primary-text: #000; --primary-bg: #FFF; --black: #FFF; - --message-bg-hover: #dedee2; --typing-bg: #dad8d8; --timestamp-color: #929297; @@ -68,32 +66,25 @@ --filename: #47bbff; --mention-bg: #F00; --pronouns: #6a6a6d; - --profile-bg: #cacad8; --profile-info-bg: #bbbbce; - --server-border: #bebed3; --server-bg: #c0c0d4; - --reply-border: #b1b2bd; --reply-bg: #d4d6e9; --reply-text: #2e2e30; - --spoiler-hover: #b9b9b9; --spoiler-open-bg: #dadada; - --unknown-file-bg: #bdbdbd; --unknown-file-border: #adadad; - --login-border: #c3c0e0; --loading-bg: #b5b7cc; - --dialog-bg: #c1c8d6; --dialog-border: #b9b7db; - --scrollbar-track: #d5d1e2; --scrollbar-thumb: #b0afc0; --scrollbar-thumb-hover: #a5a5b8; + --embed: #cdccd1; } .Light-theme { color-scheme: light; @@ -144,4 +135,5 @@ --scrollbar-track: #d2cedf; --scrollbar-thumb: #bdbcca; --scrollbar-thumb-hover: #a7a7be; + --embed: #cdccd1; }