diff --git a/api/js/etemplate/et2_widget_htmlarea.js b/api/js/etemplate/et2_widget_htmlarea.js index 5fcd46231d..2989ce19f2 100644 --- a/api/js/etemplate/et2_widget_htmlarea.js +++ b/api/js/etemplate/et2_widget_htmlarea.js @@ -84,6 +84,7 @@ var et2_htmlarea = /** @class */ (function (_super) { } // default settings for initialization var settings = { + base_url: egw.webserverUrl + '/vendor/tinymce/tinymce', target: this.htmlNode[0], body_id: this.dom_id + '_htmlarea', menubar: false, @@ -129,7 +130,7 @@ var et2_htmlarea = /** @class */ (function (_super) { ], toolbar: et2_htmlarea.TOOLBAR_SIMPLE, 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," + "sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book " + "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')), }; 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].block = rte_formatblock; } @@ -159,7 +166,7 @@ var et2_htmlarea = /** @class */ (function (_super) { self.set_value(self.htmlNode.val()); self.resetDirty(); 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.iframeElement.contentWindow.document).on('dragenter', function () { if (jQuery('#dragover-tinymce').length < 1) diff --git a/api/js/etemplate/et2_widget_htmlarea.ts b/api/js/etemplate/et2_widget_htmlarea.ts index b2fe40ee44..c7d83e13cc 100644 --- a/api/js/etemplate/et2_widget_htmlarea.ts +++ b/api/js/etemplate/et2_widget_htmlarea.ts @@ -213,7 +213,8 @@ export class et2_htmlarea extends et2_editableWidget implements et2_IResizeable '&request_id='+this.getInstanceManager().etemplate_exec_id+'&type=htmlarea'; } // default settings for initialization - let settings = { + let settings : any = { + base_url: egw.webserverUrl + '/vendor/tinymce/tinymce', target: this.htmlNode[0], body_id: this.dom_id + '_htmlarea', menubar: false, @@ -259,7 +260,7 @@ export class et2_htmlarea extends et2_editableWidget implements et2_IResizeable ], toolbar: et2_htmlarea.TOOLBAR_SIMPLE, 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,"+ "sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book "+ "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_unit', 'common')), }; - const rte_formatblock = (egw.preference('rte_formatblock', 'common') || 'p'); - if (rte_formatblock !== 'p') + let rte_formatblock = (egw.preference('rte_formatblock', 'common') || '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].block = rte_formatblock; @@ -291,7 +299,7 @@ export class et2_htmlarea extends et2_editableWidget implements et2_IResizeable self.resetDirty(); 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.iframeElement.contentWindow.document).on('dragenter', function(){ if (jQuery('#dragover-tinymce').length < 1) jQuery("").appendTo('head'); @@ -579,4 +587,4 @@ export class et2_htmlarea extends et2_editableWidget implements et2_IResizeable } } } -et2_register_widget(et2_htmlarea, ["htmlarea"]); \ No newline at end of file +et2_register_widget(et2_htmlarea, ["htmlarea"]); diff --git a/preferences/inc/class.preferences_hooks.inc.php b/preferences/inc/class.preferences_hooks.inc.php index c865143793..b18527d194 100644 --- a/preferences/inc/class.preferences_hooks.inc.php +++ b/preferences/inc/class.preferences_hooks.inc.php @@ -435,9 +435,9 @@ class preferences_hooks 'h5' => lang("Heading %1", '5'), 'h6' => lang("Heading %1", '6'), '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, 'admin' => false, 'default' => 'p' @@ -525,4 +525,4 @@ class preferences_hooks ); display_section($appname, $file); } -} +} \ No newline at end of file diff --git a/preferences/lang/egw_de.lang b/preferences/lang/egw_de.lang index a3ca5db3cb..e3db4fed78 100644 --- a/preferences/lang/egw_de.lang +++ b/preferences/lang/egw_de.lang @@ -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. 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 format block. custom paragraph adds less line space between new lines. preferences de Startet automatisch mit dieser Formatierung.
Absatz schmal 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.
Schmaler Absatz erzeugt einen geringeren Zeilenabstand. 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 password preferences de Passwort ändern @@ -31,7 +31,7 @@ color preferences de Farbe country preferences de Land 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 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 dark mode theme preferences de Dark Mode Thema dark moono theme preferences de Dunkles Moono Schema diff --git a/preferences/lang/egw_en.lang b/preferences/lang/egw_en.lang index 4b5659ebcb..9d1d338995 100644 --- a/preferences/lang/egw_en.lang +++ b/preferences/lang/egw_en.lang @@ -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 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 format block. custom paragraph adds less line space between new lines. preferences en Automatically start with this format block.
Custom Paragraph 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.
Small Paragraph adds less line space between new lines. 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 password preferences en Change password @@ -31,7 +31,7 @@ color preferences en Color country preferences en Country 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 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 dark mode theme preferences en Dark mode theme dark moono theme preferences en Dark Moono Theme diff --git a/preferences/lang/egw_fr.lang b/preferences/lang/egw_fr.lang index 09ed4130a3..3abba5e922 100644 --- a/preferences/lang/egw_fr.lang +++ b/preferences/lang/egw_fr.lang @@ -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 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 format block. custom paragraph adds less line space between new lines. preferences fr Démarrer automatiquement avec ce format de bloc.
Paragraphe personnalisé 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.
Petit Paragraphe ajoute moins d'espace entre les nouvelles lignes. 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 password preferences fr Changer votre mot de passe @@ -31,7 +31,7 @@ color preferences fr Couleur country preferences fr Pays 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 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 dark moono theme preferences fr Thème Dark Moono data exchange settings preferences fr Paramètres d'échange de données diff --git a/preferences/lang/egw_sk.lang b/preferences/lang/egw_sk.lang index 822e20ace6..dd67be5c86 100644 --- a/preferences/lang/egw_sk.lang +++ b/preferences/lang/egw_sk.lang @@ -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 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 format block.
custom paragraph adds less line space between new lines. preferences sk Automaticky začať týmto formátovacím blokom.
Vlastný odstavec 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 password preferences sk Zmeniť heslo change your password preferences sk Zmeniť heslo @@ -30,7 +29,6 @@ color preferences sk Farba country preferences sk Krajina 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 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 dark moono theme preferences sk Tmavá Moono téma data exchange settings preferences sk Nastavenia pre výmenu údajov