Merge branch 'main' into dev

This commit is contained in:
2025-10-17 14:47:47 +02:00
12 changed files with 42 additions and 60 deletions

View File

@@ -8,7 +8,7 @@
href = '#',
onclick = evt => { evt.preventDefault(); startEdit(); return false },
onSet = newVal => {return true;},
title = t('long_click_to_edit'),
title = t('click_to_edit'),
type = 'div',
value = $bindable(null)
} = $props();

View File

@@ -104,29 +104,16 @@
if (simple) startEdit();
</script>
<style>
textarea{
width: 100%;
min-height: 100px;
}
div{
min-width: 40px;
min-height: 20px;
}
div.editable:hover{
border: 1px dotted;
}
</style>
<div class="markdown {editing?'editing':''}">
{#if editing}
<div class="boundary">
<textarea bind:value={editValue.source} onkeyup={typed} autofocus={!simple}></textarea>
<span class="buttons">
<button class="cancel" onclick={e => editing = false}>{t('cancel')}</button>
<button class="save" onclick={doSave}>{t('save')}</button>
</span>
<textarea bind:value={editValue.source} onkeyup={typed} autofocus={!simple}></textarea>
<div>{@html target(editValue.rendered)}</div>
<div class="buttons">
<button class="cancel" onclick={e => editing = false}>{t('cancel')}</button>
<span>{@html t('markdown_supported')}</span>
<button class="save" onclick={doSave}>{t('save')}</button>
</div>
{:else}
<svelte:element this={type} {onclick} {oncontextmenu} class={{editable}} title={t('right_click_to_edit')} >{@html target(editValue.rendered)}</svelte:element>
{/if}
<svelte:element this={type} {onclick} {oncontextmenu} class={{editable}} title={t('long_click_to_edit')} >{@html target(editValue.rendered)}</svelte:element>
</div>

View File

@@ -85,7 +85,7 @@
<textarea bind:value={editValue} onkeyup={typed} autofocus></textarea>
{:else}
{#if value}
<svelte:element this={type} {onmousedown} {onmouseup} {ontouchstart} {ontouchend} class={{editable}} title={t('long_click_to_edit')} >
<svelte:element this={type} {onmousedown} {onmouseup} {ontouchstart} {ontouchend} class={{editable}} title={t('right_click_to_edit')} >
{#each value.split("\n") as line}
{line}<br/>
{/each}

View File

@@ -49,5 +49,4 @@
</fieldset>
</form>
<Notes module="time" entity_id={record.id} />
{record.description.source}
{/if}