diff --git a/src/coll-index.ts b/src/coll-index.ts index ee0b6653..be566601 100644 --- a/src/coll-index.ts +++ b/src/coll-index.ts @@ -189,7 +189,6 @@ class CollIndex extends LitElement { line-height: 0.4em; padding: 6px; border-radius: 10px; - display: none; position: absolute; } .copy:active { @@ -346,7 +345,7 @@ class CollIndex extends LitElement { `; } - renderCollInfo(coll) { + renderCollInfo(coll: Coll) { return html``; } @@ -381,6 +380,7 @@ class CollInfo extends LitElement { .column { word-break: break-word; position: relative; + /* font-family: monospace; */ } :host { @@ -405,56 +405,74 @@ class CollInfo extends LitElement { height: 100%; } .column:hover > .copy, - .source-text:hover + .copy, + .col-content:hover .copy, .copy:hover { - display: inline; + color: inherit; } .copy { color: black; margin: 0px; - margin: 0; + margin: -4px 0 0; line-height: 0.4em; padding: 6px; border-radius: 10px; - display: none; position: absolute; } .copy:active { background-color: lightgray; } + .col-content { + font-family: monospace; + font-size: 14px; + color: #1f2937; + } .minihead { - font-size: 10px; - font-weight: bold; + font-size: 12px; + line-height: 16px; + margin-bottom: 4px; } `; } - renderSource(coll) { + renderSource() { + const coll = this.coll; return html`
-

Source

+

Source

+
${coll.sourceUrl && (coll.sourceUrl.startsWith("http://") || coll.sourceUrl.startsWith("https://")) - ? html` ${coll.sourceUrl} ` - : html` ${coll.sourceUrl} `} - - - - - - ${coll.sourceUrl && coll.sourceUrl.startsWith("googledrive://") - ? html`

(${coll.filename})

` - : ""} + ? html` ${coll.sourceUrl} ` + : html` ${coll.sourceUrl}`} + ${coll.sourceUrl && coll.sourceUrl.startsWith("googledrive://") + ? html` (${coll.filename})` + : ""} + + + +
+
+
+

Collection id

+
+ ${coll.coll} + + + +

Date Loaded

- ${coll.ctime ? new Date(coll.ctime).toLocaleString() : ""} +
+ ${coll.ctime ? new Date(coll.ctime).toLocaleString() : ""} +

Total Size

- ${prettyBytes(Number(coll.totalSize || coll.size || 0))} +
+ ${prettyBytes(Number(coll.totalSize || coll.size || 0))} +
`; } @@ -470,7 +488,7 @@ class CollInfo extends LitElement { > - ${this.renderSource(coll)} + ${this.renderSource()} `; } @@ -494,24 +512,16 @@ class CollInfo extends LitElement { : ""; return html`
-
- - ${coll.name || coll.title || coll.filename} - -
- ${coll.desc - ? html`
-

Description

- ${coll.desc} -
` - : html``} - ${coll.description + ${coll.name || coll.title ? html`
-

Description

- ${coll.description} +

Title

+
${coll.name || coll.title}
` - : html``} - + : ""} +
+

Filename

+
${coll.filename}
+
${coll.resources ? html`

Files

@@ -525,61 +535,70 @@ class CollInfo extends LitElement { )}
` - : html`
-

Filename

- ${coll.filename} -
`} - ${this.renderSource(coll)} + : ""} + ${this.renderSource()} ${domain ? html`

Observed By

-

${domain}

- ${certFingerprintUrl - ? html`View Certificate` - : ""} + +

${domain}

+ ${certFingerprintUrl + ? html`View Certificate` + : ""} +
` : software ? html`

Created With

- ${software || "Unknown"} +
${software || "Unknown"}
` : ""}

Validation

- ${numValid > 0 || numInvalid > 0 - ? html`

- ${numValid} hashes - verified${numInvalid ? html`, ${numInvalid} invalid` : ""} -

` - : html` Not Available`} +
+ ${numValid > 0 || numInvalid > 0 + ? html`

+ ${numValid} hashes + verified${numInvalid ? html`, ${numInvalid} invalid` : ""} +

` + : html` Not Available`} +

Package Hash

- ${datapackageHash || "Not Available"} +
+ ${datapackageHash || "Not Available"} + + + +

Observer Public Key

- ${publicKey || "Not Available"} +
+ ${publicKey || "Not Available"} + + + +

Loading Mode

- ${coll.onDemand ? "Download On-Demand" : "Fully Local"} -
-
-

Collection id

- ${coll.coll} +
+ ${coll.onDemand ? "Download On-Demand" : "Fully Local"} +
`; } @@ -588,10 +607,10 @@ class CollInfo extends LitElement { return this.detailed ? this.renderDetailed() : this.renderSummaryView(); } - onCopy(event, sourceUrl) { + onCopy(event: Event, text: string | undefined) { event.preventDefault(); event.stopPropagation(); - navigator.clipboard.writeText(sourceUrl); + if (text) navigator.clipboard.writeText(text); return false; } diff --git a/src/types.ts b/src/types.ts index 3ea8f168..c454f437 100644 --- a/src/types.ts +++ b/src/types.ts @@ -14,4 +14,7 @@ export interface Coll { onDemand?: any; pages?: any[]; lists?: any[]; + ctime?: string; + totalSize?: unknown; + size?: unknown; }