14 changed files with 389 additions and 392 deletions
@ -1,43 +0,0 @@
@@ -1,43 +0,0 @@
|
||||
// DEPRECATE.
|
||||
import { EmojiButton } from 'https://cdn.skypack.dev/@joeattardi/emoji-button' |
||||
|
||||
fetch('/emoji') |
||||
.then(response => { |
||||
if (!response.ok) { |
||||
throw new Error(`Network response was not ok ${response.ok}`); |
||||
} |
||||
return response.json(); |
||||
}) |
||||
.then(json => { |
||||
setupEmojiPickerWithCustomEmoji(json); |
||||
}) |
||||
.catch(error => { |
||||
this.handleNetworkingError(`Emoji Fetch: ${error}`); |
||||
}); |
||||
|
||||
function setupEmojiPickerWithCustomEmoji(customEmoji) { |
||||
const picker = new EmojiButton({ |
||||
zIndex: 100, |
||||
theme: 'dark', |
||||
custom: customEmoji, |
||||
initialCategory: 'custom', |
||||
showPreview: false, |
||||
position: { |
||||
top: '50%', |
||||
right: '100' |
||||
} |
||||
}); |
||||
const trigger = document.querySelector('#emoji-button'); |
||||
|
||||
trigger.addEventListener('click', () => picker.togglePicker(picker)); |
||||
|
||||
picker.on('emoji', emoji => { |
||||
if (emoji.url) { |
||||
const url = location.protocol + "//" + location.host + "/" + emoji.url; |
||||
const name = url.split('\\').pop().split('/').pop(); |
||||
document.querySelector('#message-body-form').innerHTML += "<img class=\"emoji\" alt=\"" + name + "\" src=\"" + url + "\"/>"; |
||||
} else { |
||||
document.querySelector('#message-body-form').innerHTML += emoji.emoji; |
||||
} |
||||
}); |
||||
} |
||||
@ -0,0 +1,73 @@
@@ -0,0 +1,73 @@
|
||||
|
||||
// x, y pixel psitions of /img/social.gif image.
|
||||
export const SOCIAL_PLATFORMS = { |
||||
default: { |
||||
name: "default", |
||||
imgPos: [0,0], // [row,col]
|
||||
}, |
||||
|
||||
facebook: { |
||||
name: "Facebook", |
||||
imgPos: [0,1], |
||||
}, |
||||
twitter: { |
||||
name: "Twitter", |
||||
imgPos: [0,2], |
||||
}, |
||||
instagram: { |
||||
name: "Instagram", |
||||
imgPos: [0,3], |
||||
}, |
||||
snapchat: { |
||||
name: "Snapchat", |
||||
imgPos: [0,4], |
||||
}, |
||||
tiktok: { |
||||
name: "TikTok", |
||||
imgPos: [0,5], |
||||
}, |
||||
soundcloud: { |
||||
name: "Soundcloud", |
||||
imgPos: [0,6], |
||||
}, |
||||
bandcamp: { |
||||
name: "Bandcamp", |
||||
imgPos: [0,7], |
||||
}, |
||||
patreon: { |
||||
name: "Patreon", |
||||
imgPos: [0,1], |
||||
}, |
||||
youtube: { |
||||
name: "YouTube", |
||||
imgPos: [0,9 ], |
||||
}, |
||||
spotify: { |
||||
name: "Spotify", |
||||
imgPos: [0,10], |
||||
}, |
||||
twitch: { |
||||
name: "Twitch", |
||||
imgPos: [0,11], |
||||
}, |
||||
paypal: { |
||||
name: "Paypal", |
||||
imgPos: [0,12], |
||||
}, |
||||
github: { |
||||
name: "Github", |
||||
imgPos: [0,13], |
||||
}, |
||||
linkedin: { |
||||
name: "LinkedIn", |
||||
imgPos: [0,14], |
||||
}, |
||||
discord: { |
||||
name: "Discord", |
||||
imgPos: [0,15], |
||||
}, |
||||
mastodon: { |
||||
name: "Mastodon", |
||||
imgPos: [0,16], |
||||
}, |
||||
}; |
||||
Loading…
Reference in new issue