21.1 JavaScript for htmlarea widget

This commit is contained in:
ralf 2022-05-11 16:00:11 +02:00
parent 85365b2f93
commit 7a5d5e2c39

View File

@ -8,7 +8,6 @@
* @link http://www.egroupware.org
* @author Hadi Nategh <hn@egroupware.org>
* @copyright Hadi Nategh <hn@egroupware.org>
* @version $Id$
*/
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
@ -99,6 +98,11 @@ var et2_htmlarea = /** @class */ (function (_super) {
theme: 'silver'
},
formats: {
// setting p (and below also the preferred formatblock) to the users font and -size preference
p: { block: 'p', styles: {
"font-family": (egw.preference('rte_font', 'common') || 'arial, helvetica, sans-serif'),
"font-size": (egw.preference('rte_font_size', 'common') || '10') + 'pt'
} },
customparagraph: { block: 'p', styles: { "margin-block-start": "0px", "margin-block-end": "0px" } }
},
min_height: 100,
@ -135,6 +139,10 @@ var et2_htmlarea = /** @class */ (function (_super) {
"MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;" +
"Wingdings=wingdings,zapf dingbats",
fontsize_formats: '8pt 10pt 12pt 14pt 18pt 24pt 36pt',
// this displays all p and li with the users default font and -size (only kosmetik, as TinyMCE does not return or set these styles!)
content_style: (egw.preference('rte_formatblock', 'common') || 'p') + ',li' +
' { font-family: ' + (egw.preference('rte_font', 'common') || 'arial, helvetica, sans-serif') +
'; font-size: ' + (egw.preference('rte_font_size', 'common') || '10') + 'pt }',
setup: function (ed) {
ed.on('init', function () {
this.execCommand('fontName', false, egw.preference('rte_font', 'common'));
@ -143,6 +151,11 @@ var et2_htmlarea = /** @class */ (function (_super) {
});
}
};
var rte_formatblock = (egw.preference('rte_formatblock', 'common') || 'p');
if (rte_formatblock !== 'p') {
settings.formats[rte_formatblock] = jQuery.extend(true, {}, settings.formats.p);
settings.formats[rte_formatblock].block = rte_formatblock;
}
// extend default settings with configured options and preferences
jQuery.extend(settings, this._extendedSettings());
this.tinymce = tinymce.init(settings);