diff --git a/shared/naturalcrit/codeEditor/autocomplete-emoji.js b/shared/naturalcrit/codeEditor/autocomplete-emoji.js index 6167a90e7..87950322f 100644 --- a/shared/naturalcrit/codeEditor/autocomplete-emoji.js +++ b/shared/naturalcrit/codeEditor/autocomplete-emoji.js @@ -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 = ` ${emoji}`; + div.innerHTML = ` ${emoji}`; element.appendChild(div); } }; diff --git a/shared/naturalcrit/codeEditor/codeEditor.less b/shared/naturalcrit/codeEditor/codeEditor.less index a59010a9d..65078886d 100644 --- a/shared/naturalcrit/codeEditor/codeEditor.less +++ b/shared/naturalcrit/codeEditor/codeEditor.less @@ -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; +} \ No newline at end of file diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index a0af8e451..cad31038a 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -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(); @@ -631,6 +635,7 @@ function MarkedVariables() { const MarkedEmojiOptions = { emojis: { ...diceFont, + ...elderberryInn, "fas-heart": "fa-solid fa-heart", "fas-star": "fa-solid fa-star" }, diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index 25b784cfc..2c818608f 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -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 { diff --git a/themes/fonts/icon fonts/diceFont.js b/themes/fonts/icon fonts/diceFont.js index 039e8abd7..f13d19533 100644 --- a/themes/fonts/icon fonts/diceFont.js +++ b/themes/fonts/icon fonts/diceFont.js @@ -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; \ No newline at end of file +module.exports = diceFont; \ No newline at end of file