From e60d061183d21d63d80381a385f6c9e141f31f06 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Thu, 25 Oct 2018 16:16:39 +0200 Subject: [PATCH] W.I.P. implementing TinyMCE editor and deprecating CKEditor: - Fix selector fails when textarea id includes some specific chars - Fix width and height --- api/src/Html.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/api/src/Html.php b/api/src/Html.php index 51092b084f..05b0e74d1a 100644 --- a/api/src/Html.php +++ b/api/src/Html.php @@ -479,14 +479,16 @@ var font_size_formats = { pt: "8pt 10pt 12pt 14pt 18pt 24pt 36pt 48pt 72pt", px:"8px 10px 12px 14px 18px 24px 36px 48px 72px" }; - +var name = "#"+"'.$_name.'".replace( /(:|\.|\[|\]|,|=|@)/g, "\\\$1" ); +var height = "'.$_height.'"; +var width = "'.$_width.'"; tinymce.init({ - selector: "#'.$_name.'", + selector: name, menubar: parseInt('. $rte_menubar.')? true : false, branding: false, resize: false, - height: parseInt("'.$_height.'"), - width: parseInt("'.$_width.'"), + height: height.match(/%/) ? height : parseInt(height), + width: width.match(/%/) ? width : parseInt(width), min_height: 100, auto_focus: "'.$focusToBody.'", language:"'. $GLOBALS['egw_info']['user']['preferences']['common']['lang'].'",