Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion public/api/widget-config/w-books
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"widgetSize":"small","widgetConfig":{"provider":"audiobookshelf","absUrl":"https://books.example.com","source":"unread","href":"https://books.example.com"}}
{"widgetSize": "small", "widgetConfig": {"provider": "audiobookshelf", "absUrl": "https://books.example.com", "href": "https://books.example.com", "shelves": [{"source": "unread"}]}}
2 changes: 1 addition & 1 deletion public/api/widget-config/w-books-md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"widgetSize": "medium", "widgetConfig": {"provider": "audiobookshelf", "absUrl": "https://books.example.com", "source": "unread", "href": "https://books.example.com"}}
{"widgetSize": "medium", "widgetConfig": {"provider": "audiobookshelf", "absUrl": "https://books.example.com", "href": "https://books.example.com", "shelves": [{"source": "unread"}]}}
44 changes: 38 additions & 6 deletions public/api/widget-data/w-books
Original file line number Diff line number Diff line change
@@ -1,10 +1,42 @@
{
"provider": "audiobookshelf",
"source": "list",
"books": [
{ "title": "Dune", "author": "Frank Herbert", "progress": 0.42, "finished": false, "color": "#A8622A", "kind": "book" },
{ "title": "Project Hail Mary", "author": "Andy Weir", "progress": 0.77, "finished": false, "color": "#1D4E6B", "kind": "book" },
{ "title": "The Hobbit", "author": "J. R. R. Tolkien", "progress": 1, "finished": true, "color": "#2F5D3A", "kind": "book" },
{ "title": "Neuromancer", "author": "William Gibson", "progress": null, "finished": false, "color": "#6E2B4F", "kind": "book" }
"shelves": [
{
"source": "list",
"books": [
{
"title": "Dune",
"author": "Frank Herbert",
"progress": 0.42,
"finished": false,
"color": "#A8622A",
"kind": "book"
},
{
"title": "Project Hail Mary",
"author": "Andy Weir",
"progress": 0.77,
"finished": false,
"color": "#1D4E6B",
"kind": "book"
},
{
"title": "The Hobbit",
"author": "J. R. R. Tolkien",
"progress": 1,
"finished": true,
"color": "#2F5D3A",
"kind": "book"
},
{
"title": "Neuromancer",
"author": "William Gibson",
"progress": null,
"finished": false,
"color": "#6E2B4F",
"kind": "book"
}
]
}
]
}
98 changes: 86 additions & 12 deletions public/api/widget-data/w-books-md
Original file line number Diff line number Diff line change
@@ -1,16 +1,90 @@
{
"provider": "komga",
"source": "recently",
"books": [
{ "title": "Saga", "author": "Brian K. Vaughan", "progress": 0.31, "finished": false, "color": "#9B2F2F", "kind": "series" },
{ "title": "Watchmen", "author": "Alan Moore", "progress": 0.64, "finished": false, "color": "#C8A21C", "kind": "series" },
{ "title": "Berserk", "author": "Kentaro Miura", "progress": 1, "finished": true, "color": "#33363B", "kind": "series" },
{ "title": "Monstress", "author": "Marjorie Liu", "progress": null, "finished": false, "color": "#4A3A7A", "kind": "series" },
{ "title": "Akira", "author": "Katsuhiro Otomo", "progress": 0.18, "finished": false, "color": "#1F6F6B", "kind": "series" },
{ "title": "Vinland Saga", "author": "Makoto Yukimura", "progress": 0.52, "finished": false, "color": "#7A4A1F", "kind": "series" },
{ "title": "Blacksad", "author": "Juan Diaz Canales", "progress": 0.87, "finished": false, "color": "#264F7A", "kind": "series" },
{ "title": "Sandman", "author": "Neil Gaiman", "progress": 1, "finished": true, "color": "#5C2C6E", "kind": "series" },
{ "title": "Pluto", "author": "Naoki Urasawa", "progress": 0.05, "finished": false, "color": "#A34E1C", "kind": "series" },
{ "title": "Nausicaa", "author": "Hayao Miyazaki", "progress": null, "finished": false, "color": "#3F6B32", "kind": "series" }
"shelves": [
{
"source": "recently",
"books": [
{
"title": "Saga",
"author": "Brian K. Vaughan",
"progress": 0.31,
"finished": false,
"color": "#9B2F2F",
"kind": "series"
},
{
"title": "Watchmen",
"author": "Alan Moore",
"progress": 0.64,
"finished": false,
"color": "#C8A21C",
"kind": "series"
},
{
"title": "Berserk",
"author": "Kentaro Miura",
"progress": 1,
"finished": true,
"color": "#33363B",
"kind": "series"
},
{
"title": "Monstress",
"author": "Marjorie Liu",
"progress": null,
"finished": false,
"color": "#4A3A7A",
"kind": "series"
},
{
"title": "Akira",
"author": "Katsuhiro Otomo",
"progress": 0.18,
"finished": false,
"color": "#1F6F6B",
"kind": "series"
},
{
"title": "Vinland Saga",
"author": "Makoto Yukimura",
"progress": 0.52,
"finished": false,
"color": "#7A4A1F",
"kind": "series"
},
{
"title": "Blacksad",
"author": "Juan Diaz Canales",
"progress": 0.87,
"finished": false,
"color": "#264F7A",
"kind": "series"
},
{
"title": "Sandman",
"author": "Neil Gaiman",
"progress": 1,
"finished": true,
"color": "#5C2C6E",
"kind": "series"
},
{
"title": "Pluto",
"author": "Naoki Urasawa",
"progress": 0.05,
"finished": false,
"color": "#A34E1C",
"kind": "series"
},
{
"title": "Nausicaa",
"author": "Hayao Miyazaki",
"progress": null,
"finished": false,
"color": "#3F6B32",
"kind": "series"
}
]
}
]
}
2 changes: 1 addition & 1 deletion public/js/admin-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { paintIcon } from '/js/admin-shared.js?v=132c869f';
import { clr as rc, el, qa, setUserText } from '/js/utils.js?v=d949e985';
import { html, raw, setHtml } from '/js/html.js?v=c71f8903';
import { t } from '/js/i18n.js?v=e644a5c5';
import { sizeLabel } from '/js/admin-widget-form.js?v=db272c65';
import { sizeLabel } from '/js/admin-widget-form.js?v=0ca20e21';
import { widgetGlyph } from '/js/widget-glyphs.js?v=12b0a947';

/** @type {{ openModal: (idx: number|null) => void,
Expand Down
2 changes: 1 addition & 1 deletion public/js/admin-widget-form.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { state } from '/js/admin-state.js?v=7d68e98e';
import { PE_SVG, CHEV_SVG, initInlineEdit } from '/js/admin-shared.js?v=132c869f';
import { renderWidgetConfigForm } from '/js/widget-config-form.js?v=ccaf1acf';
import { renderWidgetConfigForm } from '/js/widget-config-form.js?v=0f95ec4c';
import { html, raw, setHtml } from '/js/html.js?v=c71f8903';
import { sizesForView, widgetConfigMode, rejectionLines, carriesTypedValues } from '/js/admin-logic.js?v=dcf7c37d';
import { t } from '/js/i18n.js?v=e644a5c5';
Expand Down
4 changes: 2 additions & 2 deletions public/js/admin.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { buildAppForm, buildFolderForm, captureActLabels, serializeKvRows } from '/js/admin-app-form.js?v=5702feef';
import { checkAuth, requireLogin, wirePasswordStrength } from '/js/admin-auth.js?v=9fc96f28';
import { initList, render, syncFilterUI } from '/js/admin-list.js?v=cea8d7ce';
import { initList, render, syncFilterUI } from '/js/admin-list.js?v=0a1e50b5';
import { resolveAdminSection } from '/js/admin-logic.js?v=dcf7c37d';
import {
buildAppItem,
Expand All @@ -13,7 +13,7 @@ import {
import { loadSettings, showBgFields, showBgFit, showWallpaperFile } from '/js/admin-settings.js?v=f019211c';
import { ag, ap, initInlineEdit, paintIcon, setReauthHandler, toast } from '/js/admin-shared.js?v=132c869f';
import { collapsedFolders, filter, state } from '/js/admin-state.js?v=7d68e98e';
import { buildWidgetForm } from '/js/admin-widget-form.js?v=db272c65';
import { buildWidgetForm } from '/js/admin-widget-form.js?v=0ca20e21';
import { html, raw, setHtml } from '/js/html.js?v=c71f8903';
import { initI18n, LANGUAGES, t } from '/js/i18n.js?v=e644a5c5';
import { loadLocalIcons } from '/js/icons.js?v=69c2b9bd';
Expand Down
12 changes: 10 additions & 2 deletions public/js/widget-config-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ function _object(field, value, ctx) {
if (sf.type === 'group' || sf.type === 'object') continue;
const b = _buildSimple(sf, cfg, subCtx);
b.field = sf;
if (!b.el.classList.contains('row')) b.el.classList.add('row-wrap');
card.appendChild(b.el);
built.push(b);
}
Expand Down Expand Up @@ -614,6 +615,7 @@ function _group(field, rows, size, ctx) {
if (sf.type === 'group' || sf.type === 'object') continue;
const b = _buildSimple(sf, rowData, rowCtx);
b.field = sf;
if (!b.el.classList.contains('row')) b.el.classList.add('row-wrap');
card.appendChild(b.el);
built.push(b);
}
Expand Down Expand Up @@ -686,9 +688,14 @@ export function renderWidgetConfigForm(container, fields, config = {}, opts = {}
};
for (const f of fields) {
if (!f || !f.key) continue;
if (f.type === 'group' || f.type === 'object') {
if (f.type === 'group' || f.type === 'object' || f.type === 'picklist') {
flush();
const b = f.type === 'group' ? _group(f, config[f.key], opts && opts.size, ctx) : _object(f, config[f.key], ctx);
const b =
f.type === 'group'
? _group(f, config[f.key], opts && opts.size, ctx)
: f.type === 'object'
? _object(f, config[f.key], ctx)
: _picklist(f, config[f.key], ctx, ctx.size);
b.field = f;
container.appendChild(b.el);
built.push(b);
Expand All @@ -701,6 +708,7 @@ export function renderWidgetConfigForm(container, fields, config = {}, opts = {}
card.className = 'grp';
container.appendChild(card);
}
if (!b.el.classList.contains('row')) b.el.classList.add('row-wrap');
card.appendChild(b.el);
if (b.control) b.control.addEventListener('change', () => notify(f.key));
built.push(b);
Expand Down
Loading