mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 00:17:03 +03:00
Add "cc" to "View in separate window"/"Print"
This commit is contained in:
parent
e7d280c0a7
commit
483549660b
3 changed files with 28 additions and 24 deletions
|
|
@ -617,7 +617,7 @@ export function clearBqSwitcher(body)
|
||||||
* @param {boolean} print
|
* @param {boolean} print
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
export function previewMessage({title, subject, date, fromCreds, toCreds, toLabel}, body, isHtml, print)
|
export function previewMessage({title, subject, date, fromCreds, toCreds, toLabel, ccClass, ccCreds, ccLabel}, body, isHtml, print)
|
||||||
{
|
{
|
||||||
const
|
const
|
||||||
win = window.open(''),
|
win = window.open(''),
|
||||||
|
|
@ -636,6 +636,9 @@ export function previewMessage({title, subject, date, fromCreds, toCreds, toLabe
|
||||||
.replace('{{fromCreds}}', encodeHtml(fromCreds))
|
.replace('{{fromCreds}}', encodeHtml(fromCreds))
|
||||||
.replace('{{toCreds}}', encodeHtml(toCreds))
|
.replace('{{toCreds}}', encodeHtml(toCreds))
|
||||||
.replace('{{toLabel}}', encodeHtml(toLabel))
|
.replace('{{toLabel}}', encodeHtml(toLabel))
|
||||||
|
.replace('{{ccClass}}', encodeHtml(ccClass))
|
||||||
|
.replace('{{ccCreds}}', encodeHtml(ccCreds))
|
||||||
|
.replace('{{ccLabel}}', encodeHtml(ccLabel))
|
||||||
.replace('{{bodyClass}}', bodyClass)
|
.replace('{{bodyClass}}', bodyClass)
|
||||||
.replace('{{html}}', html)
|
.replace('{{html}}', html)
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -72,42 +72,39 @@ pre {
|
||||||
border-left: 2px solid red;
|
border-left: 2px solid red;
|
||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
.rl-preview-subject {
|
||||||
.rl-previre-subject {
|
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
border-bottom: 1px solid #ccc;
|
|
||||||
}
|
}
|
||||||
|
.rl-preview-creds-from, .rl-preview-creds-to, .rl-preview-creds-cc {
|
||||||
.rl-previre-creds-from, .rl-previre-creds-to {
|
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
padding: 10px 15px;
|
padding: 5px 15px;
|
||||||
}
|
}
|
||||||
|
.rl-preview-date {
|
||||||
.rl-previre-creds-from {
|
|
||||||
padding-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rl-previre-creds-to {
|
|
||||||
border-bottom: 1px solid #ccc;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rl-previre-date {
|
|
||||||
float: right;
|
float: right;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
padding: 10px 15px;
|
padding: 10px 15px;
|
||||||
|
}
|
||||||
|
.rl-preview-section {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
border-bottom: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
.rl-preview-hide {
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div>
|
<div class="rl-preview-section">
|
||||||
<div class="rl-previre-subject">{{subject}}</div>
|
<div class="rl-preview-subject">{{subject}}</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="rl-preview-section">
|
||||||
<div class="rl-previre-date">{{date}}</div>
|
<div class="rl-preview-date">{{date}}</div>
|
||||||
<div class="rl-previre-creds-from">{{fromCreds}}</div>
|
<div class="rl-preview-creds-from">{{fromCreds}}</div>
|
||||||
<div class="rl-previre-creds-to">{{toLabel}}: {{toCreds}}</div>
|
<div class="rl-preview-creds-to">{{toLabel}}: {{toCreds}}</div>
|
||||||
|
<div class="rl-preview-creds-cc {{ccClass}}">{{ccLabel}}: {{ccCreds}}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="body-wrp {{bodyClass}}">{{html}}</div>
|
<div class="body-wrp {{bodyClass}}">{{html}}</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
|
|
@ -640,6 +640,7 @@ class MessageModel extends AbstractModel
|
||||||
|
|
||||||
const
|
const
|
||||||
timeStampInUTC = this.dateTimeStampInUTC() || 0,
|
timeStampInUTC = this.dateTimeStampInUTC() || 0,
|
||||||
|
ccLine = this.ccToLine(false),
|
||||||
m = 0 < timeStampInUTC ? moment.unix(timeStampInUTC) : null;
|
m = 0 < timeStampInUTC ? moment.unix(timeStampInUTC) : null;
|
||||||
|
|
||||||
previewMessage({
|
previewMessage({
|
||||||
|
|
@ -648,7 +649,10 @@ class MessageModel extends AbstractModel
|
||||||
date: m ? m.format('LLL') : '',
|
date: m ? m.format('LLL') : '',
|
||||||
fromCreds: this.fromToLine(false),
|
fromCreds: this.fromToLine(false),
|
||||||
toLabel: i18n('MESSAGE/LABEL_TO'),
|
toLabel: i18n('MESSAGE/LABEL_TO'),
|
||||||
toCreds: this.toToLine(false)
|
toCreds: this.toToLine(false),
|
||||||
|
ccClass: ccLine ? '' : 'rl-preview-hide',
|
||||||
|
ccLabel: i18n('MESSAGE/LABEL_CC'),
|
||||||
|
ccCreds: ccLine
|
||||||
}, this.body, this.isHtml(), print);
|
}, this.body, this.isHtml(), print);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue