From 6a6ea3e63b89274bc70493835f6ba68918cad580 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 30 Oct 2020 12:53:25 -0400 Subject: [PATCH] message view: add print button & stylesheet --- themes/alps/assets/print.css | 10 ++++++++++ themes/alps/assets/print.js | 6 ++++++ themes/alps/head.html | 1 + themes/alps/message.html | 12 +++++++++++- 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 themes/alps/assets/print.css create mode 100644 themes/alps/assets/print.js diff --git a/themes/alps/assets/print.css b/themes/alps/assets/print.css new file mode 100644 index 0000000..dd23d82 --- /dev/null +++ b/themes/alps/assets/print.css @@ -0,0 +1,10 @@ +header, +aside, +.actions, +.tabs { + display: none; +} + +.message { + padding: 0; +} diff --git a/themes/alps/assets/print.js b/themes/alps/assets/print.js new file mode 100644 index 0000000..c4379ad --- /dev/null +++ b/themes/alps/assets/print.js @@ -0,0 +1,6 @@ +const print = document.getElementById("print"); +print.style.display = "inherit"; +print.addEventListener("click", e => { + e.preventDefault(); + window.print(); +}); diff --git a/themes/alps/head.html b/themes/alps/head.html index c2d5130..c0b726d 100644 --- a/themes/alps/head.html +++ b/themes/alps/head.html @@ -9,5 +9,6 @@ {{end -}} {{.GlobalData.Title}} + diff --git a/themes/alps/message.html b/themes/alps/message.html index 28287ab..8d6c425 100644 --- a/themes/alps/message.html +++ b/themes/alps/message.html @@ -78,7 +78,7 @@ - + {{if .Message.HasFlag "\\Draft"}} Edit draft {{else}} @@ -86,6 +86,15 @@ Forward {{end}} + + + + @@ -204,5 +213,6 @@ + {{template "foot.html"}}