Cleaning up of index with some fixes
This commit is contained in:
@@ -127,7 +127,7 @@ let replyingto=null;
|
||||
function createchannels(fincall){
|
||||
let name="";
|
||||
let category=0;
|
||||
console.log(fincall)
|
||||
console.log(fincall);
|
||||
channelselect=new fullscreen(
|
||||
["vdiv",
|
||||
["radio","select channel type",
|
||||
@@ -153,7 +153,7 @@ function createchannels(fincall){
|
||||
function createcategory(fincall){
|
||||
let name="";
|
||||
let category=4;
|
||||
console.log(fincall)
|
||||
console.log(fincall);
|
||||
channelselect=new fullscreen(
|
||||
["vdiv",
|
||||
["textbox","Name of category","",function(){
|
||||
@@ -235,7 +235,7 @@ function buildprofile(x,y,user,type="author"){
|
||||
function profileclick(obj,author){
|
||||
obj.onclick=function(e){
|
||||
console.log(e.clientX,e.clientY,author);
|
||||
buildprofile(e.clientX,e.clientY,author)
|
||||
buildprofile(e.clientX,e.clientY,author);
|
||||
e.stopPropagation();
|
||||
}
|
||||
}
|
||||
@@ -263,7 +263,7 @@ async function enter(event){
|
||||
}
|
||||
replyingto=false;
|
||||
thisuser.channelfocus.sendMessage(typebox.value,{
|
||||
attatchmenets:images,
|
||||
attachments:images,
|
||||
replyingto:replying,
|
||||
})
|
||||
}
|
||||
@@ -356,79 +356,11 @@ document.addEventListener('paste', async (e) => {
|
||||
console.log(file.type)
|
||||
});
|
||||
});
|
||||
let usersettings
|
||||
function genusersettings(){
|
||||
const hypothetcialprofie=document.createElement("div");
|
||||
let file=null;
|
||||
let newprouns=null;
|
||||
let newbio=null;
|
||||
let hypouser=new user(thisuser.user,true);
|
||||
function regen(){
|
||||
hypothetcialprofie.textContent="";
|
||||
const hypoprofile=buildprofile(-1,-1,hypouser);
|
||||
|
||||
hypothetcialprofie.appendChild(hypoprofile)
|
||||
console.log(hypothetcialprofie,hypoprofile)
|
||||
}
|
||||
regen();
|
||||
usersettings=new fullscreen(
|
||||
["hdiv",
|
||||
["vdiv",
|
||||
["fileupload","upload pfp:",function(e){
|
||||
console.log(this.files[0])
|
||||
file=this.files[0];
|
||||
const blob = URL.createObjectURL(this.files[0]);
|
||||
hypouser.avatar = blob;
|
||||
hypouser.hypotheticalpfp=true;
|
||||
regen();
|
||||
}],
|
||||
["textbox","Pronouns:",thisuser.user.pronouns,function(e){
|
||||
console.log(this.value);
|
||||
hypouser.pronouns=this.value;
|
||||
newprouns=this.value;
|
||||
regen();
|
||||
}],
|
||||
["mdbox","Bio:",thisuser.user.bio,function(e){
|
||||
console.log(this.value);
|
||||
hypouser.bio=this.value;
|
||||
newbio=this.value;
|
||||
regen();
|
||||
}],
|
||||
["button","update user content:","submit",function(){
|
||||
if(file!==null){
|
||||
thisuser.updatepfp(file);
|
||||
}
|
||||
if(newprouns!==null){
|
||||
thisuser.updatepronouns(newprouns);
|
||||
}
|
||||
if(newbio!==null){
|
||||
thisuser.updatebio(newbio);
|
||||
}
|
||||
}],
|
||||
["select","Theme:",["Dark","Light","WHITE"],e=>{
|
||||
localStorage.setItem("theme",["Dark","Light","WHITE"][e.target.selectedIndex]);
|
||||
setTheme();
|
||||
},["Dark","Light","WHITE"].indexOf(localStorage.getItem("theme"))],
|
||||
["select","Notification sound:",voice.sounds,e=>{
|
||||
voice.setNotificationSound(voice.sounds[e.target.selectedIndex]);
|
||||
voice.noises(voice.sounds[e.target.selectedIndex]);
|
||||
},voice.sounds.indexOf(voice.getNotificationSound())]
|
||||
],
|
||||
["vdiv",
|
||||
["html",hypothetcialprofie]
|
||||
]
|
||||
],_=>{},function(){
|
||||
hypouser=new user(thisuser.user);
|
||||
regen();
|
||||
file=null;
|
||||
newprouns=null;
|
||||
newbio=null;
|
||||
})
|
||||
}
|
||||
setTheme();
|
||||
|
||||
function userSettings(){
|
||||
usersettings.show();
|
||||
thisuser.usersettings.show();
|
||||
}
|
||||
let triggered=false;
|
||||
document.getElementById("messagecontainer").addEventListener("scroll",(e)=>{
|
||||
|
Reference in New Issue
Block a user