forked from indymedia/epicyon
Emoji style in header
parent
74ceb8dd28
commit
567a439598
|
@ -380,6 +380,17 @@ a:link {
|
|||
border-radius: 0px;
|
||||
}
|
||||
|
||||
.container img.emojiheader {
|
||||
float: none;
|
||||
width: 20px;
|
||||
margin-left: 0px;
|
||||
margin-right: 0px;
|
||||
padding-right: 0px;
|
||||
border-radius: 0px;
|
||||
-ms-transform: translateY(0%);
|
||||
transform: translateY(0%);
|
||||
}
|
||||
|
||||
.containericons {
|
||||
padding: 0px 0px;
|
||||
margin: 0px 0px;
|
||||
|
|
|
@ -1414,7 +1414,7 @@ def contentWarningScript() -> str:
|
|||
'}\n'
|
||||
return script
|
||||
|
||||
def htmlReplaceEmojiFromTags(content: str,tag: []) -> str:
|
||||
def htmlReplaceEmojiFromTags(content: str,tag: [],inMessageContent: bool) -> str:
|
||||
"""Uses the tags to replace :emoji: with html image markup
|
||||
"""
|
||||
for tagItem in tag:
|
||||
|
@ -1430,7 +1430,10 @@ def htmlReplaceEmojiFromTags(content: str,tag: []) -> str:
|
|||
continue
|
||||
if tagItem['name'] not in content:
|
||||
continue
|
||||
emojiHtml="<img src=\""+tagItem['icon']['url']+"\" alt=\""+tagItem['name'].replace(':','')+"\" align=\"middle\" class=\"emoji\"/>"
|
||||
htmlClass='emoji'
|
||||
if not inMessageContent:
|
||||
htmlClass='emojiheader'
|
||||
emojiHtml="<img src=\""+tagItem['icon']['url']+"\" alt=\""+tagItem['name'].replace(':','')+"\" align=\"middle\" class=\""+htmlClass+"\"/>"
|
||||
content=content.replace(tagItem['name'],emojiHtml)
|
||||
return content
|
||||
|
||||
|
@ -1625,7 +1628,7 @@ def addEmojiToDisplayName(baseDir: str,httpPrefix: str, \
|
|||
emojiTagsList=[]
|
||||
for tagName,tag in emojiTags.items():
|
||||
emojiTagsList.append(tag)
|
||||
displayName=htmlReplaceEmojiFromTags(displayName,emojiTagsList)
|
||||
displayName=htmlReplaceEmojiFromTags(displayName,emojiTagsList,False)
|
||||
return displayName
|
||||
|
||||
def individualPostAsHtml(iconsDir: str,translate: {}, \
|
||||
|
@ -2017,7 +2020,7 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \
|
|||
contentStr+='</div>'
|
||||
|
||||
if postJsonObject['object'].get('tag'):
|
||||
contentStr=htmlReplaceEmojiFromTags(contentStr,postJsonObject['object']['tag'])
|
||||
contentStr=htmlReplaceEmojiFromTags(contentStr,postJsonObject['object']['tag'],True)
|
||||
|
||||
contentStr='<div class="message">'+contentStr+'</div>'
|
||||
|
||||
|
|
Loading…
Reference in New Issue