From: Scott Worley Date: Thu, 10 Feb 2022 00:59:50 +0000 (-0800) Subject: "i"nbox view shows "u"ntagged tasks X-Git-Url: http://git.scottworley.com/vopamoi/commitdiff_plain/84849dfaf119d5b7aae614fcae323ee78461d84f?hp=32808c9a5b8154746bf98339e58ed827c399a9d3 "i"nbox view shows "u"ntagged tasks --- diff --git a/vopamoi.ts b/vopamoi.ts index a114959..ad7a93e 100644 --- a/vopamoi.ts +++ b/vopamoi.ts @@ -537,6 +537,16 @@ function BrowserUI() { } }, + setUntaggedView: function () { + for (const task of document.getElementsByClassName("task")) { + if (task.getElementsByClassName("tag").length === 0) { + task.classList.remove("hide"); + } else { + task.classList.add("hide"); + } + } + }, + undo: function () { const ret = ui.undo(); if (ret && ret instanceof HTMLElement) ret.focus(); @@ -613,10 +623,12 @@ function handleKey(event: any) { if (event.key == "a") return browserUI.setView("all"); if (event.key == "c") return browserUI.setView("cancelled"); if (event.key == "d") return browserUI.setView("done"); + if (event.key == "i") return browserUI.setUntaggedView(); if (event.key == "q") return browserUI.setView("todo"); if (event.key == "s") return (inputState = InputState.VS); if (event.key == "T") return browserUI.resetTagView(); if (event.key == "t") return browserUI.setTagView(); + if (event.key == "u") return browserUI.setUntaggedView(); if (event.key == "v") return browserUI.resetView(); if (event.key == "w") return browserUI.setView("waiting"); if (event.key == "x") return browserUI.setView("deleted");