From 44172cbca7d903cf0f25e4f8968acee65756080f Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 29 Sep 2022 15:36:06 +0200 Subject: [PATCH] updated plugin and command ids --- esbuild.config.mjs | 2 +- manifest.json | 2 +- package-lock.json | 2 +- package.json | 2 +- src/main.ts | 2 +- test-vault/.obsidian/community-plugins.json | 2 +- .../obsidian-simple-time-tracker/main.js | 274 ----------------- .../data.json | 0 .../plugins/simple-time-tracker/main.js | 275 ++++++++++++++++++ .../manifest.json | 2 +- .../styles.css | 0 test-vault/Cool Project.md | 2 +- 12 files changed, 283 insertions(+), 282 deletions(-) delete mode 100644 test-vault/.obsidian/plugins/obsidian-simple-time-tracker/main.js rename test-vault/.obsidian/plugins/{obsidian-simple-time-tracker => simple-time-tracker}/data.json (100%) create mode 100644 test-vault/.obsidian/plugins/simple-time-tracker/main.js rename test-vault/.obsidian/plugins/{obsidian-simple-time-tracker => simple-time-tracker}/manifest.json (85%) rename test-vault/.obsidian/plugins/{obsidian-simple-time-tracker => simple-time-tracker}/styles.css (100%) diff --git a/esbuild.config.mjs b/esbuild.config.mjs index 67d2e2d..febaa19 100644 --- a/esbuild.config.mjs +++ b/esbuild.config.mjs @@ -46,7 +46,7 @@ esbuild.build({ copy({ assets: [{ from: ["./manifest.json", "./main.js", "./styles.css"], - to: ["./test-vault/.obsidian/plugins/obsidian-simple-time-tracker/."] + to: ["./test-vault/.obsidian/plugins/simple-time-tracker/."] }] }), ], diff --git a/manifest.json b/manifest.json index 514dc0c..5c426fd 100644 --- a/manifest.json +++ b/manifest.json @@ -1,5 +1,5 @@ { - "id": "obsidian-simple-time-tracker", + "id": "simple-time-tracker", "name": "Super Simple Time Tracker", "version": "0.1.1", "minAppVersion": "0.15.0", diff --git a/package-lock.json b/package-lock.json index a64259e..f3c6bda 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "obsidian-simple-time-tracker", + "name": "simple-time-tracker", "version": "0.1.1", "lockfileVersion": 1, "requires": true, diff --git a/package.json b/package.json index 4acb5a0..2bf7d73 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "obsidian-simple-time-tracker", + "name": "simple-time-tracker", "version": "0.1.1", "description": "Multi-purpose time trackers for your notes!", "main": "main.js", diff --git a/src/main.ts b/src/main.ts index 2918211..6e0dd94 100644 --- a/src/main.ts +++ b/src/main.ts @@ -19,7 +19,7 @@ export default class SimpleTimeTrackerPlugin extends Plugin { }); this.addCommand({ - id: `insert-simple-time-tracker`, + id: `insert`, name: `Insert Time Tracker`, editorCallback: (e, _) => { e.replaceSelection("```simple-time-tracker\n```\n"); diff --git a/test-vault/.obsidian/community-plugins.json b/test-vault/.obsidian/community-plugins.json index 257504c..655cfd3 100644 --- a/test-vault/.obsidian/community-plugins.json +++ b/test-vault/.obsidian/community-plugins.json @@ -1,3 +1,3 @@ [ - "obsidian-simple-time-tracker" + "simple-time-tracker" ] \ No newline at end of file diff --git a/test-vault/.obsidian/plugins/obsidian-simple-time-tracker/main.js b/test-vault/.obsidian/plugins/obsidian-simple-time-tracker/main.js deleted file mode 100644 index 819f4d8..0000000 --- a/test-vault/.obsidian/plugins/obsidian-simple-time-tracker/main.js +++ /dev/null @@ -1,274 +0,0 @@ -/* -THIS IS A GENERATED/BUNDLED FILE BY ESBUILD -if you want to view the source, please visit the github repository of this plugin -*/ -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __markAsModule = (target) => __defProp(target, "__esModule", { value: true }); -var __export = (target, all) => { - __markAsModule(target); - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __reExport = (target, module2, desc) => { - if (module2 && typeof module2 === "object" || typeof module2 === "function") { - for (let key of __getOwnPropNames(module2)) - if (!__hasOwnProp.call(target, key) && key !== "default") - __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable }); - } - return target; -}; -var __toModule = (module2) => { - return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2); -}; -var __async = (__this, __arguments, generator) => { - return new Promise((resolve, reject) => { - var fulfilled = (value) => { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - }; - var rejected = (value) => { - try { - step(generator.throw(value)); - } catch (e) { - reject(e); - } - }; - var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); - step((generator = generator.apply(__this, __arguments)).next()); - }); -}; - -// src/main.ts -__export(exports, { - default: () => SimpleTimeTrackerPlugin -}); -var import_obsidian3 = __toModule(require("obsidian")); - -// src/settings.ts -var defaultSettings = { - timestampFormat: "YY-MM-DD hh:mm:ss", - csvDelimiter: "," -}; - -// src/settings-tab.ts -var import_obsidian = __toModule(require("obsidian")); -var SimpleTimeTrackerSettingsTab = class extends import_obsidian.PluginSettingTab { - constructor(app, plugin) { - super(app, plugin); - this.plugin = plugin; - } - display() { - this.containerEl.empty(); - this.containerEl.createEl("h2", { text: "Super Simple Time Tracker Settings" }); - new import_obsidian.Setting(this.containerEl).setName("Timestamp Display Format").setDesc(createFragment((f) => { - f.createSpan({ text: "The way that timestamps in time tracker tables should be displayed. Uses " }); - f.createEl("a", { text: "moment.js", href: "https://momentjs.com/docs/#/parsing/string-format/" }); - f.createSpan({ text: " syntax." }); - })).addText((t) => { - t.setValue(String(this.plugin.settings.timestampFormat)); - t.onChange((v) => __async(this, null, function* () { - this.plugin.settings.timestampFormat = v.length ? v : defaultSettings.timestampFormat; - yield this.plugin.saveSettings(); - })); - }); - new import_obsidian.Setting(this.containerEl).setName("CSV Delimiter").setDesc("The delimiter character that should be used when copying a tracker table as CSV. For example, some languages use a semicolon instead of a comma.").addText((t) => { - t.setValue(String(this.plugin.settings.csvDelimiter)); - t.onChange((v) => __async(this, null, function* () { - this.plugin.settings.csvDelimiter = v.length ? v : defaultSettings.csvDelimiter; - yield this.plugin.saveSettings(); - })); - }); - this.containerEl.createEl("hr"); - this.containerEl.createEl("p", { text: "If you like this plugin and want to support its development, you can do so through my website by clicking this fancy image!" }); - this.containerEl.createEl("a", { href: "https://ellpeck.de/support" }).createEl("img", { attr: { src: "https://ellpeck.de/res/generalsupport.png" }, cls: "simple-time-tracker-support" }); - } -}; - -// 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(); - let content = yield app.vault.cachedRead(file); - let lines = content.split("\n"); - let prev = lines.filter((_, i) => i <= section.lineStart).join("\n"); - let next = lines.filter((_, i) => i >= section.lineEnd).join("\n"); - content = `${prev} -${JSON.stringify(tracker)} -${next}`; - yield app.vault.modify(file, content); - }); -} -function loadTracker(json) { - if (json) { - try { - return JSON.parse(json); - } catch (e) { - console.log(`Failed to parse Tracker from ${json}`); - } - } - return { entries: [] }; -} -function displayTracker(tracker, element, getSectionInfo, settings) { - let running = isRunning(tracker); - let btn = new import_obsidian2.ButtonComponent(element).setButtonText(running ? "End" : "Start").onClick(() => __async(this, null, function* () { - if (running) { - endEntry(tracker); - } else { - startEntry(tracker, name.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 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" }); - currentDiv.createEl("span", { text: "Current" }); - let totalDiv = timer.createEl("div", { cls: "simple-time-tracker-timer" }); - let total = totalDiv.createEl("span", { cls: "simple-time-tracker-timer-time", text: "0s" }); - 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" })); - for (let entry of tracker.entries) { - let row = table.createEl("tr"); - row.createEl("td", { text: entry.name }); - 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 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))); - } - setCountdownValues(tracker, current, total, currentDiv); - let intervalId = window.setInterval(() => { - if (!element.isConnected) { - window.clearInterval(intervalId); - return; - } - 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))); - } - currentDiv.hidden = !currEntry || !!currEntry.endTime; -} -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)); - } - return totalDuration; -} -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 = ""; - if (duration.hours() > 0) - ret += duration.hours() + "h "; - if (duration.minutes() > 0) - ret += duration.minutes() + "m "; - ret += duration.seconds() + "s"; - return ret; -} -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))}**`]); - 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++) { - if (r == 1) - ret += Array.from(Array(4).keys()).map((i) => "-".repeat(widths[i])).join(" | ") + "\n"; - let row = []; - for (let i = 0; i < 4; i++) - row.push(table[r][i].padEnd(widths[i], " ")); - ret += row.join(" | ") + "\n"; - } - return ret; -} -function createCsv(tracker, settings) { - let ret = ""; - for (let entry of tracker.entries) - ret += createTableRow(entry, settings).join(settings.csvDelimiter) + "\n"; - return ret; -} -function createTableRow(entry, settings) { - return [ - entry.name, - formatTimestamp(entry.startTime, settings), - entry.endTime ? formatTimestamp(entry.endTime, settings) : "", - entry.endTime ? formatDurationBetween(entry.startTime, entry.endTime) : "" - ]; -} - -// src/main.ts -var SimpleTimeTrackerPlugin = class extends import_obsidian3.Plugin { - onload() { - return __async(this, null, function* () { - yield this.loadSettings(); - this.addSettingTab(new SimpleTimeTrackerSettingsTab(this.app, this)); - this.registerMarkdownCodeBlockProcessor("simple-time-tracker", (s, e, i) => { - let tracker = loadTracker(s); - e.empty(); - displayTracker(tracker, e, () => i.getSectionInfo(e), this.settings); - }); - this.addCommand({ - id: `insert-simple-time-tracker`, - name: `Insert Time Tracker`, - editorCallback: (e, _) => { - e.replaceSelection("```simple-time-tracker\n```\n"); - } - }); - }); - } - loadSettings() { - return __async(this, null, function* () { - this.settings = Object.assign({}, defaultSettings, yield this.loadData()); - }); - } - saveSettings() { - return __async(this, null, function* () { - yield this.saveData(this.settings); - }); - } -}; diff --git a/test-vault/.obsidian/plugins/obsidian-simple-time-tracker/data.json b/test-vault/.obsidian/plugins/simple-time-tracker/data.json similarity index 100% rename from test-vault/.obsidian/plugins/obsidian-simple-time-tracker/data.json rename to test-vault/.obsidian/plugins/simple-time-tracker/data.json diff --git a/test-vault/.obsidian/plugins/simple-time-tracker/main.js b/test-vault/.obsidian/plugins/simple-time-tracker/main.js new file mode 100644 index 0000000..a3d1d9a --- /dev/null +++ b/test-vault/.obsidian/plugins/simple-time-tracker/main.js @@ -0,0 +1,275 @@ +/* +THIS IS A GENERATED/BUNDLED FILE BY ESBUILD +if you want to view the source, please visit the github repository of this plugin +*/ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __markAsModule = (target) => __defProp(target, "__esModule", { value: true }); +var __export = (target, all) => { + __markAsModule(target); + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __reExport = (target, module2, desc) => { + if (module2 && typeof module2 === "object" || typeof module2 === "function") { + for (let key of __getOwnPropNames(module2)) + if (!__hasOwnProp.call(target, key) && key !== "default") + __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable }); + } + return target; +}; +var __toModule = (module2) => { + return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2); +}; +var __async = (__this, __arguments, generator) => { + return new Promise((resolve, reject) => { + var fulfilled = (value) => { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + }; + var rejected = (value) => { + try { + step(generator.throw(value)); + } catch (e) { + reject(e); + } + }; + var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); + step((generator = generator.apply(__this, __arguments)).next()); + }); +}; + +// src/main.ts +__export(exports, { + default: () => SimpleTimeTrackerPlugin +}); +var import_obsidian3 = __toModule(require("obsidian")); + +// src/settings.ts +var defaultSettings = { + timestampFormat: "YY-MM-DD hh:mm:ss", + csvDelimiter: "," +}; + +// src/settings-tab.ts +var import_obsidian = __toModule(require("obsidian")); +var SimpleTimeTrackerSettingsTab = class extends import_obsidian.PluginSettingTab { + constructor(app, plugin) { + super(app, plugin); + this.plugin = plugin; + } + display() { + this.containerEl.empty(); + this.containerEl.createEl("h2", { text: "Super Simple Time Tracker Settings" }); + new import_obsidian.Setting(this.containerEl).setName("Timestamp Display Format").setDesc(createFragment((f) => { + f.createSpan({ text: "The way that timestamps in time tracker tables should be displayed. Uses " }); + f.createEl("a", { text: "moment.js", href: "https://momentjs.com/docs/#/parsing/string-format/" }); + f.createSpan({ text: " syntax." }); + })).addText((t) => { + t.setValue(String(this.plugin.settings.timestampFormat)); + t.onChange((v) => __async(this, null, function* () { + this.plugin.settings.timestampFormat = v.length ? v : defaultSettings.timestampFormat; + yield this.plugin.saveSettings(); + })); + }); + new import_obsidian.Setting(this.containerEl).setName("CSV Delimiter").setDesc("The delimiter character that should be used when copying a tracker table as CSV. For example, some languages use a semicolon instead of a comma.").addText((t) => { + t.setValue(String(this.plugin.settings.csvDelimiter)); + t.onChange((v) => __async(this, null, function* () { + this.plugin.settings.csvDelimiter = v.length ? v : defaultSettings.csvDelimiter; + yield this.plugin.saveSettings(); + })); + }); + this.containerEl.createEl("hr"); + this.containerEl.createEl("p", { text: "If you like this plugin and want to support its development, you can do so through my website by clicking this fancy image!" }); + this.containerEl.createEl("a", { href: "https://ellpeck.de/support" }).createEl("img", { attr: { src: "https://ellpeck.de/res/generalsupport.png" }, cls: "simple-time-tracker-support" }); + } +}; + +// 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(); + let content = yield app.vault.cachedRead(file); + let lines = content.split("\n"); + let prev = lines.filter((_, i) => i <= section.lineStart).join("\n"); + let next = lines.filter((_, i) => i >= section.lineEnd).join("\n"); + content = `${prev} +${JSON.stringify(tracker)} +${next}`; + yield app.vault.modify(file, content); + }); +} +function loadTracker(json) { + if (json) { + try { + return JSON.parse(json); + } catch (e) { + console.log(`Failed to parse Tracker from ${json}`); + } + } + return { entries: [] }; +} +function displayTracker(tracker, element, getSectionInfo, settings) { + let running = isRunning(tracker); + let btn = new import_obsidian2.ButtonComponent(element).setButtonText(running ? "End" : "Start").onClick(() => __async(this, null, function* () { + if (running) { + endEntry(tracker); + } else { + startEntry(tracker, name.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 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" }); + currentDiv.createEl("span", { text: "Current" }); + let totalDiv = timer.createEl("div", { cls: "simple-time-tracker-timer" }); + let total = totalDiv.createEl("span", { cls: "simple-time-tracker-timer-time", text: "0s" }); + 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" })); + for (let entry of tracker.entries) { + let row = table.createEl("tr"); + row.createEl("td", { text: entry.name }); + 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 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))); + } + setCountdownValues(tracker, current, total, currentDiv); + let intervalId = window.setInterval(() => { + if (!element.isConnected) { + window.clearInterval(intervalId); + return; + } + 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))); + } + currentDiv.hidden = !currEntry || !!currEntry.endTime; +} +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)); + } + return totalDuration; +} +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 = ""; + if (duration.hours() > 0) + ret += duration.hours() + "h "; + if (duration.minutes() > 0) + ret += duration.minutes() + "m "; + ret += duration.seconds() + "s"; + return ret; +} +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))}**`]); + 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++) { + if (r == 1) + ret += Array.from(Array(4).keys()).map((i) => "-".repeat(widths[i])).join(" | ") + "\n"; + let row = []; + for (let i = 0; i < 4; i++) + row.push(table[r][i].padEnd(widths[i], " ")); + ret += row.join(" | ") + "\n"; + } + return ret; +} +function createCsv(tracker, settings) { + let ret = ""; + for (let entry of tracker.entries) + ret += createTableRow(entry, settings).join(settings.csvDelimiter) + "\n"; + return ret; +} +function createTableRow(entry, settings) { + return [ + entry.name, + formatTimestamp(entry.startTime, settings), + entry.endTime ? formatTimestamp(entry.endTime, settings) : "", + entry.endTime ? formatDurationBetween(entry.startTime, entry.endTime) : "" + ]; +} + +// src/main.ts +var SimpleTimeTrackerPlugin = class extends import_obsidian3.Plugin { + onload() { + return __async(this, null, function* () { + yield this.loadSettings(); + this.addSettingTab(new SimpleTimeTrackerSettingsTab(this.app, this)); + this.registerMarkdownCodeBlockProcessor("simple-time-tracker", (s, e, i) => { + let tracker = loadTracker(s); + e.empty(); + displayTracker(tracker, e, () => i.getSectionInfo(e), this.settings); + }); + this.addCommand({ + id: `insert`, + name: `Insert Time Tracker`, + editorCallback: (e, _) => { + e.replaceSelection("```simple-time-tracker\n```\n"); + } + }); + }); + } + loadSettings() { + return __async(this, null, function* () { + this.settings = Object.assign({}, defaultSettings, yield this.loadData()); + }); + } + saveSettings() { + return __async(this, null, function* () { + yield this.saveData(this.settings); + }); + } +}; +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsic3JjL21haW4udHMiLCAic3JjL3NldHRpbmdzLnRzIiwgInNyYy9zZXR0aW5ncy10YWIudHMiLCAic3JjL3RyYWNrZXIudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImltcG9ydCB7IFBsdWdpbiB9IGZyb20gXCJvYnNpZGlhblwiO1xyXG5pbXBvcnQgeyBkZWZhdWx0U2V0dGluZ3MsIFNpbXBsZVRpbWVUcmFja2VyU2V0dGluZ3MgfSBmcm9tIFwiLi9zZXR0aW5nc1wiO1xyXG5pbXBvcnQgeyBTaW1wbGVUaW1lVHJhY2tlclNldHRpbmdzVGFiIH0gZnJvbSBcIi4vc2V0dGluZ3MtdGFiXCI7XHJcbmltcG9ydCB7IGRpc3BsYXlUcmFja2VyLCBsb2FkVHJhY2tlciB9IGZyb20gXCIuL3RyYWNrZXJcIjtcclxuXHJcbmV4cG9ydCBkZWZhdWx0IGNsYXNzIFNpbXBsZVRpbWVUcmFja2VyUGx1Z2luIGV4dGVuZHMgUGx1Z2luIHtcclxuXHJcblx0c2V0dGluZ3M6IFNpbXBsZVRpbWVUcmFja2VyU2V0dGluZ3M7XHJcblxyXG5cdGFzeW5jIG9ubG9hZCgpOiBQcm9taXNlPHZvaWQ+IHtcclxuXHRcdGF3YWl0IHRoaXMubG9hZFNldHRpbmdzKCk7XHJcblxyXG5cdFx0dGhpcy5hZGRTZXR0aW5nVGFiKG5ldyBTaW1wbGVUaW1lVHJhY2tlclNldHRpbmdzVGFiKHRoaXMuYXBwLCB0aGlzKSk7XHJcblxyXG5cdFx0dGhpcy5yZWdpc3Rlck1hcmtkb3duQ29kZUJsb2NrUHJvY2Vzc29yKFwic2ltcGxlLXRpbWUtdHJhY2tlclwiLCAocywgZSwgaSkgPT4ge1xyXG5cdFx0XHRsZXQgdHJhY2tlciA9IGxvYWRUcmFja2VyKHMpO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DakYsU0FBTztBQUFBLElBQ0gsTUFBTTtBQUFBLElBQ04sZ0JBQWdCLE1BQU0sV0FBVztBQUFBLElBQ2pDLE1BQU0sVUFBVSxnQkFBZ0IsTUFBTSxTQUFTLFlBQVk7QUFBQSxJQUMzRCxNQUFNLFVBQVUsc0JBQXNCLE1BQU0sV0FBVyxNQUFNLFdBQVc7QUFBQTtBQUFBOzs7QUgvTGhGLDRDQUFxRCx3QkFBTztBQUFBLEVBSXJELFNBQXdCO0FBQUE7QUFDN0IsWUFBTSxLQUFLO0FBRVgsV0FBSyxjQUFjLElBQUksNkJBQTZCLEtBQUssS0FBSztBQUU5RCxXQUFLLG1DQUFtQyx1QkFBdUIsQ0FBQyxHQUFHLEdBQUcsTUFBTTtBQUMzRSxZQUFJLFVBQVUsWUFBWTtBQUMxQixVQUFFO0FBQ0YsdUJBQWUsU0FBUyxHQUFHLE1BQU0sRUFBRSxlQUFlLElBQUksS0FBSztBQUFBO0FBRzVELFdBQUssV0FBVztBQUFBLFFBQ2YsSUFBSTtBQUFBLFFBQ0osTUFBTTtBQUFBLFFBQ04sZ0JBQWdCLENBQUMsR0FBRyxNQUFNO0FBQ3pCLFlBQUUsaUJBQWlCO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQSxFQUtoQixlQUFlO0FBQUE7QUFDcEIsV0FBSyxXQUFXLE9BQU8sT0FBTyxJQUFJLGlCQUFpQixNQUFNLEtBQUs7QUFBQTtBQUFBO0FBQUEsRUFHekQsZUFBZTtBQUFBO0FBQ3BCLFlBQU0sS0FBSyxTQUFTLEtBQUs7QUFBQTtBQUFBO0FBQUE7IiwKICAibmFtZXMiOiBbXQp9Cg== diff --git a/test-vault/.obsidian/plugins/obsidian-simple-time-tracker/manifest.json b/test-vault/.obsidian/plugins/simple-time-tracker/manifest.json similarity index 85% rename from test-vault/.obsidian/plugins/obsidian-simple-time-tracker/manifest.json rename to test-vault/.obsidian/plugins/simple-time-tracker/manifest.json index 514dc0c..5c426fd 100644 --- a/test-vault/.obsidian/plugins/obsidian-simple-time-tracker/manifest.json +++ b/test-vault/.obsidian/plugins/simple-time-tracker/manifest.json @@ -1,5 +1,5 @@ { - "id": "obsidian-simple-time-tracker", + "id": "simple-time-tracker", "name": "Super Simple Time Tracker", "version": "0.1.1", "minAppVersion": "0.15.0", diff --git a/test-vault/.obsidian/plugins/obsidian-simple-time-tracker/styles.css b/test-vault/.obsidian/plugins/simple-time-tracker/styles.css similarity index 100% rename from test-vault/.obsidian/plugins/obsidian-simple-time-tracker/styles.css rename to test-vault/.obsidian/plugins/simple-time-tracker/styles.css diff --git a/test-vault/Cool Project.md b/test-vault/Cool Project.md index aecff0f..bf62ae8 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}]} +{"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}]} ``` ```