File tree Expand file tree Collapse file tree 2 files changed +43
-7
lines changed
js/content_scripts/webmail/thunderbird Expand file tree Collapse file tree 2 files changed +43
-7
lines changed Original file line number Diff line number Diff line change @@ -3502,6 +3502,41 @@ body#settings div.webmail_notifications div.webmail_notification a:hover {
35023502 text-decoration : none;
35033503}
35043504
3505+ /* thunderbird ui css */
3506+
3507+ .thunderbird_attachment_root {
3508+ display : inline-flex;
3509+ margin : 0 7px 7px 0 ;
3510+ background : # fff ;
3511+ align-items : center;
3512+ align-content : center;
3513+ border : 1px solid gray;
3514+ padding : 2px ;
3515+ cursor : pointer;
3516+ }
3517+
3518+ .thunderbird_attachment_root div {
3519+ display : inline-block;
3520+ }
3521+
3522+ .thunderbird_attachment_root .thunderbird_attachment_name {
3523+ margin : 0 2px ;
3524+ }
3525+
3526+ .thunderbird_attachment_root .thunderbird_attachment_icon {
3527+ height : 40px ;
3528+ width : 40px ;
3529+ background : # fff ;
3530+ overflow : hidden;
3531+ }
3532+
3533+ .thunderbird_attachment_root .thunderbird_attachment_download {
3534+ background : url ('/img/svgs/download-link.svg' ) center / auto no-repeat;
3535+ padding : 2px ;
3536+ height : 40px ;
3537+ width : 40px ;
3538+ }
3539+
35053540/* print class */
35063541@media screen {
35073542 .printable {
Original file line number Diff line number Diff line change @@ -114,16 +114,17 @@ export class ThunderbirdElementReplacer extends WebmailElementReplacer {
114114 } ;
115115
116116 private generatePgpAttachmentTemplate = ( attachment : messenger . messages . MessageAttachment ) => {
117- const attachmentHtmlRoot = $ ( '<div>' ) ;
118- const attachmentFilename = $ ( '<div> ' ) ;
119- attachmentFilename . addClass ( 'attachment_name' ) . text ( Xss . escape ( attachment . name ) ) ;
120- const attachmentDownloadBtn = $ ( '<div> ') ;
121- attachmentDownloadBtn
122- . addClass ( 'attachment_download ')
123- . text ( 'download ')
117+ const attachmentHtmlRoot = $ ( '<div>' ) . addClass ( 'thunderbird_attachment_root' ) ;
118+ const attachmentFileTypeIcon = $ ( '<img>' ) . addClass ( 'thunderbird_attachment_icon ') ;
119+ attachmentFileTypeIcon . attr ( 'alt' , Xss . escape ( attachment . name ) ) ;
120+ attachmentFileTypeIcon . attr ( 'src' , '/image/fileformat/generic.png ') ;
121+ const attachmentFilename = $ ( '<div>' ) . addClass ( 'thunderbird_attachment_name' ) . text ( Xss . escape ( attachment . name ) ) ;
122+ const attachmentDownloadBtn = $ ( '<div> ')
123+ . addClass ( 'thunderbird_attachment_download ')
124124 . on ( 'click' , async ( ) => {
125125 await this . downloadThunderbirdAttachmentHandler ( attachment ) ;
126126 } ) ;
127+ attachmentHtmlRoot . append ( attachmentFileTypeIcon ) ; // xss-escaped
127128 attachmentHtmlRoot . append ( attachmentFilename ) ; // xss-escaped
128129 attachmentHtmlRoot . append ( attachmentDownloadBtn ) ; // xss-escaped
129130 return attachmentHtmlRoot ;
You can’t perform that action at this time.
0 commit comments