Merge branch 'the-djmaze:master' into master

This commit is contained in:
cm-schl
2024-05-14 15:48:41 +02:00
committed by GitHub
5 changed files with 483 additions and 357 deletions

View File

@@ -6,7 +6,7 @@ class CompactComposerPlugin extends \RainLoop\Plugins\AbstractPlugin
NAME = 'Compact Composer',
AUTHOR = 'Sergey Mosin',
URL = 'https://github.com/the-djmaze/snappymail/pull/1466',
VERSION = '1.0.3',
VERSION = '1.0.4',
RELEASE = '2024-04-23',
REQUIRED = '2.34.0',
LICENSE = 'AGPL v3',

View File

@@ -155,6 +155,20 @@
pasteImageHandler(e, squire);
});
wysiwyg.addEventListener('focus', () => {
const range = this.squire.getSelection();
if (range.collapsed && range.startContainer === wysiwyg) {
// when the caret is directly in the wysiwyg a bunch of stuff
// (like lists, blockquotes, etc...) do not work,
// so we need to place it inside the nearest element
if (wysiwyg.children[range.startOffset] !== undefined) {
const newRange = document.createRange();
newRange.setStart(wysiwyg.children[range.startOffset], 0);
this.squire.setSelection(newRange);
}
}
});
// squire.addEventListener('focus', () => shortcuts.off());
// squire.addEventListener('blur', () => shortcuts.on());
@@ -598,7 +612,7 @@
type: 'menu_item',
label: 'HTML Mode',
id: 'menu-item-mode-wysiwyg',
cmd: () => this.setMode('wysiwyg'),
cmd: () => this.setModeCmd('wysiwyg'),
showInPlainMode: true,
icon: '<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m2 2v3h1v-2h2v-1zm13 0v1h2v2h1v-3zm-9 3v10h2v-4h4v4h2v-10h-2v4h-4v-4zm-4 10v3h3v-1h-2v-2zm15 0v2h-2v1h3v-3z"/></svg>'
},
@@ -606,7 +620,7 @@
type: 'menu_item',
label: 'Edit Source',
id: 'menu-item-mode-source',
cmd: () => this.setMode('source'),
cmd: () => this.setModeCmd('source'),
showInPlainMode: true,
icon: '<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m12 2.83c-0.478-0.138-0.976 0.141-1.11 0.619l-3.6 12.6c-0.138 0.478 0.141 0.976 0.619 1.11 0.478 0.138 0.976-0.141 1.11-0.619l3.6-12.6c0.138-0.478-0.141-0.976-0.619-1.11zm2.27 4.65 2.51 2.51-2.51 2.51c-0.352 0.352-0.352 0.923 0 1.27 0.352 0.352 0.923 0.352 1.27 0l3.15-3.15c0.352-0.352 0.352-0.923 0-1.27l-3.15-3.15c-0.352-0.352-0.923-0.352-1.27-0.00141-0.35 0.35-0.35 0.921 0.00141 1.27zm-8.63-1.27c-0.352-0.352-0.923-0.352-1.27 0l-3.15 3.15c-0.352 0.352-0.352 0.923 0 1.27l3.15 3.15c0.352 0.352 0.923 0.352 1.27 0 0.352-0.352 0.352-0.923 0-1.27l-2.51-2.51 2.51-2.51c0.352-0.352 0.352-0.923 0-1.27z"/></svg>'
},
@@ -614,7 +628,7 @@
type: 'menu_item',
label: 'Plain Text Mode',
id: 'menu-item-mode-plain',
cmd: () => this.setMode('plain'),
cmd: () => this.setModeCmd('plain'),
showInPlainMode: true,
icon: '<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m2 2v3h1v-2h2v-1zm13 0v1h2v2h1v-3zm-9 3v2h3v8h2v-8h3v-2zm-4 10v3h3v-1h-2v-2zm15 0v2h-2v1h3v-3z"/></svg>'
}
@@ -871,6 +885,12 @@
return validation.test(this.squire.getPath()) || this.squire.hasFormat(format);
}
*/
setModeCmd(mode) {
this.setMode(mode);
setTimeout(() => this.focus(), 1);
}
setMode(mode) {
if (this.mode !== mode) {
let cl = this.container.classList,
@@ -894,7 +914,6 @@
this.mode = mode;
cl.add('squire2-mode-' + mode);
this.onModeChange?.();
setTimeout(() => this.focus(), 1);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -17,6 +17,18 @@ namespace MailSo\Smtp;
use MailSo\Net\Enumerations\ConnectionSecurityType;
use SnappyMail\IDN;
/**
response codes:
220 ready
221 Closing
235 Authentication succeeded
250 Requested mail action okay, completed
251 User not local; will forward
252 Cannot verify the user, but it will try to deliver the message anyway
334 Server challenge (the text part contains the Base64-encoded challenge)
354 Start mail input
*/
/**
* @category MailSo
* @package Smtp
@@ -183,7 +195,7 @@ class SmtpClient extends \MailSo\Net\NetClient
// RFC 5802
$sRequest = $SASL->authenticate($sLogin, $sPassword, $sResult);
$this->logMask($sRequest);
$sResult = $this->sendRequestWithCheck($sRequest, 234);
$sResult = $this->sendRequestWithCheck($sRequest, 334);
$sRequest = $SASL->challenge($sResult);
} else switch ($type) {
// RFC 4616

View File

@@ -286,10 +286,10 @@
"CREATE_SELF_SIGNED": "Criar auto-assinado",
"VALID_UNTIL": "Válido até",
"PRIVATE_KEY": "Chave privada",
"CHANGE_PASS": "Change passphrase",
"CURRENT_PASS": "Current passphrase",
"NEW_PASS": "New passphrase",
"ASK_CRYPTKEY_PASS": "Your login passphrase has changed. Please fill in your old login passphrase to decrypt data"
"CHANGE_PASS": "Alterar frase secreta",
"CURRENT_PASS": "Frase secreta atual",
"NEW_PASS": "Nova frase secreta",
"ASK_CRYPTKEY_PASS": "A sua frase secreta de autenticação foi alterada. Por favor, preencha a sua frase secreta antiga para desencriptar os dados"
},
"OPENPGP": {
"POPUP_IMPORT_TITLE": "Importar chave OpenPGP",
@@ -616,7 +616,7 @@
"DemoAccountError": "Por motivos de segurança, esta conta não tem permissão de executar esta ação!",
"AccountAlreadyExists": "Esta conta já existe",
"AccountDoesNotExist": "Esta conta não existe",
"AccountSwitchFailed": "A mudança para a conta \"%EMAIL%\" falhou",
"AccountSwitchFailed": "A alteração para a conta \"%EMAIL%\" falhou",
"MailServerError": "Ocorreu um erro ao aceder ao servidor de correio",
"InvalidInputArgument": "Parâmetro de entrada inválido",
"UnknownError": "Erro desconhecido"