updated apps
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
* tap_action: none # none | more-info
|
||||
*/
|
||||
|
||||
const VERSION = "1.0.0";
|
||||
const VERSION = "1.2.2";
|
||||
|
||||
const ANIMATED_TRANSITIONS = [
|
||||
"fade",
|
||||
@@ -46,10 +46,10 @@ const TRANSITIONS = new Set(["random", "none", ...ANIMATED_TRANSITIONS]);
|
||||
|
||||
const FIT_MODES = new Set(["auto", "cover", "contain"]);
|
||||
|
||||
// Caption overlay (date / location). ``show`` is an ordered subset of
|
||||
// these fields; ``position`` is one of a 3x3 anchor grid; ``date_format``
|
||||
// is one of the named presets below or a custom token string.
|
||||
const CAPTION_FIELDS = ["date", "location"];
|
||||
// Caption overlay (date / location / description). ``show`` is an ordered
|
||||
// subset of these fields; ``position`` is one of a 3x3 anchor grid;
|
||||
// ``date_format`` is one of the named presets below or a custom token string.
|
||||
const CAPTION_FIELDS = ["date", "location", "description"];
|
||||
const CAPTION_POSITIONS = new Set([
|
||||
"top-left",
|
||||
"top-center",
|
||||
@@ -492,6 +492,7 @@ function createAlbumSlideshowCardClass(Base) {
|
||||
location: attrs.location,
|
||||
latitude: attrs.latitude,
|
||||
longitude: attrs.longitude,
|
||||
description: attrs.description,
|
||||
}
|
||||
: null;
|
||||
this._loadAndSwap(url, fit, blurBackdrop, captionData);
|
||||
@@ -644,6 +645,7 @@ function createAlbumSlideshowCardClass(Base) {
|
||||
location: data.location ?? null,
|
||||
latitude: data.latitude ?? null,
|
||||
longitude: data.longitude ?? null,
|
||||
description: data.description ?? null,
|
||||
},
|
||||
];
|
||||
}
|
||||
@@ -656,6 +658,8 @@ function createAlbumSlideshowCardClass(Base) {
|
||||
if (txt) lines.push(txt);
|
||||
} else if (field === "location") {
|
||||
if (frame.location) lines.push(String(frame.location));
|
||||
} else if (field === "description") {
|
||||
if (frame.description) lines.push(String(frame.description));
|
||||
}
|
||||
}
|
||||
return lines;
|
||||
@@ -890,6 +894,7 @@ const TAP_OPTIONS = [
|
||||
const CAPTION_SHOW_OPTIONS = [
|
||||
{ value: "date", label: "Date" },
|
||||
{ value: "location", label: "Location" },
|
||||
{ value: "description", label: "Description" },
|
||||
];
|
||||
|
||||
const CAPTION_POSITION_OPTIONS = [
|
||||
@@ -952,6 +957,7 @@ const CAPTION_DEFAULTS = {
|
||||
const LIVE_FIELDS = [
|
||||
"paused",
|
||||
"date_filter",
|
||||
"missing_date_mode",
|
||||
"portrait_mode",
|
||||
"order_mode",
|
||||
"slide_interval",
|
||||
@@ -962,6 +968,7 @@ const LIVE_FIELDS = [
|
||||
const LIVE_SUFFIX = {
|
||||
paused: "_paused",
|
||||
date_filter: "_date_filter",
|
||||
missing_date_mode: "_missing_date_mode",
|
||||
portrait_mode: "_portrait_mode",
|
||||
order_mode: "_order_mode",
|
||||
slide_interval: "_interval",
|
||||
@@ -974,6 +981,7 @@ const LIVE_SUFFIX = {
|
||||
const LIVE_LABELS = {
|
||||
live_paused: "Pause slideshow",
|
||||
live_date_filter: "Date filter",
|
||||
live_missing_date_mode: "Missing capture date",
|
||||
live_portrait_mode: "Orientation mismatch mode",
|
||||
live_order_mode: "Order mode",
|
||||
live_slide_interval: "Slide interval (seconds)",
|
||||
@@ -1130,6 +1138,7 @@ function createAlbumSlideshowCardEditorClass(Base) {
|
||||
}
|
||||
for (const [field, id] of [
|
||||
["date_filter", s.date_filter],
|
||||
["missing_date_mode", s.missing_date_mode],
|
||||
["portrait_mode", s.portrait_mode],
|
||||
["order_mode", s.order_mode],
|
||||
]) {
|
||||
@@ -1263,7 +1272,7 @@ function createAlbumSlideshowCardEditorClass(Base) {
|
||||
},
|
||||
{
|
||||
type: "expandable",
|
||||
title: "Caption (date & location)",
|
||||
title: "Caption (date, location & description)",
|
||||
icon: "mdi:format-text",
|
||||
schema: [
|
||||
{ name: "caption_enabled", selector: { boolean: {} } },
|
||||
@@ -1377,7 +1386,7 @@ function createAlbumSlideshowCardEditorClass(Base) {
|
||||
const e = st(s.paused);
|
||||
out.live_paused = !!e && e.state === "on";
|
||||
}
|
||||
for (const f of ["date_filter", "portrait_mode", "order_mode"]) {
|
||||
for (const f of ["date_filter", "missing_date_mode", "portrait_mode", "order_mode"]) {
|
||||
if (s[f]) {
|
||||
const e = st(s[f]);
|
||||
out[`live_${f}`] = e ? e.state : "";
|
||||
@@ -1429,12 +1438,16 @@ function createAlbumSlideshowCardEditorClass(Base) {
|
||||
"How long the card freezes its slide after a tap. 0 disables it.",
|
||||
caption_date_format:
|
||||
"Pick a preset or type a custom format (YYYY, MMMM, MMM, MM, DD, D).",
|
||||
caption_show:
|
||||
"Description comes from the photo's EXIF/IPTC/XMP caption and is only available with the local-folder provider.",
|
||||
caption_per_image:
|
||||
"When a portrait pair is shown, caption each photo with its own date and location.",
|
||||
"When a portrait pair is shown, caption each photo with its own date, location and description.",
|
||||
caption_color: "CSS color, e.g. #ffffff or white.",
|
||||
caption_font_size: "CSS size, e.g. 14px, 1.1em.",
|
||||
live_paused:
|
||||
"These control the Album Slideshow integration directly and apply everywhere this album is shown, not only this card.",
|
||||
live_missing_date_mode:
|
||||
"What a date filter does with photos that have no capture date: use the upload date, keep them, or drop them.",
|
||||
};
|
||||
return helpers[s.name] || "";
|
||||
};
|
||||
@@ -1558,6 +1571,7 @@ function createAlbumSlideshowCardEditorClass(Base) {
|
||||
});
|
||||
} else if (
|
||||
field === "date_filter" ||
|
||||
field === "missing_date_mode" ||
|
||||
field === "portrait_mode" ||
|
||||
field === "order_mode"
|
||||
) {
|
||||
@@ -1636,7 +1650,9 @@ function createAlbumSlideshowCardEditorClass(Base) {
|
||||
if (data.caption_enabled) {
|
||||
let show = data.caption_show;
|
||||
if (!Array.isArray(show)) show = show ? [show] : [];
|
||||
show = show.filter((v) => v === "date" || v === "location");
|
||||
show = show.filter(
|
||||
(v) => v === "date" || v === "location" || v === "description",
|
||||
);
|
||||
if (show.length > 0) {
|
||||
const cap = { show };
|
||||
const pos = data.caption_position || CAPTION_DEFAULTS.position;
|
||||
|
||||
Reference in New Issue
Block a user