0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 20:42:43 +00:00

add elderberryInn to emoji syntax

This commit is contained in:
Trevor Buckner
2024-04-18 23:06:21 -04:00
parent 8d8a965241
commit cd35e91ea2
5 changed files with 23 additions and 7 deletions

View File

@@ -1,7 +1,9 @@
const diceFont = require('../../../themes/fonts/icon fonts/diceFont.js');
const diceFont = require('../../../themes/fonts/icon fonts/diceFont.js');
const elderberryInn = require('../../../themes/fonts/icon fonts/elderberryInn.js');
const emojis = {
...diceFont,
...elderberryInn,
"fas-heart": "fa-solid fa-heart",
"fas-star": "fa-solid fa-star"
};
@@ -20,7 +22,7 @@ const showEmojiAutocomplete = function(CodeMirror, editor) {
const list = Object.keys(emojis).filter(function(emoji) {
return emoji.indexOf(currentWord) >= 0;
return emoji.toLowerCase().indexOf(currentWord.toLowerCase()) >= 0;
}).sort((a, b) => {
const lowerA = a.replace(/\d+/g, function(match) { // Temporarily convert any numbers in emoji string
return match.padStart(4, '0'); // to 4-digits, left-padded with 0's, to aid in
@@ -37,7 +39,7 @@ const showEmojiAutocomplete = function(CodeMirror, editor) {
text: emoji + ":", // Text to output to editor when option is selected
render: function(element, self, data) { // How to display the option in the dropdown
const div = document.createElement('div');
div.innerHTML = `<i class="${emojis[emoji]}"></i> ${emoji}`;
div.innerHTML = `<i class="emojiPreview ${emojis[emoji]}"></i> ${emoji}`;
element.appendChild(div);
}
};

View File

@@ -3,7 +3,10 @@
@import (less) 'codemirror/addon/search/matchesonscrollbar.css';
@import (less) 'codemirror/addon/dialog/dialog.css';
@import (less) 'codemirror/addon/hint/show-hint.css';
//Icon fonts included so they can appear in emoji autosuggest dropdown
@import (less) './themes/fonts/icon fonts/diceFont.less';
@import (less) './themes/fonts/icon fonts/elderberryInn.less';
@keyframes sourceMoveAnimation {
50% {background-color: red; color: white;}
@@ -36,6 +39,7 @@
}
}
//.cm-tab {
// background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAMCAQAAACOs/baAAAARUlEQVR4nGJgIAG8JkXxUAcCtDWemcGR1lY4MvgzCEKY7jSBjgxBDAG09UEQzAe0AMwMHrSOAwEGRtpaMIwAAAAA//8DAG4ID9EKs6YqAAAAAElFTkSuQmCC) no-repeat right;
//}
@@ -46,3 +50,8 @@
// }
//}
}
.emojiPreview {
font-size: 1.5em;
line-height: 1.2em;
}

View File

@@ -5,7 +5,11 @@ const MarkedExtendedTables = require('marked-extended-tables');
const { markedSmartypantsLite: MarkedSmartypantsLite } = require('marked-smartypants-lite');
const { gfmHeadingId: MarkedGFMHeadingId } = require('marked-gfm-heading-id');
const { markedEmoji: MarkedEmojis} = require('marked-emoji');
//Icon fonts included so they can appear in emoji autosuggest dropdown
const diceFont = require('../../themes/fonts/icon fonts/diceFont.js');
const elderberryInn = require('../../themes/fonts/icon fonts/elderberryInn.js');
const MathParser = require('expr-eval').Parser;
const renderer = new Marked.Renderer();
const tokenizer = new Marked.Tokenizer();
@@ -674,6 +678,7 @@ function MarkedVariables() {
const MarkedEmojiOptions = {
emojis: {
...diceFont,
...elderberryInn,
"fas-heart": "fa-solid fa-heart",
"fas-star": "fa-solid fa-star"
},

View File

@@ -1,5 +1,5 @@
@import (less) './themes/assets/assets.less';
@import (less) './themes/fonts/icon fonts/font-icons.less';
@import (less) './themes/fonts/icon fonts/elderberryInn.less';
@import (less) './themes/fonts/icon fonts/diceFont.less';
:root {

View File

@@ -1,4 +1,4 @@
const dicefont = {
const diceFont = {
"df-F" : "df F",
"df-F-minus" : "df F-minus",
"df-F-plus" : "df F-plus",
@@ -90,7 +90,7 @@ const dicefont = {
"df-solid-small-dot-d6-3" : "df solid-small-dot-d6-3",
"df-solid-small-dot-d6-4" : "df solid-small-dot-d6-4",
"df-solid-small-dot-d6-5" : "df solid-small-dot-d6-5",
"df-solid-small-dot-d6-6" : "df solid-small-dot-d6-6",
"df-solid-small-dot-d6-6" : "df solid-small-dot-d6-6"
}
module.exports = dicefont;
module.exports = diceFont;