mirror of https://gitlab.com/bashrc2/epicyon
Emoji image style in search
parent
43ad80e2f5
commit
216d2b60ba
|
@ -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;
|
||||
|
|
|
@ -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+='<center>'
|
||||
for emojiName,filename in results.items():
|
||||
emojiForm+='<h5>:'+emojiName+':<img src="/emoji/'+filename+'"/></h5>'
|
||||
emojiForm+='<p><h3>:'+emojiName+':</h3><img class="searchEmoji" src="/emoji/'+filename+'"/></p>'
|
||||
emojiForm+='</center>'
|
||||
|
||||
emojiForm+=htmlFooter()
|
||||
|
|
Loading…
Reference in New Issue