}
},
+ removeTag: function (createTimestamp: string, tagName: string) {
+ const task = this.getTask(createTimestamp);
+ if (!task) return null;
+ const tag = this.hasTag(task, tagName);
+ if (!tag) return;
+ task.removeChild(tag);
+ },
+
setPriority: function (createTimestamp: string, priority: number): Element | null {
const target = this.getTask(createTimestamp);
if (!target) return null;
const [createTimestamp, tag] = splitN(data, " ", 1);
return Model.addTag(createTimestamp, tag);
}
+ if (command == "Untag") {
+ const [createTimestamp, tag] = splitN(data, " ", 1);
+ return Model.removeTag(createTimestamp, tag);
+ }
},
record: function (entry: string) {
return <Element>log.recordAndApply(`${now} Create ${description}`);
},
addTag: function (createTimestamp: string, tag: string) {
- // TODO: undo
+ undoLog.push(`Untag ${createTimestamp} ${tag}`);
return log.recordAndApply(`${clock.now()} Tag ${createTimestamp} ${tag}`);
},
edit: function (createTimestamp: string, newDescription: string, oldDescription: string) {
if (event.key == "d") return browserUI.setView("done", "LawnGreen");
if (event.key == "q") return browserUI.setView("todo", "White");
if (event.key == "s") return browserUI.setView("someday-maybe", "DeepSkyBlue");
+ if (event.key == "v") return browserUI.setView("todo", "White");
if (event.key == "w") return browserUI.setView("waiting", "MediumOrchid");
if (event.key == "x") return browserUI.setView("deleted", "Black");
}