Skip to content

Commit

Permalink
Added ss to the Zk UUID, removed isMobile checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan J.A. Murphy committed Oct 14, 2021
1 parent 56c0f09 commit a6822c6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 20 deletions.
23 changes: 5 additions & 18 deletions main.ts
Expand Up @@ -15,7 +15,7 @@ const DEFAULT_SETTINGS: LumberjackSettings = {
useTimestamp: true,
alwaysOpenInNewLeaf: false,
inboxFilePath: "/",
newDraftFilenameTemplate: "YYYYMMDDHHmm",
newDraftFilenameTemplate: "YYYYMMDDHHmmss",
targetHeader: "Journal"
}

Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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", "");
Expand All @@ -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());

}

Expand Down
2 changes: 1 addition & 1 deletion 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",
Expand Down
2 changes: 1 addition & 1 deletion 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": {
Expand Down

0 comments on commit a6822c6

Please sign in to comment.