diff --git a/webpage/audio.ts b/webpage/audio.ts index c006881..fb88160 100644 --- a/webpage/audio.ts +++ b/webpage/audio.ts @@ -42,13 +42,13 @@ class Voice{ this.updateWave(); } updateWave():void{ - const func=this.waveFucnion(); + const func=this.waveFunction(); for (let i = 0; i < this.buffer.length; i++) { this.buffer[i]=func(i/this.audioCtx.sampleRate,this.freq); } } - waveFucnion():Function{ + waveFunction():Function{ if(typeof this.wave === 'function'){ return this.wave; } @@ -134,12 +134,12 @@ class Voice{ } static setNotificationSound(sound:string){ let userinfos=getBulkInfo(); - userinfos.preferances.notisound=sound; + userinfos.preferences.notisound=sound; localStorage.setItem("userinfos",JSON.stringify(userinfos)); } static getNotificationSound(){ let userinfos=getBulkInfo(); - return userinfos.preferances.notisound; + return userinfos.preferences.notisound; } } export {Voice as Voice}; diff --git a/webpage/channel.ts b/webpage/channel.ts index 8537587..d846159 100644 --- a/webpage/channel.ts +++ b/webpage/channel.ts @@ -24,7 +24,7 @@ class Channel{ name:string; id:string; parent_id:string; - parrent:Channel; + parent:Channel; children:Channel[]; guild_id:string; messageids:{[key : string]:Message}; @@ -95,7 +95,7 @@ class Channel{ this.name=JSON.name; this.id=JSON.id; this.parent_id=JSON.parent_id; - this.parrent=null; + this.parent=null; this.children=[]; this.guild_id=JSON.guild_id; this.messageids={}; @@ -142,12 +142,12 @@ class Channel{ } for(const thing of member.roles){ if(this.permission_overwrites[thing.id]){ - let perm=this.permission_overwrites[thing.id].getPermision(name); + let perm=this.permission_overwrites[thing.id].getPermission(name); if(perm){ return perm===1; } } - if(thing.permissions.getPermision(name)){ + if(thing.permissions.getPermission(name)){ return true; } } @@ -163,12 +163,12 @@ class Channel{ this.children.sort((a,b)=>{return a.position-b.position}); } resolveparent(guild:Guild){ - this.parrent=guild.channelids[this.parent_id]; - this.parrent??=null; - if(this.parrent!==null){ - this.parrent.children.push(this); + this.parent=guild.channelids[this.parent_id]; + this.parent??=null; + if(this.parent!==null){ + this.parent.children.push(this); } - return this.parrent===null; + return this.parent===null; } calculateReorder(){ let position=-1; @@ -298,9 +298,9 @@ class Channel{ const search=document.getElementById("channels").children[0].children if(this.guild!==this.localuser.lookingguild){ return null - }else if(this.parrent){ + }else if(this.parent){ for(const thing of search){ - if(thing["all"]===this.parrent){ + if(thing["all"]===this.parent){ for(const thing2 of thing.children[1].children){ if(thing2["all"]===this){ return thing2; @@ -347,30 +347,30 @@ class Channel{ event.preventDefault(); if(container){ that.move_id=this.id; - if(that.parrent){ - that.parrent.children.splice(that.parrent.children.indexOf(that),1); + if(that.parent){ + that.parent.children.splice(that.parent.children.indexOf(that),1); } - that.parrent=this; + that.parent=this; (container as HTMLElement).prepend(Channel.dragged[1]); this.children.unshift(that); }else{ console.log(this,Channel.dragged); that.move_id=this.parent_id; - if(that.parrent){ - that.parrent.children.splice(that.parrent.children.indexOf(that),1); + if(that.parent){ + that.parent.children.splice(that.parent.children.indexOf(that),1); }else{ this.guild.headchannels.splice(this.guild.headchannels.indexOf(that),1); } - that.parrent=this.parrent; - if(that.parrent){ + that.parent=this.parent; + if(that.parent){ const build=[]; - for(let i=0;i=100||this.allthewayup){return}; const j=await fetch(this.info.api.toString()+"/channels/"+this.id+"/messages?limit=100",{ - method: 'GET', headers: this.headers, }) - const responce=await j.json(); - if(responce.length!==100){ + const response=await j.json(); + if(response.length!==100){ this.allthewayup=true; } - for(const thing of responce){ + for(const thing of response){ const messager=new Message(thing,this) if(this.messageids[messager.id]===undefined){ this.messageids[messager.id]=messager; @@ -542,24 +541,23 @@ class Channel{ const out=this; await fetch(this.info.api.toString()+"/channels/"+this.id+"/messages?before="+this.messages[this.messages.length-1].id+"&limit=100",{ - method:"GET", headers:this.headers - }).then((j)=>{return j.json()}).then(responce=>{ + }).then((j)=>{return j.json()}).then(response=>{ //messages.innerHTML = ''; - //responce.reverse() + //response.reverse() let next:Message; - if(responce.length===0){ + if(response.length===0){ out.allthewayup=true; } - for(const i in responce){ + for(const i in response){ let messager:Message; if(!next){ - messager=new Message(responce[i],this) + messager=new Message(response[i],this) }else{ messager=next; } - if(responce[+i+1]!==undefined){ - next=new Message(responce[+i+1],this); + if(response[+i+1]!==undefined){ + next=new Message(response[+i+1],this); }else{ next=undefined; console.log("ohno",+i+1) @@ -593,7 +591,7 @@ class Channel{ this.type=JSON.type; this.name=JSON.name; this.parent_id=JSON.parent_id; - this.parrent=null; + this.parent=null; this.children=[]; this.guild_id=JSON.guild_id; this.messageids={}; @@ -763,15 +761,15 @@ class Channel{ this.permission_overwritesar.push([role.id,perm]); } async updateRolePermissions(id:string,perms:Permissions){ - const permision=this.permission_overwrites[id]; - permision.allow=perms.allow; - permision.deny=perms.deny; + const permission=this.permission_overwrites[id]; + permission.allow=perms.allow; + permission.deny=perms.deny; await fetch(this.info.api.toString()+"/channels/"+this.id+"/permissions/"+id,{ method:"PUT", headers:this.headers, body:JSON.stringify({ - allow:permision.allow.toString(), - deny:permision.deny.toString(), + allow:permission.allow.toString(), + deny:permission.deny.toString(), id:id, type:0 }) diff --git a/webpage/direct.ts b/webpage/direct.ts index 63c2aff..cf8a9de 100644 --- a/webpage/direct.ts +++ b/webpage/direct.ts @@ -22,7 +22,7 @@ class Direct extends Guild{ this.roles=[]; this.roleids={}; this.prevchannel=undefined; - this.properties.name="Dirrect Messages"; + this.properties.name="Direct Messages"; for(const thing of JSON){ const temp=new Group(thing,this); this.channels.push(temp); @@ -77,7 +77,7 @@ class Group extends Channel{ this.name??=this.localuser.user.username; this.id=JSON.id; this.parent_id=null; - this.parrent=null; + this.parent=null; this.children=[]; this.guild_id="@me"; this.messageids={}; diff --git a/webpage/embed.ts b/webpage/embed.ts index db6c1ef..b9a4886 100644 --- a/webpage/embed.ts +++ b/webpage/embed.ts @@ -170,10 +170,10 @@ class Embed{ const div=document.createElement("div"); div.classList.add("embed"); if(this.json.provider){ - const providor=document.createElement("p"); - providor.classList.add("provider"); - providor.textContent=this.json.provider.name; - div.append(providor); + const provider=document.createElement("p"); + provider.classList.add("provider"); + provider.textContent=this.json.provider.name; + div.append(provider); } const a=document.createElement("a"); a.href=this.json.url; diff --git a/webpage/guild.ts b/webpage/guild.ts index 428adb2..3f13e7a 100644 --- a/webpage/guild.ts +++ b/webpage/guild.ts @@ -423,7 +423,7 @@ class Guild{ this.channelids[JSON.id]=thischannel; this.channels.push(thischannel); thischannel.resolveparent(this); - if(!thischannel.parrent){ + if(!thischannel.parent){ this.headchannels.push(thischannel); } this.calculateReorder(); @@ -489,8 +489,8 @@ class Guild{ build.push(thing) }else{ console.log("fail"); - if(thing.parrent){ - thing.parrent.delChannel(JSON); + if(thing.parent){ + thing.parent.delChannel(JSON); } } } @@ -500,7 +500,7 @@ class Guild{ } createChannel(name:string,type:number){ fetch(this.info.api.toString()+"/guilds/"+this.id+"/channels",{ - method:"Post", + method:"POST", headers:this.headers, body:JSON.stringify({name: name, type: type}) }) diff --git a/webpage/index.html b/webpage/index.html index 4ea6348..930695e 100644 --- a/webpage/index.html +++ b/webpage/index.html @@ -28,7 +28,7 @@

USERNAME

-

SATUS

+

STATUS

@@ -47,15 +47,15 @@
- -
diff --git a/webpage/localuser.ts b/webpage/localuser.ts index 31e5b27..3b76c9e 100644 --- a/webpage/localuser.ts +++ b/webpage/localuser.ts @@ -168,7 +168,7 @@ class Localuser{ break; case "TYPING_START": if(this.initialized){ - this.typeingStart(temp); + this.typingStart(temp); } break; case "USER_UPDATE": @@ -208,7 +208,7 @@ class Localuser{ const guildy=new Guild(temp.d,this,this.user); this.guilds.push(guildy); this.guildids[guildy.id]=guildy; - document.getElementById("servers").insertBefore(guildy.generateGuildIcon(),document.getElementById("bottomseperator")); + document.getElementById("servers").insertBefore(guildy.generateGuildIcon(),document.getElementById("bottomseparator")); } } @@ -351,7 +351,7 @@ class Localuser{ const br=document.createElement("hr"); br.classList.add("lightbr"); serverlist.appendChild(br); - br.id="bottomseperator"; + br.id="bottomseparator"; const div=document.createElement("div"); div.textContent="+"; @@ -423,7 +423,7 @@ class Localuser{ thing.unreads(this.guildhtml[thing.id]); } } - typeingStart(typing):void{ + typingStart(typing):void{ if(this.channelfocus.id===typing.d.channel_id){ const memb=typing.d.member; let name; @@ -517,16 +517,16 @@ class Localuser{ } } genusersettings():void{ - const hypothetcialprofie=document.createElement("div"); + const hypotheticalProfile=document.createElement("div"); let file=null; let newprouns=null; let newbio=null; let hypouser=new User(this.user,this,true); function regen(){ - hypothetcialprofie.textContent=""; + hypotheticalProfile.textContent=""; const hypoprofile=hypouser.buildprofile(-1,-1); - hypothetcialprofie.appendChild(hypoprofile) + hypotheticalProfile.appendChild(hypoprofile) } regen(); this.usersettings=new Fullscreen( @@ -573,7 +573,7 @@ class Localuser{ },Voice.sounds.indexOf(Voice.getNotificationSound())] ], ["vdiv", - ["html",hypothetcialprofie] + ["html",hypotheticalProfile] ] ],_=>{},function(){ console.log(this); diff --git a/webpage/login.ts b/webpage/login.ts index fd0a593..6c0ac44 100644 --- a/webpage/login.ts +++ b/webpage/login.ts @@ -25,10 +25,10 @@ function setDefaults(){ localStorage.setItem("userinfos",JSON.stringify({ currentuser:null, users:{}, - preferances: + preferences: { theme:"Dark", - notifcations:false, + notifications:false, notisound:"three", }, })); @@ -37,15 +37,15 @@ function setDefaults(){ if(userinfos.users===undefined){ userinfos.users={}; } - if(userinfos.preferances===undefined){ - userinfos.preferances={ + if(userinfos.preferences===undefined){ + userinfos.preferences={ theme:"Dark", - notifcations:false, + notifications:false, notisound:"three", } } - if(userinfos.preferances&&(userinfos.preferances.notisound===undefined)){ - userinfos.preferances.notisound="three"; + if(userinfos.preferences&&(userinfos.preferences.notisound===undefined)){ + userinfos.preferences.notisound="three"; } localStorage.setItem("userinfos",JSON.stringify(userinfos)); } @@ -158,7 +158,7 @@ async function login(username, password){ try{ const info=JSON.parse(localStorage.getItem("instanceinfo")); const url=new URL(info.login); - return await fetch(url.origin+'/api/auth/login',options).then(responce=>responce.json()) + return await fetch(url.origin+'/api/auth/login',options).then(response=>response.json()) .then((response) => { console.log(response,response.message) if("Invalid Form Body"===response.message){ diff --git a/webpage/markdown.ts b/webpage/markdown.ts index d6230e4..0150309 100644 --- a/webpage/markdown.ts +++ b/webpage/markdown.ts @@ -270,12 +270,12 @@ function markdown(text : string|string[],{keep=false,stdsize=false} = {}){ if(find===count){ appendcurrent(); i=j; - const underscores="~~"; + const tildes="~~"; if(count===2){ const s=document.createElement("s"); - if(keep){s.append(underscores)} + if(keep){s.append(tildes)} s.appendChild(markdown(build,{keep:keep,stdsize:stdsize})); - if(keep){s.append(underscores)} + if(keep){s.append(tildes)} span.appendChild(s); } continue; @@ -300,14 +300,14 @@ function markdown(text : string|string[],{keep=false,stdsize=false} = {}){ if(find===count){ appendcurrent(); i=j; - const underscores="||"; + const pipes="||"; if(count===2){ const j=document.createElement("j"); - if(keep){j.append(underscores)} + if(keep){j.append(pipes)} j.appendChild(markdown(build,{keep:keep,stdsize:stdsize})); j.classList.add("spoiler"); j.onclick=markdown.unspoil; - if(keep){j.append(underscores)} + if(keep){j.append(pipes)} span.appendChild(j); } continue; diff --git a/webpage/member.ts b/webpage/member.ts index b155092..2154cd7 100644 --- a/webpage/member.ts +++ b/webpage/member.ts @@ -119,7 +119,7 @@ class Member{ } isAdmin(){ for(const role of this.roles){ - if(role.permissions.getPermision("ADMINISTRATOR")){ + if(role.permissions.getPermission("ADMINISTRATOR")){ return true; } } diff --git a/webpage/message.ts b/webpage/message.ts index c79d8f5..0a49a6d 100644 --- a/webpage/message.ts +++ b/webpage/message.ts @@ -269,11 +269,11 @@ class Message{ build.appendChild(text) if(this.attachments.length){ console.log(this.attachments) - const attatch = document.createElement("tr") + const attach = document.createElement("tr") for(const thing of this.attachments){ - attatch.appendChild(thing.getHTML()) + attach.appendChild(thing.getHTML()) } - messagedwrap.appendChild(attatch) + messagedwrap.appendChild(attach) } if(this.embeds.length){ const embeds = document.createElement("tr") diff --git a/webpage/permissions.ts b/webpage/permissions.ts index 28f7506..3bce00f 100644 --- a/webpage/permissions.ts +++ b/webpage/permissions.ts @@ -8,10 +8,10 @@ class Permissions{ this.allow=BigInt(allow); this.deny=BigInt(deny); } - getPermisionbit(b:number,big:bigint) : boolean{ + getPermissionbit(b:number,big:bigint) : boolean{ return Boolean((big>>BigInt(b))&1n); } - setPermisionbit(b:number,state:boolean,big:bigint) : bigint{ + setPermissionbit(b:number,state:boolean,big:bigint) : bigint{ const bit=1n<

- I agree to the TOS: + I agree to the Terms of Service:


diff --git a/webpage/register.js b/webpage/register.js index 2dfca4a..7dc3dcc 100644 --- a/webpage/register.js +++ b/webpage/register.js @@ -46,11 +46,11 @@ async function tosLogic(){ const apiurl=new URL(JSON.parse(localStorage.getItem("instanceinfo")).api) const tosPage=(await (await fetch(apiurl.toString()+"/ping")).json()).instance.tosPage; if(tosPage){ - document.getElementById("TOSbox").innerHTML="I agree to the TOS:"; + document.getElementById("TOSbox").innerHTML="I agree to the Terms of Service:"; TOSa=document.getElementById("TOSa"); TOSa.href=tosPage; }else{ - document.getElementById("TOSbox").textContent="This instance has no TOS, accept TOS anyways:"; + document.getElementById("TOSbox").textContent="This instance has no Terms of Service, accept ToS anyways:"; TOSa=null; } console.log(tosPage); diff --git a/webpage/settings.ts b/webpage/settings.ts index 29b7ddf..67b3b50 100644 --- a/webpage/settings.ts +++ b/webpage/settings.ts @@ -63,11 +63,11 @@ class Buttons{ save(){} } -class PermisionToggle{ +class PermissionToggle{ readonly rolejson:{name:string,readableName:string,description:string}; permissions:Permissions; owner:Options; - constructor(roleJSON:PermisionToggle["rolejson"],permissions:Permissions,owner:Options){ + constructor(roleJSON:PermissionToggle["rolejson"],permissions:Permissions,owner:Options){ this.rolejson=roleJSON; this.permissions=permissions; this.owner=owner; @@ -90,7 +90,7 @@ class PermisionToggle{ generateCheckbox():HTMLElement{ const div=document.createElement("div"); div.classList.add("tritoggle"); - const state=this.permissions.getPermision(this.rolejson.name); + const state=this.permissions.getPermission(this.rolejson.name); const on=document.createElement("input"); on.type="radio"; @@ -98,7 +98,7 @@ class PermisionToggle{ div.append(on); if(state===1){on.checked=true;}; on.onclick=_=>{ - this.permissions.setPermision(this.rolejson.name,1); + this.permissions.setPermission(this.rolejson.name,1); this.owner.changed(); } @@ -108,7 +108,7 @@ class PermisionToggle{ div.append(no); if(state===0){no.checked=true;}; no.onclick=_=>{ - this.permissions.setPermision(this.rolejson.name,0); + this.permissions.setPermission(this.rolejson.name,0); this.owner.changed(); } if(this.permissions.hasDeny){ @@ -118,7 +118,7 @@ class PermisionToggle{ div.append(off); if(state===-1){off.checked=true;}; off.onclick=_=>{ - this.permissions.setPermision(this.rolejson.name,-1); + this.permissions.setPermission(this.rolejson.name,-1); this.owner.changed(); } } @@ -147,7 +147,7 @@ class RoleList extends Buttons{ this.permission=new Permissions("0"); } for(const thing of Permissions.info){ - options.addPermisionToggle(thing,this.permission);// + options.addPermissionToggle(thing,this.permission);// } for(const i of permissions){ this.buttons.push([guild.getRole(i[0]).name,i[0]])// @@ -170,7 +170,7 @@ class RoleList extends Buttons{ class Options{ name:string; haschanged=false; - readonly options:(PermisionToggle|Buttons|RoleList)[]; + readonly options:(PermissionToggle|Buttons|RoleList)[]; readonly owner:Buttons; constructor(name:string,owner:Buttons){ @@ -179,8 +179,8 @@ class Options{ this.owner=owner; } - addPermisionToggle(roleJSON:PermisionToggle["rolejson"],permissions:Permissions){ - this.options.push(new PermisionToggle(roleJSON,permissions,this)); + addPermissionToggle(roleJSON:PermissionToggle["rolejson"],permissions:Permissions){ + this.options.push(new PermissionToggle(roleJSON,permissions,this)); } generateHTML():HTMLElement{ const div=document.createElement("div");