Skip to content

Commit

Permalink
Merge branch 'pu/je/felamimail_background_quoted_emails' into '2024.11'
Browse files Browse the repository at this point in the history
tweak(Felamimail): Set background for quoted emails in editor

See merge request tine20/tine20!4988
  • Loading branch information
pschuele committed Feb 21, 2024
2 parents 38d075c + 7b12f8d commit 7531c48
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions tine20/Felamimail/js/MessageEditDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,10 @@ Tine.Felamimail.MessageEditDialog = Ext.extend(Tine.widgets.dialog.EditDialog, {
}
}

if (this.isForwardedMessage()) {
this.msgBody = '<div class="felamimail-body-forwarded">' + this.msgBody + '</div>'
}

this.msgBody = this.getQuotedMailHeader(format) + this.msgBody;

if (this.isForwardedMessage()) {
Expand Down
2 changes: 1 addition & 1 deletion tine20/Tinebase/js/util/contrastColors.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const contrastColors = {
if (c.classList.contains('felamimail-body-signature-current')) {
return;
}
if (c.classList.contains('felamimail-body-blockquote')) {
if (c.classList.contains('felamimail-body-blockquote') || c.classList.contains('felamimail-body-forwarded')) {
// quoted email gets its own background
contrastColors.findBackground(c)
} else {
Expand Down
11 changes: 11 additions & 0 deletions tine20/library/ExtJS/src/widgets/form/HtmlEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* [email protected]
* http://www.extjs.com/license
*/
import {contrastColors} from "../../../../../Tinebase/js/util/contrastColors";

/**
* @class Ext.form.HtmlEditor
* @extends Ext.form.Field
Expand Down Expand Up @@ -667,6 +669,7 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
// private
initEvents : function(){
this.originalValue = this.getValue();
this.on('activate', this.onActivate);
},

/**
Expand Down Expand Up @@ -892,6 +895,14 @@ Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
this.fireEvent('activate', this);
},

onActivate: function (e) {
_.forEach(this.getEditorBody().children, (c) => {
if (c.classList.contains('felamimail-body-blockquote') || c.classList.contains('felamimail-body-forwarded')) {
contrastColors.findBackground(c)
}
})
},

// private
adjustFont: function(btn){
var adjust = btn.getItemId() == 'increasefontsize' ? 1 : -1,
Expand Down

0 comments on commit 7531c48

Please sign in to comment.