return tag;
}
}
- task.appendChild(tag);
+ task.insertBefore(tag, task.getElementsByClassName("desc")[0]!);
return tag;
},
if (!target) return null;
if (target.hasAttribute("data-description")) {
// Oh no: An edit has arrived from a replica while a local edit is in progress.
- const input = target.firstChild as HTMLInputElement;
+ const input = target.getElementsByTagName("input")[0]!;
if (
input.value === target.getAttribute("data-description") &&
input.selectionStart === input.value.length &&
todo: "White",
waiting: "MediumOrchid",
};
+ var currentTagView: string | null = null;
var currentViewState = "todo";
var taskFocusedBeforeJumpingToInput: HTMLElement | null = null;
var lastTagNameEntered = "";
this.firstVisibleTask()?.focus();
}
input.value = "";
+ if (currentTagView) {
+ ui.addTag(task.getAttribute("data-created")!, currentTagView);
+ }
if (event.getModifierState("Control")) {
this.makeBottomPriority(task);
}
},
resetTagView: function () {
+ currentTagView = null;
for (const task of document.getElementsByClassName("task")) {
task.classList.remove("hide");
}
task.classList.add("hide");
}
}
+ currentTagView = tag;
},
setView: function (state: string) {
}
},
+ 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();
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");