location bar fixes:
- fix url not being updated from navigation - reload current url when pressing enter in location bar - revert to current url when losing focus and url is blank - fix hitting 'escape' resets location bar to current url - bump version to 1.2.0-beta.1 latest wabac.js: fixes for fetch credentials override, use wabac.js 2.1.0-beta.4
This commit is contained in:
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "replaywebpage",
|
"name": "replaywebpage",
|
||||||
"productName": "ReplayWeb.page",
|
"productName": "ReplayWeb.page",
|
||||||
"version": "1.2.0-beta.0",
|
"version": "1.2.0-beta.1",
|
||||||
"description": "Serverless Web Archive Replay",
|
"description": "Serverless Web Archive Replay",
|
||||||
"repository": "https://github.com/webrecorder/replayweb.page",
|
"repository": "https://github.com/webrecorder/replayweb.page",
|
||||||
"homepage": "https://replayweb.page/",
|
"homepage": "https://replayweb.page/",
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fortawesome/fontawesome-free": "^5.13.0",
|
"@fortawesome/fontawesome-free": "^5.13.0",
|
||||||
"@webrecorder/wabac": "github:webrecorder/wabac.js#develop",
|
"@webrecorder/wabac": "github:webrecorder/wabac.js",
|
||||||
"bulma": "^0.9.0",
|
"bulma": "^0.9.0",
|
||||||
"fetch-ndjson": "^1.1.0",
|
"fetch-ndjson": "^1.1.0",
|
||||||
"flexsearch": "^0.6.32",
|
"flexsearch": "^0.6.32",
|
||||||
|
|||||||
+26
-6
@@ -1,4 +1,4 @@
|
|||||||
import { LitElement, html, css, query } from 'lit-element';
|
import { LitElement, html, css } from 'lit-element';
|
||||||
import { wrapCss, rwpLogo, IS_APP, clickOnSpacebarPress } from './misc';
|
import { wrapCss, rwpLogo, IS_APP, clickOnSpacebarPress } from './misc';
|
||||||
|
|
||||||
import { sourceToId, tsToDate, getPageDateTS } from './pageutils';
|
import { sourceToId, tsToDate, getPageDateTS } from './pageutils';
|
||||||
@@ -317,7 +317,7 @@ class Coll extends LitElement
|
|||||||
}
|
}
|
||||||
|
|
||||||
onCollTabNav(event) {
|
onCollTabNav(event) {
|
||||||
if (event.target.id === this.tabData.view) {
|
if (event.target.id === this.tabData.view || event.target.id === "replay" && this.tabData.url) {
|
||||||
this.updateTabData(event.detail.data, event.detail.replaceLoc, false);
|
this.updateTabData(event.detail.data, event.detail.replaceLoc, false);
|
||||||
} else if (this.showSidebar && this.tabData.url) {
|
} else if (this.showSidebar && this.tabData.url) {
|
||||||
this.updateTabData(event.detail.data, event.detail.replaceLoc, true);
|
this.updateTabData(event.detail.data, event.detail.replaceLoc, true);
|
||||||
@@ -705,7 +705,7 @@ class Coll extends LitElement
|
|||||||
</a>
|
</a>
|
||||||
<form @submit="${this.onSubmit}">
|
<form @submit="${this.onSubmit}">
|
||||||
<div class="control is-expanded ${showFavIcon ? 'has-icons-left' : ''}">
|
<div class="control is-expanded ${showFavIcon ? 'has-icons-left' : ''}">
|
||||||
<input id="url" class="input" type="search" @keydown="${this.onKeyDown}" .value="${this.url}" placeholder="Enter text to search or a URL to replay"/>
|
<input id="url" class="input" type="search" @keydown="${this.onKeyDown}" @blur="${this.onLostFocus}" .value="${this.url}" placeholder="Enter text to search or a URL to replay"/>
|
||||||
${isReplay ? html`<p id="datetime" class="control is-hidden-mobile">${dateStr}</p>` : html``}
|
${isReplay ? html`<p id="datetime" class="control is-hidden-mobile">${dateStr}</p>` : html``}
|
||||||
${showFavIcon ? html`
|
${showFavIcon ? html`
|
||||||
<span class="favicon icon is-small is-left">
|
<span class="favicon icon is-small is-left">
|
||||||
@@ -851,7 +851,8 @@ class Coll extends LitElement
|
|||||||
|
|
||||||
onKeyDown(event) {
|
onKeyDown(event) {
|
||||||
if (event.key === "Esc" || event.key === "Escape") {
|
if (event.key === "Esc" || event.key === "Escape") {
|
||||||
event.target.value = this.url;
|
event.preventDefault();
|
||||||
|
event.currentTarget.value = this.url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -952,16 +953,35 @@ class Coll extends LitElement
|
|||||||
|
|
||||||
onSubmit(event) {
|
onSubmit(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const value = this.renderRoot.querySelector("input").value;
|
const input = this.renderRoot.querySelector("input");
|
||||||
this.navigateTo(value);
|
if (input.value) {
|
||||||
|
this.navigateTo(input.value);
|
||||||
|
} else {
|
||||||
|
input.value = this.url;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onLostFocus(event) {
|
||||||
|
if (!event.currentTarget.value) {
|
||||||
|
event.currentTarget.value = this.url;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
navigateTo(value) {
|
navigateTo(value) {
|
||||||
let data;
|
let data;
|
||||||
|
|
||||||
if (value.startsWith("http://") || value.startsWith("https://")) {
|
if (value.startsWith("http://") || value.startsWith("https://")) {
|
||||||
data = {url: value};
|
data = {url: value};
|
||||||
|
|
||||||
|
if (value === this.tabData.url) {
|
||||||
|
const replay = this.renderRoot.querySelector("wr-coll-replay");
|
||||||
|
if (replay) {
|
||||||
|
replay.refresh();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (!value.startsWith(RWP_SCHEME)) {
|
if (!value.startsWith(RWP_SCHEME)) {
|
||||||
data = {query: value, view: "pages"};
|
data = {query: value, view: "pages"};
|
||||||
|
|||||||
@@ -291,9 +291,9 @@
|
|||||||
"@webassemblyjs/wast-parser" "1.9.0"
|
"@webassemblyjs/wast-parser" "1.9.0"
|
||||||
"@xtuc/long" "4.2.2"
|
"@xtuc/long" "4.2.2"
|
||||||
|
|
||||||
"@webrecorder/wabac@github:webrecorder/wabac.js#develop":
|
"@webrecorder/wabac@github:webrecorder/wabac.js":
|
||||||
version "2.1.0-beta.3"
|
version "2.1.0-beta.4"
|
||||||
resolved "https://codeload.github.com/webrecorder/wabac.js/tar.gz/0f0ba4b2f2a636fdb8c4359d2fe986ff5849f572"
|
resolved "https://codeload.github.com/webrecorder/wabac.js/tar.gz/21bb3b5ea9bb9d67aa9c12cb1de7bf168616a92b"
|
||||||
dependencies:
|
dependencies:
|
||||||
brotli "github:foliojs/brotli.js"
|
brotli "github:foliojs/brotli.js"
|
||||||
fast-xml-parser "^3.15.1"
|
fast-xml-parser "^3.15.1"
|
||||||
@@ -310,7 +310,7 @@
|
|||||||
unescape-js "^1.1.4"
|
unescape-js "^1.1.4"
|
||||||
warcio "^1.2.0"
|
warcio "^1.2.0"
|
||||||
wbn "^0.0.3"
|
wbn "^0.0.3"
|
||||||
wombat "github:webrecorder/wombat#post-to-get"
|
wombat "github:webrecorder/wombat"
|
||||||
|
|
||||||
"@xtuc/ieee754@^1.2.0":
|
"@xtuc/ieee754@^1.2.0":
|
||||||
version "1.2.0"
|
version "1.2.0"
|
||||||
@@ -6326,9 +6326,9 @@ widest-line@^3.1.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
string-width "^4.0.0"
|
string-width "^4.0.0"
|
||||||
|
|
||||||
"wombat@github:webrecorder/wombat#post-to-get":
|
"wombat@github:webrecorder/wombat":
|
||||||
version "3.0.0"
|
version "3.0.0"
|
||||||
resolved "https://codeload.github.com/webrecorder/wombat/tar.gz/3b77ec41c3e28b51da772bebaedcb49e09970e37"
|
resolved "https://codeload.github.com/webrecorder/wombat/tar.gz/d547717e1daabc7769b0b2ee562a13baeeec180e"
|
||||||
|
|
||||||
worker-farm@^1.7.0:
|
worker-farm@^1.7.0:
|
||||||
version "1.7.0"
|
version "1.7.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user