Skip to content

Commit

Permalink
Expose encoded queries via link
Browse files Browse the repository at this point in the history
  • Loading branch information
carlopi committed Dec 18, 2023
1 parent ba936c9 commit 4bdc05d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/duckdb-wasm-app/static/css/navbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
}
.submenu {
display: grid;
grid-template-rows: repeat(5, 48px);
grid-template-rows: repeat(6, 48px);
grid-template-columns: 100%;
}
}
Expand Down
7 changes: 7 additions & 0 deletions packages/duckdb-wasm-app/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@
</div>
</a>
</div>
<div class="submenu_item">
<a href="/" title="Save URL-encoded queries" id="hashencoded">
<div>
<svg xmlns="http://www.w3.org/2000/svg" height="16" width="18" viewBox="0 0 576 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2023 Fonticons, Inc.--><path fill="#ffffff" d="M272 416c17.7 0 32-14.3 32-32s-14.3-32-32-32H160c-17.7 0-32-14.3-32-32V192h32c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-64-64c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l32 0 0 128c0 53 43 96 96 96H272zM304 96c-17.7 0-32 14.3-32 32s14.3 32 32 32l112 0c17.7 0 32 14.3 32 32l0 128H416c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8l-32 0V192c0-53-43-96-96-96L304 96z"/></svg>
</div>
</a>
</div>
<div class="submenu_item">
<a href="/docs/" title="Read the Documentation">
<div>
Expand Down
3 changes: 3 additions & 0 deletions packages/duckdb-wasm-shell/src/shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ class ShellRuntime {
this.hash += encode;
if (window.location.hash.startsWith("#savequeries"))
window.location.hash = "savequeries&" + this.hash;
const a = document.getElementById("hashencoded");
if (a && a instanceof HTMLAnchorElement)
a.href= "/#" + this.hash;
this.history.push(value);
}
}
Expand Down

0 comments on commit 4bdc05d

Please sign in to comment.