xi-conversations

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

commit
c5116920b6edfebbc9ec58f3d8605ed0b1c59003
parent
39860ce59c1ac40ad99408b4f33d7e4465f2c2f5
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2023-09-04 18:41
update material icons

Diffstat

M content/js/util.js 2 +-
M content/material-icons.svg 22 +++++++++++-----------
M scripts/get-material-icons.sh 12 +++---------

3 files changed, 15 insertions, 21 deletions


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

@@ -57,7 +57,7 @@ export var createIcon = function(key) {
   57    57 
   58    58 	if (key.substring(0, 2) === 'x-') {
   59    59 		use.setAttributeNS(nsxlink, 'href', `/content/material-icons.svg#${key.substring(2)}`);
   60    -1 		svg.setAttribute('viewBox', '0 0 24 24');
   -1    60 		svg.setAttribute('viewBox', '0 -960 960 960');
   61    61 	} else {
   62    62 		// File no longer exists. Is there a new one?
   63    63 		use.setAttributeNS(nsxlink, 'href', `chrome://messenger/skin/icons/mail-toolbar.svg#${key}`);

diff --git a/content/material-icons.svg b/content/material-icons.svg

@@ -1,14 +1,14 @@
    1     1 <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
    2     2     <!-- Material icons are published under Apache License Version 2.0. https://material.io/icons/ -->
    3    -1     <path id="attachment" d="M2 12.5C2 9.46 4.46 7 7.5 7H18c2.21 0 4 1.79 4 4s-1.79 4-4 4H9.5C8.12 15 7 13.88 7 12.5S8.12 10 9.5 10H17v2H9.41c-.55 0-.55 1 0 1H18c1.1 0 2-.9 2-2s-.9-2-2-2H7.5C5.57 9 4 10.57 4 12.5S5.57 16 7.5 16H17v2H7.5C4.46 18 2 15.54 2 12.5z"/>
    4    -1     <path id="code" d="M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"/>
    5    -1     <path id="open_in_new" d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"/>
    6    -1     <path id="star" d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/>
    7    -1     <path id="lock" d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"/>
    8    -1     <path id="reply" d="M10 9V5l-7 7 7 7v-4.1c5 0 8.5 1.6 11 5.1-1-5-4-10-11-11z"/>
    9    -1     <path id="reply_all" d="M7 8V5l-7 7 7 7v-3l-4-4 4-4zm6 1V5l-7 7 7 7v-4.1c5 0 8.5 1.6 11 5.1-1-5-4-10-11-11z"/>
   10    -1     <path id="menu" d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/>
   11    -1     <path id="list" d="M3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7z"/>
   12    -1     <path id="forward" d="M12 8V4l8 8-8 8v-4H4V8z"/>
   13    -1     <path id="create" d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/>
   -1     3     <path id="attachment" d="M300-260q-92 0-156-64T80-480q0-92 64-156t156-64h420q66 0 113 47t47 113q0 66-47 113t-113 47H340q-42 0-71-29t-29-71q0-42 29-71t71-29h380v60H340q-17 0-28.5 11.5T300-480q0 17 11.5 28.5T340-440h380q42 0 71-29t29-71q0-42-29-71t-71-29H300q-66 0-113 47t-47 113q0 66 47 113t113 47h420v60H300Z"/>
   -1     4     <path id="code" d="M320-240 80-480l240-240 57 57-184 184 183 183-56 56Zm320 0-57-57 184-184-183-183 56-56 240 240-240 240Z"/>
   -1     5     <path id="open_in_new" d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h280v80H200v560h560v-280h80v280q0 33-23.5 56.5T760-120H200Zm188-212-56-56 372-372H560v-80h280v280h-80v-144L388-332Z"/>
   -1     6     <path id="star" d="m233-80 65-281L80-550l288-25 112-265 112 265 288 25-218 189 65 281-247-149L233-80Z"/>
   -1     7     <path id="lock" d="M240-80q-33 0-56.5-23.5T160-160v-400q0-33 23.5-56.5T240-640h40v-80q0-83 58.5-141.5T480-920q83 0 141.5 58.5T680-720v80h40q33 0 56.5 23.5T800-560v400q0 33-23.5 56.5T720-80H240Zm240-200q33 0 56.5-23.5T560-360q0-33-23.5-56.5T480-440q-33 0-56.5 23.5T400-360q0 33 23.5 56.5T480-280ZM360-640h240v-80q0-50-35-85t-85-35q-50 0-85 35t-35 85v80Z"/>
   -1     8     <path id="reply" d="M760-200v-160q0-50-35-85t-85-35H273l144 144-57 56-240-240 240-240 57 56-144 144h367q83 0 141.5 58.5T840-360v160h-80Z"/>
   -1     9     <path id="reply_all" d="M320-280 80-520l240-240 57 56-184 184 184 184-57 56Zm480 80v-160q0-50-35-85t-85-35H433l144 144-57 56-240-240 240-240 57 56-144 144h247q83 0 141.5 58.5T880-360v160h-80Z"/>
   -1    10     <path id="menu" d="M120-240v-80h720v80H120Zm0-200v-80h720v80H120Zm0-200v-80h720v80H120Z"/>
   -1    11     <path id="list" d="M280-600v-80h560v80H280Zm0 160v-80h560v80H280Zm0 160v-80h560v80H280ZM160-600q-17 0-28.5-11.5T120-640q0-17 11.5-28.5T160-680q17 0 28.5 11.5T200-640q0 17-11.5 28.5T160-600Zm0 160q-17 0-28.5-11.5T120-480q0-17 11.5-28.5T160-520q17 0 28.5 11.5T200-480q0 17-11.5 28.5T160-440Zm0 160q-17 0-28.5-11.5T120-320q0-17 11.5-28.5T160-360q17 0 28.5 11.5T200-320q0 17-11.5 28.5T160-280Z"/>
   -1    12     <path id="forward" d="m640-280-57-56 184-184-184-184 57-56 240 240-240 240ZM80-200v-160q0-83 58.5-141.5T280-560h247L383-704l57-56 240 240-240 240-57-56 144-144H280q-50 0-85 35t-35 85v160H80Z"/>
   -1    13     <path id="create" d="M772-603 602-771l56-56q23-23 56.5-23t56.5 23l56 56q23 23 24 55.5T829-660l-57 57Zm-58 59L290-120H120v-170l424-424 170 170Z"/>
   14    14 </svg>

diff --git a/scripts/get-material-icons.sh b/scripts/get-material-icons.sh

@@ -1,16 +1,10 @@
    1     1 #!/bin/sh
    2     2 
    3    -1 if which ghead >/dev/null 2>&1; then
    4    -1   HEAD=ghead
    5    -1 else
    6    -1   HEAD=head
    7    -1 fi
    8    -1 
    9     3 echo '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">'
   10     4 echo '    <!-- Material icons are published under Apache License Version 2.0. https://material.io/icons/ -->'
   11     5 for icon in attachment code open_in_new star lock reply reply_all menu list forward create; do
   12    -1     wget -q "https://storage.googleapis.com/material-icons/external-assets/v4/icons/svg/ic_${icon}_black_24px.svg" -O - \
   13    -1         | grep -v fill | $HEAD -n -1 \
   14    -1         | sed "s/<path/<path id=\"${icon}\"/"
   -1     6     wget -q "https://fonts.gstatic.com/s/i/short-term/release/materialsymbolsoutlined/${icon}/fill1/24px.svg" -O - \
   -1     7         | grep -o '<path.*/>' \
   -1     8         | sed "s/<path/    <path id=\"${icon}\"/"
   15     9 done
   16    10 echo "</svg>"