mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 03:59:21 +03:00
Merge branch 'master' of github.com:the-djmaze/snappymail
This commit is contained in:
commit
9e05aa4a50
6 changed files with 63 additions and 76 deletions
|
|
@ -39,6 +39,7 @@
|
|||
|
||||
.squire-toolbar-svg-icon {
|
||||
display: block;
|
||||
fill: var(--dialog-clr, #333);
|
||||
}
|
||||
|
||||
.squire2-mode-wysiwyg .squire-plain,
|
||||
|
|
|
|||
|
|
@ -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.0',
|
||||
VERSION = '1.0.1',
|
||||
RELEASE = '2024-02-23',
|
||||
REQUIRED = '2.34.0',
|
||||
LICENSE = 'AGPL v3',
|
||||
|
|
@ -14,7 +14,7 @@ class CompactComposerPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
|
||||
public function Init(): void
|
||||
{
|
||||
$this->addTemplate('templates/PopupsCompose.html');
|
||||
$this->addTemplate('templates/PopupsCompactCompose.html');
|
||||
$this->addCss('css/composer.css');
|
||||
$this->addJs('js/squire-raw.js');
|
||||
$this->addJs('js/parsel.js');
|
||||
|
|
|
|||
|
|
@ -1,16 +1,47 @@
|
|||
/* eslint max-len: 0 */
|
||||
(win => {
|
||||
|
||||
addEventListener('rl-view-model.create', e => {
|
||||
if (e.detail.viewModelTemplateID === 'PopupsCompose') {
|
||||
// There is a better way to do this probably,
|
||||
// but we need this for drag and drop to work
|
||||
e.detail.attachmentsArea = e.detail.bodyArea;
|
||||
}
|
||||
const rl = win.rl;
|
||||
|
||||
if (!rl) {
|
||||
return;
|
||||
}
|
||||
|
||||
rl.registerWYSIWYG('CompactComposer', (owner, container, onReady) => {
|
||||
const editor = new CompactComposer(container);
|
||||
onReady(editor);
|
||||
});
|
||||
|
||||
const doc = win.document;
|
||||
const rl = win.rl;
|
||||
|
||||
// If a user (or admin) selected the CompactComposer we need to
|
||||
// replace PopupsCompose template with PopupsCompactCompose template.
|
||||
// --
|
||||
// This might break some plugins if they query/change PopupsCompose template
|
||||
// before this code is called. They should instead listen for
|
||||
// 'rl-view-model.create' to work properly.
|
||||
if (rl.settings.get('editorWysiwyg') === 'CompactComposer') {
|
||||
const compactTemplate = doc.getElementById('PopupsCompactCompose');
|
||||
if (!compactTemplate) {
|
||||
console.error('CompactComposer: PopupsCompactCompose template not found');
|
||||
return;
|
||||
}
|
||||
const originalTemplate = doc.getElementById('PopupsCompose');
|
||||
if (originalTemplate) {
|
||||
originalTemplate.id = 'PopupsCompose_replaced';
|
||||
} else {
|
||||
console.warn('CompactComposer: PopupsCompose template not found');
|
||||
}
|
||||
compactTemplate.id = 'PopupsCompose';
|
||||
|
||||
addEventListener('rl-view-model.create', e => {
|
||||
if (e.detail.viewModelTemplateID === 'PopupsCompose') {
|
||||
// There is a better way to do this probably,
|
||||
// but we need this for drag and drop to work
|
||||
e.detail.attachmentsArea = e.detail.bodyArea;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const
|
||||
removeElements = 'HEAD,LINK,META,NOSCRIPT,SCRIPT,TEMPLATE,TITLE',
|
||||
|
|
@ -114,9 +145,6 @@
|
|||
|
||||
this.container = container;
|
||||
|
||||
toolbar.className = 'squire-toolbar btn-toolbar';
|
||||
const actions = this.#makeActions(squire, toolbar);
|
||||
|
||||
plain.className = 'squire-plain';
|
||||
wysiwyg.className = 'squire-wysiwyg';
|
||||
wysiwyg.dir = 'auto';
|
||||
|
|
@ -126,6 +154,9 @@
|
|||
this.wysiwyg = wysiwyg;
|
||||
this.toolbar = toolbar;
|
||||
|
||||
toolbar.className = 'squire-toolbar btn-toolbar';
|
||||
const actions = this.#makeActions(squire, toolbar);
|
||||
|
||||
this.squire.addEventListener('willPaste', pasteSanitizer);
|
||||
this.squire.addEventListener('pasteImage', (e) => {
|
||||
pasteImageHandler(e, squire);
|
||||
|
|
@ -663,13 +694,13 @@
|
|||
return indicators;
|
||||
case 'menu':
|
||||
case 'menu_more':
|
||||
const menuWrap = document.createElement('div');
|
||||
const menuWrap = createElement('div');
|
||||
menuWrap.className = 'btn-group dropdown squire-toolbar-menu-wrap';
|
||||
menuWrap.title = item.label;
|
||||
if (!item.showInPlainMode) {
|
||||
menuWrap.className += ' squire-html-mode-item';
|
||||
}
|
||||
const menuBtn = document.createElement('a');
|
||||
const menuBtn = createElement('button');
|
||||
menuBtn.className = 'btn dropdown-toggle';
|
||||
if (item.icon !== '') {
|
||||
menuBtn.innerHTML = item.icon;
|
||||
|
|
@ -680,7 +711,7 @@
|
|||
}
|
||||
menuWrap.appendChild(menuBtn);
|
||||
|
||||
const menu = document.createElement('ul');
|
||||
const menu = createElement('ul');
|
||||
menu.className = 'dropdown-menu squire-toolbar-menu';
|
||||
if (item.rightEdge) {
|
||||
menu.className += ' right-edge';
|
||||
|
|
@ -956,12 +987,4 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (rl) {
|
||||
rl.registerWYSIWYG('CompactComposer', (owner, container, onReady) => {
|
||||
const editor = new CompactComposer(container);
|
||||
onReady(editor);
|
||||
});
|
||||
}
|
||||
|
||||
})(window);
|
||||
|
|
|
|||
|
|
@ -145,10 +145,10 @@
|
|||
</a>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<a class="btn fontastic" style="padding-left: 10px; padding-right: 10px;" id="composeUploadButton"
|
||||
data-bind="visible: addAttachmentEnabled()" data-i18n="[title]COMPOSE/ATTACH_FILES">
|
||||
<button class="btn fontastic" id="composeUploadButton"
|
||||
data-bind="visible: addAttachmentEnabled()" data-i18n="[title]COMPOSE/ATTACH_FILES">
|
||||
⁺📎
|
||||
</a>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -167,41 +167,6 @@
|
|||
<div class="tab-content" role="tabpanel" aria-hidden="false" style="grid-column-end:3">
|
||||
<div class="textAreaParent" data-bind="initDom: editorArea, attr:{spellcheck:allowSpellcheck()?'true':'false'}"></div>
|
||||
</div>
|
||||
|
||||
<!-- <input type="radio" name="tabs" value="attachments" id="tab-attachments" data-bind="checked: viewArea">-->
|
||||
<!-- <label for="tab-attachments"-->
|
||||
<!-- role="tab"-->
|
||||
<!-- aria-selected="false"-->
|
||||
<!-- aria-controls="panel2"-->
|
||||
<!-- tabindex="0"-->
|
||||
<!-- data-bind="-->
|
||||
<!-- css: { 'btn-danger': attachmentsInErrorCount() },-->
|
||||
<!-- tooltipErrorTip: attachmentsErrorTooltip">-->
|
||||
<!-- <b data-bind="visible: attachmentsCount, text: attachmentsCount"></b>-->
|
||||
<!-- <i data-bind="css: { 'icon-attachment': !attachmentsInProcessCount(), 'icon-spinner': attachmentsInProcessCount()}"></i>-->
|
||||
<!-- <span data-i18n="GLOBAL/ATTACHMENTS"></span>-->
|
||||
<!-- </label>-->
|
||||
<!-- <div class="tab-content attachmentAreaParent" role="tabpanel" aria-hidden="true" style="grid-column-end:4">-->
|
||||
<!-- <div class="b-attachment-place" data-bind="visible: addAttachmentEnabled() && dragAndDropVisible(), css: {dragAndDropOver: dragAndDropOver}"-->
|
||||
<!-- data-i18n="COMPOSE/ATTACH_DROP_FILES_DESC"></div>-->
|
||||
<!-- <ul class="attachmentList" data-bind="foreach: attachments">-->
|
||||
<!-- <li class="attachmentItem" data-bind="attr: { title: title }, css: { waiting: waiting, error: '' !== error() }">-->
|
||||
<!-- <div class="attachmentIcon">-->
|
||||
<!-- <i class="iconMain" data-bind="css: iconClass, visible: !uploading() || 0 === progress()"></i>-->
|
||||
<!-- <div class="iconProgress" data-bind="attr: { style: progressStyle }, visible: uploading"></div>-->
|
||||
<!-- <div class="iconBG" data-bind="text: progressText, visible: uploading"></div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="attachmentNameParent">-->
|
||||
<!-- <a href="#" class="close pull-right" style="margin-top:-4px;" data-bind="click: cancel">×</a>-->
|
||||
<!-- <div class="attachmentName" data-bind="text: fileName"></div>-->
|
||||
<!-- <span class="attachmentSize" data-bind="text: friendlySize"></span>-->
|
||||
<!-- </div>-->
|
||||
<!-- </li>-->
|
||||
<!-- </ul>-->
|
||||
<!-- <div class="no-attachments-desc" data-bind="visible: 0 === attachments().length"-->
|
||||
<!-- data-i18n="COMPOSE/NO_ATTACHMENTS_HERE_DESC"></div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<input type="radio" name="tabs" value="mailvelope" id="tab-mailvelope" data-bind="checked: viewArea">
|
||||
<label for="tab-mailvelope"
|
||||
role="tab"
|
||||
|
|
@ -219,8 +184,6 @@
|
|||
<div class="attachmentAreaParent compact">
|
||||
<div class="b-attachment-place" data-bind="visible: addAttachmentEnabled(), css: {dragAndDropOver: dragAndDropVisible}"
|
||||
data-i18n="COMPOSE/ATTACH_DROP_FILES_DESC"></div>
|
||||
<!-- <div class="b-attachment-place dragAndDropOver"-->
|
||||
<!-- data-i18n="COMPOSE/ATTACH_DROP_FILES_DESC"></div>-->
|
||||
<ul class="attachmentList" data-bind="foreach: attachments">
|
||||
<li class="attachmentItem" data-bind="attr: { title: title }, css: { waiting: waiting, error: '' !== error() }">
|
||||
<div class="attachmentIcon">
|
||||
|
|
@ -69,7 +69,7 @@
|
|||
"LABEL_STORAGE_DSN": "Dsn",
|
||||
"LABEL_STORAGE_USER": "Utilisateur",
|
||||
"LABEL_STORAGE_PASSWORD": "Mot de passe",
|
||||
"SQLITE_GLOBAL": "Use a global DB instead of per account",
|
||||
"SQLITE_GLOBAL": "Utilisez une DB globale au lieu de par compte",
|
||||
"ALERT_NOTICE": "Note !",
|
||||
"SUGGESTIONS_LIMIT": "Limite de suggestions",
|
||||
"HTML_ALERT_DO_NOT_USE_THIS_DATABASE": "N'utilisez pas ce type de base de données avec un grand nombre d'utilisateurs actifs.",
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@
|
|||
"ADD_MENU_TAGS": "Étiquettes",
|
||||
"BUTTON_SHARE_ALL": "Tout le monde",
|
||||
"BUTTON_SYNC": "Synchronisation (CardDAV)",
|
||||
"SEND_TO_ALL_CONTACT_EMAILS": "Send to all contact emails"
|
||||
"SEND_TO_ALL_CONTACT_EMAILS": "Envoyer à tous les e-mails contact"
|
||||
},
|
||||
"COMPOSE": {
|
||||
"LINK_SHOW_INPUTS": "Voir tous les champs",
|
||||
|
|
@ -282,8 +282,8 @@
|
|||
"GOOD_SIGNATURE": "Signature valide pour %USER%",
|
||||
"ERROR": "Erreur %TYPE%: %ERROR%",
|
||||
"CREATE_SELF_SIGNED": "Create self-signed",
|
||||
"VALID_UNTIL": "Valid until",
|
||||
"PRIVATE_KEY": "Private key"
|
||||
"VALID_UNTIL": "Valable jusque",
|
||||
"PRIVATE_KEY": "Clé privée"
|
||||
},
|
||||
"OPENPGP": {
|
||||
"POPUP_IMPORT_TITLE": "Importer la clef OpenPGP",
|
||||
|
|
@ -296,19 +296,19 @@
|
|||
"SIGNED_MESSAGE": "Message signé par OpenPGP",
|
||||
"ENCRYPTED_MESSAGE": "Message chiffré par OpenPGP",
|
||||
"STORE_IN_GNUPG": "Stocker sur le serveur dans GnuPG",
|
||||
"STORE_PUBLIC_KEY_IN_GNUPG": "Store public key on server in GnuPG",
|
||||
"STORE_PRIVATE_KEY_IN_GNUPG": "Store private key on server in GnuPG",
|
||||
"STORE_PUBLIC_KEY_IN_GNUPG": "Stocker la clé publique sur le serveur dans GnuPG",
|
||||
"STORE_PRIVATE_KEY_IN_GNUPG": "Stocker la clé privée sur le serveur dans GnuPG",
|
||||
"BACKUP_ON_SERVER": "Stocker (chiffré) sur le serveur",
|
||||
"BACKUP_PUBLIC_KEY_ON_SERVER": "Backup public key on server",
|
||||
"BACKUP_PRIVATE_KEY_ON_SERVER": "Backup private key on server"
|
||||
"BACKUP_PUBLIC_KEY_ON_SERVER": "Clé publique de sauvegarde sur le serveur",
|
||||
"BACKUP_PRIVATE_KEY_ON_SERVER": "Clé privée de sauvegarde sur le serveur"
|
||||
},
|
||||
"SMIME": {
|
||||
"POPUP_IMPORT_TITLE": "Import S\/MIME certificate",
|
||||
"CERTIFICATE": "Certificate",
|
||||
"CERTIFICATES": "S\/MIME Certificates",
|
||||
"POPUP_IMPORT_TITLE": "Importer le certificat S\/MIME",
|
||||
"CERTIFICATE": "Certificat",
|
||||
"CERTIFICATES": "Certificats S\/MIME",
|
||||
"SIGNED_MESSAGE": "Message signé par S\/MIME",
|
||||
"ENCRYPTED_MESSAGE": "Message chiffré par S\/MIME",
|
||||
"PRIVATE_KEY_OF": "S\/MIME private key of %EMAIL%"
|
||||
"PRIVATE_KEY_OF": "Clé privée S\/MIME de %EMAIL%"
|
||||
},
|
||||
"POPUPS_FILTER": {
|
||||
"TITLE_CREATE_FILTER": "Créer un filtre ?",
|
||||
|
|
@ -532,7 +532,7 @@
|
|||
"SETTINGS_OPENPGP": {
|
||||
"BUTTON_IMPORT_KEY": "Importer la clé",
|
||||
"BUTTON_GENERATE_KEY_PAIR": "Générer les clés",
|
||||
"IMPORT_FROM_SERVER": "Import from server",
|
||||
"IMPORT_FROM_SERVER": "Importer depuis le serveur",
|
||||
"TITLE_PRIVATE": "Privée",
|
||||
"TITLE_PUBLIC": "Publique",
|
||||
"GET_MAILVELOPE": "Obtenez le module complémentaire de navigateur Mailvelope"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue