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%;
|
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 {
|
.container img.emoji {
|
||||||
float: none;
|
float: none;
|
||||||
width: 50px;
|
width: 50px;
|
||||||
|
|
|
@ -68,19 +68,15 @@ def htmlSearchEmoji(baseDir: str,searchStr: str) -> str:
|
||||||
with open(emojiLookupFilename, 'r') as fp:
|
with open(emojiLookupFilename, 'r') as fp:
|
||||||
emojiJson=commentjson.load(fp)
|
emojiJson=commentjson.load(fp)
|
||||||
results={}
|
results={}
|
||||||
if emojiJson.get(searchStr):
|
for emojiName,filename in emojiJson.items():
|
||||||
# exact match
|
if searchStr in emojiName:
|
||||||
results[searchStr] = emojiJson[searchStr]+'.png'
|
results[emojiName] = filename+'.png'
|
||||||
else:
|
for emojiName,filename in emojiJson.items():
|
||||||
for emojiName,filename in emojiJson.items():
|
if emojiName in searchStr:
|
||||||
if searchStr in emojiName:
|
results[emojiName] = filename+'.png'
|
||||||
results[emojiName] = filename+'.png'
|
|
||||||
for emojiName,filename in emojiJson.items():
|
|
||||||
if emojiName in searchStr:
|
|
||||||
results[emojiName] = filename+'.png'
|
|
||||||
emojiForm+='<center>'
|
emojiForm+='<center>'
|
||||||
for emojiName,filename in results.items():
|
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+='</center>'
|
||||||
|
|
||||||
emojiForm+=htmlFooter()
|
emojiForm+=htmlFooter()
|
||||||
|
|
Loading…
Reference in New Issue