I think I could add the little post time thing to chats (like posted 3m ago
)
I could also add replies, if I get a better understanding about how the db works
possibly a notification system?
also I think i made a 3 minutes ago thing if you didn’t implement yet:
var units = {
year : 24 * 60 * 60 * 1000 * 365,
month : 24 * 60 * 60 * 1000 * 365/12,
day : 24 * 60 * 60 * 1000,
hour : 60 * 60 * 1000,
minute: 60 * 1000,
second: 1000
}
var rtf = new Intl.RelativeTimeFormat('en', { numeric: 'auto' })
var getRelativeTime = (d1, d2 = new Date()) => {
var elapsed = d1 - d2;
//d1 = old_time
//d2 = current_time
// "Math.abs" accounts for both "past" & "future" scenarios
for (var u in units){
if (Math.abs(elapsed) > units[u] || u == 'second'){
return (u == 'second') ? 'just now' : rtf.format(Math.round(elapsed/units[u]), u)
}
}
}
usage
getRelativeTime(timestamp, new Date());
Are d1
and d2
of type Date
?
There’s this really cool thing called “testing”
In what conversation are you ever going to write <script src="script.js">
? Like that was entirely your fault, you were warned not to use script
tags
I added that before I saw this lol
I know
Bruh. Then make a HTML format detector.
- I went to themes
- I selected the hacker theme
- I pressed the “Change Theme” button (Was it called that? I don’t remember)
- It told me to close the theme tab and refresh chat
- I closed the theme tab
- I refreshed chat
Done! So basically, I didn’t hack. I guess there’s something wrong the code.
- I’m already banned
- I didn’t even hack to get the hacker theme
Then why should it excecute script tags?
I don’t think it does anymore.
Should remove the auto-ban.
It works on any device where you can type and press buttons.
Not anymore.
Yay thanks for unbanning me
No, but button
is the only one “allowed”. By the way, onclick
counts as XSS
I was testing so I knew that.
I get an error message when I try onclick
It seems our XSS filter is completely broken, so that’s fun.
Didn’t @element1010 say he was going to remove the auto-ban?
Also every time I attempt XSS I get an error message, so I suppose there’s still a XSS filter
Seems to still exist. @element1010 can we please remove it. I don’t want to spend another minute debugging my garbage code
(also don’t mind the weird comment element put)
Wait… is the hacker theme gone? I just decided to ‘purchase’ it for fun rip
Well I’m pretty sure Element wanted it gone. I can add it back.
And I figured out how to break the servers with minimal effort…