From 4a5e663e1dfb97135804be214fce5a3be3dbcdc8 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 10 Oct 2022 14:40:36 +0200 Subject: [PATCH] added the ability to edit and remove segments --- README.md | 1 - src/tracker.ts | 38 ++++++++++++++++++- styles.css | 4 ++ .../plugins/simple-time-tracker/main.js | 28 ++++++++++++-- .../plugins/simple-time-tracker/styles.css | 4 ++ 5 files changed, 69 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4f97cab..d66e916 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,6 @@ The tracker's information is stored in the code block as JSON data. The names, s # 🛣️ Roadmap Super Simple Time Tracker is still in its early stages! There are a lot of plans for it, including: - A setting to link segments to corresponding daily notes automatically -- A neat interface to edit previous segments' names and time stamps - A fancier Start and End button # 🙏 Acknowledgements diff --git a/src/tracker.ts b/src/tracker.ts index accce47..b1b4070 100644 --- a/src/tracker.ts +++ b/src/tracker.ts @@ -90,16 +90,50 @@ export function displayTracker(tracker: Tracker, element: HTMLElement, getSectio createEl("th", { text: "Segment" }), createEl("th", { text: "Start time" }), createEl("th", { text: "End time" }), - createEl("th", { text: "Duration" })); + createEl("th", { text: "Duration" }), + createEl("th")); for (let entry of tracker.entries) { let row = table.createEl("tr"); - row.createEl("td", { text: entry.name }); + + let name = row.createEl("td"); + let namePar = name.createEl("span", { text: entry.name }); + let nameBox = new TextComponent(name).setValue(entry.name); + nameBox.inputEl.hidden = true; + row.createEl("td", { text: formatTimestamp(entry.startTime, settings) }); if (entry.endTime) { row.createEl("td", { text: formatTimestamp(entry.endTime, settings) }); row.createEl("td", { text: formatDurationBetween(entry.startTime, entry.endTime) }); } + + let entryButtons = row.createEl("td"); + let editButton = new ButtonComponent(entryButtons) + .setClass("clickable-icon") + .setTooltip("Edit") + .setIcon("lucide-pencil") + .onClick(() => { + if (namePar.hidden) { + namePar.hidden = false; + nameBox.inputEl.hidden = true; + if (nameBox.getValue()) + namePar.setText(nameBox.getValue()); + editButton.setIcon("lucide-pencil"); + } else { + namePar.hidden = true; + nameBox.inputEl.hidden = false; + nameBox.setValue(namePar.getText()); + editButton.setIcon("lucide-check"); + } + }); + new ButtonComponent(entryButtons) + .setClass("clickable-icon") + .setTooltip("Remove") + .setIcon("lucide-trash") + .onClick(async () => { + tracker.entries.remove(entry); + await saveTracker(tracker, this.app, getSectionInfo()); + }); } // add copy buttons diff --git a/styles.css b/styles.css index 0d85443..7437926 100644 --- a/styles.css +++ b/styles.css @@ -53,3 +53,7 @@ .simple-time-tracker-table th { border: none; } + +.simple-time-tracker-table .clickable-icon { + display: inline; +} diff --git a/test-vault/.obsidian/plugins/simple-time-tracker/main.js b/test-vault/.obsidian/plugins/simple-time-tracker/main.js index 41caf5c..8705f88 100644 --- a/test-vault/.obsidian/plugins/simple-time-tracker/main.js +++ b/test-vault/.obsidian/plugins/simple-time-tracker/main.js @@ -155,15 +155,37 @@ function displayTracker(tracker, element, getSectionInfo, settings) { totalDiv.createEl("span", { text: "Total" }); if (tracker.entries.length > 0) { let table = element.createEl("table", { cls: "simple-time-tracker-table" }); - table.createEl("tr").append(createEl("th", { text: "Segment" }), createEl("th", { text: "Start time" }), createEl("th", { text: "End time" }), createEl("th", { text: "Duration" })); + table.createEl("tr").append(createEl("th", { text: "Segment" }), createEl("th", { text: "Start time" }), createEl("th", { text: "End time" }), createEl("th", { text: "Duration" }), createEl("th")); for (let entry of tracker.entries) { let row = table.createEl("tr"); - row.createEl("td", { text: entry.name }); + let name2 = row.createEl("td"); + let namePar = name2.createEl("span", { text: entry.name }); + let nameBox = new import_obsidian2.TextComponent(name2).setValue(entry.name); + nameBox.inputEl.hidden = true; row.createEl("td", { text: formatTimestamp(entry.startTime, settings) }); if (entry.endTime) { row.createEl("td", { text: formatTimestamp(entry.endTime, settings) }); row.createEl("td", { text: formatDurationBetween(entry.startTime, entry.endTime) }); } + let entryButtons = row.createEl("td"); + let editButton = new import_obsidian2.ButtonComponent(entryButtons).setClass("clickable-icon").setTooltip("Edit").setIcon("lucide-pencil").onClick(() => { + if (namePar.hidden) { + namePar.hidden = false; + nameBox.inputEl.hidden = true; + if (nameBox.getValue()) + namePar.setText(nameBox.getValue()); + editButton.setIcon("lucide-pencil"); + } else { + namePar.hidden = true; + nameBox.inputEl.hidden = false; + nameBox.setValue(namePar.getText()); + editButton.setIcon("lucide-check"); + } + }); + new import_obsidian2.ButtonComponent(entryButtons).setClass("clickable-icon").setTooltip("Remove").setIcon("lucide-trash").onClick(() => __async(this, null, function* () { + tracker.entries.remove(entry); + yield saveTracker(tracker, this.app, getSectionInfo()); + })); } let buttons = element.createEl("div", { cls: "simple-time-tracker-bottom" }); new import_obsidian2.ButtonComponent(buttons).setButtonText("Copy as table").onClick(() => navigator.clipboard.writeText(createMarkdownTable(tracker, settings))); @@ -274,4 +296,4 @@ var SimpleTimeTrackerPlugin = class extends import_obsidian3.Plugin { }); } }; -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsic3JjL21haW4udHMiLCAic3JjL3NldHRpbmdzLnRzIiwgInNyYy9zZXR0aW5ncy10YWIudHMiLCAic3JjL3RyYWNrZXIudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImltcG9ydCB7IFBsdWdpbiB9IGZyb20gXCJvYnNpZGlhblwiO1xyXG5pbXBvcnQgeyBkZWZhdWx0U2V0dGluZ3MsIFNpbXBsZVRpbWVUcmFja2VyU2V0dGluZ3MgfSBmcm9tIFwiLi9zZXR0aW5nc1wiO1xyXG5pbXBvcnQgeyBTaW1wbGVUaW1lVHJhY2tlclNldHRpbmdzVGFiIH0gZnJvbSBcIi4vc2V0dGluZ3MtdGFiXCI7XHJcbmltcG9ydCB7IGRpc3BsYXlUcmFja2VyLCBsb2FkVHJhY2tlciB9IGZyb20gXCIuL3RyYWNrZXJcIjtcclxuXHJcbmV4cG9ydCBkZWZhdWx0IGNsYXNzIFNpbXBsZVRpbWVUcmFja2VyUGx1Z2luIGV4dGVuZHMgUGx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BcIlN1cGVyIFNpbXBsZSBUaW1lIFRyYWNrZXIgU2V0dGluZ3NcIiB9KTtcclxuXHJcbiAgICAgICAgbmV3IFNldHRpbmcodGhpcy5jb250YWluZXJFbClcclxuICAgICAgICAgICAgLnNldE5hbWUoXCJUaW1lc3RhbXAgRGlzcGxheSBGb3JtYXRcIilcclxuICAgICAgICAgICAgLnNldERlc2MoY3JlYXRlRnJhZ21lbnQoZiA9PiB7XHJcbiAgICAgICAgICAgICAgICBmLmNyZWF0ZVNwYW4oeyB0ZXh0OiBcIlRoZSB3YXkgdGhhdCB0aW1lc3RhbXBzIGluIHRpbWUgdHJhY2tlciB0YWJsZXMgc2hvdWxkIGJlIGRpc3BsYXllZC4gVXNlcyBcIiB9KTtcclxuICAgICAgICAgICAgICAgIGYuY3JlYXRlRWwoXCJhXCIsIHsgdGV4dDogXCJtb21lbnQuanNcIiwgaHJlZjogXCJodHRwczovL21vbWVudGpzLmNvbS9kb2NzLyMvcGFyc2luZy9zdHJpbmctZm9ybWF0L1wiIH0pO1xyXG4gICAgICAgICAgICAgICAgZi5jcmVhdGVTcGFuKHsgdGV4dDogXCIgc3ludGF4LlwiIH0pO1xyXG4gICAgICAgICAgICB9KSlcclxuICAgICAgICAgICAgLmFkZFRleHQodCA9PiB7XHJcbiAgICAgICAgICAgICAgICB0LnNldFZhbHVlKFN0cmluZyh0aGlzLnBsdWdpbi5zZXR0aW5ncy50aW1lc3RhbXBGb3JtYXQpKTtcclxuICAgICAgICAgICAgICAgIHQub25DaGFuZ2UoYXN5bmMgdiA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5wbHVnaW4uc2V0dGluZ3MudGltZXN0YW1wRm9ybWF0ID0gdi5sZW5ndGggPyB2IDogZGVmYXVsdFNldHRpbmdzLnRpbWVzdGFtcEZvcm1hdDtcclxuICAgICAgICAgICAgICAgICAgICBhd2FpdCB0aGlzLnBsdWdpbi5zYXZlU2V0dGluZ3MoKTtcclxuICAgICAgICAgICAgICA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cnlCdXR0b25zKVxyXG4gICAgICAgICAgICAgICAgLnNldENsYXNzKFwiY2xpY2thYmxlLWljb25cIilcclxuICAgICAgICAgICAgICAgIC5zZXRUb29sdGlwKFwiRWRpdFwiKVxyXG4gICAgICAgICAgICAgICAgLnNldEljb24oXCJsdWNpZGUtcGVuY2lsXCIpXHJcbiAgICAgICAgICAgICAgICAub25DbGljaygoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG5hbWVQYXIuaGlkZGVuKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVQYXIuaGlkZGVuID0gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVCb3guaW5wdXRFbC5oaWRkZW4gPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobmFtZUJveC5nZXRWYWx1ZSgpKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZVBhci5zZXRUZXh0KG5hbWVCb3guZ2V0VmFsdWUoKSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGVkaXRCdXR0b24uc2V0SWNvbihcImx1Y2lkZS1wZW5jaWxcIik7XHJcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZVBhci5oaWRkZW4gPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lQm94LmlucHV0RWwuaGlkZGVuID0gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVCb3guc2V0VmFsdWUobmFtZVBhci5nZXRUZXh0KCkpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBlZGl0QnV0dG9uLnNldEljb24oXCJsdWNpZGUtY2hlY2tcIik7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIG5ldyBCdXR0b25Db21wb25lbnQoZW50cnlCdXR0b25zKVxyXG4gICAgICAgICAgICAgICAgLnNldENsYXNzKFwiY2xpY2thYmxlLWljb25cIilcclxuICAgICAgICAgICAgICAgIC5zZXRUb29sdGlwKFwiUmVtb3ZlXCIpXHJcbiAgICAgICAgICAgICAgICAuc2V0SWNvbihcImx1Y2lkZS10cmFzaFwiKVxyXG4gICAgICAgICAgICAgICAgLm9uQ2xpY2soYXN5bmMgKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIHRyYWNrZXIuZW50cmllcy5yZW1vdmUoZW50cnkpO1xyXG4gICAgICAgICAgICAgICAgICAgIGF3YWl0IHNhdmVUcmFja2VyKHRyYWNrZXIsIHRoaXMuYXBwLCBnZXRTZWN0aW9uSW5mbygpKTtcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy8gYWRkIGNvcHkgYnV0dG9uc1xyXG4gICAgICAgIGxldCBidXR0b25zID0gZWxlbWVudC5jcmVhdGVFbChcImRpdlwiLCB7IGNsczogXCJzaW1wbGUtdGltZS10cmFja2VyLWJvdHRvbVwiIH0pO1xyXG4gICAgICAgIG5ldyBCdXR0b25Db21wb25lbnQoYnV0dG9ucylcclxuICAgICAgICAgICAgLnNldEJ1dHRvblRleHQoXCJDb3B5IGFzIHRhYmxlXCIpXHJcbiAgICAgICAgICAgIC5vbkNsaWNrKCgpID0+IG5hdmlnYXRvci5jbGlwYm9hcmQud3JpdGVUZXh0KGNyZWF0ZU1hcmtkb3duVGFibGUodHJhY2tlciwgc2V0dGluZ3MpKSk7XHJcbiAgICAgICAgbmV3IEJ1dHRvbkNvbXBvbmVudChidXR0b25zKVxyXG4gICAgICAgICAgICAuc2V0QnV0dG9uVGV4dChcIkNvcHkgYXMgQ1NWXCIpXHJcbiAgICAgICAgICAgIC5vbkNsaWNrKCgpID0+IG5hdmlnYXRvci5jbGlwYm9hcmQud3JpdGVUZXh0KGNyZWF0ZUNzdih0cmFja2VyLCBzZXR0aW5ncykpKTtcclxuICAgIH1cclxuXHJcblxyXG4gICAgc2V0Q291bnRkb3duVmFsdWVzKHRyYWNrZXIsIGN1cnJlbnQsIHRvdGFsLCBjdXJyZW50RGl2KTtcclxuICAgIGxldCBpbnRlcnZhbElkID0gd2luZG93LnNldEludGVydmFsKCgpID0+IHtcclxuICAgICAgICAvLyB3ZSBkZWxldGUgdGhlIGludGVydmFsIHRpbWVyIHdoZW4gdGhlIGVsZW1lbnQgaXMgcmVtb3ZlZFxyXG4gICAgICAgIGlmICghZWxlbWVudC5pc0Nvbm5lY3RlZCkge1xyXG4gICAgICAgICAgICB3aW5kb3cuY2xlYXJJbnRlcnZhbChpbnRlcnZhbElkKTtcclxuICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgIH1cclxuICAgICAgICBzZXRDb3VudGRvd25WYWx1ZXModHJhY2tlciwgY3VycmVudCwgdG90YWwsIGN1cnJlbnREaXYpO1xyXG4gICAgfSwgMTAwMCk7XHJcbn1cclxuXHJcbmZ1bmN0aW9uIHNldENvdW50ZG93blZhbHVlcyh0cmFja2VyOiBUcmFja2VyLCBjdXJyZW50OiBIVE1MRWxlbWVudCwgdG90YWw6IEhUTUxFbGVtZW50LCBjdXJyZW50RGl2OiBIVE1MRGl2RWxlbWVudCkge1xyXG4gICAgbGV0IGN1cnJFbnRyeSA9IHRyYWNrZXIuZW50cmllcy5sYXN0KCk7XHJcbiAgICBpZiAoY3VyckVudHJ5KSB7XHJcbiAgICAgICAgaWYgKCFjdXJyRW50cnkuZW5kVGltZSlcclxuICAgICAgICAgICAgY3VycmVudC5zZXRUZXh0KGZvcm1hdER1cmF0aW9uQmV0d2VlbihjdXJyRW50cnkuc3RhcnRUaW1lLCBtb21lbnQoKS51bml4KCkpKTtcclxuICAgICAgICB0b3RhbC5zZXRUZXh0KGZvcm1hdER1cmF0aW9uKGdldFRvdGFsRHVyYXRpb24odHJhY2tlcikpKTtcclxuICAgIH1cclxuICAgIGN1cnJlbnREaXYuaGlkZGVuID0g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TUFBTSxXQUFXLE1BQU0sV0FBVztBQUFBO0FBQUE7OztBSG5PaEYsNENBQXFELHdCQUFPO0FBQUEsRUFJckQsU0FBd0I7QUFBQTtBQUM3QixZQUFNLEtBQUs7QUFFWCxXQUFLLGNBQWMsSUFBSSw2QkFBNkIsS0FBSyxLQUFLO0FBRTlELFdBQUssbUNBQW1DLHVCQUF1QixDQUFDLEdBQUcsR0FBRyxNQUFNO0FBQzNFLFlBQUksVUFBVSxZQUFZO0FBQzFCLFVBQUU7QUFDRix1QkFBZSxTQUFTLEdBQUcsTUFBTSxFQUFFLGVBQWUsSUFBSSxLQUFLO0FBQUE7QUFHNUQsV0FBSyxXQUFXO0FBQUEsUUFDZixJQUFJO0FBQUEsUUFDSixNQUFNO0FBQUEsUUFDTixnQkFBZ0IsQ0FBQyxHQUFHLE1BQU07QUFDekIsWUFBRSxpQkFBaUI7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBLEVBS2hCLGVBQWU7QUFBQTtBQUNwQixXQUFLLFdBQVcsT0FBTyxPQUFPLElBQUksaUJBQWlCLE1BQU0sS0FBSztBQUFBO0FBQUE7QUFBQSxFQUd6RCxlQUFlO0FBQUE7QUFDcEIsWUFBTSxLQUFLLFNBQVMsS0FBSztBQUFBO0FBQUE7QUFBQTsiLAogICJuYW1lcyI6IFtdCn0K diff --git a/test-vault/.obsidian/plugins/simple-time-tracker/styles.css b/test-vault/.obsidian/plugins/simple-time-tracker/styles.css index 0d85443..7437926 100644 --- a/test-vault/.obsidian/plugins/simple-time-tracker/styles.css +++ b/test-vault/.obsidian/plugins/simple-time-tracker/styles.css @@ -53,3 +53,7 @@ .simple-time-tracker-table th { border: none; } + +.simple-time-tracker-table .clickable-icon { + display: inline; +}