mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-18 04:31:06 +01:00
preset font span, omit empty style elements completely
This commit is contained in:
parent
8fef5d106d
commit
945f256e1b
@ -669,7 +669,7 @@
|
||||
// User preferences for style
|
||||
$font = $GLOBALS['egw_info']['user']['preferences']['common']['rte_font'];
|
||||
$font_size = egw_ckeditor_config::font_size_from_prefs();
|
||||
$font_span = '<span '.($font||$font_size?'style="':'').($font?'font-family:'.$font.'; ':'').';'.($font_size?'font-size:'.$font_size.'; ':'').'">'.' '.'</span>';
|
||||
$font_span = '<span '.($font||$font_size?'style="':'').($font?'font-family:'.$font.'; ':'').($font_size?'font-size:'.$font_size.'; ':'').'">'.' '.'</span>';
|
||||
if (empty($font) && empty($font_size)) $font_span = '';
|
||||
}
|
||||
//remove possible html header stuff
|
||||
|
@ -526,6 +526,8 @@ class html
|
||||
// User preferences
|
||||
$font = $GLOBALS['egw_info']['user']['preferences']['common']['rte_font'];
|
||||
$font_size = egw_ckeditor_config::font_size_from_prefs();
|
||||
$font_span = '<span '.($font||$font_size?'style=\"':'').($font?'font-family:'.$font.'; ':'').($font_size?'font-size:'.$font_size.'; ':'').'\">';
|
||||
if (empty($font) && empty($font_size)) $font_span = '';
|
||||
|
||||
// we need to enable double encoding here, as ckEditor has to undo one level of encoding
|
||||
// otherwise < and > chars eg. from html markup entered in regular (not source) input, will turn into html!
|
||||
@ -542,8 +544,8 @@ class html
|
||||
ev.editor.resize("100%", '.str_replace('px', '', $pxheight).');
|
||||
}
|
||||
);'.
|
||||
(trim($_content) == '' ? 'CKEDITOR.instances["'.$_name.'"].setData("<span style=\"font-family:'.$font.';font-size:'.$font_size.';\">​</span>");' : '').'
|
||||
</script>
|
||||
(trim($_content) == '' && $font_span ? 'CKEDITOR.instances["'.$_name.'"].setData("'.$font_span.'​</span>");' : '').
|
||||
'</script>
|
||||
';
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user