forked from rDrama/rDrama
show appropriate author credit for emojis
parent
cdad9c2069
commit
b60f3deb90
|
@ -163,7 +163,7 @@ function fetchEmojis() {
|
||||||
if (! (emojis instanceof Array ))
|
if (! (emojis instanceof Array ))
|
||||||
throw new TypeError("[EMOJI DIALOG] rDrama's server should have sent a JSON-coded Array!");
|
throw new TypeError("[EMOJI DIALOG] rDrama's server should have sent a JSON-coded Array!");
|
||||||
|
|
||||||
globalEmojis = emojis.map(({name, author, count}) => ({name, author, count}));
|
globalEmojis = emojis.map(({name, author_username, count}) => ({name, author_username, count}));
|
||||||
|
|
||||||
let classes = ["Marsey", "Platy", "Wolf", "Donkey Kong", "Tay", "Capy", "Carp", "Marsey Flags", "Marsey Alphabet", "Classic", "Rage", "Wojak", "Misc"]
|
let classes = ["Marsey", "Platy", "Wolf", "Donkey Kong", "Tay", "Capy", "Carp", "Marsey Flags", "Marsey Alphabet", "Classic", "Rage", "Wojak", "Misc"]
|
||||||
|
|
||||||
|
@ -175,14 +175,11 @@ function fetchEmojis() {
|
||||||
|
|
||||||
emojisSearchDictionary.updateTag(emoji.name, emoji.name);
|
emojisSearchDictionary.updateTag(emoji.name, emoji.name);
|
||||||
|
|
||||||
if (emoji.author_username !== undefined && emoji.author_username !== null)
|
if (!emoji.author_username.endsWith(' user')) {
|
||||||
emojisSearchDictionary.updateTag(`@${emoji.author_username.toLowerCase()}`, emoji.name);
|
emojisSearchDictionary.updateTag(`@${emoji.author_username.toLowerCase()}`, emoji.name);
|
||||||
|
|
||||||
if (emoji.author_original_username !== undefined && emoji.author_original_username !== null)
|
|
||||||
emojisSearchDictionary.updateTag(`@${emoji.author_original_username.toLowerCase()}`, emoji.name);
|
emojisSearchDictionary.updateTag(`@${emoji.author_original_username.toLowerCase()}`, emoji.name);
|
||||||
|
|
||||||
if (emoji.author_prelock_username !== undefined && emoji.author_prelock_username !== null)
|
|
||||||
emojisSearchDictionary.updateTag(`@${emoji.author_prelock_username.toLowerCase()}`, emoji.name);
|
emojisSearchDictionary.updateTag(`@${emoji.author_prelock_username.toLowerCase()}`, emoji.name);
|
||||||
|
}
|
||||||
|
|
||||||
if (emoji.tags instanceof Array)
|
if (emoji.tags instanceof Array)
|
||||||
for(let i = 0; i < emoji.tags.length; i++)
|
for(let i = 0; i < emoji.tags.length; i++)
|
||||||
|
@ -192,8 +189,7 @@ function fetchEmojis() {
|
||||||
const emojiDOM = document.importNode(emojiButtonTemplateDOM.content, true).children[0];
|
const emojiDOM = document.importNode(emojiButtonTemplateDOM.content, true).children[0];
|
||||||
|
|
||||||
emojiDOM.title = emoji.name
|
emojiDOM.title = emoji.name
|
||||||
if (emoji.author_username !== undefined && emoji.author_username !== null)
|
emojiDOM.title += "\nauthor\t" + emoji.author_username
|
||||||
emojiDOM.title += "\nauthor\t" + emoji.author_username
|
|
||||||
if (emoji.count !== undefined)
|
if (emoji.count !== undefined)
|
||||||
emojiDOM.title += "\nused\t" + emoji.count;
|
emojiDOM.title += "\nused\t" + emoji.count;
|
||||||
emojiDOM.dataset.className = emoji.kind;
|
emojiDOM.dataset.className = emoji.kind;
|
||||||
|
@ -414,8 +410,7 @@ function populate_speed_emoji_modal(results, textbox)
|
||||||
|
|
||||||
emoji_option_text.title = name;
|
emoji_option_text.title = name;
|
||||||
|
|
||||||
if (emoji.author_username !== undefined && emoji.author_username !== null)
|
emoji_option_text.title += "\nauthor\t" + emoji.author_username
|
||||||
emoji_option_text.title += "\nauthor\t" + emoji.author_username
|
|
||||||
|
|
||||||
if (emoji.count !== undefined)
|
if (emoji.count !== undefined)
|
||||||
emoji_option_text.title += "\nused\t" + emoji.count;
|
emoji_option_text.title += "\nused\t" + emoji.count;
|
||||||
|
|
|
@ -99,7 +99,12 @@ def get_emojis(nsfw):
|
||||||
|
|
||||||
collected = []
|
collected = []
|
||||||
for emoji, author in emojis:
|
for emoji, author in emojis:
|
||||||
if FEATURES['EMOJI_SUBMISSIONS']:
|
if author.id == 2:
|
||||||
|
if SITE == 'rdrama.net':
|
||||||
|
emoji.author_username = 'a WPD user'
|
||||||
|
else:
|
||||||
|
emoji.author_username = 'an rDrama user'
|
||||||
|
else:
|
||||||
emoji.author_username = author.username
|
emoji.author_username = author.username
|
||||||
emoji.author_original_username = author.original_username
|
emoji.author_original_username = author.original_username
|
||||||
emoji.author_prelock_username = author.prelock_username
|
emoji.author_prelock_username = author.prelock_username
|
||||||
|
|
|
@ -46,10 +46,10 @@
|
||||||
{% if FEATURES['EMOJI_SUBMISSIONS'] %}
|
{% if FEATURES['EMOJI_SUBMISSIONS'] %}
|
||||||
<td>
|
<td>
|
||||||
{% if emoji.author_id == 2 %}
|
{% if emoji.author_id == 2 %}
|
||||||
{% if SITE_NAME == 'WPD' %}
|
{% if SITE == 'rdrama.net' %}
|
||||||
an rDrama user
|
|
||||||
{% else %}
|
|
||||||
a WPD user
|
a WPD user
|
||||||
|
{% else %}
|
||||||
|
an rDrama user
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set user = emoji.user %}
|
{% set user = emoji.user %}
|
||||||
|
|
Loading…
Reference in New Issue