* Mail/RichTextEditor: common preference "small paragraph" now changes return key to a line break instead of a paragraph (with margin)

This commit is contained in:
ralf 2022-09-12 10:04:42 +02:00
parent 09b69cdb97
commit 25877c7ba6
7 changed files with 33 additions and 20 deletions

View File

@ -84,6 +84,7 @@ var et2_htmlarea = /** @class */ (function (_super) {
} }
// default settings for initialization // default settings for initialization
var settings = { var settings = {
base_url: egw.webserverUrl + '/vendor/tinymce/tinymce',
target: this.htmlNode[0], target: this.htmlNode[0],
body_id: this.dom_id + '_htmlarea', body_id: this.dom_id + '_htmlarea',
menubar: false, menubar: false,
@ -129,7 +130,7 @@ var et2_htmlarea = /** @class */ (function (_super) {
], ],
toolbar: et2_htmlarea.TOOLBAR_SIMPLE, toolbar: et2_htmlarea.TOOLBAR_SIMPLE,
block_formats: "Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;" + block_formats: "Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;" +
"Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre;Custom Paragraph=customparagraph", "Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",
font_formats: "Andale Mono=andale mono,times;Arial=arial,helvetica," + font_formats: "Andale Mono=andale mono,times;Arial=arial,helvetica," +
"sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book " + "sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book " +
"antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;" + "antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;" +
@ -146,7 +147,13 @@ var et2_htmlarea = /** @class */ (function (_super) {
egw.preference('rte_font_unit', 'common')), egw.preference('rte_font_unit', 'common')),
}; };
var rte_formatblock = (egw.preference('rte_formatblock', 'common') || 'p'); var rte_formatblock = (egw.preference('rte_formatblock', 'common') || 'p');
if (rte_formatblock !== 'p') { if (rte_formatblock === 'customparagraph') {
settings.forced_root_block = false;
settings.force_br_newlines = true;
settings.force_p_newlines = false;
rte_formatblock = 'p';
}
else if (rte_formatblock !== 'p') {
settings.formats[rte_formatblock] = jQuery.extend(true, {}, settings.formats.p); settings.formats[rte_formatblock] = jQuery.extend(true, {}, settings.formats.p);
settings.formats[rte_formatblock].block = rte_formatblock; settings.formats[rte_formatblock].block = rte_formatblock;
} }
@ -159,7 +166,7 @@ var et2_htmlarea = /** @class */ (function (_super) {
self.set_value(self.htmlNode.val()); self.set_value(self.htmlNode.val());
self.resetDirty(); self.resetDirty();
if (self.editor && self.editor.editorContainer) { if (self.editor && self.editor.editorContainer) {
self.editor.formatter.toggle(egw.preference('rte_formatblock', 'common')); self.editor.formatter.toggle(rte_formatblock);
jQuery(self.editor.editorContainer).height(self.options.height); jQuery(self.editor.editorContainer).height(self.options.height);
jQuery(self.editor.iframeElement.contentWindow.document).on('dragenter', function () { jQuery(self.editor.iframeElement.contentWindow.document).on('dragenter', function () {
if (jQuery('#dragover-tinymce').length < 1) if (jQuery('#dragover-tinymce').length < 1)

View File

@ -213,7 +213,8 @@ export class et2_htmlarea extends et2_editableWidget implements et2_IResizeable
'&request_id='+this.getInstanceManager().etemplate_exec_id+'&type=htmlarea'; '&request_id='+this.getInstanceManager().etemplate_exec_id+'&type=htmlarea';
} }
// default settings for initialization // default settings for initialization
let settings = { let settings : any = {
base_url: egw.webserverUrl + '/vendor/tinymce/tinymce',
target: this.htmlNode[0], target: this.htmlNode[0],
body_id: this.dom_id + '_htmlarea', body_id: this.dom_id + '_htmlarea',
menubar: false, menubar: false,
@ -259,7 +260,7 @@ export class et2_htmlarea extends et2_editableWidget implements et2_IResizeable
], ],
toolbar: et2_htmlarea.TOOLBAR_SIMPLE, toolbar: et2_htmlarea.TOOLBAR_SIMPLE,
block_formats: "Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;"+ block_formats: "Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;"+
"Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre;Custom Paragraph=customparagraph", "Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",
font_formats: "Andale Mono=andale mono,times;Arial=arial,helvetica,"+ font_formats: "Andale Mono=andale mono,times;Arial=arial,helvetica,"+
"sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book "+ "sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book "+
"antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;"+ "antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;"+
@ -275,8 +276,15 @@ export class et2_htmlarea extends et2_editableWidget implements et2_IResizeable
egw.preference('rte_font_size', 'common')+'::'+ egw.preference('rte_font_size', 'common')+'::'+
egw.preference('rte_font_unit', 'common')), egw.preference('rte_font_unit', 'common')),
}; };
const rte_formatblock = <string>(egw.preference('rte_formatblock', 'common') || 'p'); let rte_formatblock = <string>(egw.preference('rte_formatblock', 'common') || 'p');
if (rte_formatblock !== 'p') if (rte_formatblock === 'customparagraph')
{
settings.forced_root_block = false;
settings.force_br_newlines = true;
settings.force_p_newlines = false;
rte_formatblock = 'p';
}
else if (rte_formatblock !== 'p')
{ {
settings.formats[rte_formatblock] = jQuery.extend(true, {}, settings.formats.p); settings.formats[rte_formatblock] = jQuery.extend(true, {}, settings.formats.p);
settings.formats[rte_formatblock].block = rte_formatblock; settings.formats[rte_formatblock].block = rte_formatblock;
@ -291,7 +299,7 @@ export class et2_htmlarea extends et2_editableWidget implements et2_IResizeable
self.resetDirty(); self.resetDirty();
if (self.editor && self.editor.editorContainer) if (self.editor && self.editor.editorContainer)
{ {
self.editor.formatter.toggle(<string><unknown>egw.preference('rte_formatblock', 'common')); self.editor.formatter.toggle(rte_formatblock);
jQuery(self.editor.editorContainer).height(self.options.height); jQuery(self.editor.editorContainer).height(self.options.height);
jQuery(self.editor.iframeElement.contentWindow.document).on('dragenter', function(){ jQuery(self.editor.iframeElement.contentWindow.document).on('dragenter', function(){
if (jQuery('#dragover-tinymce').length < 1) jQuery("<style id='dragover-tinymce'>.dragover:after {height:calc(100% - "+jQuery(this).height()+"px) !important;}</style>").appendTo('head'); if (jQuery('#dragover-tinymce').length < 1) jQuery("<style id='dragover-tinymce'>.dragover:after {height:calc(100% - "+jQuery(this).height()+"px) !important;}</style>").appendTo('head');

View File

@ -435,9 +435,9 @@ class preferences_hooks
'h5' => lang("Heading %1", '5'), 'h5' => lang("Heading %1", '5'),
'h6' => lang("Heading %1", '6'), 'h6' => lang("Heading %1", '6'),
'pre' => lang("Preformatted"), 'pre' => lang("Preformatted"),
'customparagraph' => lang("Custom Paragraph") 'customparagraph' => lang("Small Paragraph")
), ),
'help' => 'Automatically start with this format block. Custom Paragraph adds less line space between new lines.', 'help' => 'Automatically start with this format block. Small Paragraph adds less line space between new lines.',
'xmlrpc' => True, 'xmlrpc' => True,
'admin' => false, 'admin' => false,
'default' => 'p' 'default' => 'p'

View File

@ -15,7 +15,7 @@ audio effect preferences de Audio-Effekt
audio effect enables|disables sound effects used in the theme preferences de Audio Effekte (Sound) für das Thema aktivieren|deaktivieren. audio effect enables|disables sound effects used in the theme preferences de Audio Effekte (Sound) für das Thema aktivieren|deaktivieren.
automatically start with this font preferences de Startet automatisch mit dieser Schrift automatically start with this font preferences de Startet automatisch mit dieser Schrift
automatically start with this font size preferences de Startet automatisch mit dieser Schriftgröße automatically start with this font size preferences de Startet automatisch mit dieser Schriftgröße
automatically start with this format block. custom paragraph adds less line space between new lines. preferences de Startet automatisch mit dieser Formatierung.<br/> <b>Absatz schmal</b> erzeugt einen geringeren Zeilenabstand. automatically start with this format block. custom paragraph adds less line space between new lines. preferences de Startet automatisch mit dieser Formatierung.<br/> <b>Schmaler Absatz</b> erzeugt einen geringeren Zeilenabstand.
br preferences de br br preferences de br
change a user password by passing the old and new passwords. returns true on success, false on failure. preferences de Ändern Sie Ihr Passwort, indem Sie Ihr altes und neues Passwort angeben. Es wird TRUE zurückgegeben für eine erfolgreiche Änderung und FALSE wenn es nicht erfolgreich war. change a user password by passing the old and new passwords. returns true on success, false on failure. preferences de Ändern Sie Ihr Passwort, indem Sie Ihr altes und neues Passwort angeben. Es wird TRUE zurückgegeben für eine erfolgreiche Änderung und FALSE wenn es nicht erfolgreich war.
change password preferences de Passwort ändern change password preferences de Passwort ändern
@ -31,7 +31,7 @@ color preferences de Farbe
country preferences de Land country preferences de Land
current password preferences de Aktuelles Passwort current password preferences de Aktuelles Passwort
custom login box color, defaults to above color darkened preferences de Benutzerdefinierte Farbe der Anmeldemaske, Vorgabe obige Farbe abgedunkelt custom login box color, defaults to above color darkened preferences de Benutzerdefinierte Farbe der Anmeldemaske, Vorgabe obige Farbe abgedunkelt
custom paragraph preferences de Absatz schmal small paragraph preferences de Schmaler Absatz
custom sidebar menu active color, defaults to above color darkened preferences de Benutzerdefinierte Farbe des Seitenmenü, Vorgabe obige Farbe abgedunkelt custom sidebar menu active color, defaults to above color darkened preferences de Benutzerdefinierte Farbe des Seitenmenü, Vorgabe obige Farbe abgedunkelt
dark mode theme preferences de Dark Mode Thema dark mode theme preferences de Dark Mode Thema
dark moono theme preferences de Dunkles Moono Schema dark moono theme preferences de Dunkles Moono Schema

View File

@ -15,7 +15,7 @@ audio effect preferences en Audio effect
audio effect enables|disables sound effects used in the theme preferences en Audio effect enables|disables sound effects used in the theme audio effect enables|disables sound effects used in the theme preferences en Audio effect enables|disables sound effects used in the theme
automatically start with this font preferences en Automatically start with this font automatically start with this font preferences en Automatically start with this font
automatically start with this font size preferences en Automatically start with this font size automatically start with this font size preferences en Automatically start with this font size
automatically start with this format block. custom paragraph adds less line space between new lines. preferences en Automatically start with this format block.<br/><b>Custom Paragraph</b> adds less line space between new lines. automatically start with this format block. small paragraph adds less line space between new lines. preferences en Automatically start with this format block.<br/><b>Small Paragraph</b> adds less line space between new lines.
br preferences en br br preferences en br
change a user password by passing the old and new passwords. returns true on success, false on failure. preferences en Change a user password by passing the old and new passwords. Returns TRUE on success, FALSE on failure. change a user password by passing the old and new passwords. returns true on success, false on failure. preferences en Change a user password by passing the old and new passwords. Returns TRUE on success, FALSE on failure.
change password preferences en Change password change password preferences en Change password
@ -31,7 +31,7 @@ color preferences en Color
country preferences en Country country preferences en Country
current password preferences en Current password current password preferences en Current password
custom login box color, defaults to above color darkened preferences en Custom login box color, defaults to above color darkened custom login box color, defaults to above color darkened preferences en Custom login box color, defaults to above color darkened
custom paragraph preferences en Custom Paragraph small paragraph preferences en Small Paragraph
custom sidebar menu active color, defaults to above color darkened preferences en Custom sidebar menu active color, defaults to above color darkened custom sidebar menu active color, defaults to above color darkened preferences en Custom sidebar menu active color, defaults to above color darkened
dark mode theme preferences en Dark mode theme dark mode theme preferences en Dark mode theme
dark moono theme preferences en Dark Moono Theme dark moono theme preferences en Dark Moono Theme

View File

@ -15,7 +15,7 @@ audio effect preferences fr Effet audio
audio effect enables|disables sound effects used in the theme preferences fr Effets Audio : active|désactive les effets sonores utilisés dans le thème audio effect enables|disables sound effects used in the theme preferences fr Effets Audio : active|désactive les effets sonores utilisés dans le thème
automatically start with this font preferences fr Démarrer automatiquement avec cette police automatically start with this font preferences fr Démarrer automatiquement avec cette police
automatically start with this font size preferences fr Démarrer automatiquement avec cette taille de police automatically start with this font size preferences fr Démarrer automatiquement avec cette taille de police
automatically start with this format block. custom paragraph adds less line space between new lines. preferences fr Démarrer automatiquement avec ce format de bloc.<br/><b>Paragraphe personnalisé</b> ajoute moins d'espace entre les nouvelles lignes. automatically start with this format block. custom paragraph adds less line space between new lines. preferences fr Démarrer automatiquement avec ce format de bloc.<br/><b>Petit Paragraphe</b> ajoute moins d'espace entre les nouvelles lignes.
br preferences fr br br preferences fr br
change a user password by passing the old and new passwords. returns true on success, false on failure. preferences fr Change un mot de passe en fournissant l'ancien et le nouveau mot de passe. Retourne TRUE en cas de réussite, FALSE en cas d'échec. change a user password by passing the old and new passwords. returns true on success, false on failure. preferences fr Change un mot de passe en fournissant l'ancien et le nouveau mot de passe. Retourne TRUE en cas de réussite, FALSE en cas d'échec.
change password preferences fr Changer votre mot de passe change password preferences fr Changer votre mot de passe
@ -31,7 +31,7 @@ color preferences fr Couleur
country preferences fr Pays country preferences fr Pays
current password preferences fr Mot de passe actuel current password preferences fr Mot de passe actuel
custom login box color, defaults to above color darkened preferences fr Couleur de la boîte de connexion personnalisée, par défaut, plus sombre custom login box color, defaults to above color darkened preferences fr Couleur de la boîte de connexion personnalisée, par défaut, plus sombre
custom paragraph preferences fr Paragraphe personnalisé small paragraph preferences fr Paragraphe petit
custom sidebar menu active color, defaults to above color darkened preferences fr Couleur de la sélection active sur le menu latéral, par défaut, plus sombre custom sidebar menu active color, defaults to above color darkened preferences fr Couleur de la sélection active sur le menu latéral, par défaut, plus sombre
dark moono theme preferences fr Thème Dark Moono dark moono theme preferences fr Thème Dark Moono
data exchange settings preferences fr Paramètres d'échange de données data exchange settings preferences fr Paramètres d'échange de données

View File

@ -15,7 +15,6 @@ audio effect preferences sk Zvukový efekt
audio effect enables|disables sound effects used in the theme preferences sk Zvukový efekt - zapne/vypne zvukvé efekty použité v tejto téme audio effect enables|disables sound effects used in the theme preferences sk Zvukový efekt - zapne/vypne zvukvé efekty použité v tejto téme
automatically start with this font preferences sk Automaticky začať s týmto písmom automatically start with this font preferences sk Automaticky začať s týmto písmom
automatically start with this font size preferences sk Automaticky začať s touto veľkosťou písma automatically start with this font size preferences sk Automaticky začať s touto veľkosťou písma
automatically start with this format block.<br/><b>custom paragraph</b> adds less line space between new lines. preferences sk Automaticky začať týmto formátovacím blokom.<br/><b>Vlastný odstavec</b> pridáva menej odsadenia medzi novými riadkami.
change a user password by passing the old and new passwords. returns true on success, false on failure. preferences sk Zmeniť používateľské heslo zadaním starého a nového hesla. Vráti TRUE v prípade úspechu a FALSE v prípade neúspechu. change a user password by passing the old and new passwords. returns true on success, false on failure. preferences sk Zmeniť používateľské heslo zadaním starého a nového hesla. Vráti TRUE v prípade úspechu a FALSE v prípade neúspechu.
change password preferences sk Zmeniť heslo change password preferences sk Zmeniť heslo
change your password preferences sk Zmeniť heslo change your password preferences sk Zmeniť heslo
@ -30,7 +29,6 @@ color preferences sk Farba
country preferences sk Krajina country preferences sk Krajina
current password preferences sk Súčasné heslo current password preferences sk Súčasné heslo
custom login box color, defaults to above color darkened preferences sk Vlastná farba pre prihlasovacie okno, predvolený je tmavší odtieň vyššieuvedenej farby custom login box color, defaults to above color darkened preferences sk Vlastná farba pre prihlasovacie okno, predvolený je tmavší odtieň vyššieuvedenej farby
custom paragraph preferences sk Vlastný odstavec
custom sidebar menu active color, defaults to above color darkened preferences sk Vlastná farba pre bočný panel, predvolený je tmavší odtieň vyššieuvedenej farby custom sidebar menu active color, defaults to above color darkened preferences sk Vlastná farba pre bočný panel, predvolený je tmavší odtieň vyššieuvedenej farby
dark moono theme preferences sk Tmavá Moono téma dark moono theme preferences sk Tmavá Moono téma
data exchange settings preferences sk Nastavenia pre výmenu údajov data exchange settings preferences sk Nastavenia pre výmenu údajov