mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-18 20:51:23 +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
|
// User preferences for style
|
||||||
$font = $GLOBALS['egw_info']['user']['preferences']['common']['rte_font'];
|
$font = $GLOBALS['egw_info']['user']['preferences']['common']['rte_font'];
|
||||||
$font_size = egw_ckeditor_config::font_size_from_prefs();
|
$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 = '';
|
if (empty($font) && empty($font_size)) $font_span = '';
|
||||||
}
|
}
|
||||||
//remove possible html header stuff
|
//remove possible html header stuff
|
||||||
|
@ -526,6 +526,8 @@ class html
|
|||||||
// User preferences
|
// User preferences
|
||||||
$font = $GLOBALS['egw_info']['user']['preferences']['common']['rte_font'];
|
$font = $GLOBALS['egw_info']['user']['preferences']['common']['rte_font'];
|
||||||
$font_size = egw_ckeditor_config::font_size_from_prefs();
|
$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
|
// 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!
|
// 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).');
|
ev.editor.resize("100%", '.str_replace('px', '', $pxheight).');
|
||||||
}
|
}
|
||||||
);'.
|
);'.
|
||||||
(trim($_content) == '' ? 'CKEDITOR.instances["'.$_name.'"].setData("<span style=\"font-family:'.$font.';font-size:'.$font_size.';\">​</span>");' : '').'
|
(trim($_content) == '' && $font_span ? 'CKEDITOR.instances["'.$_name.'"].setData("'.$font_span.'​</span>");' : '').
|
||||||
</script>
|
'</script>
|
||||||
';
|
';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user