Skip to content

Commit 4a95af1

Browse files
committed
add ui adjustment
1 parent bb50a72 commit 4a95af1

File tree

2 files changed

+43
-7
lines changed

2 files changed

+43
-7
lines changed

extension/css/cryptup.css

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff 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 {

extension/js/content_scripts/webmail/thunderbird/thunderbird-element-replacer.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)