more work on emojis

This commit is contained in:
Mario
2024-03-09 20:53:18 +00:00
parent ba1e705c61
commit 46fa26502b
36 changed files with 217 additions and 38 deletions

View File

@@ -299,13 +299,17 @@ code.inline-code {
text-decoration: overline;
}
img.smiley.emoji {
height: .9em;
img.emoji {
height: 1rem;
vertical-align: baseline;
margin-bottom: -.1em;
margin-bottom: -.1rem;
}
img.smiley.emoji:hover {
img.emoji.single-emoji {
height: 2rem;
}
img.emoji:not(.single-emoji):hover {
transform: scale(2);
transition: transform .1s ease-out;
filter: drop-shadow(0px 0px 1px rgba(0, 0, 0, .5));

View File

@@ -45,7 +45,7 @@ function contact_format(item) {
}
function smiley_format(item) {
return "<div class='dropdown-item'>" + item.icon + ' ' + item.text + "</div>";
return "<div class='dropdown-item'><img class='emoji' src='" + item.filepath + "'> " + item.shortname.replaceAll(':', '') + "</div>";
}
function bbco_format(item) {
@@ -193,8 +193,8 @@ function string2bb(element) {
match: /(^|\s)(:[a-z0-9_:]{2,})$/,
index: 2,
cache: true,
search: function(term, callback) { $.getJSON('/smilies/json').done(function(data) { callback($.map(data, function(entry) { return entry.text.indexOf(term.substr(1)) !== -1 ? entry : null; })); }); },
replace: function(item) { return "$1" + item.text + ' '; },
search: function(term, callback) { $.getJSON('/smilies/json').done(function(data) { callback($.map(data, function(entry) { return entry.shortname.indexOf(term.substr(1)) !== -1 ? entry : null; })); }); },
replace: function(item) { return "$1" + item.shortname + ' '; },
context: function(text) { return text.toLowerCase(); },
template: smiley_format
};