Revert "Merge branch 'print-headers' into 'master'"
This reverts merge request !45
This commit is contained in:
parent
ad984903c4
commit
00e7834082
5 changed files with 3 additions and 64 deletions
|
|
@ -805,6 +805,9 @@ public class ConversationEmail : Gtk.Box, Geary.BaseInterface {
|
|||
}
|
||||
|
||||
private void print() {
|
||||
// XXX This isn't anywhere near good enough - headers aren't
|
||||
// being printed.
|
||||
|
||||
Gtk.Window? window = get_toplevel() as Gtk.Window;
|
||||
WebKit.PrintOperation op = new WebKit.PrintOperation(
|
||||
this.primary_message.web_view
|
||||
|
|
|
|||
|
|
@ -482,13 +482,6 @@ public class ConversationMessage : Gtk.Grid, Geary.BaseInterface {
|
|||
}
|
||||
|
||||
load_cancelled.cancelled.connect(() => { web_view.stop_loading(); });
|
||||
this.web_view.set_print_headers(
|
||||
this.message.from != null ? this.message.from.to_string() : null,
|
||||
this.message.to != null ? this.message.to.to_string() : null,
|
||||
this.message.cc != null ? this.message.cc.to_string() : null,
|
||||
this.message.bcc != null ? this.message.bcc.to_string() : null,
|
||||
this.message.date != null ? this.message.date.to_string() : null,
|
||||
this.message.subject != null ? this.message.subject.to_string() : null);
|
||||
this.web_view.load_html(body_text ?? "");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,18 +54,6 @@ public class ConversationWebView : ClientWebView {
|
|||
);
|
||||
}
|
||||
|
||||
public void set_print_headers(string? from, string? to, string? cc, string? bcc, string? date, string? subject) {
|
||||
StringBuilder js = new StringBuilder("var gearyEmailHeaders = {");
|
||||
if (from != null) js.append(_("'From:':'") + from.replace("'", "\\'") + "',");
|
||||
if (to != null) js.append(_("'To:':'") + to.replace("'", "\\'") + "',");
|
||||
if (cc != null) js.append(_("'CC:':'") + cc.replace("'", "\\'") + "',");
|
||||
if (bcc != null) js.append(_("'BCC:':'") + bcc.replace("'", "\\'") + "',");
|
||||
if (date != null) js.append(_("'Date:':'") + date.replace("'", "\\'") + "',");
|
||||
if (subject != null) js.append(_("'Subject:':'") + subject.replace("'", "\\'") + "',");
|
||||
js.append("};");
|
||||
this.run_javascript(js.str, null);
|
||||
}
|
||||
|
||||
|
||||
/** Emitted when the user clicks on a link with deceptive text. */
|
||||
public signal void deceptive_link_clicked(
|
||||
|
|
|
|||
|
|
@ -193,17 +193,8 @@ pre {
|
|||
}
|
||||
}
|
||||
|
||||
#geary-message-headers {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media print {
|
||||
.geary-button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#geary-message-headers {
|
||||
all: initial;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -314,39 +314,3 @@ ConversationPageState.isDescendantOf = function(node, ancestorTag) {
|
|||
};
|
||||
|
||||
var geary = new ConversationPageState();
|
||||
|
||||
/**
|
||||
* Add email headers for printing
|
||||
*/
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
let headerBlock = document.createElement('div');
|
||||
headerBlock.id = 'geary-message-headers';
|
||||
|
||||
let shadowRoot = headerBlock.attachShadow({mode: 'closed'});
|
||||
|
||||
let shadowStyle = document.createElement('style');
|
||||
shadowStyle.textContent = "\
|
||||
table, tr, th, td, hr { all:initial; }\
|
||||
table { display:table; }\
|
||||
tr { display:table-row; }\
|
||||
td, th { display:table-cell; line-height:1.5em; }\
|
||||
th { font-weight:bold; padding-right:2ex; }\
|
||||
hr { display:block; border-style:inset; border-width:1px; margin-top:0.5em; margin-bottom:0.5em; }";
|
||||
shadowRoot.appendChild(shadowStyle);
|
||||
|
||||
let headerTable = document.createElement('table');
|
||||
shadowRoot.appendChild(headerTable);
|
||||
|
||||
for (header in gearyEmailHeaders) {
|
||||
let row = headerTable.appendChild(document.createElement('tr'));
|
||||
let name = row.appendChild(document.createElement('th'));
|
||||
let value = row.appendChild(document.createElement('td'));
|
||||
name.textContent = header;
|
||||
value.textContent = gearyEmailHeaders[header];
|
||||
}
|
||||
|
||||
shadowRoot.appendChild(document.createElement('hr'));
|
||||
|
||||
document.body.insertBefore(headerBlock, document.body.firstChild);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue