diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2023-12-23 07:59:19 +0100 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2023-12-23 08:24:22 +0100 |
commit | d945fe936d250877e141fce748783d4fc7d591de (patch) | |
tree | 444c722ad7ec0f62b96c1eb2a4e804998d7208b4 /public | |
parent | d7c775a7d2df82316255a42475f7a58bdd79c7ea (diff) | |
download | gallery-d945fe936d250877e141fce748783d4fc7d591de.tar.gz gallery-d945fe936d250877e141fce748783d4fc7d591de.tar.xz gallery-d945fe936d250877e141fce748783d4fc7d591de.zip |
WIP: Orphans
Diffstat (limited to 'public')
-rw-r--r-- | public/gallery.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/public/gallery.js b/public/gallery.js index 970a3bf..222bde5 100644 --- a/public/gallery.js +++ b/public/gallery.js @@ -363,6 +363,44 @@ let Duplicates = { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +let OrphansModel = { + entries: [], + + async reload() { + this.entries = await call('orphans', {}) + }, +} + +let OrphansList = { + // See BrowseView. + oncreate(vnode) { vnode.dom.focus() }, + + view(vnode) { + let children = (DuplicatesModel.entries.length == 0) + ? "No orphans" + : OrphansModel.entries.map(group => + m('.row', "TODO")) + return m('.orphans[tabindex=0]', {}, children) + }, +} + +let Orphans = { + oninit(vnode) { + OrphansModel.reload() + }, + + view(vnode) { + return m('.container', {}, [ + m('.header', {}, [ + "Orphans", + ]), + m('.body', {}, m(OrphansList)), + ]) + }, +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + window.addEventListener('load', () => { m.route(document.body, "/browse/", { // The path doesn't need to be escaped, perhaps change that (":key..."). @@ -371,6 +409,7 @@ window.addEventListener('load', () => { "/view/:key": View, "/similar/:key": Similar, "/duplicates": Duplicates, + "/orphans": Orphans, "/tags": undefined, "/tags/:space": undefined, |