[geary/revert-ad984903] Revert "Merge branch 'print-headers' into 'master'"



commit 00e7834082b82dfc3e9b9c787e700f7a344a9894
Author: Michael Gratton <mike vee net>
Date:   Sun Sep 23 02:18:24 2018 +0000

    Revert "Merge branch 'print-headers' into 'master'"
    
    This reverts merge request !45

 .../conversation-viewer/conversation-email.vala    |  3 ++
 .../conversation-viewer/conversation-message.vala  |  7 -----
 .../conversation-viewer/conversation-web-view.vala | 12 --------
 ui/conversation-web-view.css                       |  9 ------
 ui/conversation-web-view.js                        | 36 ----------------------
 5 files changed, 3 insertions(+), 64 deletions(-)
---
diff --git a/src/client/conversation-viewer/conversation-email.vala 
b/src/client/conversation-viewer/conversation-email.vala
index 0bf6c121..493e462c 100644
--- a/src/client/conversation-viewer/conversation-email.vala
+++ b/src/client/conversation-viewer/conversation-email.vala
@@ -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
diff --git a/src/client/conversation-viewer/conversation-message.vala 
b/src/client/conversation-viewer/conversation-message.vala
index 6c68c7c4..dfbce2ce 100644
--- a/src/client/conversation-viewer/conversation-message.vala
+++ b/src/client/conversation-viewer/conversation-message.vala
@@ -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 ?? "");
     }
 
diff --git a/src/client/conversation-viewer/conversation-web-view.vala 
b/src/client/conversation-viewer/conversation-web-view.vala
index 62323b2a..217d0a64 100644
--- a/src/client/conversation-viewer/conversation-web-view.vala
+++ b/src/client/conversation-viewer/conversation-web-view.vala
@@ -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(
diff --git a/ui/conversation-web-view.css b/ui/conversation-web-view.css
index 70de0047..0040bca3 100644
--- a/ui/conversation-web-view.css
+++ b/ui/conversation-web-view.css
@@ -193,17 +193,8 @@ pre {
   }
 }
 
-#geary-message-headers {
-  display: none;
-}
-
 @media print {
   .geary-button {
     display: none;
   }
-
-  #geary-message-headers {
-    all: initial;
-    display: block;
-  }
 }
diff --git a/ui/conversation-web-view.js b/ui/conversation-web-view.js
index 6b9dc262..b24beb33 100644
--- a/ui/conversation-web-view.js
+++ b/ui/conversation-web-view.js
@@ -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);
-});


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]