mirror of
https://github.com/owncast/owncast.git
synced 2025-11-15 20:18:58 +08:00
Feature: emoji editor (#2411)
* Custom emoji editor: implement backend This reuses the logo upload code * Implement emoji edit admin interface Again reuse base64 logic from the logo upload * Allow toggling between uploaded and default emojis * Add route that always serves uploaded emojis This is needed for the admin emoji interface, as otherwise the emojis will 404 if custom emojis are disabled * Fix linter warnings * Remove custom/uploaded emoji logic * Reset timer after emoji deletion * Setup: copy built-in emojis to emoji directory
This commit is contained in:
@@ -64,6 +64,12 @@ export const CHAT_HISTORY = `${API_LOCATION}chat/messages`;
|
||||
// Get chat history
|
||||
export const UPDATE_CHAT_MESSGAE_VIZ = `/api/admin/chat/messagevisibility`;
|
||||
|
||||
// Upload a new custom emoji
|
||||
export const UPLOAD_EMOJI = `${API_LOCATION}emoji/upload`;
|
||||
|
||||
// Delete a custom emoji
|
||||
export const DELETE_EMOJI = `${API_LOCATION}emoji/delete`;
|
||||
|
||||
// Get all access tokens
|
||||
export const ACCESS_TOKENS = `${API_LOCATION}accesstokens`;
|
||||
|
||||
|
||||
7
web/utils/images.ts
Normal file
7
web/utils/images.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export const ACCEPTED_IMAGE_TYPES = ['image/png', 'image/jpeg', 'image/gif'];
|
||||
|
||||
export function getBase64(img: File | Blob, callback: (imageUrl: string | ArrayBuffer) => void) {
|
||||
const reader = new FileReader();
|
||||
reader.addEventListener('load', () => callback(reader.result));
|
||||
reader.readAsDataURL(img);
|
||||
}
|
||||
Reference in New Issue
Block a user