From a6822c626921a4806aa1c4b46ed83aa91abe4c6a Mon Sep 17 00:00:00 2001 From: "Ryan J.A. Murphy" Date: Thu, 14 Oct 2021 10:34:03 -0600 Subject: [PATCH] Added ss to the Zk UUID, removed isMobile checks --- main.ts | 23 +++++------------------ manifest.json | 2 +- package.json | 2 +- 3 files changed, 7 insertions(+), 20 deletions(-) diff --git a/main.ts b/main.ts index b9a4aa0..c284f64 100644 --- a/main.ts +++ b/main.ts @@ -15,7 +15,7 @@ const DEFAULT_SETTINGS: LumberjackSettings = { useTimestamp: true, alwaysOpenInNewLeaf: false, inboxFilePath: "/", - newDraftFilenameTemplate: "YYYYMMDDHHmm", + newDraftFilenameTemplate: "YYYYMMDDHHmmss", targetHeader: "Journal" } @@ -85,12 +85,8 @@ export default class LumberjackPlugin extends Plugin { } - // + // newLog creates a new item with a user-configured prefix under a user-configured heading in the daily note, and gives them editing ability in that position immediately. async newLog(openFileInNewLeaf: boolean) { - - // check if the app is mobile, to change how the editor is manipulated (CM5 vs CM6 have slightly different functions) - // note: might need to re-evaluate this once the desktop CM6 editor is launched - let obsidianMobileFlag = Platform.isMobile; // find or create the daily note let dailyNote = getDailyNote(moment(), getAllDailyNotes()); @@ -211,7 +207,6 @@ ${this.settings.logPrefix}${tampTime}${someData}` } async timber() { - let obsidianMobileFlag = Platform.isMobile; let zkUUIDNoteName = moment().format(this.settings.newDraftFilenameTemplate); await this.app.vault.create(this.settings.inboxFilePath + zkUUIDNoteName + ".md", ""); @@ -220,17 +215,9 @@ ${this.settings.logPrefix}${tampTime}${someData}` editor.focus(); let startChar = ""; - if (obsidianMobileFlag) { - editor.setCursor(editor.lastLine()); - editor.replaceSelection(startChar); - editor.setCursor(editor.lastLine()); - } else { - const initialLines = editor.lineCount(); - editor.setCursor({ line: initialLines, ch: 0 }); - editor.replaceSelection(startChar); - const finalLines = editor.lineCount(); - editor.setCursor({ ch: 0, line: finalLines }); - } + editor.setCursor(editor.lastLine()); + editor.replaceSelection(startChar); + editor.setCursor(editor.lastLine()); } diff --git a/manifest.json b/manifest.json index d586d54..e9f5ae8 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "lumberjack-obsidian", "name": "Lumberjack 🪓 🪵", - "version": "1.1.0", + "version": "1.1.1", "minAppVersion": "0.12.0", "description": "Log your thoughts! Lumberjack adds URL commands to help you axe inefficiency and get right to writing.", "author": "ryanjamurphy", diff --git a/package.json b/package.json index d8d9656..b453679 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Lumberjack 🪓🪵", - "version": "1.1.0", + "version": "1.1.1", "description": "Log your thoughts! Lumberjack adds URL commands to help you axe inefficiency and get right to writing.", "main": "main.js", "scripts": {