Added option to prefer HTML to plain text view.

This commit is contained in:
the-djmaze 2022-01-14 14:05:33 +01:00
parent 8343e76d5f
commit 7680372eda
41 changed files with 107 additions and 18 deletions

View file

@ -37,6 +37,7 @@ export class GeneralUserSettings /*extends AbstractViewSettings*/ {
this.enableDesktopNotification = NotificationUserStore.enableDesktopNotification;
this.isDesktopNotificationAllowed = NotificationUserStore.isDesktopNotificationAllowed;
this.viewHTML = SettingsUserStore.viewHTML;
this.showImages = SettingsUserStore.showImages;
this.removeColors = SettingsUserStore.removeColors;
this.useCheckboxesInList = SettingsUserStore.useCheckboxesInList;
@ -111,6 +112,7 @@ export class GeneralUserSettings /*extends AbstractViewSettings*/ {
messagesPerPage: value => Remote.saveSetting('MPP', value,
settingsSaveHelperSimpleFunction(this.mppTrigger, this)),
viewHTML: value => Remote.saveSetting('ViewHTML', value ? 1 : 0),
showImages: value => Remote.saveSetting('ShowImages', value ? 1 : 0),
removeColors: value => {

View file

@ -402,7 +402,7 @@ export const MessageUserStore = new class {
message.body = body;
message.fetchDataFromDom();
} else {
let isHtml = !!json.Html,
let isHtml = (SettingsUserStore.viewHTML() || !json.Plain) && !!json.Html,
resultHtml = '';
if (isHtml) {
resultHtml = json.Html.toString().replace(/font-size:\s*[0-9]px/g,'font-size:11px');

View file

@ -28,6 +28,7 @@ export const SettingsUserStore = new class {
self.messageReadDelay = ko.observable(5).extend({ debounce: 999 });
addObservablesTo(self, {
viewHTML: 1,
showImages: 0,
removeColors: 0,
useCheckboxesInList: 1,
@ -74,6 +75,7 @@ export const SettingsUserStore = new class {
self.messageReadDelay(pInt(SettingsGet('MessageReadDelay')));
self.autoLogout(pInt(SettingsGet('AutoLogout')));
self.viewHTML(SettingsGet('ViewHTML'));
self.showImages(SettingsGet('ShowImages'));
self.removeColors(SettingsGet('RemoveColors'));
self.useCheckboxesInList(SettingsGet('UseCheckboxesInList'));