Skip to content

Commit c7745f6

Browse files
authored
Merge pull request #863 from hackmdio/feature/slidePrint
Add Print icon to slide view
2 parents 6634fac + 04d16e4 commit c7745f6

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

public/docs/slide-example.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,4 +266,12 @@ Press `B` or `.` on your keyboard to pause the presentation. This is helpful whe
266266

267267
---
268268

269+
## Print your Slides
270+
271+
Down below you can find a print icon<i class="fa fa-fw fa-print"></i>.
272+
273+
After you click on it, use the print function of your browser (either CTRL+P or cmd+P) to print the slides as PDF.
274+
275+
---
276+
269277
# The End

public/js/slide.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ window.lastchangetime = window.lastchangeui.time.attr('data-updatetime')
1414
updateLastChange()
1515
const url = window.location.pathname
1616
$('.ui-edit').attr('href', `${url}/edit`)
17+
$('.ui-print').attr('href', `${url}?print-pdf`)
1718

1819
$(document).ready(() => {
1920
// tooltip

public/views/slide.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
&nbsp;<span class="text-uppercase ui-status-lastchange"></span>
7070
<span class="ui-lastchange text-uppercase" data-createtime="<%- createtime %>" data-updatetime="<%- updatetime %>"></span>
7171
</span>
72-
<span class="pull-right"><%- viewcount %> views <a href="#" class="ui-edit" title="Edit this note"><i class="fa fa-fw fa-pencil"></i></a></span>
72+
<span class="pull-right"><%- viewcount %> views <a href="#" class="ui-edit" title="Edit this note"><i class="fa fa-fw fa-pencil"></i></a><a class="ui-print" href="" title="Open print view"><i class="fa fa-fw fa-print"></i></a></span>
7373
<br>
7474
<% if(ownerprofile && owner !== lastchangeuser) { %>
7575
<span class="ui-owner">

0 commit comments

Comments
 (0)