Made SquaresDark theme really dark.

Due to that, e-mails with incorrect background/color settings are unreadable.
So a new feature in the settings is there to remove colors from messages.
Not perfect yet, but it works.
This commit is contained in:
djmaze 2021-02-24 00:17:53 +01:00
parent fac36e828b
commit 2982027dd2
22 changed files with 164 additions and 63 deletions

View file

@ -39,6 +39,7 @@ export class GeneralUserSettings {
this.isDesktopNotificationDenied = NotificationStore.isDesktopNotificationDenied;
this.showImages = SettingsStore.showImages;
this.removeColors = SettingsStore.removeColors;
this.useCheckboxesInList = SettingsStore.useCheckboxesInList;
this.threadsAllowed = AppStore.threadsAllowed;
this.useThreads = SettingsStore.useThreads;
@ -125,6 +126,7 @@ export class GeneralUserSettings {
this.editorDefaultType.subscribe(Remote.saveSettingsHelper('EditorDefaultType', null, f0));
this.messagesPerPage.subscribe(Remote.saveSettingsHelper('MPP', null, f1));
this.showImages.subscribe(Remote.saveSettingsHelper('ShowImages', v=>v?'1':'0'));
this.removeColors.subscribe(Remote.saveSettingsHelper('RemoveColors', v=>v?'1':'0'));
this.useCheckboxesInList.subscribe(Remote.saveSettingsHelper('UseCheckboxesInList', v=>v?'1':'0'));

View file

@ -47,7 +47,24 @@ const
findEmailAndLinks = html => html
.replace(url, '$1<a href="$2" target="_blank">$2</a>')
.replace(email, '$1<a href="mailto:$2">$2</a>'),
isChecked = item => item.checked();
isChecked = item => item.checked(),
// Removes background and color
// Many e-mails incorrectly only define one, not both
// And in dark theme mode this kills the readability
removeColors = html => {
let l;
do {
l = html.length;
html = html
.replace(/(<[^>]+);?background(-color)?\s*:[^;"']+/gi, '$1')
.replace(/(<[^>]+[^-]);?color\s*:[^;"']+/gi, '$1')
.replace(/(<[^>]+[^-])\sbgcolor="[^"]+"/gi, '$1')
.replace(/(<[^>]+[^-])\scolor="[^"]+"/gi, '$1');
//.replace(/<\/?font[^>]+>/gmi, '')
} while (l != html.length)
return html;
};
doc.body.append(hcont);
@ -499,12 +516,13 @@ class MessageUserStore {
message.fetchDataFromDom();
messagesDom.append(textBody);
} else {
let isHtml = false;
if (json.Html) {
isHtml = true;
let isHtml = !!json.Html;
if (isHtml) {
resultHtml = json.Html.toString();
if (SettingsStore.removeColors()) {
resultHtml = removeColors(resultHtml);
}
} else if (json.Plain) {
isHtml = false;
resultHtml = plainToHtml(json.Plain.toString());
if ((message.isPgpSigned() || message.isPgpEncrypted()) && PgpStore.capaOpenPGP()) {
@ -534,7 +552,6 @@ class MessageUserStore {
resultHtml = '<pre>' + resultHtml + '</pre>';
}
} else {
isHtml = false;
resultHtml = '<pre>' + resultHtml + '</pre>';
}
@ -552,7 +569,7 @@ class MessageUserStore {
message.body = body;
message.isHtml(!!isHtml);
message.isHtml(isHtml);
message.hasImages(!!json.HasExternals);
messagesDom.append(body);

View file

@ -27,6 +27,7 @@ class SettingsUserStore {
ko.addObservablesTo(this, {
showImages: false,
removeColors: false,
useCheckboxesInList: true,
allowDraftAutosave: true,
useThreads: false,
@ -58,6 +59,7 @@ class SettingsUserStore {
this.messagesPerPage(settingsGet('MPP'));
this.showImages(!!settingsGet('ShowImages'));
this.removeColors(!!settingsGet('RemoveColors'));
this.useCheckboxesInList(!!(ThemeStore.isMobile() || settingsGet('UseCheckboxesInList')));
this.allowDraftAutosave(!!settingsGet('AllowDraftAutosave'));
this.useThreads(!!settingsGet('UseThreads'));

View file

@ -307,7 +307,6 @@ html.rl-no-preview-pane {
}
.subjectParent {
color: #000;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@ -316,7 +315,7 @@ html.rl-no-preview-pane {
.subjectParent .emptySubjectText {
display: none;
font-style: italic;
color: #999;
opacity: 0.5;
}
&.emptySubject .subjectParent {

View file

@ -206,6 +206,7 @@
.messageItem {
color: #000;
position: absolute;
top: 0;
bottom: 0;
@ -347,8 +348,6 @@
.bodyText {
color: #000;
.b-text-part {
height: 100%;

View file

@ -70,20 +70,23 @@
.e-page {
display: inline-block;
color: #999;
opacity: 0.5;
text-decoration: none;
font-size: 22px;
padding: 3px;
cursor: pointer;
&:hover .e-page-number {
color: #555;
&:hover {
opacity: 0.8;
}
&.current {
opacity: 1;
}
&.current .e-page-number {
font-size: 25px;
color: #333;
border-bottom: 2px solid #000;
font-size: 115%;
text-decoration: underline;
}
}
}

View file

@ -300,8 +300,7 @@ class MessageViewMailBoxUserView extends AbstractViewRight {
detectDomBackgroundColor(dom) {
let color = '';
if (dom) {
if (dom && !SettingsStore.removeColors()) {
let limit = 5,
aC = dom;
while (!color && aC && limit--) {
@ -317,7 +316,6 @@ class MessageViewMailBoxUserView extends AbstractViewRight {
color = isTransparent(color) ? '' : color;
}
return color;
}

View file

@ -1079,6 +1079,7 @@ class Actions
// user
'ShowImages' => (bool) $oConfig->Get('defaults', 'show_images', false),
'RemoveColors' => (bool) $oConfig->Get('defaults', 'remove_colors', false),
'MPP' => (int) $oConfig->Get('webmail', 'messages_per_page', 25),
'SoundNotification' => false,
'DesktopNotifications' => false,
@ -1237,6 +1238,7 @@ class Actions
$aResult['EditorDefaultType'] = (string)$oSettings->GetConf('EditorDefaultType', $aResult['EditorDefaultType']);
$aResult['ShowImages'] = (bool)$oSettings->GetConf('ShowImages', $aResult['ShowImages']);
$aResult['RemoveColors'] = (bool)$oSettings->GetConf('RemoveColors', $aResult['RemoveColors']);
$aResult['ContactsAutosave'] = (bool)$oSettings->GetConf('ContactsAutosave', $aResult['ContactsAutosave']);
$aResult['MPP'] = (int)$oSettings->GetConf('MPP', $aResult['MPP']);
$aResult['SoundNotification'] = (bool)$oSettings->GetConf('SoundNotification', $aResult['SoundNotification']);

View file

@ -356,6 +356,7 @@ trait User
$this->setSettingsFromParams($oSettings, 'EditorDefaultType', 'string');
$this->setSettingsFromParams($oSettings, 'ShowImages', 'bool');
$this->setSettingsFromParams($oSettings, 'RemoveColors', 'bool');
$this->setSettingsFromParams($oSettings, 'ContactsAutosave', 'bool');
$this->setSettingsFromParams($oSettings, 'DesktopNotifications', 'bool');
$this->setSettingsFromParams($oSettings, 'SoundNotification', 'bool');

View file

@ -385,16 +385,13 @@ en:
LABEL_EDITOR_PLAIN: "Plain"
LABEL_EDITOR_HTML_FORCED: "Html (forced)"
LABEL_EDITOR_PLAIN_FORCED: "Plain (forced)"
LABEL_ANIMATION: "Interface animation"
LABEL_ANIMATION_FULL: "Full"
LABEL_ANIMATION_NORMAL: "Normal"
LABEL_VIEW_OPTIONS: "View options"
LABEL_USE_PREVIEW_PANE: "Use preview pane"
LABEL_USE_CHECKBOXES_IN_LIST: "Display checkboxes in list"
LABEL_USE_THREADS: "Use threads"
LABEL_REPLY_SAME_FOLDER: "Place replies in the folder of the message being replied to"
LABEL_SHOW_IMAGES: "Always display external images in message body"
LABEL_SHOW_ANIMATION: "Show animation"
LABEL_REMOVE_COLORS: "Remove background and text colors from message body"
LABEL_MESSAGE_PER_PAGE: "Messages on page"
LABEL_NOTIFICATIONS: "Notifications"
LABEL_SOUND_NOTIFICATION: "Sound notification"

View file

@ -386,16 +386,13 @@ de_DE:
LABEL_EDITOR_PLAIN: "Unformatierter Text"
LABEL_EDITOR_HTML_FORCED: "HTML (erzwungen)"
LABEL_EDITOR_PLAIN_FORCED: "Unformatierter Text (erzwungen)"
LABEL_ANIMATION: "Interface-Animation"
LABEL_ANIMATION_FULL: "Komplett"
LABEL_ANIMATION_NORMAL: "Normal"
LABEL_VIEW_OPTIONS: "Optionen anzeigen"
LABEL_USE_PREVIEW_PANE: "Vorschaufenster nutzen"
LABEL_USE_CHECKBOXES_IN_LIST: "Kontrollkästchen in der Liste anzeigen"
LABEL_USE_THREADS: "Als Unterhaltungen anzeigen"
LABEL_REPLY_SAME_FOLDER: "Antworten im gleichen Ordner wie die Nachricht, auf die geantwortet wurde, abspeichern"
LABEL_SHOW_IMAGES: "In der Nachricht enthaltene Bilder immer anzeigen"
LABEL_SHOW_ANIMATION: "Animation anzeigen"
LABEL_REMOVE_COLORS: "Entfern Hintergrund- und Textfarben aus der Nachricht"
LABEL_MESSAGE_PER_PAGE: "Nachrichten pro Seite"
LABEL_NOTIFICATIONS: "Benachrichtigungen"
LABEL_SOUND_NOTIFICATION: "Benachrichtigungston"

View file

@ -385,16 +385,13 @@ en_GB:
LABEL_EDITOR_PLAIN: "Plain"
LABEL_EDITOR_HTML_FORCED: "Html (forced)"
LABEL_EDITOR_PLAIN_FORCED: "Plain (forced)"
LABEL_ANIMATION: "Interface animation"
LABEL_ANIMATION_FULL: "Full"
LABEL_ANIMATION_NORMAL: "Normal"
LABEL_VIEW_OPTIONS: "View options"
LABEL_USE_PREVIEW_PANE: "Use preview pane"
LABEL_USE_CHECKBOXES_IN_LIST: "Display checkboxes in list"
LABEL_USE_THREADS: "Use threads"
LABEL_REPLY_SAME_FOLDER: "Place replies in the folder of the message being replied to"
LABEL_SHOW_IMAGES: "Always display external images in message body"
LABEL_SHOW_ANIMATION: "Show animation"
LABEL_REMOVE_COLORS: "Remove background and text colors from message body"
LABEL_MESSAGE_PER_PAGE: "Messages on page"
LABEL_NOTIFICATIONS: "Notifications"
LABEL_SOUND_NOTIFICATION: "Sound notification"

View file

@ -385,16 +385,13 @@ en_US:
LABEL_EDITOR_PLAIN: "Plain"
LABEL_EDITOR_HTML_FORCED: "Html (forced)"
LABEL_EDITOR_PLAIN_FORCED: "Plain (forced)"
LABEL_ANIMATION: "Interface animation"
LABEL_ANIMATION_FULL: "Full"
LABEL_ANIMATION_NORMAL: "Normal"
LABEL_VIEW_OPTIONS: "View options"
LABEL_USE_PREVIEW_PANE: "Use preview pane"
LABEL_USE_CHECKBOXES_IN_LIST: "Display checkboxes in list"
LABEL_USE_THREADS: "Use threads"
LABEL_REPLY_SAME_FOLDER: "Place replies in the folder of the message being replied to"
LABEL_SHOW_IMAGES: "Always display external images in message body"
LABEL_SHOW_ANIMATION: "Show animation"
LABEL_REMOVE_COLORS: "Remove background and text colors from message body"
LABEL_MESSAGE_PER_PAGE: "Messages on page"
LABEL_NOTIFICATIONS: "Notifications"
LABEL_SOUND_NOTIFICATION: "Sound notification"

View file

@ -387,16 +387,13 @@ es_ES:
LABEL_EDITOR_PLAIN: "Texto plano"
LABEL_EDITOR_HTML_FORCED: "Html (forzado)"
LABEL_EDITOR_PLAIN_FORCED: "Texto plano (forzado)"
LABEL_ANIMATION: "Interface animation"
LABEL_ANIMATION_FULL: "Todo"
LABEL_ANIMATION_NORMAL: "Normal"
LABEL_VIEW_OPTIONS: "Ver opciones"
LABEL_USE_PREVIEW_PANE: "Utilice el panel de vista previa"
LABEL_USE_CHECKBOXES_IN_LIST: "Mostrar casillas de verificación en la lista"
LABEL_USE_THREADS: "Usar hilos de conversación"
LABEL_REPLY_SAME_FOLDER: "Coloque las respuestas en la carpeta del mensaje que esta respondiendo."
LABEL_SHOW_IMAGES: "Mostrar siempre las imágenes en el cuerpo del mensaje"
LABEL_SHOW_ANIMATION: "Mostrar animación"
LABEL_REMOVE_COLORS: "Eliminar el fondo y los colores del texto del mensaje"
LABEL_MESSAGE_PER_PAGE: "Mensajes en página"
LABEL_NOTIFICATIONS: "Notificaciones"
LABEL_SOUND_NOTIFICATION: "Sonido de la notificación"

View file

@ -386,16 +386,13 @@ fr_FR:
LABEL_EDITOR_PLAIN: "Non-formaté"
LABEL_EDITOR_HTML_FORCED: "HTML (forcé)"
LABEL_EDITOR_PLAIN_FORCED: "Non-formaté (forcé)"
LABEL_ANIMATION: "Animation de l'interface"
LABEL_ANIMATION_FULL: "Plein"
LABEL_ANIMATION_NORMAL: "Normal"
LABEL_VIEW_OPTIONS: "Voir les options"
LABEL_USE_PREVIEW_PANE: "Utiliser le panneau de prévisualisation"
LABEL_USE_CHECKBOXES_IN_LIST: "Afficher des cases à cocher dans la liste"
LABEL_USE_THREADS: "Regrouper en conversations"
LABEL_REPLY_SAME_FOLDER: "Placer les réponses dans le dossier du message"
LABEL_SHOW_IMAGES: "Toujours afficher les images dans le mail"
LABEL_SHOW_ANIMATION: "Voir les animations"
LABEL_REMOVE_COLORS: "Supprimer les couleurs d'arrière-plan et de texte du message"
LABEL_MESSAGE_PER_PAGE: "Messages par page"
LABEL_NOTIFICATIONS: "Notifications"
LABEL_SOUND_NOTIFICATION: "Son de notification"

View file

@ -385,16 +385,13 @@ nl_NL:
LABEL_EDITOR_PLAIN: "Platte tekst"
LABEL_EDITOR_HTML_FORCED: "Html (geforceerd)"
LABEL_EDITOR_PLAIN_FORCED: "Platte tekst (geforceerd)"
LABEL_ANIMATION: "Interface animatie"
LABEL_ANIMATION_FULL: "Volledig"
LABEL_ANIMATION_NORMAL: "Normaal"
LABEL_VIEW_OPTIONS: "Bekijk opties"
LABEL_USE_PREVIEW_PANE: "Toon leesvenster"
LABEL_USE_CHECKBOXES_IN_LIST: "Toon selectievakjes in de lijst"
LABEL_USE_THREADS: "Groepeer berichten"
LABEL_REPLY_SAME_FOLDER: "Plaats antwoorden in de map van het originele bericht"
LABEL_SHOW_IMAGES: "Afbeeldingen altijd weergeven in het bericht"
LABEL_SHOW_ANIMATION: "Toon animaties"
LABEL_REMOVE_COLORS: "Verwijder achtergrond- en tekstkleuren uit het bericht"
LABEL_MESSAGE_PER_PAGE: "Berichten op pagina"
LABEL_NOTIFICATIONS: "Notificaties"
LABEL_SOUND_NOTIFICATION: "Notificatie geluid"

View file

@ -383,16 +383,13 @@ zh_CN:
LABEL_EDITOR_PLAIN: "普通文本"
LABEL_EDITOR_HTML_FORCED: "强制HTML文本"
LABEL_EDITOR_PLAIN_FORCED: "强制普通文本"
LABEL_ANIMATION: "界面动画"
LABEL_ANIMATION_FULL: "完整"
LABEL_ANIMATION_NORMAL: "正常"
LABEL_VIEW_OPTIONS: "视图选项"
LABEL_USE_PREVIEW_PANE: "使用预览"
LABEL_USE_CHECKBOXES_IN_LIST: "列表中显示多选框"
LABEL_USE_THREADS: "使用对话"
LABEL_REPLY_SAME_FOLDER: "将回复的邮件置于被回复的邮件所在的文件夹"
LABEL_SHOW_IMAGES: "总是显示外部图片信息"
LABEL_SHOW_ANIMATION: "显示动画"
LABEL_REMOVE_COLORS: "从消息中删除背景和文本颜色"
LABEL_MESSAGE_PER_PAGE: "封邮件每页"
LABEL_NOTIFICATIONS: "通知"
LABEL_SOUND_NOTIFICATION: "提示音"

View file

@ -43,7 +43,7 @@
<b data-i18n="POPUPS_SIEVE_SCRIPT/CAPABILITY_LABEL"></b>:
<span data-bind="text: $root.sieveCapabilities"></span>
</pre>
<textarea class="span8" data-bind="value: body, valueUpdate: 'input'"></textarea>
<textarea style="width:100%" data-bind="value: body, valueUpdate: 'input'"></textarea>
</div>
</div>
<div data-bind="visible: !$root.rawActive()">

View file

@ -85,7 +85,14 @@
value: showImages
}
}"></div>
<div class="hide-mobile" data-bind="component: {
<div data-bind="component: {
name: 'Checkbox',
params: {
label: 'SETTINGS_GENERAL/LABEL_REMOVE_COLORS',
value: removeColors
}
}"></div>
<div data-bind="component: {
name: 'Checkbox',
params: {
label: 'SETTINGS_GENERAL/LABEL_USE_CHECKBOXES_IN_LIST',

View file

@ -1,7 +1,7 @@
:root {
// MAIN
--main-color: #333;
--main-color: #fff;
--main-bg-color: #48525C;
--main-bg-image: url("@{base}images/background.jpg");
@ -48,6 +48,105 @@
}
.thm-message-list-top-toolbar, .thm-message-list-bottom-toolbar {
background-image: linear-gradient(to bottom, #f4f4f4, #dfdfdf) !important;
background-image: linear-gradient(to bottom,#444,#111) !important;
background-repeat: repeat-x !important;
color: #fff;
}
.btn:not(.btn-success):not(.btn-warning):not(.btn-danger) {
border-color: rgba(255,255,255,.15) rgba(255,255,255,.15) rgba(255,255,255,.25);
box-shadow: inset 0 1px 0 rgba(0,0,0,.2), 0 1px 2px rgba(255,255,255,.05);
color: #fff;
text-shadow: 0 -1px 0 rgba(255,255,255,.25);
background-color: #000;
}
.btn:not(.btn-success):not(.btn-warning):not(.btn-danger).active, .btn:not(.btn-success):not(.btn-warning):not(.btn-danger):active {
box-shadow: inset 0 2px 4px rgba(255,255,255,.5), 0 1px 2px rgba(255,255,255,.25);
}
.btn .icon-spinner {
border-color: #333;
border-top-color: #aaa;
}
.btn .caret {
border-top-color: #fff;
}
.messageList .b-message-list-wrapper {
border-color: #555;
}
.modal,
.b-settins-right .b-content,
.messageList .b-content,
.messageView .b-content {
background-color: #000;
border-color: #555;
color: #fff;
}
.legend,
.modal-header, .modal-footer,
.table td, .table th {
border-color: #555;
}
.legend,
.b-compose .b-header .e-identity,
.messageView .b-content .messageItem {
color: #fff;
}
.b-compose .b-header,
.squire-toolbar,
.b-themes-list .e-item {
background-color: #222;
color: #fff;
}
.g-ui-link,
.messageView .b-content .messageItemHeader .informationShort a,
.messageView .b-content .messageItem .bodyText .b-text-part a {
color: #6AE;
}
.messageView .b-content .messageItemHeader,
.messageView .b-content .messageItem .pgpEncrypted,
.messageView .b-content .messageItem .pgpSigned,
.messageView .b-content .messageItem .readReceipt,
.messageView .b-content .messageItem .showImages,
.messageView .b-content .messageItem .attachmentsPlace {
background-color: #222;
border-bottom-color: #444;
}
.messageList .b-content .messageListItem {
background-color: #111;
border-left-color: #111;
color: #EEE;
}
.messageList .b-content .messageListItem.focused,
#rl-popups .b-languages-content .lang-item {
background-color: #222;
}
.table-hover tbody tr:hover td,
.table-hover tbody tr:hover th,
#rl-popups .b-languages-content .lang-item:hover {
background-color: #333;
}
.messageList .b-content .messageListItem.hasUnseenSubMessage,
.messageList .b-content .messageListItem.unseen,
#rl-popups .b-languages-content .lang-item.user {
background-color: #220;
}
.messageList .b-content .messageListItem.selected {
background-color: #345;
}
.b-themes-list .e-item.selected,
#rl-popups .b-languages-content .lang-item.selected {
background-color: #020;
}

View file

@ -8,14 +8,13 @@
font-size: 20px;
font-weight: bold;
line-height: @baseLineHeight;
color: @black;
color: inherit;
text-shadow: 0 1px 0 rgba(255,255,255,1);
opacity: 0.2;
opacity: 0.5;
&:hover {
color: @black;
text-decoration: none;
cursor: pointer;
opacity: 0.4;
opacity: 0.8;
}
}

View file

@ -34,7 +34,6 @@
.modal-body {
overflow-y: auto;
padding: 15px;
background-color: #fff;
}
// Footer (for actions)
@ -42,10 +41,8 @@
padding: 14px 15px 15px;
margin-bottom: 0;
text-align: right; // right align buttons
background-color: #f5f5f5;
border-top: 1px solid #ddd;
border-radius: 0 0 6px 6px;
box-shadow: inset 0 1px 0 @white;
.clearfix(); // clear it in case folks use .pull-* classes on buttons
// Properly space out buttons