kanvas add send-to functionality

Signed-off-by: vladmandic <mandic00@live.com>
This commit is contained in:
vladmandic
2026-01-04 19:37:10 +01:00
parent deb59c60fc
commit 87429b19ca
6 changed files with 28 additions and 13 deletions
+7 -1
View File
@@ -86,6 +86,12 @@ function extract_image_from_gallery(gallery) {
return [gallery[index]];
}
function send_to_kanvas(gallery) {
const [image] = extract_image_from_gallery(gallery);
log('sendToKanvas', image);
if (window.loadFromURL && image.data) window.loadFromURL(image.data);
}
async function setTheme(val, old) {
if (!old || val === old) return;
old = old.replace('modern/', '');
@@ -99,7 +105,7 @@ async function setTheme(val, old) {
const href = link.href.replace(old, val);
const res = await fetch(href);
if (res.ok) {
log('setTheme:', old, val);
log('setTheme', old, val);
link.href = link.href.replace(old, val);
} else {
log('setTheme: CSS not found', val);