Lint and fix Lit html (#216)
- Adds eslint lit plugin to catch linting errors in lit html - Fixes linting errors
This commit is contained in:
@@ -5,8 +5,12 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
"extends": [
|
"extends": [
|
||||||
"eslint:recommended",
|
"eslint:recommended",
|
||||||
|
"plugin:lit/recommended",
|
||||||
"prettier"
|
"prettier"
|
||||||
],
|
],
|
||||||
|
"plugins": [
|
||||||
|
"lit"
|
||||||
|
],
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"ecmaVersion": 2018,
|
"ecmaVersion": 2018,
|
||||||
"sourceType": "module"
|
"sourceType": "module"
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
"electron-notarize": "^1.1.1",
|
"electron-notarize": "^1.1.1",
|
||||||
"eslint": "^8.23.1",
|
"eslint": "^8.23.1",
|
||||||
"eslint-config-prettier": "^9.0.0",
|
"eslint-config-prettier": "^9.0.0",
|
||||||
|
"eslint-plugin-lit": "^1.9.1",
|
||||||
"http-server": "^13.0.2",
|
"http-server": "^13.0.2",
|
||||||
"husky": "^8.0.0",
|
"husky": "^8.0.0",
|
||||||
"lint-staged": "^14.0.0",
|
"lint-staged": "^14.0.0",
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
"electron-notarize": "^1.1.1",
|
"electron-notarize": "^1.1.1",
|
||||||
"eslint": "^8.23.1",
|
"eslint": "^8.23.1",
|
||||||
"eslint-config-prettier": "^9.0.0",
|
"eslint-config-prettier": "^9.0.0",
|
||||||
|
"eslint-plugin-lit": "^1.9.1",
|
||||||
"http-server": "^13.0.2",
|
"http-server": "^13.0.2",
|
||||||
"husky": "^8.0.0",
|
"husky": "^8.0.0",
|
||||||
"lint-staged": "^14.0.0",
|
"lint-staged": "^14.0.0",
|
||||||
|
|||||||
+11
-9
@@ -292,12 +292,11 @@ class CollIndex extends LitElement {
|
|||||||
class="input is-small"
|
class="input is-small"
|
||||||
@input="${(e) => (this.query = e.currentTarget.value)}"
|
@input="${(e) => (this.query = e.currentTarget.value)}"
|
||||||
.value="${this.query}"
|
.value="${this.query}"
|
||||||
type="text"
|
|
||||||
placeholder="Search by Archive Title or Source"
|
placeholder="Search by Archive Title or Source"
|
||||||
/>
|
/>
|
||||||
<span class="icon is-left is-small"
|
<span class="icon is-left is-small">
|
||||||
><fa-icon .svg="${fasSearch}"
|
<fa-icon .svg="${fasSearch}"></fa-icon>
|
||||||
/></span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<wr-sorter
|
<wr-sorter
|
||||||
id="index"
|
id="index"
|
||||||
@@ -327,8 +326,11 @@ class CollIndex extends LitElement {
|
|||||||
@click="${this.onDeleteColl}"
|
@click="${this.onDeleteColl}"
|
||||||
></button>
|
></button>
|
||||||
`
|
`
|
||||||
: html`
|
: html` <span
|
||||||
<span class="button delete-button is-loading is-static">Deleting</span`}
|
class="button delete-button is-loading is-static"
|
||||||
|
>
|
||||||
|
Deleting
|
||||||
|
</span>`}
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
)}
|
)}
|
||||||
@@ -446,9 +448,9 @@ class CollInfo extends LitElement {
|
|||||||
: html` ${coll.sourceUrl} `}
|
: html` ${coll.sourceUrl} `}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<a @click="${(e) => this.onCopy(e, coll.sourceUrl)}" class="copy"
|
<a @click="${(e) => this.onCopy(e, coll.sourceUrl)}" class="copy">
|
||||||
><fa-icon .svg="${fasCopy}"
|
<fa-icon .svg="${fasCopy}"></fa-icon>
|
||||||
/></a>
|
</a>
|
||||||
${coll.sourceUrl && coll.sourceUrl.startsWith("googledrive://")
|
${coll.sourceUrl && coll.sourceUrl.startsWith("googledrive://")
|
||||||
? html` <p><i>(${coll.filename})</i></p>`
|
? html` <p><i>(${coll.filename})</i></p>`
|
||||||
: ""}
|
: ""}
|
||||||
|
|||||||
+115
-70
@@ -203,45 +203,76 @@ export class RWPEmbedReceipt extends LitElement {
|
|||||||
const dateStr = tsToDate(this.ts).toLocaleString();
|
const dateStr = tsToDate(this.ts).toLocaleString();
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<div class="dropdown mb-4 ${this.active ? "is-active" : ""}">
|
<div class="dropdown mb-4 ${this.active ? "is-active" : ""}">
|
||||||
<div class="dropdown-trigger embed-info-container">
|
<div class="dropdown-trigger embed-info-container">
|
||||||
<button class="embed-info is-small is-rounded mt-4" aria-haspopup="true" aria-controls="embed-dropdown" @click="${
|
<button
|
||||||
this.onEmbedDrop
|
class="embed-info is-small is-rounded mt-4"
|
||||||
}">
|
aria-haspopup="true"
|
||||||
<fa-icon class="menu-logo mr-2 embed-globe" size="1rem" aria-hidden="true" .svg=${btGlobe}></fa-icon>
|
aria-controls="embed-dropdown"
|
||||||
<span class="embed-info-buttontext">
|
@click="${this.onEmbedDrop}"
|
||||||
This embed is part of a web archive. Click here to learn more.
|
>
|
||||||
</span>
|
<fa-icon
|
||||||
<span class="icon is-small mr-4 ml-2">
|
class="menu-logo mr-2 embed-globe"
|
||||||
<fa-icon title="Toggle" .svg="${
|
size="1rem"
|
||||||
this.active ? btAngleDoubleUp : btAngleDoubleDown
|
aria-hidden="true"
|
||||||
}" aria-hidden="true"></fa-icon>
|
.svg=${btGlobe}
|
||||||
</span>
|
></fa-icon>
|
||||||
</button>
|
<span class="embed-info-buttontext">
|
||||||
</div>
|
This embed is part of a web archive. Click here to learn more.
|
||||||
<div class="dropdown-menu embed-info-container" id="embed-dropdown" role="menu">
|
|
||||||
<div class="dropdown-content embed-info-drop">
|
|
||||||
<p class="mb-4">
|
|
||||||
Even if the original page goes offline or is changed, the content below will remain unchanged as it is loaded from a web archive.
|
|
||||||
</p>
|
|
||||||
<hr class="dropdown-divider">
|
|
||||||
<h2 mt-4">Get A Copy!</h2>
|
|
||||||
<p class="mt-2">After downloading, this web archive can be loaded and viewed directly in your browser via <a style="white-space: nowrap;" target="_blank" href="https://replayweb.page">replayweb.page</a>.</p>
|
|
||||||
<a href="${sourceUrl}" class="button is-primary mt-4" @keyup="${clickOnSpacebarPress}">
|
|
||||||
<span class="icon is-small">
|
|
||||||
<fa-icon size="1.0em" aria-hidden="true" .svg="${fasDownload}"></fa-icon>
|
|
||||||
</span>
|
</span>
|
||||||
<span>Download Archive</span>
|
<span class="icon is-small mr-4 ml-2">
|
||||||
</a>
|
<fa-icon
|
||||||
<hr class="dropdown-divider mt-4">
|
title="Toggle"
|
||||||
<h2 mt-4">Technical Information</h2>
|
.svg="${this.active ? btAngleDoubleUp : btAngleDoubleDown}"
|
||||||
<div class="embed-info-drop-statscontainer mb-4">
|
aria-hidden="true"
|
||||||
<h3>Original URL:</h3>
|
></fa-icon>
|
||||||
<p><a target="_blank" href="${this.url}">${this.url}</a></p>
|
</span>
|
||||||
<h3 class="mt-2">Archived On:</h3>
|
</button>
|
||||||
<p>${dateStr}</p>
|
</div>
|
||||||
${
|
<div
|
||||||
domain
|
class="dropdown-menu embed-info-container"
|
||||||
|
id="embed-dropdown"
|
||||||
|
role="menu"
|
||||||
|
>
|
||||||
|
<div class="dropdown-content embed-info-drop">
|
||||||
|
<p class="mb-4">
|
||||||
|
Even if the original page goes offline or is changed, the content
|
||||||
|
below will remain unchanged as it is loaded from a web archive.
|
||||||
|
</p>
|
||||||
|
<hr class="dropdown-divider" />
|
||||||
|
<h2 class="mt-4">Get A Copy!</h2>
|
||||||
|
<p class="mt-2">
|
||||||
|
After downloading, this web archive can be loaded and viewed
|
||||||
|
directly in your browser via
|
||||||
|
<a
|
||||||
|
style="white-space: nowrap;"
|
||||||
|
target="_blank"
|
||||||
|
href="https://replayweb.page"
|
||||||
|
>replayweb.page</a
|
||||||
|
>.
|
||||||
|
</p>
|
||||||
|
<a
|
||||||
|
href="${sourceUrl}"
|
||||||
|
class="button is-primary mt-4"
|
||||||
|
@keyup="${clickOnSpacebarPress}"
|
||||||
|
>
|
||||||
|
<span class="icon is-small">
|
||||||
|
<fa-icon
|
||||||
|
size="1.0em"
|
||||||
|
aria-hidden="true"
|
||||||
|
.svg="${fasDownload}"
|
||||||
|
></fa-icon>
|
||||||
|
</span>
|
||||||
|
<span>Download Archive</span>
|
||||||
|
</a>
|
||||||
|
<hr class="dropdown-divider mt-4" />
|
||||||
|
<h2 class="mt-4">Technical Information</h2>
|
||||||
|
<div class="embed-info-drop-statscontainer mb-4">
|
||||||
|
<h3>Original URL:</h3>
|
||||||
|
<p><a target="_blank" href="${this.url}">${this.url}</a></p>
|
||||||
|
<h3 class="mt-2">Archived On:</h3>
|
||||||
|
<p>${dateStr}</p>
|
||||||
|
${domain
|
||||||
? html`
|
? html`
|
||||||
<h3 class="mt-2">Observed By:</h3>
|
<h3 class="mt-2">Observed By:</h3>
|
||||||
<p>${domain}</p>
|
<p>${domain}</p>
|
||||||
@@ -256,47 +287,61 @@ export class RWPEmbedReceipt extends LitElement {
|
|||||||
: software
|
: software
|
||||||
? html` <h3 class="mt-2">Created With:</h3>
|
? html` <h3 class="mt-2">Created With:</h3>
|
||||||
<p>${software}</p>`
|
<p>${software}</p>`
|
||||||
: ""
|
: ""}
|
||||||
}
|
${!domain && publicKey
|
||||||
${
|
|
||||||
!domain && publicKey
|
|
||||||
? html` <h3 class="mt-2">Observer Public Key:</h3>
|
? html` <h3 class="mt-2">Observer Public Key:</h3>
|
||||||
<p class="show-key">${publicKey}</p>`
|
<p class="show-key">${publicKey}</p>`
|
||||||
: ""
|
: ""}
|
||||||
}
|
<h3 class="mt-2">Validation:</h3>
|
||||||
<h3 class="mt-2">Validation:</h3>
|
${numValid > 0 || numInvalid > 0
|
||||||
${
|
|
||||||
numValid > 0 || numInvalid > 0
|
|
||||||
? html` <p>
|
? html` <p>
|
||||||
${numValid} hashes
|
${numValid} hashes
|
||||||
verified${numInvalid ? html`, ${numInvalid} invalid` : ""}
|
verified${numInvalid ? html`, ${numInvalid} invalid` : ""}
|
||||||
</p>`
|
</p>`
|
||||||
: html` <p>Not Available</p> `
|
: html` <p>Not Available</p> `}
|
||||||
}
|
<h3 class="mt-2">Package Hash:</h3>
|
||||||
<h3 class="mt-2">Package Hash:</h3>
|
<p class="show-hash">${datapackageHash}</p>
|
||||||
<p class="show-hash">${datapackageHash}</p>
|
<h3 class="mt-2">Size</h3>
|
||||||
<h3 class="mt-2">Size</h3>
|
<p>${prettyBytes(Number(this.collInfo.size || 0))}</p>
|
||||||
<p>${prettyBytes(Number(this.collInfo.size || 0))}</p>
|
</div>
|
||||||
|
${sourceUrl ? html`` : ""}
|
||||||
|
<p
|
||||||
|
class="is-size-7 is-flex is-justify-content-space-between"
|
||||||
|
style="margin-top: 40px"
|
||||||
|
>
|
||||||
|
<span>
|
||||||
|
<a
|
||||||
|
class="has-text-black"
|
||||||
|
target="_blank"
|
||||||
|
href="https://github.com/webrecorder/replayweb.page"
|
||||||
|
>
|
||||||
|
<fa-icon
|
||||||
|
class="menu-logo mr-1"
|
||||||
|
size="1.0rem"
|
||||||
|
aria-hidden="true"
|
||||||
|
.svg=${this.appLogo}
|
||||||
|
></fa-icon>
|
||||||
|
Powered by ReplayWeb.page
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
<a
|
||||||
|
class="has-text-black"
|
||||||
|
target="_blank"
|
||||||
|
href="https://github.com/webrecorder/replayweb.page"
|
||||||
|
>Source Code
|
||||||
|
<fa-icon
|
||||||
|
class="menu-logo ml-1"
|
||||||
|
size="1.0rem"
|
||||||
|
aria-hidden="true"
|
||||||
|
.svg=${fabGithub}
|
||||||
|
></fa-icon>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
${sourceUrl ? html`` : ""}
|
|
||||||
<p class="is-size-7 is-flex is-justify-content-space-between" style="margin-top: 40px">
|
|
||||||
<span>
|
|
||||||
<a class="has-text-black" target="_blank" href="https://github.com/webrecorder/replayweb.page">
|
|
||||||
<fa-icon class="menu-logo mr-1" size="1.0rem" aria-hidden="true" .svg=${
|
|
||||||
this.appLogo
|
|
||||||
}></fa-icon>
|
|
||||||
Powered by ReplayWeb.page
|
|
||||||
</a>
|
|
||||||
</span>
|
|
||||||
<span>
|
|
||||||
<a class="has-text-black" target="_blank" href="https://github.com/webrecorder/replayweb.page">Source Code
|
|
||||||
<fa-icon class="menu-logo ml-1" size="1.0rem" aria-hidden="true" .svg=${fabGithub}></fa-icon>
|
|
||||||
</a>
|
|
||||||
</span>
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -330,7 +330,7 @@ You can select a file to upload from the main page by clicking the 'Choose File.
|
|||||||
return html`
|
return html`
|
||||||
<section class="container">
|
<section class="container">
|
||||||
<div class="has-text-centered is-flex">
|
<div class="has-text-centered is-flex">
|
||||||
<wr-anim-logo class="logo" size="96px" />
|
<wr-anim-logo class="logo" size="96px"></wr-anim-logo>
|
||||||
</div>
|
</div>
|
||||||
${!this.embed
|
${!this.embed
|
||||||
? html` <div class="level">
|
? html` <div class="level">
|
||||||
@@ -352,7 +352,7 @@ You can select a file to upload from the main page by clicking the 'Choose File.
|
|||||||
return html`<wr-gdrive
|
return html`<wr-gdrive
|
||||||
.sourceUrl=${this.sourceUrl}
|
.sourceUrl=${this.sourceUrl}
|
||||||
@load-ready=${this.onLoadReady}
|
@load-ready=${this.onLoadReady}
|
||||||
/>`;
|
></wr-gdrive>`;
|
||||||
|
|
||||||
case "started":
|
case "started":
|
||||||
return html` <div class="progress-div">
|
return html` <div class="progress-div">
|
||||||
@@ -412,7 +412,7 @@ You can select a file to upload from the main page by clicking the 'Choose File.
|
|||||||
return html`<progress
|
return html`<progress
|
||||||
class="progress is-primary is-large"
|
class="progress is-primary is-large"
|
||||||
style="max-width: 400px"
|
style="max-width: 400px"
|
||||||
/>`;
|
></progress>`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+49
-43
@@ -549,7 +549,6 @@ class Pages extends LitElement {
|
|||||||
class="control has-icons-left ${this.loading ? "is-loading" : ""}"
|
class="control has-icons-left ${this.loading ? "is-loading" : ""}"
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
type="search"
|
|
||||||
class="input"
|
class="input"
|
||||||
@input="${this.onChangeQuery}"
|
@input="${this.onChangeQuery}"
|
||||||
.value="${this.query}"
|
.value="${this.query}"
|
||||||
@@ -661,49 +660,56 @@ class Pages extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderDownloadMenu() {
|
renderDownloadMenu() {
|
||||||
return html`
|
return html` <div class="dropdown ${this.menuActive ? "is-active" : ""}">
|
||||||
<div class="dropdown ${this.menuActive ? "is-active" : ""}">
|
<div class="dropdown-trigger">
|
||||||
<div class="dropdown-trigger">
|
<button
|
||||||
<button @click="${
|
@click="${this.onMenu}"
|
||||||
this.onMenu
|
class="button is-small"
|
||||||
}" class="button is-small" aria-haspopup="true" aria-expanded="${
|
aria-haspopup="true"
|
||||||
this.menuActive
|
aria-expanded="${this.menuActive}"
|
||||||
}" aria-controls="dropdown-menu">
|
aria-controls="dropdown-menu"
|
||||||
<span>Download</span>
|
>
|
||||||
<span class="icon is-small">
|
<span>Download</span>
|
||||||
<fa-icon .svg="${fasAngleDown} aria-hidden="true"></fa-icon>
|
<span class="icon is-small">
|
||||||
</span>
|
<fa-icon .svg="${fasAngleDown}" aria-hidden="true"></fa-icon>
|
||||||
</button>
|
</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="dropdown-menu" id="dropdown-menu">
|
||||||
|
<div class="dropdown-content">
|
||||||
|
<a
|
||||||
|
role="button"
|
||||||
|
href="#"
|
||||||
|
@click="${(e) => this.onDownload(e, "wacz")}"
|
||||||
|
@keyup="${clickOnSpacebarPress}"
|
||||||
|
class="dropdown-item"
|
||||||
|
>
|
||||||
|
Download ${this.selectedPages.size === 0 ? "All" : "Selected"} as
|
||||||
|
WACZ (Web Archive Collection Zip)
|
||||||
|
</a>
|
||||||
|
<a
|
||||||
|
role="button"
|
||||||
|
href="#"
|
||||||
|
@click="${(e) => this.onDownload(e, "warc")}"
|
||||||
|
@keyup="${clickOnSpacebarPress}"
|
||||||
|
class="dropdown-item"
|
||||||
|
>
|
||||||
|
Download ${this.selectedPages.size === 0 ? "All" : "Selected"} as
|
||||||
|
WARC 1.1 Only
|
||||||
|
</a>
|
||||||
|
<a
|
||||||
|
role="button"
|
||||||
|
href="#"
|
||||||
|
@click="${(e) => this.onDownload(e, "warc1.0")}"
|
||||||
|
@keyup="${clickOnSpacebarPress}"
|
||||||
|
class="dropdown-item"
|
||||||
|
>
|
||||||
|
Download ${this.selectedPages.size === 0 ? "All" : "Selected"} as
|
||||||
|
WARC 1.0 Only
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown-menu" id="dropdown-menu">
|
</div>
|
||||||
<div class="dropdown-content">
|
</div>`;
|
||||||
<a role="button" href="#"
|
|
||||||
@click="${(e) => this.onDownload(e, "wacz")}"
|
|
||||||
@keyup="${clickOnSpacebarPress}"
|
|
||||||
class="dropdown-item">
|
|
||||||
Download ${
|
|
||||||
this.selectedPages.size === 0 ? "All" : "Selected"
|
|
||||||
} as WACZ (Web Archive Collection Zip)
|
|
||||||
</a>
|
|
||||||
<a role="button" href="#"
|
|
||||||
@click="${(e) => this.onDownload(e, "warc")}"
|
|
||||||
@keyup="${clickOnSpacebarPress}"
|
|
||||||
class="dropdown-item">
|
|
||||||
Download ${
|
|
||||||
this.selectedPages.size === 0 ? "All" : "Selected"
|
|
||||||
} as WARC 1.1 Only
|
|
||||||
</a>
|
|
||||||
<a role="button" href="#"
|
|
||||||
@click="${(e) => this.onDownload(e, "warc1.0")}"
|
|
||||||
@keyup="${clickOnSpacebarPress}"
|
|
||||||
class="dropdown-item">
|
|
||||||
Download ${
|
|
||||||
this.selectedPages.size === 0 ? "All" : "Selected"
|
|
||||||
} as WARC 1.0 Only
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
renderPageHeader() {
|
renderPageHeader() {
|
||||||
|
|||||||
+1
-1
@@ -397,7 +397,7 @@ class Replay extends LitElement {
|
|||||||
.state="trymanual"
|
.state="trymanual"
|
||||||
.reauth="${true}"
|
.reauth="${true}"
|
||||||
@load-ready="${this.onReAuthed}"
|
@load-ready="${this.onReAuthed}"
|
||||||
/>`}
|
></wr-gdrive>`}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+213
-131
@@ -315,148 +315,230 @@ class URLResources extends LitElement {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
return html`
|
return html`
|
||||||
<div role="heading" aria-level="${
|
<div
|
||||||
this.isSidebar ? "2" : "1"
|
role="heading"
|
||||||
}" class="is-sr-only">URLs in ${this.collInfo.title}</div>
|
aria-level="${this.isSidebar ? "2" : "1"}"
|
||||||
|
class="is-sr-only"
|
||||||
|
>
|
||||||
|
URLs in ${this.collInfo.title}
|
||||||
|
</div>
|
||||||
|
|
||||||
<div role="heading" aria-level="${
|
<div
|
||||||
this.isSidebar ? "3" : "2"
|
role="heading"
|
||||||
}" class="is-sr-only">Search and Filter</div>
|
aria-level="${this.isSidebar ? "3" : "2"}"
|
||||||
<div class="notification level is-marginless">
|
class="is-sr-only"
|
||||||
<div class="level-left flex-auto">
|
>
|
||||||
<div class="level-item flex-auto">
|
Search and Filter
|
||||||
<span class="is-hidden-mobile">Search: </span>
|
</div>
|
||||||
<div class="select">
|
<div class="notification level is-marginless">
|
||||||
<select @change="${this.onChangeTypeSearch}">
|
<div class="level-left flex-auto">
|
||||||
${URLResources.filters.map(
|
<div class="level-item flex-auto">
|
||||||
(filter) => html`
|
<span class="is-hidden-mobile">Search: </span>
|
||||||
<option
|
<div class="select">
|
||||||
value="${filter.filter}"
|
<select @change="${this.onChangeTypeSearch}">
|
||||||
?selected="${filter.filter === this.currMime}"
|
${URLResources.filters.map(
|
||||||
>
|
(filter) => html`
|
||||||
${filter.name}
|
<option
|
||||||
</option>
|
value="${filter.filter}"
|
||||||
`,
|
?selected="${filter.filter === this.currMime}"
|
||||||
)}
|
>
|
||||||
</select>
|
${filter.name}
|
||||||
</div>
|
</option>
|
||||||
<div class="field flex-auto">
|
`,
|
||||||
<div class="control has-icons-left ${
|
)}
|
||||||
this.loading ? "is-loading" : ""
|
</select>
|
||||||
}">
|
</div>
|
||||||
<input type="text" class="input" @input="${
|
<div class="field flex-auto">
|
||||||
this.onChangeQuery
|
<div
|
||||||
}" .value="${
|
class="control has-icons-left ${this.loading
|
||||||
this.query
|
? "is-loading"
|
||||||
}" type="text" placeholder="Enter URL to Search">
|
: ""}"
|
||||||
<span class="icon is-left"><fa-icon .svg="${fasSearch}"/></span>
|
>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="input"
|
||||||
|
@input="${this.onChangeQuery}"
|
||||||
|
.value="${this.query}"
|
||||||
|
placeholder="Enter URL to Search"
|
||||||
|
/>
|
||||||
|
<span class="icon is-left"
|
||||||
|
><fa-icon .svg="${fasSearch}"></fa-icon
|
||||||
|
></span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="control level-right">
|
||||||
<div class="control level-right">
|
<div style="margin-left: 1em" class="control">
|
||||||
<div style="margin-left: 1em" class="control">
|
<label class="radio has-text-left"
|
||||||
<label class="radio has-text-left"><input type="radio" name="urltype" value="contains" ?checked="${
|
><input
|
||||||
this.urlSearchType === "contains"
|
type="radio"
|
||||||
}" @click="${this.onClickUrlType}"> Contains</label>
|
name="urltype"
|
||||||
<label class="radio has-text-left"><input type="radio" name="urltype" value="prefix" ?checked="${
|
value="contains"
|
||||||
this.urlSearchType === "prefix"
|
?checked="${this.urlSearchType === "contains"}"
|
||||||
}" @click="${this.onClickUrlType}"> Prefix</label>
|
@click="${this.onClickUrlType}"
|
||||||
<label class="radio has-text-left"><input type="radio" name="urltype" value="exact" ?checked="${
|
/> Contains</label
|
||||||
this.urlSearchType === "exact"
|
>
|
||||||
}" @click="${this.onClickUrlType}"> Exact</label>
|
<label class="radio has-text-left"
|
||||||
<span id="num-results" class="num-results" is-pulled-right" aria-live="polite" aria-atomic="true">${
|
><input
|
||||||
this.filteredResults.length
|
type="radio"
|
||||||
} Result(s)</span>
|
name="urltype"
|
||||||
|
value="prefix"
|
||||||
|
?checked="${this.urlSearchType === "prefix"}"
|
||||||
|
@click="${this.onClickUrlType}"
|
||||||
|
/> Prefix</label
|
||||||
|
>
|
||||||
|
<label class="radio has-text-left"
|
||||||
|
><input
|
||||||
|
type="radio"
|
||||||
|
name="urltype"
|
||||||
|
value="exact"
|
||||||
|
?checked="${this.urlSearchType === "exact"}"
|
||||||
|
@click="${this.onClickUrlType}"
|
||||||
|
/> Exact</label
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
id="num-results"
|
||||||
|
class="num-results"
|
||||||
|
is-pulled-right
|
||||||
|
aria-live="polite"
|
||||||
|
aria-atomic="true"
|
||||||
|
>${this.filteredResults.length} Result(s)</span
|
||||||
|
>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="sort-header is-hidden-tablet">
|
<div class="sort-header is-hidden-tablet">
|
||||||
<wr-sorter id="urls"
|
<wr-sorter
|
||||||
.sortKey="${this.sortKey}"
|
id="urls"
|
||||||
.sortDesc="${this.sortDesc}"
|
.sortKey="${this.sortKey}"
|
||||||
.sortKeys="${URLResources.sortKeys}"
|
.sortDesc="${this.sortDesc}"
|
||||||
.data="${this.filteredResults}"
|
.sortKeys="${URLResources.sortKeys}"
|
||||||
@sort-changed="${this.onSortChanged}">
|
.data="${this.filteredResults}"
|
||||||
</wr-sorter>
|
@sort-changed="${this.onSortChanged}"
|
||||||
</div>
|
>
|
||||||
|
</wr-sorter>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div role="heading" aria-level="${
|
<div
|
||||||
this.isSidebar ? "3" : "2"
|
role="heading"
|
||||||
}" id="results-heading" class="is-sr-only">Results</div>
|
aria-level="${this.isSidebar ? "3" : "2"}"
|
||||||
|
id="results-heading"
|
||||||
|
class="is-sr-only"
|
||||||
|
>
|
||||||
|
Results
|
||||||
|
</div>
|
||||||
|
|
||||||
<table class="all-results" aria-labelledby="results-heading num-results">
|
<table class="all-results" aria-labelledby="results-heading num-results">
|
||||||
<thead>
|
<thead>
|
||||||
<tr class="columns results-head has-text-weight-bold">
|
<tr class="columns results-head has-text-weight-bold">
|
||||||
<th scope="col" class="column col-url is-6 is-hidden-mobile"><a role="button" href="#" @click="${
|
<th scope="col" class="column col-url is-6 is-hidden-mobile">
|
||||||
this.onSort
|
<a
|
||||||
}" @keyup="${clickOnSpacebarPress}" data-key="url" class="${
|
role="button"
|
||||||
this.sortKey === "url" ? (this.sortDesc ? "desc" : "asc") : ""
|
href="#"
|
||||||
}">URL</a></th>
|
@click="${this.onSort}"
|
||||||
<th scope="col" class="column col-ts is-2 is-hidden-mobile"><a role="button" href="#" @click="${
|
@keyup="${clickOnSpacebarPress}"
|
||||||
this.onSort
|
data-key="url"
|
||||||
}" @keyup="${clickOnSpacebarPress}" data-key="ts" class="${
|
class="${this.sortKey === "url"
|
||||||
this.sortKey === "ts" ? (this.sortDesc ? "desc" : "asc") : ""
|
? this.sortDesc
|
||||||
}">Date</a></th>
|
? "desc"
|
||||||
<th scope="col" class="column col-mime is-3 is-hidden-mobile"><a role="button" href="#" @click="${
|
: "asc"
|
||||||
this.onSort
|
: ""}"
|
||||||
}" @keyup="${clickOnSpacebarPress}" data-key="mime" class="${
|
>URL</a
|
||||||
this.sortKey === "mime" ? (this.sortDesc ? "desc" : "asc") : ""
|
>
|
||||||
}">Mime Type</a></th>
|
</th>
|
||||||
<th scope="col" class="column col-status is-1 is-hidden-mobile"><a role="button" href="#" @click="${
|
<th scope="col" class="column col-ts is-2 is-hidden-mobile">
|
||||||
this.onSort
|
<a
|
||||||
}" @keyup="${clickOnSpacebarPress}" data-key="status" class="${
|
role="button"
|
||||||
this.sortKey === "status" ? (this.sortDesc ? "desc" : "asc") : ""
|
href="#"
|
||||||
}">Status</a></th>
|
@click="${this.onSort}"
|
||||||
</tr>
|
@keyup="${clickOnSpacebarPress}"
|
||||||
</thead>
|
data-key="ts"
|
||||||
|
class="${this.sortKey === "ts"
|
||||||
|
? this.sortDesc
|
||||||
|
? "desc"
|
||||||
|
: "asc"
|
||||||
|
: ""}"
|
||||||
|
>Date</a
|
||||||
|
>
|
||||||
|
</th>
|
||||||
|
<th scope="col" class="column col-mime is-3 is-hidden-mobile">
|
||||||
|
<a
|
||||||
|
role="button"
|
||||||
|
href="#"
|
||||||
|
@click="${this.onSort}"
|
||||||
|
@keyup="${clickOnSpacebarPress}"
|
||||||
|
data-key="mime"
|
||||||
|
class="${this.sortKey === "mime"
|
||||||
|
? this.sortDesc
|
||||||
|
? "desc"
|
||||||
|
: "asc"
|
||||||
|
: ""}"
|
||||||
|
>Mime Type</a
|
||||||
|
>
|
||||||
|
</th>
|
||||||
|
<th scope="col" class="column col-status is-1 is-hidden-mobile">
|
||||||
|
<a
|
||||||
|
role="button"
|
||||||
|
href="#"
|
||||||
|
@click="${this.onSort}"
|
||||||
|
@keyup="${clickOnSpacebarPress}"
|
||||||
|
data-key="status"
|
||||||
|
class="${this.sortKey === "status"
|
||||||
|
? this.sortDesc
|
||||||
|
? "desc"
|
||||||
|
: "asc"
|
||||||
|
: ""}"
|
||||||
|
>Status</a
|
||||||
|
>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
<tbody class="main-scroll" @scroll="${this.onScroll}">
|
<tbody class="main-scroll" @scroll="${this.onScroll}">
|
||||||
${
|
${this.sortedResults.length
|
||||||
this.sortedResults.length
|
? this.sortedResults.map(
|
||||||
? this.sortedResults.map(
|
(result) => html`
|
||||||
(result) => html`
|
<tr class="columns result">
|
||||||
<tr class="columns result">
|
<td class="column col-url is-6">
|
||||||
<td class="column col-url is-6">
|
<p class="minihead is-hidden-tablet">URL</p>
|
||||||
<p class="minihead is-hidden-tablet">URL</p>
|
<a
|
||||||
<a
|
@click="${this.onReplay}"
|
||||||
@click="${this.onReplay}"
|
data-url="${result.url}"
|
||||||
data-url="${result.url}"
|
data-ts="${result.ts}"
|
||||||
data-ts="${result.ts}"
|
href="${getReplayLink(
|
||||||
href="${getReplayLink(
|
"resources",
|
||||||
"resources",
|
result.url,
|
||||||
result.url,
|
result.ts,
|
||||||
result.ts,
|
)}"
|
||||||
)}"
|
|
||||||
>
|
|
||||||
<keyword-mark keywords="${this.query}"
|
|
||||||
>${result.url}</keyword-mark
|
|
||||||
>
|
>
|
||||||
</a>
|
<keyword-mark keywords="${this.query}"
|
||||||
</td>
|
>${result.url}</keyword-mark
|
||||||
<td class="column col-ts is-2">
|
>
|
||||||
<p class="minihead is-hidden-tablet">Date</p>
|
</a>
|
||||||
${new Date(result.date).toLocaleString()}
|
</td>
|
||||||
</td>
|
<td class="column col-ts is-2">
|
||||||
<td class="column col-mime is-3">
|
<p class="minihead is-hidden-tablet">Date</p>
|
||||||
<p class="minihead is-hidden-tablet">Mime Type</p>
|
${new Date(result.date).toLocaleString()}
|
||||||
${result.mime}
|
</td>
|
||||||
</td>
|
<td class="column col-mime is-3">
|
||||||
<td class="column col-status is-1">
|
<p class="minihead is-hidden-tablet">Mime Type</p>
|
||||||
<p class="minihead is-hidden-tablet">Status</p>
|
${result.mime}
|
||||||
${result.status}
|
</td>
|
||||||
</td>
|
<td class="column col-status is-1">
|
||||||
</tr>
|
<p class="minihead is-hidden-tablet">Status</p>
|
||||||
`,
|
${result.status}
|
||||||
)
|
</td>
|
||||||
: html`<tr class="section">
|
</tr>
|
||||||
<td colspan="4"><i>No Results Found.</i></td>
|
`,
|
||||||
</tr>`
|
)
|
||||||
}
|
: html`<tr class="section">
|
||||||
</tbody>
|
<td colspan="4"><i>No Results Found.</i></td>
|
||||||
</table>
|
</tr>`}
|
||||||
`;
|
</tbody>
|
||||||
|
</table>
|
||||||
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
onSort(event) {
|
onSort(event) {
|
||||||
|
|||||||
@@ -2271,6 +2271,15 @@ eslint-config-prettier@^9.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz#eb25485946dd0c66cd216a46232dc05451518d1f"
|
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz#eb25485946dd0c66cd216a46232dc05451518d1f"
|
||||||
integrity sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==
|
integrity sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==
|
||||||
|
|
||||||
|
eslint-plugin-lit@^1.9.1:
|
||||||
|
version "1.9.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/eslint-plugin-lit/-/eslint-plugin-lit-1.9.1.tgz#40cdd1f8d1b565eb5e913eab159c88f6f947bb19"
|
||||||
|
integrity sha512-XFFVufVxYJwqRB9sLkDXB7SvV1xi9hrC4HRFEdX1h9+iZ3dm4x9uS7EuT9uaXs6zR3DEgcojia1F7pmvWbc4Gg==
|
||||||
|
dependencies:
|
||||||
|
parse5 "^6.0.1"
|
||||||
|
parse5-htmlparser2-tree-adapter "^6.0.1"
|
||||||
|
requireindex "^1.2.0"
|
||||||
|
|
||||||
eslint-scope@5.1.1:
|
eslint-scope@5.1.1:
|
||||||
version "5.1.1"
|
version "5.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c"
|
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c"
|
||||||
@@ -4508,6 +4517,13 @@ parse5-html-rewriting-stream@^7.0.0:
|
|||||||
parse5 "^7.0.0"
|
parse5 "^7.0.0"
|
||||||
parse5-sax-parser "^7.0.0"
|
parse5-sax-parser "^7.0.0"
|
||||||
|
|
||||||
|
parse5-htmlparser2-tree-adapter@^6.0.1:
|
||||||
|
version "6.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz#2cdf9ad823321140370d4dbf5d3e92c7c8ddc6e6"
|
||||||
|
integrity sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==
|
||||||
|
dependencies:
|
||||||
|
parse5 "^6.0.1"
|
||||||
|
|
||||||
parse5-sax-parser@^7.0.0:
|
parse5-sax-parser@^7.0.0:
|
||||||
version "7.0.0"
|
version "7.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/parse5-sax-parser/-/parse5-sax-parser-7.0.0.tgz#4c05064254f0488676aca75fb39ca069ec96dee5"
|
resolved "https://registry.yarnpkg.com/parse5-sax-parser/-/parse5-sax-parser-7.0.0.tgz#4c05064254f0488676aca75fb39ca069ec96dee5"
|
||||||
@@ -4515,6 +4531,11 @@ parse5-sax-parser@^7.0.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
parse5 "^7.0.0"
|
parse5 "^7.0.0"
|
||||||
|
|
||||||
|
parse5@^6.0.1:
|
||||||
|
version "6.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b"
|
||||||
|
integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==
|
||||||
|
|
||||||
parse5@^7.0.0:
|
parse5@^7.0.0:
|
||||||
version "7.1.2"
|
version "7.1.2"
|
||||||
resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.1.2.tgz#0736bebbfd77793823240a23b7fc5e010b7f8e32"
|
resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.1.2.tgz#0736bebbfd77793823240a23b7fc5e010b7f8e32"
|
||||||
@@ -4927,6 +4948,11 @@ require-from-string@^2.0.2:
|
|||||||
resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909"
|
resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909"
|
||||||
integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==
|
integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==
|
||||||
|
|
||||||
|
requireindex@^1.2.0:
|
||||||
|
version "1.2.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/requireindex/-/requireindex-1.2.0.tgz#3463cdb22ee151902635aa6c9535d4de9c2ef1ef"
|
||||||
|
integrity sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==
|
||||||
|
|
||||||
requires-port@^1.0.0:
|
requires-port@^1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
|
resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
|
||||||
|
|||||||
Reference in New Issue
Block a user