From 216d2b60ba9a5fb97f8711e8e57cc12749baff8c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 19 Aug 2019 20:10:55 +0100 Subject: [PATCH] Emoji image style in search --- epicyon-profile.css | 10 ++++++++++ webinterface.py | 18 +++++++----------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/epicyon-profile.css b/epicyon-profile.css index bc5131b01..867a0fa6d 100644 --- a/epicyon-profile.css +++ b/epicyon-profile.css @@ -341,6 +341,16 @@ a:link { border-radius: 10%; } +.searchEmoji { + float: none; + width: 80px; + margin-left: 0px; + margin-right: 0px; + padding-right: 0px; + padding-left: 0px; + border-radius: 0px; +} + .container img.emoji { float: none; width: 50px; diff --git a/webinterface.py b/webinterface.py index 62dbd39c3..c210cd61f 100644 --- a/webinterface.py +++ b/webinterface.py @@ -68,19 +68,15 @@ def htmlSearchEmoji(baseDir: str,searchStr: str) -> str: with open(emojiLookupFilename, 'r') as fp: emojiJson=commentjson.load(fp) results={} - if emojiJson.get(searchStr): - # exact match - results[searchStr] = emojiJson[searchStr]+'.png' - else: - for emojiName,filename in emojiJson.items(): - if searchStr in emojiName: - results[emojiName] = filename+'.png' - for emojiName,filename in emojiJson.items(): - if emojiName in searchStr: - results[emojiName] = filename+'.png' + for emojiName,filename in emojiJson.items(): + if searchStr in emojiName: + results[emojiName] = filename+'.png' + for emojiName,filename in emojiJson.items(): + if emojiName in searchStr: + results[emojiName] = filename+'.png' emojiForm+='
' for emojiName,filename in results.items(): - emojiForm+='
:'+emojiName+':
' + emojiForm+='

:'+emojiName+':

' emojiForm+='
' emojiForm+=htmlFooter()