wip image templates

This commit is contained in:
2026-05-14 19:24:25 +03:00
parent 0725366dd5
commit ef29e4d261
9 changed files with 195 additions and 443 deletions
@@ -4,6 +4,7 @@
import { createEventDispatcher, getContext } from "svelte";
import Preview from "../../files/Preview.svelte";
import Dropdown from "../../common/Dropdown.svelte";
import { htmlurl } from "../../files/imageserver";
const dispatch = createEventDispatcher();
const channel = getContext("channel");
@@ -20,16 +21,16 @@
function insert(e, preset) {
e.preventDefault();
// let html = htmlurl(channel, record, preset);
// let url = !preset
// ? `/${record._file.path}`
// : `/templates/${preset}/${record._file.path}`;
// dispatch("editor-insert", {
// html: html,
// url: channel.filesUrl + url,
// originalUrl: channel.filesUrl + "/" + record._file.path,
// record: record,
// });
let html = htmlurl(channel, record, preset);
let url = !preset
? `/${record._file.path}`
: `/templates/${preset}/${record._file.path}`;
dispatch("editor-insert", {
html: html,
url: channel.filesUrl + url,
originalUrl: channel.filesUrl + "/" + record._file.path,
record: record,
});
}
</script>