mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	Add tooltip for, e.g. !gravatar(wdaher@zulip.com) output.
(imported from commit eff24a2fc7da77edc26449074acf75832d368a17)
This commit is contained in:
		@@ -2791,6 +2791,7 @@ div.edit_bot {
 | 
			
		||||
.message_body_gravatar {
 | 
			
		||||
    width: 20px;
 | 
			
		||||
    height: 20px;
 | 
			
		||||
    border-radius: 10px;
 | 
			
		||||
    margin: 2px 2px 2px 0px;
 | 
			
		||||
    border: 1px solid #000;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -341,9 +341,12 @@ class InlineInterestingLinkProcessor(markdown.treeprocessors.Treeprocessor):
 | 
			
		||||
class Gravatar(markdown.inlinepatterns.Pattern):
 | 
			
		||||
    def handleMatch(self, match):
 | 
			
		||||
        img = markdown.util.etree.Element('img')
 | 
			
		||||
        img.set('class', 'message_body_gravatar img-rounded')
 | 
			
		||||
        email_address = match.group('email')
 | 
			
		||||
        img.set('class', 'message_body_gravatar')
 | 
			
		||||
        img.set('src', 'https://secure.gravatar.com/avatar/%s?d=identicon&s=30'
 | 
			
		||||
            % (gravatar_hash(match.group('email')),))
 | 
			
		||||
            % (gravatar_hash(email_address),))
 | 
			
		||||
        img.set('title', email_address)
 | 
			
		||||
        img.set('alt', email_address)
 | 
			
		||||
        return img
 | 
			
		||||
 | 
			
		||||
path_to_emoji = os.path.join(os.path.dirname(__file__), '..', '..', '..',
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user