Compare commits

..

No commits in common. "d8d22ed99ea23757791ae39b83416c633d0c7b56" and "2c992d49f0c030eba81bba300144a45c94b5dac8" have entirely different histories.

4 changed files with 6 additions and 15 deletions

View file

@ -50,7 +50,7 @@ const setupChatboxEvents = (socket) => {
emojiAutocomplete.append(
...(await emojis)
.filter(([name]) => name.toLowerCase().startsWith(search.toLowerCase()))
.map(([name, replaceWith, ext], i) => {
.map(([name, replaceWith], i) => {
const button = Object.assign(document.createElement("button"), {
className: "emoji-option" + (i === 0 ? " selected" : ""),
onmousedown: (e) => e.preventDefault(),
@ -64,7 +64,6 @@ const setupChatboxEvents = (socket) => {
onmouseover: () => select(button),
onfocus: () => select(button),
type: "button",
title: name,
});
button.append(
replaceWith[0] !== ":"
@ -74,13 +73,10 @@ const setupChatboxEvents = (socket) => {
})
: Object.assign(new Image(), {
loading: "lazy",
src: `/emojis/${name}${ext}`,
src: `/emojis/${name}.png`,
className: "emoji",
}),
Object.assign(document.createElement("span"), {
textContent: name,
className: "emoji-name",
})
Object.assign(document.createElement("span"), { textContent: name })
);
return button;
})

View file

@ -14,7 +14,7 @@ export async function emojify(text) {
} else {
nodes.push(
Object.assign(new Image(), {
src: `/emojis/${name}${emoji[2]}`,
src: `/emojis/${name}.png`,
className: "emoji",
alt: name,
})
@ -29,8 +29,6 @@ export async function emojify(text) {
export const emojis = Promise.all([
fetch("/emojis")
.then((e) => e.json())
.then((e) =>
e.map((e) => [e.slice(0, -4), ":" + e.slice(0, -4) + ":", e.slice(-4)])
),
.then((e) => e.map((e) => [e.slice(0, -4), ":" + e.slice(0, -4) + ":"])),
fetch("/emojis/unicode.json").then((e) => e.json()),
]).then((e) => e.flat(1));

View file

@ -171,7 +171,6 @@ button.small-button {
color: var(--user-color, var(--default-user-color));
}
/*
@supports (-webkit-background-clip: text) {
.chat-message > strong,
#viewer-list strong {
@ -184,7 +183,6 @@ button.small-button {
color: transparent !important;
}
}
*/
.chat-message.user-join,
.chat-message.user-leave,
@ -296,7 +294,6 @@ button.small-button {
align-items: center;
justify-content: center;
overflow: hidden;
flex-shrink: 0;
}
.emoji-option.selected {

View file

@ -20,4 +20,4 @@ read token
printf "\n" 1>&2
stty echo
curl "https://discord.com/api/v9/guilds/${guild}/emojis" -H "Authorization: $token" | jq --raw-output 'map((if .animated then ".gif" else ".png" end) as $ext | "curl '"'"'https://cdn.discordapp.com/emojis/" + .id + $ext + "?size=48&quality=lossless'"'"' -o '"'${emojiFolder}/"'" + .name + $ext + "'"'"'") | join("\n")' | sh
curl "https://discord.com/api/v9/guilds/${guild}/emojis" -H "Authorization: $token" | jq --raw-output 'map("curl '"'"'https://cdn.discordapp.com/emojis/" + .id + ".png?size=48&quality=lossless'"'"' -o '"'${emojiFolder}/"'" + .name + ".png'"'"'") | join("\n")' | sh