misc fixes for FF and safari

navbar info item: add dropdown to show info about current archive, source, size and loading mode
This commit is contained in:
Ilya Kreymer
2020-05-12 12:59:09 -07:00
parent f54078627f
commit 7294c05d2c
6 changed files with 100 additions and 68 deletions
+48 -37
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -20,6 +20,8 @@ $link: $wr-dark-blue;
$light: $wr-light-green; $light: $wr-light-green;
$dark: $wr-dark-green; $dark: $wr-dark-green;
$navbar-breakpoint: 800px;
.main-scroll { .main-scroll {
flex: 1; flex: 1;
scroll-behavior: smooth; scroll-behavior: smooth;
@@ -40,8 +42,6 @@ $dark: $wr-dark-green;
letter-spacing: -1.5px; letter-spacing: -1.5px;
} }
@import "../node_modules/bulma/bulma"; @import "../node_modules/bulma/bulma";
+1 -2
View File
@@ -69,7 +69,6 @@ class EmbedRWP extends LitElement
:host { :host {
width: 100%; width: 100%;
height: 100%; height: 100%;
flex-direction: column;
} }
`; `;
} }
@@ -77,7 +76,7 @@ class EmbedRWP extends LitElement
render() { render() {
return html` return html`
${this.paramString && this.hashString ? html` ${this.paramString && this.hashString ? html`
<iframe src="${this.replayBase}?${this.paramString}#${this.hashString}" allow="autoplay; fullscreen"></iframe> <iframe src="${this.replayBase}?${this.paramString}#${this.hashString}" allow="autoplay *; fullscreen"></iframe>
` : html``} ` : html``}
`; `;
} }
+43 -21
View File
@@ -15,6 +15,7 @@ import allCssRaw from '../scss/main.scss';
//import fasArrowLeft from '@fortawesome/fontawesome-free/svgs/solid/arrow-left.svg'; //import fasArrowLeft from '@fortawesome/fontawesome-free/svgs/solid/arrow-left.svg';
//import fasInfo from '@fortawesome/fontawesome-free/svgs/solid/info-circle.svg'; //import fasInfo from '@fortawesome/fontawesome-free/svgs/solid/info-circle.svg';
import fasArchiveIcon from '@fortawesome/fontawesome-free/svgs/solid/box-open.svg';
import fasRefresh from '@fortawesome/fontawesome-free/svgs/solid/redo-alt.svg'; import fasRefresh from '@fortawesome/fontawesome-free/svgs/solid/redo-alt.svg';
import fasHelp from '@fortawesome/fontawesome-free/svgs/solid/question-circle.svg'; import fasHelp from '@fortawesome/fontawesome-free/svgs/solid/question-circle.svg';
import farListAlt from '@fortawesome/fontawesome-free/svgs/solid/list-alt.svg'; import farListAlt from '@fortawesome/fontawesome-free/svgs/solid/list-alt.svg';
@@ -44,7 +45,7 @@ class AppMain extends LitElement
constructor() { constructor() {
super(); super();
this.sourceUrl = null; this.sourceUrl = null;
this.sourceLoaded = false; this.collInfo = null;
this.showTerms = false; this.showTerms = false;
this.pageParams = {}; this.pageParams = {};
} }
@@ -55,7 +56,7 @@ class AppMain extends LitElement
sourceUrl: { type: String }, sourceUrl: { type: String },
navMenuShown: { type: Boolean }, navMenuShown: { type: Boolean },
showTerms: { type: Boolean }, showTerms: { type: Boolean },
sourceLoaded: { type: Boolean }, collInfo: { type: Object },
embed: { type: String }, embed: { type: String },
} }
} }
@@ -67,7 +68,7 @@ class AppMain extends LitElement
margin-right: 8px; margin-right: 8px;
} }
.has-allcaps { .has-allcaps {
font-variant-caps: all-small-caps; font-variant-caps: small-caps;
} }
:host { :host {
position: fixed; position: fixed;
@@ -78,15 +79,11 @@ class AppMain extends LitElement
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.container {
width: 100%;
flex-grow: 0;
}
wr-coll { wr-coll {
height: 100%; height: 100%;
} }
.navback { .navbar {
width: 100%; padding: 0 0.5em;
} }
`); `);
} }
@@ -94,8 +91,6 @@ class AppMain extends LitElement
render() { render() {
return html` return html`
${!this.embed ? html` ${!this.embed ? html`
<div class="navback has-background-info">
<div class="container">
<nav class="navbar has-background-info" role="navigation" aria-label="main navigation"> <nav class="navbar has-background-info" role="navigation" aria-label="main navigation">
<div class="navbar-brand"> <div class="navbar-brand">
<a class="navbar-item has-text-weight-bold is-size-5 has-allcaps" href="/"> <a class="navbar-item has-text-weight-bold is-size-5 has-allcaps" href="/">
@@ -111,16 +106,33 @@ class AppMain extends LitElement
</div> </div>
<div class="navbar-menu ${this.navMenuShown ? 'is-active' : ''}"> <div class="navbar-menu ${this.navMenuShown ? 'is-active' : ''}">
<div class="navbar-start"> <div class="navbar-start">
<div class="navbar-item"></div> ${this.sourceUrl && this.collInfo ? html`
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link is-arrowless"><fa-icon size="1.5em" .svg="${fasArchiveIcon}"></fa-icon></a>
<div class="navbar-dropdown">
<div class="navbar-item"><i>Currently Loaded Archive</i></div>
<hr class="navbar-divider">
<div class="navbar-item">
Source:&nbsp;<b>${this.sourceUrl}</b>
</div>
<div class="navbar-item">
Total Size:&nbsp;<b>${prettyBytes(Number(this.collInfo.size || 0))}</b>
</div>
<div class="navbar-item">
Loading Mode:&nbsp;<b>${this.collInfo.onDemand ? "Download On-Demand" : "Fully Local"}</b>
</div>
</div>
</div>
` : ``}
</div> </div>
<div class="navbar-end"> <div class="navbar-end">
<a href="/docs" target="_blank" class="navbar-item"> <a href="/docs" target="_blank" class="navbar-item">
<fa-icon .svg="${fasHelp}"></fa-icon>&nbsp;Info <fa-icon .svg="${fasHelp}"></fa-icon>&nbsp;How it Works
</a> </a>
<a href="?terms" @click="${(e) => { e.preventDefault(); this.showTerms = true} }"class="navbar-item">Terms</a> <a href="?terms" @click="${(e) => { e.preventDefault(); this.showTerms = true} }"class="navbar-item">Terms</a>
</div> </div>
</nav> </nav>
</div></div>` : ''} ` : ''}
${this.sourceUrl ? html` ${this.sourceUrl ? html`
<wr-coll .loadInfo="${this.loadInfo}" <wr-coll .loadInfo="${this.loadInfo}"
@@ -174,7 +186,7 @@ class AppMain extends LitElement
updated(changedProperties) { updated(changedProperties) {
if (changedProperties.has("sourceUrl")) { if (changedProperties.has("sourceUrl")) {
this.sourceLoaded = false; this.collInfo = null;
} }
} }
@@ -239,8 +251,12 @@ class AppMain extends LitElement
onCollLoaded(event) { onCollLoaded(event) {
this.loadInfo = null; this.loadInfo = null;
if (event.detail.collInfo) {
this.collInfo = event.detail.collInfo;
}
if (event.detail.alreadyLoaded) { if (event.detail.alreadyLoaded) {
this.sourceLoaded = true; //this.sourceLoaded = true;
return; return;
} }
@@ -775,7 +791,10 @@ class WrColl extends LitElement
} }
this.hasCurated = (this.collInfo.lists && this.collInfo.lists.length); this.hasCurated = (this.collInfo.lists && this.collInfo.lists.length);
this.dispatchEvent(new CustomEvent("coll-loaded", {detail: {alreadyLoaded: true}})); this.dispatchEvent(new CustomEvent("coll-loaded", {detail: {
collInfo: this.collInfo,
alreadyLoaded: true
}}));
const hash = window.location.hash; const hash = window.location.hash;
if (hash) { if (hash) {
@@ -791,7 +810,10 @@ class WrColl extends LitElement
onCollLoaded(event) { onCollLoaded(event) {
this.doUpdateInfo(); this.doUpdateInfo();
this.loadInfo = null; this.loadInfo = null;
this.dispatchEvent(new CustomEvent("coll-loaded", {detail: {sourceUrl: this.sourceUrl}})); this.dispatchEvent(new CustomEvent("coll-loaded", {detail: {
sourceUrl: this.sourceUrl,
collInfo: this.collInfo,
}}));
} }
onHashChange(event) { onHashChange(event) {
@@ -1030,7 +1052,7 @@ class WrCuratedPages extends LitElement
max-height: calc(100% - 90px); max-height: calc(100% - 90px);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: fit-content; height: min-content;
} }
ul.menu-list a.is-active { ul.menu-list a.is-active {
@@ -1684,7 +1706,7 @@ class WrReplayPage extends LitElement
`} `}
${this.iframeUrl ? html` ${this.iframeUrl ? html`
<iframe @message="${this.onReplayMessage}" allow="autoplay; fullscreen" <iframe @message="${this.onReplayMessage}" allow="autoplay 'self'; fullscreen"
src="${this.iframeUrl}"></iframe> src="${this.iframeUrl}"></iframe>
` : ``} ` : ``}
@@ -1832,7 +1854,7 @@ class WrGdrive extends LitElement
const authToken = response.access_token; const authToken = response.access_token;
const headers = {"Authorization": `Bearer ${authToken}`}; const headers = {"Authorization": `Bearer ${authToken}`};
const resp = await fetch(metadataUrl + "?fields=name,size", {headers}); const resp = await fetch(metadataUrl + "?fields=name,size&supportsAllDrives=true", {headers});
if ((resp.status === 404 || resp.status == 403)) { if ((resp.status === 404 || resp.status == 403)) {
if (this.state !== "implicitonly") { if (this.state !== "implicitonly") {
+1 -1
View File
File diff suppressed because one or more lines are too long
+3 -3
View File
File diff suppressed because one or more lines are too long