diff options
author | Drew DeVault <sir@cmpwn.com> | 2020-10-30 12:53:25 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2020-10-30 12:53:25 -0400 |
commit | 6a6ea3e63b89274bc70493835f6ba68918cad580 (patch) | |
tree | f46669ec165623da406b4fce1df970c95ed0d952 /themes | |
parent | cbeacf9d060fbd8c593aa3a9a73d9fe94b9ee5d1 (diff) | |
download | alps-6a6ea3e63b89274bc70493835f6ba68918cad580.tar.gz alps-6a6ea3e63b89274bc70493835f6ba68918cad580.zip |
message view: add print button & stylesheet
Diffstat (limited to 'themes')
-rw-r--r-- | themes/alps/assets/print.css | 10 | ||||
-rw-r--r-- | themes/alps/assets/print.js | 6 | ||||
-rw-r--r-- | themes/alps/head.html | 1 | ||||
-rw-r--r-- | themes/alps/message.html | 12 |
4 files changed, 28 insertions, 1 deletions
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 -}} <title>{{.GlobalData.Title}}</title> <link rel="stylesheet" href="/themes/alps/assets/style.css"> + <link rel="stylesheet" href="/themes/alps/assets/print.css" media="print"> </head> <body> 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 @@ <button class="action-group" type="submit">Move</button> </form> - <span class="followups"> + <span class="followups action-group"> {{if .Message.HasFlag "\\Draft"}} <a class="action-group button-link" href="{{.Message.URL}}/edit{{if .Message.TextPart}}?part={{.Message.TextPart.PathString}}{{end}}">Edit draft</a> {{else}} @@ -86,6 +86,15 @@ <a class="action-group button-link" href="{{.Message.URL}}/forward{{if .Message.TextPart}}?part={{.Message.TextPart.PathString}}{{end}}">Forward</a> {{end}} </span> + + <span class="action-group"> + <a + class="action-group button-link" + id="print" + href="#" + style="display: none" + >Print</a> + </span> </div> </div> </section> @@ -204,5 +213,6 @@ </main> </div> </div> +<script src="/themes/alps/assets/print.js"></script> {{template "foot.html"}} |