1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00

Add a button to print the replay frame (#814)

This commit is contained in:
Jonas Linde 2023-02-15 21:36:30 +01:00 committed by GitHub
parent c441d83435
commit 98be48d6e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 60 additions and 11 deletions

File diff suppressed because one or more lines are too long

View File

@ -49,6 +49,7 @@
"Hide calendar":"{{ _Q('Hide calendar') }}",
"Previous capture":"{{ _Q('Previous capture') }}",
"Next capture":"{{ _Q('Next capture') }}",
"Print":"{{ _Q('Print') }}",
"Select language":"{{ _Q('Select language') }}",
"View capture on {date}":"{{ _Q('View capture on {date}') }}",
"{count} capture":"{{ _Q('{count} capture') }}",

View File

@ -77,6 +77,17 @@
<i class="far fa-chart-bar"></i>
</button>
</li>
<li class="nav-item">
<button
class="btn btn-sm"
:class="{'btn-outline-light': lightButtons, 'btn-outline-dark': !lightButtons}"
:aria-pressed="printReplayFrame"
@click="printReplayFrame"
v-if="hasReplayFrame()"
:title="_('Print')">
<i class="fas fa-print"></i>
</button>
</li>
<li class="nav-item dropdown" v-if="localesAreSet">
<button
class="btn btn-sm dropdown-toggle"
@ -306,6 +317,14 @@ export default {
this.showTimelineView = !this.showTimelineView;
window.localStorage.setItem("showTimelineView", this.showTimelineView ? "1" : "0");
},
hasReplayFrame() {
return !! window.frames.replay_iframe;
},
printReplayFrame() {
window.frames.replay_iframe.contentWindow.focus();
window.frames.replay_iframe.contentWindow.print();
return false;
},
setData(/** @type {PywbData} data */ data) {
// data-set will usually happen at App INIT (from parent caller)