|
1 | 1 | import { html, css, LitElement } from "lit";
|
| 2 | +import { property } from "lit/decorators.js"; |
| 3 | + |
2 | 4 | import { tsToDate } from "../pageutils";
|
3 | 5 | import { dateTimeFormatter } from "../utils/dateTimeFormatter";
|
4 | 6 | import fasRefresh from "@fortawesome/fontawesome-free/svgs/solid/redo-alt.svg";
|
5 | 7 | import rwpIcon from "~assets/icons/replaywebpage.svg";
|
6 | 8 |
|
7 | 9 | declare let self: Window & {
|
8 | 10 | // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
9 |
| - __wbinfo: any; |
| 11 | + __wbinfo?: any; |
10 | 12 | };
|
11 | 13 |
|
12 | 14 | 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 = ""; |
14 | 26 |
|
15 | 27 | constructor() {
|
16 | 28 | super();
|
17 | 29 |
|
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; |
20 | 32 | }
|
| 33 | + |
| 34 | + this.origin = new URL(self.__wbinfo?.url).origin; |
| 35 | + this.collName = self.__wbinfo?.collName; |
| 36 | + this.collUrl = self.__wbinfo?.collUrl; |
21 | 37 | }
|
22 | 38 |
|
23 | 39 | static get styles() {
|
@@ -152,7 +168,7 @@ export class WBBanner extends LitElement {
|
152 | 168 | </a>
|
153 | 169 | <details class="webrecorder-banner-text-container">
|
154 | 170 | <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} |
156 | 172 | </summary>
|
157 | 173 | <div class="webrecorder-details-flexcontainer">
|
158 | 174 | <div class="webrecorder-details-container">
|
@@ -184,12 +200,23 @@ export class WBBanner extends LitElement {
|
184 | 200 | ></strong>
|
185 | 201 | </p>
|
186 | 202 | <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 |
190 | 219 | >
|
191 |
| - which seeks to capture public United States government |
192 |
| - websites at the end of each presidential administration. |
193 | 220 | </p>
|
194 | 221 | </div>
|
195 | 222 | </div>
|
|
0 commit comments