Skip to content

Commit

Permalink
WIP: Add highlight for disclosures
Browse files Browse the repository at this point in the history
  • Loading branch information
c2bo committed Feb 12, 2024
1 parent 6abf30f commit 33cfe08
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { onMount } from "svelte";
let encodedJwt: string | undefined =
"eyJhbGciOiAiRVMyNTYiLCAidHlwIjogInZjK3NkLWp3dCJ9.eyJfc2QiOiBbIjBuOXl6RlNXdktfQlVIaWFNaG0xMmdockN0VmFockdKNl8ta1pQLXlTcTQiLCAiQ2gtREJjTDNrYjRWYkhJd3Rrbm5aZE5VSHRoRXE5TVpqb0ZkZzZpZGlobyIsICJEVzdnRlZaU3V5cjQyWVNZeDhwOHJWS0VrdEp6SjN1RkltZW5tSkJJbWRzIiwgIkkwMGZjRlVvRFhDdWNwNXl5MnVqcVBzc0RWR2FXTmlVbGlOel9hd0QwZ2MiLCAiWDlNYVBhRldtUVlwZkhFZHl0UmRhY2xuWW9FcnU4RXp0QkVVUXVXT2U0NCIsICJkOHFrZlBkb2UyUFlFOTNkNU1fZ0JMMWdabHBGUktDYzBkMWxhb2RfX3MwIiwgImxJM0wwaHNlQ1JXbVVQZzgyVkNVTl9hMTdzTUxfNjRRZ0E0SkZUWURGREUiLCAicHVNcEdMb0FHUmJjc0FnNTBVWjBoaFFMS0NMNnF6eFNLNDMwNGtCbjNfSSIsICJ6VTQ1MmxrR2JFS2g4WnVIXzhLeDNDVXZuMUY0eTFnWkxxbERUZ1hfOFBrIl0sICJpc3MiOiAiaHR0cHM6Ly9waWQtcHJvdmlkZXIubWVtYmVyc3RhdGUuZXhhbXBsZS5ldSIsICJpYXQiOiAxNTQxNDkzNzI0LCAiZXhwIjogMTg4MzAwMDAwMCwgInZjdCI6ICJQZXJzb25JZGVudGlmaWNhdGlvbkRhdGEiLCAiX3NkX2FsZyI6ICJzaGEtMjU2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~WyJxYzlObkVjeVA4YmsxV2RKTE53c1BBIiwiZGF0ZU9mQmlydGgiLCIyMDAwMDEwMSJd~WyJvVXJsUnNfRzlncWlQN2o4TDhPekd3IiwibmFtZSIsIkpvaG4iXQ~WyJpeld6c3BQMzUxdm55dzN0eno0blNnIiwibGFzdE5hbWUiLCJEb2UiXQ~eyJ0eXAiOiJrYitqd3QiLCJhbGciOiJFZERTQSJ9.eyJpYXQiOjE3MDc2NjcxNTM2MzMsImF1ZCI6ImRpZDpwZWVyOjQ6c29tZS12ZXJpZmllciIsIm5vbmNlIjoiaVloOXBoU3ZWWTFVcUpsX05pNklJUSIsIl9zZF9oYXNoIjoiRTYwNWJfbnJPallsdUlSbktfQThKNTNhemwwcG8wcThBbHBJczZrQm5JWSJ9.6ZAydMHRVByM02Z79zQSWuZU3ZfNIkmVrMXM2ZVR-nN92h_J9D5-2cB7gPZ3aDP3Z-BY1Wj2kp_cIakv5ji3Cw";
let jwtHeader = "";
let jwtPayload = "";
let jwtSignature = "";
Expand Down Expand Up @@ -48,7 +48,7 @@
<div class="column" style="flex: 1;">
{#await disclosures}
{:then disclosures}
<Disclosures {disclosures}></Disclosures>
<Disclosures bind:jwtPayloadSelection={jwtPayloadSelection} {disclosures}></Disclosures>
{:catch error}
<p style="color: red">{error.message}</p>
{/await}
Expand Down
Binary file added src/routes/.Disclosures.svelte.swp
Binary file not shown.
10 changes: 9 additions & 1 deletion src/routes/Disclosures.svelte
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
<script lang="ts">
import { page } from "$app/stores";
import type { Disclosure } from "@sd-jwt/core";
export let disclosures: Disclosure[] = [];
export let jwtPayloadSelection: string = "";
</script>

<div class="box">
<div class="stripes">
<h5>DISCLOSURES</h5>
</div>
{#each disclosures as disclosure}
<div class="stripes">
<div
class="stripes"
on:mouseover={() => {
jwtPayloadSelection = disclosure.digest ? disclosure.digest : "";
console.log("Hovering ", jwtPayloadSelection);
}}
>
<p style="text-align: center;"><small><b>{disclosure.key}</b></small></p>
<div style="background-color: whitesmoke;">
<p>
Expand Down
1 change: 1 addition & 0 deletions src/routes/Editor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
}
$: if (selectText != null) {
selectedText ? selectText(selectedText) : undefined;
console.log("setting hover target", selectedText);
}
onDestroy(() => {
Expand Down

0 comments on commit 33cfe08

Please sign in to comment.