(feature) Custom base font size for HTML messages

If SOGoMailComposeFontSize is set to zero, we keep the previous
behaviour (no font-size added to the message HTML body).
This commit is contained in:
Francis Lachapelle
2016-02-11 17:45:57 -05:00
parent e897bb0399
commit 256a64172e
11 changed files with 113 additions and 29 deletions
@@ -26,6 +26,15 @@
// Mail editor autosave is a number of minutes or 0 if disabled
data.SOGoMailAutoSave = parseInt(data.SOGoMailAutoSave) || 0;
// Specify a base font size for HTML messages when SOGoMailComposeFontSize is not zero
data.SOGoMailComposeFontSizeEnabled = parseInt(data.SOGoMailComposeFontSize) > 0;
if (window.CKEDITOR && data.SOGoMailComposeFontSize) {
// HTML editor is enabled; set user's preferred font size
window.CKEDITOR.config.fontSize_defaultLabel = data.SOGoMailComposeFontSize;
window.CKEDITOR.addCss('.cke_editable { font-size: ' + data.SOGoMailComposeFontSize + 'px; }');
}
// We convert our list of autoReplyEmailAddresses/forwardAddress into a string.
// We also convert our date objects into real date, otherwise we'll have strings
// or undefined values and the md-datepicker does NOT like this.
@@ -201,6 +210,9 @@
preferences.defaults.SOGoMailLabelsColors = labels;
if (!preferences.defaults.SOGoMailComposeFontSizeEnabled)
preferences.defaults.SOGoMailComposeFontSize = 0;
if (preferences.defaults.Vacation) {
if (preferences.defaults.Vacation.endDateEnabled)
preferences.defaults.Vacation.endDate = preferences.defaults.Vacation.endDate.getTime()/1000;