parent
90f7343899
commit
dc2f702a04
|
@ -29,11 +29,18 @@ const categoryLabelMap = {
|
||||||
flags: 'Flags',
|
flags: 'Flags',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function createEmojiObject(alias) {
|
||||||
|
return {
|
||||||
|
alias,
|
||||||
|
description: emojiMap[alias].description,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
function buildCategoryMap() {
|
function buildCategoryMap() {
|
||||||
return Object.keys(emojiMap).reduce((currentCategoryMap, emojiNameKey) => {
|
return Object.keys(emojiMap).reduce((currentCategoryMap, emojiNameKey) => {
|
||||||
const emojiInfo = emojiMap[emojiNameKey];
|
const emojiInfo = emojiMap[emojiNameKey];
|
||||||
if (currentCategoryMap[emojiInfo.category]) {
|
if (currentCategoryMap[emojiInfo.category]) {
|
||||||
currentCategoryMap[emojiInfo.category].push(emojiNameKey);
|
currentCategoryMap[emojiInfo.category].push(createEmojiObject(emojiNameKey));
|
||||||
}
|
}
|
||||||
|
|
||||||
return currentCategoryMap;
|
return currentCategoryMap;
|
||||||
|
@ -55,10 +62,10 @@ function renderCategory(name, emojiList, opts = {}) {
|
||||||
${name}
|
${name}
|
||||||
</h5>
|
</h5>
|
||||||
<ul class="clearfix emoji-menu-list ${opts.menuListClass || ''}">
|
<ul class="clearfix emoji-menu-list ${opts.menuListClass || ''}">
|
||||||
${emojiList.map(emojiName => `
|
${emojiList.map(emoji => `
|
||||||
<li class="emoji-menu-list-item">
|
<li class="emoji-menu-list-item">
|
||||||
<button class="emoji-menu-btn text-center js-emoji-btn" type="button">
|
<button class="emoji-menu-btn text-center js-emoji-btn" type="button" title="${emoji.description}">
|
||||||
${glEmojiTag(emojiName, {
|
${glEmojiTag(emoji.alias, {
|
||||||
sprite: true,
|
sprite: true,
|
||||||
})}
|
})}
|
||||||
</button>
|
</button>
|
||||||
|
@ -498,7 +505,7 @@ AwardsHandler.prototype.getFrequentlyUsedEmojis = function getFrequentlyUsedEmoj
|
||||||
const frequentlyUsedEmojis = _.uniq((Cookies.get('frequently_used_emojis') || '').split(','));
|
const frequentlyUsedEmojis = _.uniq((Cookies.get('frequently_used_emojis') || '').split(','));
|
||||||
this.frequentlyUsedEmojis = frequentlyUsedEmojis.filter(
|
this.frequentlyUsedEmojis = frequentlyUsedEmojis.filter(
|
||||||
inputName => isEmojiNameValid(inputName),
|
inputName => isEmojiNameValid(inputName),
|
||||||
);
|
).map(emojiNameKey => createEmojiObject(emojiNameKey));
|
||||||
|
|
||||||
return this.frequentlyUsedEmojis;
|
return this.frequentlyUsedEmojis;
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
title: Added title to award emoji buttons
|
||||||
|
merge_request:
|
||||||
|
author:
|
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
||||||
namespace :gemojione do
|
namespace :gemojione do
|
||||||
desc 'Generates Emoji SHA256 digests'
|
desc 'Generates Emoji SHA256 digests'
|
||||||
task digests: ['yarn:check', 'environment'] do
|
task digests: ['environment'] do
|
||||||
require 'digest/sha2'
|
require 'digest/sha2'
|
||||||
require 'json'
|
require 'json'
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ namespace :gemojione do
|
||||||
entry = {
|
entry = {
|
||||||
category: emoji_hash['category'],
|
category: emoji_hash['category'],
|
||||||
moji: emoji_hash['moji'],
|
moji: emoji_hash['moji'],
|
||||||
|
description: emoji_hash['description'],
|
||||||
unicodeVersion: Gitlab::Emoji.emoji_unicode_version(name),
|
unicodeVersion: Gitlab::Emoji.emoji_unicode_version(name),
|
||||||
digest: hash_digest,
|
digest: hash_digest,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue