xi-conversations

Minimal clone of thunderbird conversations
git clone https://git.ce9e.org/xi-conversations.git

commit
11ba2e9c62019edbebf87d9aa2caab6d0a166a13
parent
6c6397be9f6fbc0b7a05c56de2c9eccb42ca367a
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2023-09-04 18:44
rm legacy icons

Diffstat

M content/js/body.js 2 +-
M content/js/util.js 11 ++---------
M content/main.html 30 +++++++++++++++---------------

3 files changed, 18 insertions, 25 deletions


diff --git a/content/js/body.js b/content/js/body.js

@@ -81,7 +81,7 @@ export default function(msg) {
   81    81 	wrapper.append(pre);
   82    82 	browser.xi.getFull(msg.id).then(util.getBody).then(([body, isEncrypted]) => {
   83    83 		if (isEncrypted) {
   84    -1 			wrapper.prepend(util.createAlert(browser.i18n.getMessage('encrypted'), 'x-lock', 'info'));
   -1    84 			wrapper.prepend(util.createAlert(browser.i18n.getMessage('encrypted'), 'lock', 'info'));
   85    85 		}
   86    86 		renderBody(pre, body || msg.body || browser.i18n.getMessage('emptyBody'));
   87    87 	});

diff --git a/content/js/util.js b/content/js/util.js

@@ -53,17 +53,10 @@ export var createIcon = function(key) {
   53    53 	var svg = document.createElementNS(nssvg, 'svg') ;
   54    54 	var use = document.createElementNS(nssvg, 'use') ;
   55    55 	svg.setAttribute('class', 'icon');
   -1    56 	svg.setAttribute('viewBox', '0 -960 960 960');
   -1    57 	use.setAttributeNS(nsxlink, 'href', `/content/material-icons.svg#${key}`);
   56    58 	svg.append(use);
   57    59 
   58    -1 	if (key.substring(0, 2) === 'x-') {
   59    -1 		use.setAttributeNS(nsxlink, 'href', `/content/material-icons.svg#${key.substring(2)}`);
   60    -1 		svg.setAttribute('viewBox', '0 -960 960 960');
   61    -1 	} else {
   62    -1 		// File no longer exists. Is there a new one?
   63    -1 		use.setAttributeNS(nsxlink, 'href', `chrome://messenger/skin/icons/mail-toolbar.svg#${key}`);
   64    -1 		svg.setAttribute('viewBox', '0 0 18 18');
   65    -1 	}
   66    -1 
   67    60 	return svg;
   68    61 };
   69    62 

diff --git a/content/main.html b/content/main.html

@@ -14,7 +14,7 @@
   14    14 					{{/author}}
   15    15 				</style>
   16    16 				<header class="message__header">
   17    -1 					<button class="star {{#isFlagged}}is-active{{/isFlagged}}" data-action="toggleFlagged">{{#icon}}x-star{{/icon}}</button>
   -1    17 					<button class="star {{#isFlagged}}is-active{{/isFlagged}}" data-action="toggleFlagged">{{#icon}}star{{/icon}}</button>
   18    18 					{{#author}}<a class="message__author" href="mailto:{{ email }}">{{ name }}</a>{{/author}}
   19    19 					<span class="message__recipients">
   20    20 						{{#str}}to{{/str}}
@@ -30,39 +30,39 @@
   30    30 					</span>
   31    31 					<span class="message__summary">{{ summary }}</span>
   32    32 
   33    -1 					{{#hasAttachments}}{{#icon}}x-attachment{{/icon}}{{/hasAttachments}}
   -1    33 					{{#hasAttachments}}{{#icon}}attachment{{/icon}}{{/hasAttachments}}
   34    34 					{{#dateFilter}}{{ date }}{{/dateFilter}}
   35    35 
   36    36 					<span class="message__actions">
   37    -1 						{{#canReplyAll}}<button class="button" title="{{#str}}replyAll{{/str}}" data-action="replyAll">{{#icon}}x-reply_all{{/icon}}</button{{/canReplyAll}}
   -1    37 						{{#canReplyAll}}<button class="button" title="{{#str}}replyAll{{/str}}" data-action="replyAll">{{#icon}}reply_all{{/icon}}</button{{/canReplyAll}}
   38    38 						{{^canReplyAll}}
   39    -1 							{{#canReplyToList}}<button class="button" title="{{#str}}replyList{{/str}}" data-action="replyToList">{{#icon}}x-list{{/icon}}</button{{/canReplyToList}}
   40    -1 							{{^canReplyToList}}<button class="button" title="{{#str}}reply{{/str}}" data-action="replyToSender">{{#icon}}x-reply{{/icon}}</button{{/canReplyToList}}
   -1    39 							{{#canReplyToList}}<button class="button" title="{{#str}}replyList{{/str}}" data-action="replyToList">{{#icon}}list{{/icon}}</button{{/canReplyToList}}
   -1    40 							{{^canReplyToList}}<button class="button" title="{{#str}}reply{{/str}}" data-action="replyToSender">{{#icon}}reply{{/icon}}</button{{/canReplyToList}}
   41    41 						{{/canReplyAll}}
   42    42 
   43    -1 						><button class="button dropdownToggle" title="{{#str}}more{{/str}}">{{#icon}}x-menu{{/icon}}</button>
   -1    43 						><button class="button dropdownToggle" title="{{#str}}more{{/str}}">{{#icon}}menu{{/icon}}</button>
   44    44 						<div class="dropdown">
   45    -1 							<button class="dropdown-item" data-action="replyToSender">{{#icon}}x-reply{{/icon}} {{#str}}reply{{/str}}</button>
   46    -1 							{{#canReplyAll}}<button class="dropdown-item" data-action="replyAll">{{#icon}}x-reply_all{{/icon}} {{#str}}replyAll{{/str}}</button>{{/canReplyAll}}
   47    -1 							{{#canReplyToList}}<button class="dropdown-item" data-action="replyToList">{{#icon}}x-list{{/icon}} {{#str}}replyList{{/str}}</button>{{/canReplyToList}}
   48    -1 							<button class="dropdown-item" data-action="forward">{{#icon}}x-forward{{/icon}} {{#str}}forward{{/str}}</button>
   49    -1 							<button class="dropdown-item" data-action="editAsNew">{{#icon}}x-create{{/icon}} {{#str}}edit{{/str}}</button>
   50    -1 							<button class="dropdown-item" data-action="viewClassic">{{#icon}}x-open_in_new{{/icon}} {{#str}}viewClassic{{/str}}</button>
   51    -1 							<button class="dropdown-item" data-action="viewSource">{{#icon}}x-code{{/icon}} {{#str}}viewSource{{/str}}</button>
   -1    45 							<button class="dropdown-item" data-action="replyToSender">{{#icon}}reply{{/icon}} {{#str}}reply{{/str}}</button>
   -1    46 							{{#canReplyAll}}<button class="dropdown-item" data-action="replyAll">{{#icon}}reply_all{{/icon}} {{#str}}replyAll{{/str}}</button>{{/canReplyAll}}
   -1    47 							{{#canReplyToList}}<button class="dropdown-item" data-action="replyToList">{{#icon}}list{{/icon}} {{#str}}replyList{{/str}}</button>{{/canReplyToList}}
   -1    48 							<button class="dropdown-item" data-action="forward">{{#icon}}forward{{/icon}} {{#str}}forward{{/str}}</button>
   -1    49 							<button class="dropdown-item" data-action="editAsNew">{{#icon}}create{{/icon}} {{#str}}edit{{/str}}</button>
   -1    50 							<button class="dropdown-item" data-action="viewClassic">{{#icon}}open_in_new{{/icon}} {{#str}}viewClassic{{/str}}</button>
   -1    51 							<button class="dropdown-item" data-action="viewSource">{{#icon}}code{{/icon}} {{#str}}viewSource{{/str}}</button>
   52    52 						</div>
   53    53 					</span>
   54    54 				</header>
   55    55 
   56    56 				<div class="message__details">
   57    57 					{{#isJunk}}
   58    -1 						<div class="alert alert--warning">{{#icon}}x-mode_heat{{/icon}} {{#str}}junk{{/str}}</div>
   -1    58 						<div class="alert alert--warning">{{#icon}}mode_heat{{/icon}} {{#str}}junk{{/str}}</div>
   59    59 					{{/isJunk}}
   60    60 
   61    61 					<footer class="message__footer">
   62    62 						<ul class="attachments">
   63    63 							{{#attachments}}
   64    64 								<li>
   65    -1 									<a class="attachment" href="{{ url }}">{{#icon}}x-attachment{{/icon}} {{ name }}</a>
   -1    65 									<a class="attachment" href="{{ url }}">{{#icon}}attachment{{/icon}} {{ name }}</a>
   66    66 								</li>
   67    67 							{{/attachments}}
   68    68 						</ul>