From 1bda2accf4cc897308e454531a4cbe000048666d Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 19 Oct 2022 16:35:21 +0200 Subject: [PATCH] added the ability to create sub-entries --- src/tracker.ts | 258 ++++++++++++------ .../plugins/simple-time-tracker/main.js | 233 +++++++++++----- test-vault/Cool Project.md | 7 +- 3 files changed, 329 insertions(+), 169 deletions(-) diff --git a/src/tracker.ts b/src/tracker.ts index abc5fd9..f60267b 100644 --- a/src/tracker.ts +++ b/src/tracker.ts @@ -9,23 +9,7 @@ export interface Entry { name: string; startTime: number; endTime: number; -} - -export function startEntry(tracker: Tracker, name: string): void { - if (!name) - name = `Segment ${tracker.entries.length + 1}`; - let entry: Entry = { name: name, startTime: moment().unix(), endTime: null }; - tracker.entries.push(entry); -}; - -export function endEntry(tracker: Tracker): void { - let last = tracker.entries.last(); - last.endTime = moment().unix(); -} - -export function isRunning(tracker: Tracker): boolean { - let last = tracker.entries.last(); - return last != null && !last.endTime; + subEntries: Entry[]; } export async function saveTracker(tracker: Tracker, app: App, section: MarkdownSectionInformation): Promise { @@ -64,17 +48,17 @@ export function displayTracker(tracker: Tracker, element: HTMLElement, getSectio .setTooltip(running ? "End" : "Start") .onClick(async () => { if (running) { - endEntry(tracker); + endRunningEntry(tracker); } else { - startEntry(tracker, name.getValue()); + startNewEntry(tracker, newSegmentNameBox.getValue()); } await saveTracker(tracker, this.app, getSectionInfo()); }); btn.buttonEl.addClass("simple-time-tracker-btn"); - let name = new TextComponent(element) + let newSegmentNameBox = new TextComponent(element) .setPlaceholder("Segment name") .setDisabled(running); - name.inputEl.addClass("simple-time-tracker-txt"); + newSegmentNameBox.inputEl.addClass("simple-time-tracker-txt"); // add timers let timer = element.createDiv({ cls: "simple-time-tracker-timers" }); @@ -95,49 +79,8 @@ export function displayTracker(tracker: Tracker, element: HTMLElement, getSectio createEl("th", { text: "Duration" }), createEl("th")); - for (let entry of tracker.entries) { - let row = table.createEl("tr"); - - 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) }); - row.createEl("td", { text: entry.endTime ? formatTimestamp(entry.endTime, settings) : "" }); - row.createEl("td", { text: entry.endTime ? formatDurationBetween(entry.startTime, entry.endTime) : "" }); - - let entryButtons = row.createEl("td"); - let editButton = new ButtonComponent(entryButtons) - .setClass("clickable-icon") - .setTooltip("Edit") - .setIcon("lucide-pencil") - .onClick(async () => { - if (namePar.hidden) { - namePar.hidden = false; - nameBox.inputEl.hidden = true; - editButton.setIcon("lucide-pencil"); - if (nameBox.getValue()) { - entry.name = nameBox.getValue(); - namePar.setText(entry.name); - await saveTracker(tracker, this.app, getSectionInfo()); - } - } else { - namePar.hidden = true; - nameBox.inputEl.hidden = false; - nameBox.setValue(entry.name); - 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()); - }); - } + for (let entry of tracker.entries) + addEditableTableRow(tracker, entry, table, newSegmentNameBox, running, getSectionInfo, settings, 0); // add copy buttons let buttons = element.createEl("div", { cls: "simple-time-tracker-bottom" }); @@ -161,33 +104,103 @@ export function displayTracker(tracker: Tracker, element: HTMLElement, getSectio }, 1000); } -function setCountdownValues(tracker: Tracker, current: HTMLElement, total: HTMLElement, currentDiv: HTMLDivElement) { - let currEntry = tracker.entries.last(); - if (currEntry) { - if (!currEntry.endTime) - current.setText(formatDurationBetween(currEntry.startTime, moment().unix())); - total.setText(formatDuration(getTotalDuration(tracker))); +function startSubEntry(entry: Entry, name: string) { + // if this entry is not split yet, we add its time as a sub-entry instead + if (!entry.subEntries) { + entry.subEntries = [{ ...entry, name: `Part 1` }]; + entry.startTime = null; + entry.endTime = null; } - currentDiv.hidden = !currEntry || !!currEntry.endTime; + + if (!name) + name = `Part ${entry.subEntries.length + 1}`; + entry.subEntries.push({ name: name, startTime: moment().unix(), endTime: null, subEntries: null }); } -function getTotalDuration(tracker: Tracker): number { - let totalDuration = 0; - for (let entry of tracker.entries) { - let endTime = entry.endTime ? moment.unix(entry.endTime) : moment(); - totalDuration += endTime.diff(moment.unix(entry.startTime)); +function startNewEntry(tracker: Tracker, name: string): void { + if (!name) + name = `Segment ${tracker.entries.length + 1}`; + let entry: Entry = { name: name, startTime: moment().unix(), endTime: null, subEntries: null }; + tracker.entries.push(entry); +}; + +function endRunningEntry(tracker: Tracker): void { + let entry = getRunningEntry(tracker.entries); + entry.endTime = moment().unix(); +} + +function removeEntry(entries: Entry[], toRemove: Entry): boolean { + if (entries.contains(toRemove)) { + entries.remove(toRemove); + return true; + } else { + for (let entry of entries) { + if (entry.subEntries && removeEntry(entry.subEntries, toRemove)) { + // if we only have one sub entry remaining, we can merge back into our main entry + if (entry.subEntries.length == 1) { + let single = entry.subEntries[0]; + entry.startTime = single.startTime; + entry.endTime = single.endTime; + entry.subEntries = null; + } + return true; + } + } } - return totalDuration; + return false; +} + +function isRunning(tracker: Tracker): boolean { + return !!getRunningEntry(tracker.entries); +} + +function getRunningEntry(entries: Entry[]): Entry { + for (let entry of entries) { + // if this entry has sub entries, check if one of them is running + if (entry.subEntries) { + let running = getRunningEntry(entry.subEntries); + if (running) + return running; + } else { + // if this entry has no sub entries and no end time, it's running + if (!entry.endTime) + return entry; + } + } + return null; +} + +function getDuration(entry: Entry) { + if (entry.subEntries) { + return getTotalDuration(entry.subEntries); + } else { + let endTime = entry.endTime ? moment.unix(entry.endTime) : moment(); + return endTime.diff(moment.unix(entry.startTime)); + } +} + +function getTotalDuration(entries: Entry[]): number { + let ret = 0; + for (let entry of entries) + ret += getDuration(entry); + return ret; +} + +function setCountdownValues(tracker: Tracker, current: HTMLElement, total: HTMLElement, currentDiv: HTMLDivElement) { + let running = getRunningEntry(tracker.entries); + if (running && !running.endTime) { + current.setText(formatDuration(getDuration(running))); + currentDiv.hidden = false; + } else { + currentDiv.hidden = true; + } + total.setText(formatDuration(getTotalDuration(tracker.entries))); } function formatTimestamp(timestamp: number, settings: SimpleTimeTrackerSettings): string { return moment.unix(timestamp).format(settings.timestampFormat); } -function formatDurationBetween(startTime: number, endTime: number): string { - return formatDuration(moment.unix(endTime).diff(moment.unix(startTime))); -} - function formatDuration(totalTime: number): string { let duration = moment.duration(totalTime); let ret = ""; @@ -202,8 +215,8 @@ function formatDuration(totalTime: number): string { function createMarkdownTable(tracker: Tracker, settings: SimpleTimeTrackerSettings): string { let table = [["Segment", "Start time", "End time", "Duration"]]; for (let entry of tracker.entries) - table.push(createTableRow(entry, settings)); - table.push(["**Total**", "", "", `**${formatDuration(getTotalDuration(tracker))}**`]); + table.push(...createTableSection(entry, settings)); + table.push(["**Total**", "", "", `**${formatDuration(getTotalDuration(tracker.entries))}**`]); let ret = ""; // calculate the width every column needs to look neat when monospaced @@ -223,15 +236,82 @@ function createMarkdownTable(tracker: Tracker, settings: SimpleTimeTrackerSettin function createCsv(tracker: Tracker, settings: SimpleTimeTrackerSettings): string { let ret = ""; - for (let entry of tracker.entries) - ret += createTableRow(entry, settings).join(settings.csvDelimiter) + "\n"; + for (let entry of tracker.entries) { + for (let row of createTableSection(entry, settings)) + ret += row.join(settings.csvDelimiter) + "\n"; + } return ret; } -function createTableRow(entry: Entry, settings: SimpleTimeTrackerSettings): string[] { - return [ +function createTableSection(entry: Entry, settings: SimpleTimeTrackerSettings): string[][] { + let ret: string[][] = [[ entry.name, - formatTimestamp(entry.startTime, settings), + entry.startTime ? formatTimestamp(entry.startTime, settings) : "", entry.endTime ? formatTimestamp(entry.endTime, settings) : "", - entry.endTime ? formatDurationBetween(entry.startTime, entry.endTime) : ""]; + entry.endTime || entry.subEntries ? formatDuration(getDuration(entry)) : ""]]; + if (entry.subEntries) { + for (let sub of entry.subEntries) + ret.push(...createTableSection(sub, settings)); + } + return ret; +} + +function addEditableTableRow(tracker: Tracker, entry: Entry, table: HTMLTableElement, newSegmentNameBox: TextComponent, running: boolean, getSectionInfo: () => MarkdownSectionInformation, settings: SimpleTimeTrackerSettings, indent: number) { + let row = table.createEl("tr"); + + let name = row.createEl("td"); + let namePar = name.createEl("span", { text: entry.name }); + namePar.style.marginLeft = `${indent}em`; + let nameBox = new TextComponent(name).setValue(entry.name); + nameBox.inputEl.hidden = true; + + row.createEl("td", { text: entry.startTime ? formatTimestamp(entry.startTime, settings) : "" }); + row.createEl("td", { text: entry.endTime ? formatTimestamp(entry.endTime, settings) : "" }); + row.createEl("td", { text: entry.endTime || entry.subEntries ? formatDuration(getDuration(entry)) : "" }); + + let entryButtons = row.createEl("td"); + if (!running) { + new ButtonComponent(entryButtons) + .setClass("clickable-icon") + .setIcon(`lucide-play`) + .setTooltip("Continue") + .onClick(async () => { + startSubEntry(entry, newSegmentNameBox.getValue()); + await saveTracker(tracker, this.app, getSectionInfo()); + }); + } + let editButton = new ButtonComponent(entryButtons) + .setClass("clickable-icon") + .setTooltip("Edit") + .setIcon("lucide-pencil") + .onClick(async () => { + if (namePar.hidden) { + namePar.hidden = false; + nameBox.inputEl.hidden = true; + editButton.setIcon("lucide-pencil"); + if (nameBox.getValue()) { + entry.name = nameBox.getValue(); + namePar.setText(entry.name); + await saveTracker(tracker, this.app, getSectionInfo()); + } + } else { + namePar.hidden = true; + nameBox.inputEl.hidden = false; + nameBox.setValue(entry.name); + editButton.setIcon("lucide-check"); + } + }); + new ButtonComponent(entryButtons) + .setClass("clickable-icon") + .setTooltip("Remove") + .setIcon("lucide-trash") + .onClick(async () => { + removeEntry(tracker.entries, entry); + await saveTracker(tracker, this.app, getSectionInfo()); + }); + + if (entry.subEntries) { + for (let sub of entry.subEntries) + addEditableTableRow(tracker, sub, table, newSegmentNameBox, running, getSectionInfo, settings, indent + 1); + } } diff --git a/test-vault/.obsidian/plugins/simple-time-tracker/main.js b/test-vault/.obsidian/plugins/simple-time-tracker/main.js index ed62bdf..bcc4e94 100644 --- a/test-vault/.obsidian/plugins/simple-time-tracker/main.js +++ b/test-vault/.obsidian/plugins/simple-time-tracker/main.js @@ -4,10 +4,27 @@ if you want to view the source, please visit the github repository of this plugi */ var __create = Object.create; var __defProp = Object.defineProperty; +var __defProps = Object.defineProperties; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropDescs = Object.getOwnPropertyDescriptors; var __getOwnPropNames = Object.getOwnPropertyNames; +var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; +var __propIsEnum = Object.prototype.propertyIsEnumerable; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp.call(b, prop)) + __defNormalProp(a, prop, b[prop]); + if (__getOwnPropSymbols) + for (var prop of __getOwnPropSymbols(b)) { + if (__propIsEnum.call(b, prop)) + __defNormalProp(a, prop, b[prop]); + } + return a; +}; +var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); var __markAsModule = (target) => __defProp(target, "__esModule", { value: true }); var __export = (target, all) => { __markAsModule(target); @@ -94,20 +111,6 @@ var SimpleTimeTrackerSettingsTab = class extends import_obsidian.PluginSettingTa // src/tracker.ts var import_obsidian2 = __toModule(require("obsidian")); -function startEntry(tracker, name) { - if (!name) - name = `Segment ${tracker.entries.length + 1}`; - let entry = { name, startTime: (0, import_obsidian2.moment)().unix(), endTime: null }; - tracker.entries.push(entry); -} -function endEntry(tracker) { - let last = tracker.entries.last(); - last.endTime = (0, import_obsidian2.moment)().unix(); -} -function isRunning(tracker) { - let last = tracker.entries.last(); - return last != null && !last.endTime; -} function saveTracker(tracker, app, section) { return __async(this, null, function* () { let file = app.workspace.getActiveFile(); @@ -137,15 +140,15 @@ function displayTracker(tracker, element, getSectionInfo, settings) { let running = isRunning(tracker); let btn = new import_obsidian2.ButtonComponent(element).setClass("clickable-icon").setIcon(`lucide-${running ? "stop" : "play"}-circle`).setTooltip(running ? "End" : "Start").onClick(() => __async(this, null, function* () { if (running) { - endEntry(tracker); + endRunningEntry(tracker); } else { - startEntry(tracker, name.getValue()); + startNewEntry(tracker, newSegmentNameBox.getValue()); } yield saveTracker(tracker, this.app, getSectionInfo()); })); btn.buttonEl.addClass("simple-time-tracker-btn"); - let name = new import_obsidian2.TextComponent(element).setPlaceholder("Segment name").setDisabled(running); - name.inputEl.addClass("simple-time-tracker-txt"); + let newSegmentNameBox = new import_obsidian2.TextComponent(element).setPlaceholder("Segment name").setDisabled(running); + newSegmentNameBox.inputEl.addClass("simple-time-tracker-txt"); let timer = element.createDiv({ cls: "simple-time-tracker-timers" }); let currentDiv = timer.createEl("div", { cls: "simple-time-tracker-timer" }); let current = currentDiv.createEl("span", { cls: "simple-time-tracker-timer-time" }); @@ -156,38 +159,8 @@ function displayTracker(tracker, element, getSectionInfo, settings) { 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" }), createEl("th")); - for (let entry of tracker.entries) { - let row = table.createEl("tr"); - 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) }); - row.createEl("td", { text: entry.endTime ? formatTimestamp(entry.endTime, settings) : "" }); - row.createEl("td", { text: entry.endTime ? 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(() => __async(this, null, function* () { - if (namePar.hidden) { - namePar.hidden = false; - nameBox.inputEl.hidden = true; - editButton.setIcon("lucide-pencil"); - if (nameBox.getValue()) { - entry.name = nameBox.getValue(); - namePar.setText(entry.name); - yield saveTracker(tracker, this.app, getSectionInfo()); - } - } else { - namePar.hidden = true; - nameBox.inputEl.hidden = false; - nameBox.setValue(entry.name); - 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()); - })); - } + for (let entry of tracker.entries) + addEditableTableRow(tracker, entry, table, newSegmentNameBox, running, getSectionInfo, settings, 0); 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))); new import_obsidian2.ButtonComponent(buttons).setButtonText("Copy as CSV").onClick(() => navigator.clipboard.writeText(createCsv(tracker, settings))); @@ -201,29 +174,88 @@ function displayTracker(tracker, element, getSectionInfo, settings) { setCountdownValues(tracker, current, total, currentDiv); }, 1e3); } -function setCountdownValues(tracker, current, total, currentDiv) { - let currEntry = tracker.entries.last(); - if (currEntry) { - if (!currEntry.endTime) - current.setText(formatDurationBetween(currEntry.startTime, (0, import_obsidian2.moment)().unix())); - total.setText(formatDuration(getTotalDuration(tracker))); +function startSubEntry(entry, name) { + if (!entry.subEntries) { + entry.subEntries = [__spreadProps(__spreadValues({}, entry), { name: `Part 1` })]; + entry.startTime = null; + entry.endTime = null; } - currentDiv.hidden = !currEntry || !!currEntry.endTime; + if (!name) + name = `Part ${entry.subEntries.length + 1}`; + entry.subEntries.push({ name, startTime: (0, import_obsidian2.moment)().unix(), endTime: null, subEntries: null }); } -function getTotalDuration(tracker) { - let totalDuration = 0; - for (let entry of tracker.entries) { - let endTime = entry.endTime ? import_obsidian2.moment.unix(entry.endTime) : (0, import_obsidian2.moment)(); - totalDuration += endTime.diff(import_obsidian2.moment.unix(entry.startTime)); +function startNewEntry(tracker, name) { + if (!name) + name = `Segment ${tracker.entries.length + 1}`; + let entry = { name, startTime: (0, import_obsidian2.moment)().unix(), endTime: null, subEntries: null }; + tracker.entries.push(entry); +} +function endRunningEntry(tracker) { + let entry = getRunningEntry(tracker.entries); + entry.endTime = (0, import_obsidian2.moment)().unix(); +} +function removeEntry(entries, toRemove) { + if (entries.contains(toRemove)) { + entries.remove(toRemove); + return true; + } else { + for (let entry of entries) { + if (entry.subEntries && removeEntry(entry.subEntries, toRemove)) { + if (entry.subEntries.length == 1) { + let single = entry.subEntries[0]; + entry.startTime = single.startTime; + entry.endTime = single.endTime; + entry.subEntries = null; + } + return true; + } + } } - return totalDuration; + return false; +} +function isRunning(tracker) { + return !!getRunningEntry(tracker.entries); +} +function getRunningEntry(entries) { + for (let entry of entries) { + if (entry.subEntries) { + let running = getRunningEntry(entry.subEntries); + if (running) + return running; + } else { + if (!entry.endTime) + return entry; + } + } + return null; +} +function getDuration(entry) { + if (entry.subEntries) { + return getTotalDuration(entry.subEntries); + } else { + let endTime = entry.endTime ? import_obsidian2.moment.unix(entry.endTime) : (0, import_obsidian2.moment)(); + return endTime.diff(import_obsidian2.moment.unix(entry.startTime)); + } +} +function getTotalDuration(entries) { + let ret = 0; + for (let entry of entries) + ret += getDuration(entry); + return ret; +} +function setCountdownValues(tracker, current, total, currentDiv) { + let running = getRunningEntry(tracker.entries); + if (running && !running.endTime) { + current.setText(formatDuration(getDuration(running))); + currentDiv.hidden = false; + } else { + currentDiv.hidden = true; + } + total.setText(formatDuration(getTotalDuration(tracker.entries))); } function formatTimestamp(timestamp, settings) { return import_obsidian2.moment.unix(timestamp).format(settings.timestampFormat); } -function formatDurationBetween(startTime, endTime) { - return formatDuration(import_obsidian2.moment.unix(endTime).diff(import_obsidian2.moment.unix(startTime))); -} function formatDuration(totalTime) { let duration = import_obsidian2.moment.duration(totalTime); let ret = ""; @@ -237,8 +269,8 @@ function formatDuration(totalTime) { function createMarkdownTable(tracker, settings) { let table = [["Segment", "Start time", "End time", "Duration"]]; for (let entry of tracker.entries) - table.push(createTableRow(entry, settings)); - table.push(["**Total**", "", "", `**${formatDuration(getTotalDuration(tracker))}**`]); + table.push(...createTableSection(entry, settings)); + table.push(["**Total**", "", "", `**${formatDuration(getTotalDuration(tracker.entries))}**`]); let ret = ""; let widths = Array.from(Array(4).keys()).map((i) => Math.max(...table.map((a) => a[i].length))); for (let r = 0; r < table.length; r++) { @@ -253,17 +285,67 @@ function createMarkdownTable(tracker, settings) { } function createCsv(tracker, settings) { let ret = ""; - for (let entry of tracker.entries) - ret += createTableRow(entry, settings).join(settings.csvDelimiter) + "\n"; + for (let entry of tracker.entries) { + for (let row of createTableSection(entry, settings)) + ret += row.join(settings.csvDelimiter) + "\n"; + } return ret; } -function createTableRow(entry, settings) { - return [ +function createTableSection(entry, settings) { + let ret = [[ entry.name, - formatTimestamp(entry.startTime, settings), + entry.startTime ? formatTimestamp(entry.startTime, settings) : "", entry.endTime ? formatTimestamp(entry.endTime, settings) : "", - entry.endTime ? formatDurationBetween(entry.startTime, entry.endTime) : "" - ]; + entry.endTime || entry.subEntries ? formatDuration(getDuration(entry)) : "" + ]]; + if (entry.subEntries) { + for (let sub of entry.subEntries) + ret.push(...createTableSection(sub, settings)); + } + return ret; +} +function addEditableTableRow(tracker, entry, table, newSegmentNameBox, running, getSectionInfo, settings, indent) { + let row = table.createEl("tr"); + let name = row.createEl("td"); + let namePar = name.createEl("span", { text: entry.name }); + namePar.style.marginLeft = `${indent}em`; + let nameBox = new import_obsidian2.TextComponent(name).setValue(entry.name); + nameBox.inputEl.hidden = true; + row.createEl("td", { text: entry.startTime ? formatTimestamp(entry.startTime, settings) : "" }); + row.createEl("td", { text: entry.endTime ? formatTimestamp(entry.endTime, settings) : "" }); + row.createEl("td", { text: entry.endTime || entry.subEntries ? formatDuration(getDuration(entry)) : "" }); + let entryButtons = row.createEl("td"); + if (!running) { + new import_obsidian2.ButtonComponent(entryButtons).setClass("clickable-icon").setIcon(`lucide-play`).setTooltip("Continue").onClick(() => __async(this, null, function* () { + startSubEntry(entry, newSegmentNameBox.getValue()); + yield saveTracker(tracker, this.app, getSectionInfo()); + })); + } + let editButton = new import_obsidian2.ButtonComponent(entryButtons).setClass("clickable-icon").setTooltip("Edit").setIcon("lucide-pencil").onClick(() => __async(this, null, function* () { + if (namePar.hidden) { + namePar.hidden = false; + nameBox.inputEl.hidden = true; + editButton.setIcon("lucide-pencil"); + if (nameBox.getValue()) { + entry.name = nameBox.getValue(); + namePar.setText(entry.name); + yield saveTracker(tracker, this.app, getSectionInfo()); + } + } else { + namePar.hidden = true; + nameBox.inputEl.hidden = false; + nameBox.setValue(entry.name); + editButton.setIcon("lucide-check"); + } + })); + new import_obsidian2.ButtonComponent(entryButtons).setClass("clickable-icon").setTooltip("Remove").setIcon("lucide-trash").onClick(() => __async(this, null, function* () { + removeEntry(tracker.entries, entry); + yield saveTracker(tracker, this.app, getSectionInfo()); + })); + if (entry.subEntries) { + for (let sub of entry.subEntries) + addEditableTableRow(tracker, sub, table, newSegmentNameBox, running, getSectionInfo, settings, indent + 1); + } } // src/main.ts @@ -297,3 +379,4 @@ var SimpleTimeTrackerPlugin = class extends import_obsidian3.Plugin { }); } }; +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsic3JjL21haW4udHMiLCAic3JjL3NldHRpbmdzLnRzIiwgInNyYy9zZXR0aW5ncy10YWIudHMiLCAic3JjL3RyYWNrZXIudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImltcG9ydCB7IFBsdWdpbiB9IGZyb20gXCJvYnNpZGlhblwiO1xyXG5pbXBvcnQgeyBkZWZhdWx0U2V0dGluZ3MsIFNpbXBsZVRpbWVUcmFja2VyU2V0dGluZ3MgfSBmcm9tIFwiLi9zZXR0aW5nc1wiO1xyXG5pbXBvcnQgeyBTaW1wbGVUaW1lVHJhY2tlclNldHRpbmdzVGFiIH0gZnJvbSBcIi4vc2V0dGluZ3MtdGFiXC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KCkudW5peCgpLCBlbmRUaW1lOiBudWxsLCBzdWJFbnRyaWVzOiBudWxsIH07XHJcbiAgICB0cmFja2VyLmVudHJpZXMucHVzaChlbnRyeSk7XHJcbn07XHJcblxyXG5mdW5jdGlvbiBlbmRSdW5uaW5nRW50cnkodHJhY2tlcjogVHJhY2tlcik6IHZvaWQge1xyXG4gICAgbGV0IGVudHJ5ID0gZ2V0UnVubmluZ0VudHJ5KHRyYWNrZXIuZW50cmllcyk7XHJcbiAgICBlbnRyeS5lbmRUaW1lID0gbW9tZW50KCkudW5peCgpO1xyXG59XHJcblxyXG5mdW5jdGlvbiByZW1vdmVFbnRyeShlbnRyaWVzOiBFbnRyeVtdLCB0b1JlbW92ZTogRW50cnkpOiBib29sZWFuIHtcclxuICAgIGlmIChlbnRyaWVzLmNvbnRhaW5zKHRvUmVtb3ZlKSkge1xyXG4gICAgICAgIGVudHJpZXMucmVtb3ZlKHRvUmVtb3ZlKTtcclxuICAgICAgICByZXR1cm4gdHJ1ZTtcclxuICAgIH0gZWxzZSB7XHJcbiAgICAgICAgZm9yIChsZXQgZW50cnkgb2YgZW50cmllcykge1xyXG4gICAgICAgICAgICBpZiAoZW50cnkuc3ViRW50cmllcyAmJiByZW1vdmVFbnRyeShlbnRyeS5zdWJFbnRyaWVzLCB0b1JlbW92ZSkpIHtcclxuICAgICAgICAgICAgICAgIC8vIGlmIHdlIG9ubHkgaGF2ZSBvbmUgc3ViIGVudHJ5IHJlbWFpbmluZywgd2UgY2FuIG1lcmdlIGJhY2sgaW50byBvdXIgbWFpbiBlbnRyeVxyXG4gICAgICAgICAgICAgICAgaWYgKGVudHJ5LnN1YkVudHJpZXMubGVuZ3RoID09IDEpIHtcclxuICAgICAgICAgICAgICAgICAgICBsZXQgc2luZ2xlID0gZW50cnkuc3ViRW50cmllc1swXTtcclxuICAgICAgICAgICAgICAgICAgICBlbnRyeS5zdGFydFRpbWUgPSBzaW5nbGUuc3RhcnRUaW1lO1xyXG4gICAgICAgICAgICA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LXBlbmNpbFwiKVxyXG4gICAgICAgIC5vbkNsaWNrKGFzeW5jICgpID0+IHtcclxuICAgICAgICAgICAgaWYgKG5hbWVQYXIuaGlkZGVuKSB7XHJcbiAgICAgICAgICAgICAgICBuYW1lUGFyLmhpZGRlbiA9IGZhbHNlO1xyXG4gICAgICAgICAgICAgICAgbmFtZUJveC5pbnB1dEVsLmhpZGRlbiA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICBlZGl0QnV0dG9uLnNldEljb24oXCJsdWNpZGUtcGVuY2lsXCIpO1xyXG4gICAgICAgICAgICAgICAgaWYgKG5hbWVCb3guZ2V0VmFsdWUoKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGVudHJ5Lm5hbWUgPSBuYW1lQm94LmdldFZhbHVlKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgbmFtZVBhci5zZXRUZXh0KGVudHJ5Lm5hbWUpO1xyXG4gICAgICAgICAgICAgICAgICAgIGF3YWl0IHNhdmVUcmFja2VyKHRyYWNrZXIsIHRoaXMuYXBwLCBnZXRTZWN0aW9uSW5mbygpKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIG5hbWVQYXIuaGlkZGVuID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgIG5hbWVCb3guaW5wdXRFbC5oaWRkZW4gPSBmYWxzZTtcclxuICAgICAgICAgICAgICAgIG5hbWVCb3guc2V0VmFsdWUoZW50cnkubmFtZSk7XHJcbiAgICAgICAgICAgICAgICBlZGl0QnV0dG9uLnNldEljb24oXCJsdWNpZGUtY2hlY2tcIik7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KTtcclxuICAgIG5ldyBCdXR0b25Db21wb25lbnQoZW50cnlCdXR0b25zKVxyXG4gICAgICAgIC5zZXRDbGFzcyhcImNsaWNrYWJsZS1pY29uXCIpXHJcbiAgICAgICAgLnNldFRvb2x0aXAoXCJSZW1vdmVcIil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Z0JBQWdCLFVBQVUsU0FBUztBQUFBO0FBQUE7OztBSHJUcEgsNENBQXFELHdCQUFPO0FBQUEsRUFJckQsU0FBd0I7QUFBQTtBQUM3QixZQUFNLEtBQUs7QUFFWCxXQUFLLGNBQWMsSUFBSSw2QkFBNkIsS0FBSyxLQUFLO0FBRTlELFdBQUssbUNBQW1DLHVCQUF1QixDQUFDLEdBQUcsR0FBRyxNQUFNO0FBQzNFLFlBQUksVUFBVSxZQUFZO0FBQzFCLFVBQUU7QUFDRix1QkFBZSxTQUFTLEdBQUcsTUFBTSxFQUFFLGVBQWUsSUFBSSxLQUFLO0FBQUE7QUFHNUQsV0FBSyxXQUFXO0FBQUEsUUFDZixJQUFJO0FBQUEsUUFDSixNQUFNO0FBQUEsUUFDTixnQkFBZ0IsQ0FBQyxHQUFHLE1BQU07QUFDekIsWUFBRSxpQkFBaUI7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBLEVBS2hCLGVBQWU7QUFBQTtBQUNwQixXQUFLLFdBQVcsT0FBTyxPQUFPLElBQUksaUJBQWlCLE1BQU0sS0FBSztBQUFBO0FBQUE7QUFBQSxFQUd6RCxlQUFlO0FBQUE7QUFDcEIsWUFBTSxLQUFLLFNBQVMsS0FBSztBQUFBO0FBQUE7QUFBQTsiLAogICJuYW1lcyI6IFtdCn0K diff --git a/test-vault/Cool Project.md b/test-vault/Cool Project.md index 908491d..e5299f4 100644 --- a/test-vault/Cool Project.md +++ b/test-vault/Cool Project.md @@ -2,7 +2,7 @@ These are the notes for my cool project. There's so much left to do! I wish I had a way to track the amount of time I spend on each part of the project. ```simple-time-tracker -{"entries":[{"name":"Think about project","startTime":1664305777,"endTime":1664308788},{"name":"Create project note","startTime":1664308810,"endTime":1664308815},{"name":"Work on project","startTime":1664308830,"endTime":1664309301},{"name":"Segment 4","startTime":1664364444,"endTime":1664364449},{"name":"Segment 5","startTime":1664364495,"endTime":1664364498},{"name":"Segment 6","startTime":1664458520,"endTime":1664458523},{"name":"Segment 7","startTime":1664460326,"endTime":1664460329}]} +{"entries":[{"name":"Segment 1","startTime":1666189948,"endTime":1666189951,"subEntries":null},{"name":"Segment 2","startTime":1666189953,"endTime":1666189961,"subEntries":null},{"name":"Segment 3","startTime":null,"endTime":null,"subEntries":[{"name":"Part 1","startTime":1666189962,"endTime":1666189995,"subEntries":null},{"name":"Part 2","startTime":1666190004,"endTime":1666190025,"subEntries":null},{"name":"Part 3","startTime":1666190094,"endTime":1666190101,"subEntries":null}]},{"name":"Segment 4","startTime":1666190088,"endTime":1666190091,"subEntries":null}]} ``` ``` @@ -12,7 +12,4 @@ Work on project,22-09-27 10:00:30,22-09-27 10:08:21,7m 51s Segment 4,22-09-28 01:27:24,22-09-28 01:27:29,5s Segment 5,22-09-28 01:28:15,22-09-28 01:28:18,3s -``` - - - +``` \ No newline at end of file