-
+
Full Screen
-
+
Back
-
+
Forward
-
+
Reload
-
+
Page Search
@@ -964,7 +964,7 @@ const re=new WeakMap,oe=w(e=>t=>{if(!(t instanceof T))throw new Error("unsafeSVG
`:""}
- `}onKeyDown(e){"Esc"!==e.key&&"Escape"!==e.key||(e.target.value=this.url)}onMenu(e){e.stopPropagation(),this.menuActive=!this.menuActive,this.menuActive&&document.addEventListener("click",()=>{this.menuActive=!1},{once:!0})}onFullscreenToggle(){this.menuActive=!1,this.isFullscreen?document.exitFullscreen():this.requestFullscreen()}onGoBack(){this.menuActive=!1,window.history.back()}onGoForward(){this.menuActive=!1,window.history.forward()}onShowPages(e){e.preventDefault(),this.showSidebar||document.documentElement.clientWidth>=769?this.showSidebar=!this.showSidebar:this.tabData&&"replay"===this.tabData.view&&this.updateTabData({view:"pages"})}onReAuthed(e){this.reauthWait=(async()=>{const t=e.detail.headers;await fetch(this.collInfo.apiPrefix+"/updateAuth",{method:"POST",body:JSON.stringify({headers:t})});this.showAuth&&(this.onRefresh(null,!0),this.showAuth=!1)})()}async onPurgeCache(e){e.preventDefault();const t=await fetch(""+this.collInfo.apiPrefix,{method:"DELETE"});200===t.status&&window.parent?window.parent.location.reload():console.warn("purge failed: "+t.status)}onSubmit(e){e.preventDefault();const t=this.renderRoot.querySelector("input").value;return this.navigateTo(t),!1}navigateTo(e){let t;t=e.startsWith("http://")||e.startsWith("https://")?{url:e,view:"replay"}:e.startsWith("search://")?this._stringToParams(e):{query:e,view:"pages"},this.updateTabData(t)}_stringToParams(e){const t=new URLSearchParams(e.slice("search://".length)),i={};for(const e of["query","view","currList","currMime","urlSearchType"])t.has(e)&&(i[e]=t.get(e));return i}_paramsToString(e){const t=new URLSearchParams;for(const i of["query","view","currList","currMime","urlSearchType"])i in e&&t.set(i,e[i]);return t.toString()}onRefresh(e,t){if(e&&e.preventDefault(),this.menuActive=!1,"replay"===this.tabData.view){const e=this.renderRoot.querySelector("wr-coll-replay");e&&e.refresh()}else window.location.reload()}}customElements.define("wr-coll",St);
+ `}onKeyDown(e){"Esc"!==e.key&&"Escape"!==e.key||(e.target.value=this.url)}onMenu(e){e.stopPropagation(),this.menuActive=!this.menuActive,this.menuActive&&document.addEventListener("click",()=>{this.menuActive=!1},{once:!0})}onFullscreenToggle(){this.menuActive=!1,this.isFullscreen?document.exitFullscreen():this.requestFullscreen()}onGoBack(){this.menuActive=!1,window.history.back()}onGoForward(){this.menuActive=!1,window.history.forward()}onShowPages(e){e.preventDefault(),this.showSidebar||document.documentElement.clientWidth>=769?this.showSidebar=!this.showSidebar:this.tabData&&"replay"===this.tabData.view&&this.updateTabData({view:"pages"})}onReAuthed(e){this.reauthWait=(async()=>{const t=e.detail.headers;await fetch(this.collInfo.apiPrefix+"/updateAuth",{method:"POST",body:JSON.stringify({headers:t})});this.showAuth&&(this.onRefresh(null,!0),this.showAuth=!1)})()}async onPurgeCache(e){e.preventDefault();const t=await fetch(""+this.collInfo.apiPrefix,{method:"DELETE"});200===t.status&&window.parent?window.parent.location.reload():console.warn("purge failed: "+t.status)}onSubmit(e){e.preventDefault();const t=this.renderRoot.querySelector("input").value;return this.navigateTo(t),!1}navigateTo(e){let t;t=e.startsWith("http://")||e.startsWith("https://")?{url:e,view:"replay"}:e.startsWith("search://")?this._stringToParams(e):{query:e,view:"pages"},this.updateTabData(t)}_stringToParams(e){const t=new URLSearchParams(e.slice("search://".length)),i={};for(const e of["query","view","currList","currMime","urlSearchType"])t.has(e)&&(i[e]=t.get(e));return i}_paramsToString(e){const t=new URLSearchParams;for(const i of["query","view","currList","currMime","urlSearchType"])i in e&&t.set(i,e[i]);return t.toString()}onRefresh(e,t){if(e&&e.preventDefault(),this.menuActive=!1,"replay"===this.tabData.view){const e=this.renderRoot.querySelector("wr-coll-replay");e&&e.refresh()}else window.location.reload()}}customElements.define("wr-coll",zt);
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
@@ -978,7 +978,7 @@ const re=new WeakMap,oe=w(e=>t=>{if(!(t instanceof T))throw new Error("unsafeSVG
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
-const zt=new WeakMap,$t=w(e=>t=>{if(!(t instanceof T))throw new Error("unsafeHTML can only be used in text bindings");const i=zt.get(t);if(void 0!==i&&_(e)&&e===i.value&&t.value===i.fragment)return;const a=document.createElement("template");a.innerHTML=e;const r=document.importNode(a.content,!0);t.setValue(r),zt.set(t,{value:e,fragment:r})});var _t=i(101),Ct=i.n(_t);customElements.define("wr-coll-story",class extends ae{constructor(){super(),this.collInfo=null,this.curatedPageMap={},this.currList=0,this.active=!1,this.lastST=0,this.clickTime=0}static get properties(){return{collInfo:{type:Object},active:{type:Boolean},curatedPageMap:{type:Object},currList:{type:Number}}}updated(e){e.has("collInfo")&&this.doLoadCurated(),e.has("currList")&&this.active&&this.sendChangeEvent({currList:this.currList})}async doLoadCurated(){this.curatedPageMap={};const e={};for(const t of this.collInfo.pages)e[t.id]=t;for(const t of this.collInfo.curatedPages){this.curatedPageMap[t.list]||(this.curatedPageMap[t.list]=[]);const i=e[t.page];if(!i){console.log("No Page with id: "+i);continue}const a=i.url,r=i.ts,o=i.title||i.url,n=t.desc;this.curatedPageMap[t.list].push({url:a,ts:r,title:o,desc:n})}this.scrollToList()}static get styles(){return ue(te`
+const $t=new WeakMap,_t=w(e=>t=>{if(!(t instanceof T))throw new Error("unsafeHTML can only be used in text bindings");const i=$t.get(t);if(void 0!==i&&_(e)&&e===i.value&&t.value===i.fragment)return;const a=document.createElement("template");a.innerHTML=e;const r=document.importNode(a.content,!0);t.setValue(r),$t.set(t,{value:e,fragment:r})});var Ct=i(101),Pt=i.n(Ct);customElements.define("wr-coll-story",class extends ae{constructor(){super(),this.collInfo=null,this.curatedPageMap={},this.currList=0,this.active=!1,this.lastST=0,this.clickTime=0}static get properties(){return{collInfo:{type:Object},active:{type:Boolean},curatedPageMap:{type:Object},currList:{type:Number}}}updated(e){e.has("collInfo")&&this.doLoadCurated(),e.has("currList")&&this.active&&this.sendChangeEvent({currList:this.currList})}async doLoadCurated(){this.curatedPageMap={};const e={};for(const t of this.collInfo.pages)e[t.id]=t;for(const t of this.collInfo.curatedPages){this.curatedPageMap[t.list]||(this.curatedPageMap[t.list]=[]);const i=e[t.page];if(!i){console.log("No Page with id: "+i);continue}const a=i.url,r=i.ts,o=i.title||i.url,n=t.desc;this.curatedPageMap[t.list].push({url:a,ts:r,title:o,desc:n})}this.scrollToList()}static get styles(){return ue(te`
:host {
width: 100%;
height: 100%;
@@ -1079,7 +1079,7 @@ const zt=new WeakMap,$t=w(e=>t=>{if(!(t instanceof T))throw new Error("unsafeHTM
${this.collInfo.title}
- ${this.collInfo.desc?$t(Ct()(this.collInfo.desc)):""}
+ ${this.collInfo.desc?_t(Pt()(this.collInfo.desc)):""}
${this.renderLists()}
@@ -1099,7 +1099,7 @@ const zt=new WeakMap,$t=w(e=>t=>{if(!(t instanceof T))throw new Error("unsafeHTM
`)}`}renderCPage(e){const t=new Date(e.ts);return O`
-
+
${e.title}
${e.url}
@@ -1107,7 +1107,7 @@ const zt=new WeakMap,$t=w(e=>t=>{if(!(t instanceof T))throw new Error("unsafeHTM
${e.desc}
- `}onReplay(e){e.preventDefault();const t={url:e.currentTarget.getAttribute("data-url"),ts:e.currentTarget.getAttribute("data-ts"),view:"replay"};return this.sendChangeEvent(t),!1}sendChangeEvent(e){this.dispatchEvent(new CustomEvent("coll-tab-nav",{detail:{data:e}}))}onClickScroll(e){return e.preventDefault(),this.currList=Number(e.currentTarget.getAttribute("data-list")),this.scrollToList(),!1}scrollToList(){this.currList>this.collInfo.lists.length&&(this.currList=0);const e={behavior:"smooth",block:"nearest",inline:"nearest"};this.clickTime=(new Date).getTime();const t=this.renderRoot.getElementById("list-"+this.currList);t&&t.scrollIntoView(e)}onScroll(e){const t=e.currentTarget,i=this.renderRoot.getElementById("list-"+this.currList);if(!i)return;let a=i;const r=t.offsetTop,o=t.scrollTop;if(o>this.lastST)for(;a.nextElementSibling&&a.nextElementSibling.getBoundingClientRect().top
=r;)a=a.previousElementSibling;if(this.lastST=o,a&&a!=i&&a.id.startsWith("list-")&&(this.currList=Number(a.id.slice(5))),(new Date).getTime()-this.clickTime<1e3)return;const n=this.renderRoot.querySelector(`a[data-list="${this.currList}"]`);if(n){const e={behavior:"smooth",block:"nearest",inline:"nearest"};n.scrollIntoView(e)}}});var Pt=i(102),Lt=i.n(Pt);customElements.define("wr-gdrive",class extends ae{constructor(){super(),this.state="trypublic",this.sourceUrl="",this.scriptLoaded=!1,this.error=!1}static get properties(){return{state:{type:String},sourceUrl:{type:String},error:{type:Boolean},reauth:{type:Boolean}}}updated(e){e.has("sourceUrl")&&(this.error=!1,this.state="trypublic",this.tryPublicAccess().then(e=>{e||(this.state="tryauto",this.requestUpdate())}))}async tryPublicAccess(){try{const e=this.sourceUrl,t="https://helper-proxy.webrecorder.workers.dev/g/"+e.slice("googledrive://".length);let i=null;try{i=await fetch(t)}catch(e){return!1}const a=await i.json();if(!a.url||!a.name||!a.size)return!1;if(a.size>15e6)return!1;const r=a.url;try{const e=new AbortController,t=e.signal;if(i=await fetch(r,{signal:t}),e.abort(),200!=i.status)return!1}catch(e){return!1}const o=a.name,n={publicUrl:r},s=Number(a.size);return this.dispatchEvent(new CustomEvent("load-ready",{detail:{name:o,extra:n,size:s,sourceUrl:e}})),!0}catch(e){return!1}}onLoad(){this.scriptLoaded=!0,this.gauth("none",e=>{e.error?"implicitonly"!==this.state&&(this.state="trymanual"):this.authed(e)})}onClickAuth(){this.gauth("select_account",e=>{e.error||this.authed(e)})}async authed(e){const t=this.sourceUrl,i="https://www.googleapis.com/drive/v3/files/"+t.slice("googledrive://".length),a={Authorization:"Bearer "+e.access_token},r=await fetch(i+"?fields=name,size&supportsAllDrives=true",{headers:a});if(404===r.status||403==r.status)return"implicitonly"!==this.state&&(this.state="trymanual"),void(this.error=!0);this.error=!1;const o=await r.json(),n=o.name,s=Number(o.size);this.dispatchEvent(new CustomEvent("load-ready",{detail:{sourceUrl:t,headers:a,size:s,name:n}}))}static get styles(){return ue(te``)}render(){return O`
+ `}onReplay(e){e.preventDefault();const t={url:e.currentTarget.getAttribute("data-url"),ts:e.currentTarget.getAttribute("data-ts"),view:"replay"};return this.sendChangeEvent(t),!1}sendChangeEvent(e){this.dispatchEvent(new CustomEvent("coll-tab-nav",{detail:{data:e}}))}onClickScroll(e){return e.preventDefault(),this.currList=Number(e.currentTarget.getAttribute("data-list")),this.scrollToList(),!1}scrollToList(){this.currList>this.collInfo.lists.length&&(this.currList=0);const e={behavior:"smooth",block:"nearest",inline:"nearest"};this.clickTime=(new Date).getTime();const t=this.renderRoot.getElementById("list-"+this.currList);t&&t.scrollIntoView(e)}onScroll(e){const t=e.currentTarget,i=this.renderRoot.getElementById("list-"+this.currList);if(!i)return;let a=i;const r=t.offsetTop,o=t.scrollTop;if(o>this.lastST)for(;a.nextElementSibling&&a.nextElementSibling.getBoundingClientRect().top=r;)a=a.previousElementSibling;if(this.lastST=o,a&&a!=i&&a.id.startsWith("list-")&&(this.currList=Number(a.id.slice(5))),(new Date).getTime()-this.clickTime<1e3)return;const n=this.renderRoot.querySelector(`a[data-list="${this.currList}"]`);if(n){const e={behavior:"smooth",block:"nearest",inline:"nearest"};n.scrollIntoView(e)}}});var Lt=i(102),Tt=i.n(Lt);customElements.define("wr-gdrive",class extends ae{constructor(){super(),this.state="trypublic",this.sourceUrl="",this.scriptLoaded=!1,this.error=!1}static get properties(){return{state:{type:String},sourceUrl:{type:String},error:{type:Boolean},reauth:{type:Boolean}}}updated(e){e.has("sourceUrl")&&(this.error=!1,this.state="trypublic",this.tryPublicAccess().then(e=>{e||(this.state="tryauto",this.requestUpdate())}))}async tryPublicAccess(){try{const e=this.sourceUrl,t="https://helper-proxy.webrecorder.workers.dev/g/"+e.slice("googledrive://".length);let i=null;try{i=await fetch(t)}catch(e){return!1}const a=await i.json();if(!a.url||!a.name||!a.size)return!1;if(a.size>15e6)return!1;const r=a.url;try{const e=new AbortController,t=e.signal;if(i=await fetch(r,{signal:t}),e.abort(),200!=i.status)return!1}catch(e){return!1}const o=a.name,n={publicUrl:r},s=Number(a.size);return this.dispatchEvent(new CustomEvent("load-ready",{detail:{name:o,extra:n,size:s,sourceUrl:e}})),!0}catch(e){return!1}}onLoad(){this.scriptLoaded=!0,this.gauth("none",e=>{e.error?"implicitonly"!==this.state&&(this.state="trymanual"):this.authed(e)})}onClickAuth(){this.gauth("select_account",e=>{e.error||this.authed(e)})}async authed(e){const t=this.sourceUrl,i="https://www.googleapis.com/drive/v3/files/"+t.slice("googledrive://".length),a={Authorization:"Bearer "+e.access_token},r=await fetch(i+"?fields=name,size&supportsAllDrives=true",{headers:a});if(404===r.status||403==r.status)return"implicitonly"!==this.state&&(this.state="trymanual"),void(this.error=!0);this.error=!1;const o=await r.json(),n=o.name,s=Number(o.size);this.dispatchEvent(new CustomEvent("load-ready",{detail:{sourceUrl:t,headers:a,size:s,name:n}}))}static get styles(){return ue(te``)}render(){return O`
${this.script()}
${"trymanual"!==this.state?O`
Connecting to Google Drive...
@@ -1120,7 +1120,7 @@ const zt=new WeakMap,$t=w(e=>t=>{if(!(t instanceof T))throw new Error("unsafeHTM
`:""}
`}`}script(){if("trypublic"===this.state||this.scriptLoaded)return O``;const e=document.createElement("script");return e.onload=()=>this.onLoad(),e.src="https://apis.google.com/js/platform.js",e}gauth(e,t){gapi.load("auth2",()=>{gapi.auth2.authorize({client_id:"160798412227-tko4c82uopud11q105b2lvbogsj77hlg.apps.googleusercontent.com",scope:"https://www.googleapis.com/auth/drive.file",response_type:"token",prompt:e},t)})}});customElements.define("wr-loader",class extends ae{constructor(){super(),this.progress=0,this.total=0,this.percent=0,this.coll="",this.state="waiting",this.loadInfo=null,this.currentSize=0,this.totalSize=0,this.dbworker=ze()}static get properties(){return{sourceUrl:{type:String},loadInfo:{type:Object},state:{type:String},progress:{type:Number},percent:{type:Number},currentSize:{type:Number},totalSize:{type:Number},error:{type:String},total:{type:Number},status:{type:String},coll:{type:String},embed:{type:String}}}firstUpdated(e){this.initMessages()}initMessages(){this.dbworker.addEventListener("message",e=>{switch(e.data.msg_type){case"collProgress":e.data.name===this.coll&&(this.percent=e.data.percent,e.data.error&&(this.error=e.data.error,this.state="errored"),e.data.currentSize&&e.data.totalSize&&(this.currentSize=e.data.currentSize,this.totalSize=e.data.totalSize));break;case"collAdded":e.data.name===this.coll&&(this.total||(this.total=100),this.progress=this.total,this.percent=100,this.dispatchEvent(new CustomEvent("coll-loaded",{detail:e.data})))}})}async doLoad(){let e=this.sourceUrl,t=null;if(this.percent=this.currentSize=this.totalSize=0,!navigator.serviceWorker)return this.state="errored",void(this.error="Sorry, this browser is not supported. Please try a different browser\n(If you're using Firefox, try without Private Mode)");try{const{scheme:i,host:a,path:r}=function(e){let t=e.indexOf("://"),i=0,a="",r="",o="";return t>=0?(a=e.slice(0,t),t+=3):(t++,e.startsWith("//")&&(t+=2)),i=e.indexOf("/",t),i>0?(r=e.slice(t,i),o=e.slice(i)):(r=e.slice(t),o=""),{scheme:a,host:r,path:o}}(e);switch(i){case"googledrive":this.state="googledrive",t=await this.googledriveInit();break;case"s3":t={sourceUrl:e,loadUrl:`https://${a}.s3.amazonaws.com${r}`,name:this.sourceUrl};break;case"file":if(!this.loadInfo)return this.state="errored",void(this.error="File URLs can not be entered directly or shared.\nYou can select a file to upload from the main page by clicking the 'Choose File...' button.");t=this.loadInfo}}catch(e){}t||(t={sourceUrl:e}),this.state="started";const i={msg_type:"addColl",name:this.coll,skipExisting:!0,file:t};this.loadInfo&&this.loadInfo.extraConfig&&(i.extraConfig=this.loadInfo.extraConfig),this.dbworker.postMessage(i)}googledriveInit(){return this._gdWait=new Promise(e=>this._gdResolve=e),this._gdWait}async onLoadReady(e){this._gdResolve&&this._gdResolve(e.detail)}onCancel(){this.dbworker.postMessage({msg_type:"cancelLoad",name:this.coll})}updated(e){this.sourceUrl&&e.has("sourceUrl")&&this.doLoad()}static get styles(){return ue(te`
@@ -1183,7 +1183,7 @@ const zt=new WeakMap,$t=w(e=>t=>{if(!(t instanceof T))throw new Error("unsafeHTM
value="${this.percent}" max="100">
${this.currentSize&&this.totalSize?O`
- Loaded ${Pe()(this.currentSize)} of ${Pe()(this.totalSize)}
`:O``}
+ Loaded ${Le()(this.currentSize)} of ${Le()(this.totalSize)}
`:O``}
${this.embed?"":O`
`}
@@ -1194,7 +1194,7 @@ const zt=new WeakMap,$t=w(e=>t=>{if(!(t instanceof T))throw new Error("unsafeHTM
${this.embed?O`
window.parent.location.reload()}>Try Again`:O`
Back`}
- `;case"waiting":default:return O`