mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-16 13:03:16 +01:00
* Mail: setting default font-face and -size reliable and remove space in front of cursor
This commit is contained in:
parent
82d09611ad
commit
38f4980849
@ -38,7 +38,9 @@ class etemplate_widget_htmlarea extends etemplate_widget
|
||||
// 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.'; ':'').'">';
|
||||
$font_span = '<span style="width: 100%; display: inline-block; '.
|
||||
($font?'font-family:'.$font.'; ':'').($font_size?'font-size:'.$font_size.'; ':'').
|
||||
'">​</span>';
|
||||
if (empty($font) && empty($font_size)) $font_span = '';
|
||||
if($font_span)
|
||||
{
|
||||
|
@ -151,22 +151,9 @@ var et2_htmlarea = et2_inputWidget.extend([et2_IResizeable],
|
||||
// Add in user font preferences
|
||||
if (self.options.config.preference_style && !e.editor.getData())
|
||||
{
|
||||
e.editor.document.getBody().appendHtml(self.options.config.preference_style);
|
||||
e.editor.document.getBody().setHtml(self.options.config.preference_style);
|
||||
delete self.options.config.preference_style;
|
||||
}
|
||||
|
||||
var range = e.editor.createRange();
|
||||
range.collapse(true);
|
||||
range.selectNodeContents(e.editor.document.getBody());
|
||||
range.collapse(true);
|
||||
range.select();
|
||||
|
||||
//this stuff is needed, as the above places the caret just before the span tag
|
||||
var sN = range.startContainer.getNextSourceNode();
|
||||
//FF is selecting the span with getNextSourceNode, other browsers need to fetch it with getNext
|
||||
range.selectNodeContents(((typeof sN.getName==="function") && sN.getName()=="span"?range.startContainer.getNextSourceNode():range.startContainer.getNextSourceNode().getNext()));
|
||||
range.collapse(true);
|
||||
range.select();
|
||||
});
|
||||
|
||||
// Drag & drop of images inline won't work, because of database
|
||||
@ -269,7 +256,7 @@ var et2_htmlarea = et2_inputWidget.extend([et2_IResizeable],
|
||||
return null;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Resize htmlNode tag according to window size
|
||||
* @param {type} _height excess height which comes from window resize
|
||||
|
@ -1051,8 +1051,8 @@ class mail_compose
|
||||
// User preferences for style
|
||||
$font = $GLOBALS['egw_info']['user']['preferences']['common']['rte_font'];
|
||||
$font_size = egw_ckeditor_config::font_size_from_prefs();
|
||||
$font_part = '<span '.($font||$font_size?'style="':'').($font?'font-family:'.$font.'; ':'').($font_size?'font-size:'.$font_size.'; ':'').'">';
|
||||
$font_span = $font_part.' '.'</span>';
|
||||
$font_part = '<span style="width:100%; display: inline-block; '.($font?'font-family:'.$font.'; ':'').($font_size?'font-size:'.$font_size.'; ':'').'">';
|
||||
$font_span = $font_part.'​</span>';
|
||||
if (empty($font) && empty($font_size)) $font_span = '';
|
||||
}
|
||||
// the font span should only be applied on first load or on switch plain->html and the absence of the font_part of the span
|
||||
@ -1084,8 +1084,8 @@ class mail_compose
|
||||
}
|
||||
}
|
||||
if($content['mimeType'] == 'html') {
|
||||
$before = (!empty($font_span) && !($insertSigOnTop === 'below')?$font_span:' ').($disableRuler?''/*($sigTextStartsWithBlockElement?'':'<p style="margin:0px;"/>')*/:'<hr style="border:1px dotted silver; width:90%;">');
|
||||
$inbetween = ' <br>';
|
||||
$before = $disableRuler ? '' : '<hr style="border:1px dotted silver; width:100%;">';
|
||||
$inbetween = '';
|
||||
} else {
|
||||
$before = ($disableRuler ?"\r\n\r\n":"\r\n\r\n-- \r\n");
|
||||
$inbetween = "\r\n";
|
||||
@ -1101,7 +1101,7 @@ class mail_compose
|
||||
}
|
||||
else
|
||||
{
|
||||
$content['body'] = $before.($content['mimeType'] == 'html'?$sigText:$this->convertHTMLToText($sigText,true,true)).$inbetween.$content['body'];
|
||||
$content['body'] = $font_span.$before.($content['mimeType'] == 'html'?$sigText:$this->convertHTMLToText($sigText,true,true)).$inbetween.$content['body'];
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1289,13 +1289,13 @@ class mail_compose
|
||||
$etpl->setElementAttribute('folder','autocomplete_params',array('mailaccount'=>$content['mailaccount']));
|
||||
// join again mailaccount and identity
|
||||
$content['mailaccount'] .= ':'.$content['mailidentity'];
|
||||
|
||||
|
||||
// Resolve distribution list before send content to client
|
||||
foreach(array('to', 'cc', 'bcc', 'replyto') as $f)
|
||||
{
|
||||
if (is_array($content[$f])) $content[$f]= self::resolveEmailAddressList ($content[$f]);
|
||||
}
|
||||
|
||||
|
||||
$content['to'] = self::resolveEmailAddressList($content['to']);
|
||||
//error_log(__METHOD__.__LINE__.array2string($content));
|
||||
$etpl->exec('mail.mail_compose.compose',$content,$sel_options,$readonlys,$preserv,2);
|
||||
|
Loading…
Reference in New Issue
Block a user