summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
Diffstat (limited to 'public')
-rw-r--r--public/gallery.js39
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,