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",
|
||||
"productName": "ReplayWeb.page",
|
||||
"version": "1.2.0-beta.0",
|
||||
"version": "1.2.0-beta.1",
|
||||
"description": "Serverless Web Archive Replay",
|
||||
"repository": "https://github.com/webrecorder/replayweb.page",
|
||||
"homepage": "https://replayweb.page/",
|
||||
@@ -9,7 +9,7 @@
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-free": "^5.13.0",
|
||||
"@webrecorder/wabac": "github:webrecorder/wabac.js#develop",
|
||||
"@webrecorder/wabac": "github:webrecorder/wabac.js",
|
||||
"bulma": "^0.9.0",
|
||||
"fetch-ndjson": "^1.1.0",
|
||||
"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 { sourceToId, tsToDate, getPageDateTS } from './pageutils';
|
||||
@@ -317,7 +317,7 @@ class Coll extends LitElement
|
||||
}
|
||||
|
||||
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);
|
||||
} else if (this.showSidebar && this.tabData.url) {
|
||||
this.updateTabData(event.detail.data, event.detail.replaceLoc, true);
|
||||
@@ -705,7 +705,7 @@ class Coll extends LitElement
|
||||
</a>
|
||||
<form @submit="${this.onSubmit}">
|
||||
<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``}
|
||||
${showFavIcon ? html`
|
||||
<span class="favicon icon is-small is-left">
|
||||
@@ -851,7 +851,8 @@ class Coll extends LitElement
|
||||
|
||||
onKeyDown(event) {
|
||||
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) {
|
||||
event.preventDefault();
|
||||
const value = this.renderRoot.querySelector("input").value;
|
||||
this.navigateTo(value);
|
||||
const input = this.renderRoot.querySelector("input");
|
||||
if (input.value) {
|
||||
this.navigateTo(input.value);
|
||||
} else {
|
||||
input.value = this.url;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
onLostFocus(event) {
|
||||
if (!event.currentTarget.value) {
|
||||
event.currentTarget.value = this.url;
|
||||
}
|
||||
}
|
||||
|
||||
navigateTo(value) {
|
||||
let data;
|
||||
|
||||
if (value.startsWith("http://") || value.startsWith("https://")) {
|
||||
data = {url: value};
|
||||
|
||||
if (value === this.tabData.url) {
|
||||
const replay = this.renderRoot.querySelector("wr-coll-replay");
|
||||
if (replay) {
|
||||
replay.refresh();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
} else {
|
||||
if (!value.startsWith(RWP_SCHEME)) {
|
||||
data = {query: value, view: "pages"};
|
||||
|
||||
@@ -291,9 +291,9 @@
|
||||
"@webassemblyjs/wast-parser" "1.9.0"
|
||||
"@xtuc/long" "4.2.2"
|
||||
|
||||
"@webrecorder/wabac@github:webrecorder/wabac.js#develop":
|
||||
version "2.1.0-beta.3"
|
||||
resolved "https://codeload.github.com/webrecorder/wabac.js/tar.gz/0f0ba4b2f2a636fdb8c4359d2fe986ff5849f572"
|
||||
"@webrecorder/wabac@github:webrecorder/wabac.js":
|
||||
version "2.1.0-beta.4"
|
||||
resolved "https://codeload.github.com/webrecorder/wabac.js/tar.gz/21bb3b5ea9bb9d67aa9c12cb1de7bf168616a92b"
|
||||
dependencies:
|
||||
brotli "github:foliojs/brotli.js"
|
||||
fast-xml-parser "^3.15.1"
|
||||
@@ -310,7 +310,7 @@
|
||||
unescape-js "^1.1.4"
|
||||
warcio "^1.2.0"
|
||||
wbn "^0.0.3"
|
||||
wombat "github:webrecorder/wombat#post-to-get"
|
||||
wombat "github:webrecorder/wombat"
|
||||
|
||||
"@xtuc/ieee754@^1.2.0":
|
||||
version "1.2.0"
|
||||
@@ -6326,9 +6326,9 @@ widest-line@^3.1.0:
|
||||
dependencies:
|
||||
string-width "^4.0.0"
|
||||
|
||||
"wombat@github:webrecorder/wombat#post-to-get":
|
||||
"wombat@github:webrecorder/wombat":
|
||||
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:
|
||||
version "1.7.0"
|
||||
|
||||
Reference in New Issue
Block a user