Skip to content

Commit 21d8dd1

Browse files
committed
tweak banner
1 parent 4ec10fd commit 21d8dd1

File tree

2 files changed

+54
-26
lines changed

2 files changed

+54
-26
lines changed

proxy-test.html

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
<html>
2-
<head>
3-
<script>
4-
const wbinfo = {};
5-
wbinfo.url = "https://www.cdc.gov/";
6-
wbinfo.timestamp = "20250125223246";
7-
wbinfo.request_ts = "20250125223246000";
8-
wbinfo.mod = "id_";
9-
wbinfo.collName = "CDC";
10-
wbinfo.collUrl = "https://app.browsertrix.com/explore/usgov-archive/collections/cdc";
11-
self.__wbinfo = wbinfo;
12-
</script>
13-
<script src="./proxyui.js?banner=1"></script>
14-
</head>
15-
<body>
16-
Test
17-
</body>
2+
<head>
3+
<script>
4+
const wbinfo = {};
5+
wbinfo.url = "https://www.cdc.gov/";
6+
wbinfo.timestamp = "20250125223246";
7+
wbinfo.request_ts = "20250125223246000";
8+
wbinfo.mod = "id_";
9+
wbinfo.collName = "CDC";
10+
wbinfo.collUrl =
11+
"https://app.browsertrix.com/explore/usgov-archive/collections/cdc";
12+
self.__wbinfo = wbinfo;
13+
</script>
14+
<script src="./proxyui.js?banner=1"></script>
15+
</head>
16+
<body>
17+
Test
18+
</body>
1819
</html>

src/proxyreplay/banner.ts

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,39 @@
11
import { html, css, LitElement } from "lit";
2+
import { property } from "lit/decorators.js";
3+
24
import { tsToDate } from "../pageutils";
35
import { dateTimeFormatter } from "../utils/dateTimeFormatter";
46
import fasRefresh from "@fortawesome/fontawesome-free/svgs/solid/redo-alt.svg";
57
import rwpIcon from "~assets/icons/replaywebpage.svg";
68

79
declare let self: Window & {
810
// eslint-disable-next-line @typescript-eslint/no-explicit-any
9-
__wbinfo: any;
11+
__wbinfo?: any;
1012
};
1113

1214
export class WBBanner extends LitElement {
13-
private date: Date | null = null;
15+
@property({ type: Object })
16+
date: Date | null = null;
17+
18+
@property({ type: String })
19+
origin = "";
20+
21+
@property({ type: String })
22+
collName = "";
23+
24+
@property({ type: String })
25+
collUrl = "";
1426

1527
constructor() {
1628
super();
1729

18-
if (self.__wbinfo && self.__wbinfo.timestamp) {
19-
this.date = tsToDate(self.__wbinfo.timestamp) as Date;
30+
if (self.__wbinfo?.timestamp) {
31+
this.date = tsToDate(self.__wbinfo.timestamp as string) as Date;
2032
}
33+
34+
this.origin = new URL(self.__wbinfo?.url).origin;
35+
this.collName = self.__wbinfo?.collName;
36+
this.collUrl = self.__wbinfo?.collUrl;
2137
}
2238

2339
static get styles() {
@@ -152,7 +168,7 @@ export class WBBanner extends LitElement {
152168
</a>
153169
<details class="webrecorder-banner-text-container">
154170
<summary class="webrecorder-banner-text" title="Archive Details">
155-
You are viewing an archived web page created on ${dateStr}
171+
You are viewing an archived version of this page from ${dateStr}
156172
</summary>
157173
<div class="webrecorder-details-flexcontainer">
158174
<div class="webrecorder-details-container">
@@ -184,12 +200,23 @@ export class WBBanner extends LitElement {
184200
></strong>
185201
</p>
186202
<p>
187-
We are a collaborative partner in the
188-
<a href="https://eotarchive.org/" target="_blank"
189-
>2024 End of Term web archiving project</a
203+
This page is a single-domain mirror of the original site
204+
from <i>${this.origin}</i>
205+
</p>
206+
<p>
207+
It is part of our effort to archive United States Government
208+
websites as part of
209+
<a target="_blank" href="https://eotarchive.org/"
210+
>End-of-Term Archive.</a
211+
>
212+
</p>
213+
<p>
214+
<strong
215+
><a href="${this.collUrl}" target="_blank"
216+
>View the full ${this.collName} Collection on
217+
Browsertrix</a
218+
></strong
190219
>
191-
which seeks to capture public United States government
192-
websites at the end of each presidential administration.
193220
</p>
194221
</div>
195222
</div>

0 commit comments

Comments
 (0)