implemented sharing of bookmarks

This commit is contained in:
2025-08-03 22:42:37 +02:00
parent 783eaf3303
commit d7fe16c46e
10 changed files with 118 additions and 28 deletions

View File

@@ -3,7 +3,7 @@
import { tick } from "svelte";
let {
getCandidates = text => {},
getCandidates = async text => { conole.log('no handler for getCandidates('+text+')'); return {};},
onSelect = text => []
} = $props();
@@ -18,6 +18,7 @@
let result = {};
result[key] = text;
options = {};
text = '';
onSelect(result);
}
@@ -49,10 +50,11 @@
min-width: 200px;
}
</style>
<select size={Object.keys(options).length<2?2:Object.keys(options).length+1} {onkeyup} {ondblclick} autofocus width="40">
{#if options}
<select size={Object.keys(options).length<2?2:Object.keys(options).length+1} {onkeyup} {ondblclick} width="40">
<option>{text}</option>
{#each Object.entries(options) as [val,caption]}
<option value={val}>{caption}</option>
{/each}
</select>
{/if}