Small code cleanups and fix translations

This commit is contained in:
djmaze 2021-01-27 00:26:31 +01:00
parent b31bf3d7f5
commit 7ccc44616d
54 changed files with 288 additions and 426 deletions

View file

@ -2,9 +2,7 @@ import ko from 'ko';
import { KeyState } from 'Common/Enums';
import { Focused } from 'Common/EnumsUser';
import { keyScope, leftPanelDisabled } from 'Common/Globals';
const Settings = rl.settings;
import { keyScope, leftPanelDisabled, Settings } from 'Common/Globals';
class AppUserStore {
constructor() {

View file

@ -2,7 +2,7 @@ import ko from 'ko';
import { StorageResultType, Notification } from 'Common/Enums';
import { Layout, Focused, MessageSetAction } from 'Common/EnumsUser';
import { doc } from 'Common/Globals';
import { pInt, pString } from 'Common/Utils';
import { plainToHtml } from 'Common/UtilsUser';
@ -52,7 +52,7 @@ const
let iMessageBodyCacheCount = 0;
document.body.append(hcont);
doc.body.append(hcont);
class MessageUserStore {
constructor() {
@ -485,7 +485,7 @@ class MessageUserStore {
if (messagesDom) {
id = 'rl-mgs-' + message.hash.replace(/[^a-zA-Z0-9]/g, '');
const textBody = document.getElementById(id);
const textBody = doc.getElementById(id);
if (textBody) {
textBody.rlCacheCount = ++iMessageBodyCacheCount;
message.body = textBody;
@ -508,7 +508,7 @@ class MessageUserStore {
/-----BEGIN PGP SIGNED MESSAGE-----/.test(plain) && /-----BEGIN PGP SIGNATURE-----/.test(plain);
}
const pre = document.createElement('pre');
const pre = doc.createElement('pre');
if (pgpSigned && message.isPgpSigned()) {
pre.className = 'b-plain-openpgp signed';
pre.textContent = plain;

View file

@ -2,6 +2,7 @@ import ko from 'ko';
import { i18n } from 'Common/Translator';
import { pString } from 'Common/Utils';
import { doc } from 'Common/Globals';
import AccountStore from 'Stores/User/Account';
@ -360,7 +361,7 @@ class PgpUserStore {
verControl.addEventHandler('click', domControlSignedClickHelper(this, dom, domText));
}
dom.before(verControl, document.createElement('div'));
dom.before(verControl, doc.createElement('div'));
}
}
}

View file

@ -3,6 +3,7 @@ import ko from 'ko';
import { MESSAGES_PER_PAGE_VALUES } from 'Common/Consts';
import { Layout, EditorDefaultType } from 'Common/EnumsUser';
import { pInt } from 'Common/Utils';
import { doc } from 'Common/Globals';
class SettingsUserStore {
constructor() {
@ -39,7 +40,7 @@ class SettingsUserStore {
}
subscribers() {
const htmlCL = document.documentElement.classList;
const htmlCL = doc.documentElement.classList;
this.layout.subscribe(value => {
htmlCL.toggle('rl-no-preview-pane', Layout.NoPreview === value);
htmlCL.toggle('rl-side-preview-pane', Layout.SidePreview === value);