2025-01-18 13:21:38 +01:00
|
|
|
|
|
|
|
|
|
|
|
class Message {
|
|
|
|
uid = null
|
|
|
|
author = null
|
|
|
|
avatar = null
|
|
|
|
text = null
|
|
|
|
time = null
|
|
|
|
constructor(uid,avatar,author,text,time){
|
|
|
|
this.uid = uid
|
|
|
|
this.avatar = avatar
|
|
|
|
this.author = author
|
|
|
|
this.text = text
|
|
|
|
this.time = time
|
|
|
|
}
|
|
|
|
|
|
|
|
get links() {
|
|
|
|
if(!this.text)
|
|
|
|
return []
|
|
|
|
let result = []
|
|
|
|
for(let part in this.text.split(/[,; ]/)){
|
|
|
|
if(part.startsWith("http") || part.startsWith("www.") || part.indexOf(".com") || part.indexOf(".net") || part.indexOf(".io") || part.indexOf(".nl")){
|
|
|
|
result.push(part)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return result
|
|
|
|
}
|
|
|
|
get mentions() {
|
|
|
|
if(!this.text)
|
|
|
|
return []
|
|
|
|
let result = []
|
|
|
|
for(let part in this.text.split(/[,; ]/)){
|
|
|
|
if(part.startsWith("@")){
|
|
|
|
result.push(part)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return result
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class Messages {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Room {
|
|
|
|
name = null
|
|
|
|
messages = []
|
|
|
|
constructor(name){
|
|
|
|
this.name = name
|
|
|
|
}
|
|
|
|
setMessages(list){
|
2025-01-24 03:28:43 +01:00
|
|
|
|
2025-01-18 13:21:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2025-01-24 03:28:43 +01:00
|
|
|
class InlineAppElement extends HTMLElement {
|
|
|
|
|
|
|
|
constructor(){
|
|
|
|
this.
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
class Page {
|
|
|
|
elements = []
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2025-01-18 13:21:38 +01:00
|
|
|
class App {
|
|
|
|
rooms = []
|
|
|
|
constructor() {
|
|
|
|
this.rooms.push(new Room("General"))
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|