From bc771821be3c509f3466a6f11ac1c5e7c9381bf7 Mon Sep 17 00:00:00 2001 From: Crims-on <85900366+Crims-on@users.noreply.github.com> Date: Tue, 12 Sep 2023 16:56:14 +0200 Subject: [PATCH 1/3] zettle format --- src/options.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/options.html b/src/options.html index f0387b2..52b3575 100644 --- a/src/options.html +++ b/src/options.html @@ -69,6 +69,11 @@

An unoffical clipper

+ +
+ + +
@@ -82,4 +87,4 @@

An unoffical clipper

by jplattel

- \ No newline at end of file + From 0432a0656d3e0fffa01784f312f28c004b876595 Mon Sep 17 00:00:00 2001 From: Crims-on <85900366+Crims-on@users.noreply.github.com> Date: Tue, 12 Sep 2023 16:58:33 +0200 Subject: [PATCH 2/3] zettel --- src/options.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/options.js b/src/options.js index ea32875..ed7534a 100644 --- a/src/options.js +++ b/src/options.js @@ -9,6 +9,7 @@ function saveOptions() { var datetimeFormat = document.getElementById('datetime_format').value; var dateFormat = document.getElementById('date_format').value; var timeFormat = document.getElementById('time_format').value; + var zettelFormat = document.getElementById('zettel_format').value; chrome.storage.sync.set({ obsidianVaultName: obsidianVaultName, @@ -19,6 +20,8 @@ function saveOptions() { datetimeFormat: datetimeFormat, dateFormat: dateFormat, timeFormat: timeFormat, + zettelFormat: zettelFormat, + }, function() { // Update status to let user know options were saved. var status = document.getElementById('status'); @@ -43,6 +46,7 @@ Clipped from [{title}]({url}) at {date}.`, datetimeFormat: "YYYY-MM-DD HH:mm:ss", dateFormat: "YYYY-MM-DD", timeFormat: "HH:mm:ss", + zettelFormat: "YYYYMMDDHHmmss", }, function(options) { document.getElementById('obsidian_vault_name').value = options.obsidianVaultName; document.getElementById('obsidian_note_name').value = options.obsidianNoteName; @@ -52,6 +56,7 @@ Clipped from [{title}]({url}) at {date}.`, document.getElementById('datetime_format').value = options.datetimeFormat; document.getElementById('date_format').value = options.dateFormat; document.getElementById('time_format').value = options.timeFormat; + document.getElementById('zettel_format').value = options.zettelFormat; }); } @@ -72,4 +77,4 @@ async function testClipping() { document.addEventListener('DOMContentLoaded', restoreOptions); document.getElementById('save').addEventListener('click', saveOptions); document.getElementById('reset').addEventListener('click', resetFormat); -document.getElementById('test').addEventListener('click', testClipping); \ No newline at end of file +document.getElementById('test').addEventListener('click', testClipping); From 638aafce4a72adf1481d0b15b4fe79d7b1579d58 Mon Sep 17 00:00:00 2001 From: Crims-on <85900366+Crims-on@users.noreply.github.com> Date: Tue, 12 Sep 2023 17:00:37 +0200 Subject: [PATCH 3/3] zettel --- src/lib/clip.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/clip.js b/src/lib/clip.js index 8b067eb..1f2225c 100644 --- a/src/lib/clip.js +++ b/src/lib/clip.js @@ -17,6 +17,7 @@ export const create = async (testing=false) => { dateFormat: "YYYY-MM-DD", datetimeFormat: "YYYY-MM-DD HH:mm:ss", timeFormat: "HH:mm:ss", + zettelFormat: "YYYYMMDDmmss", } async function getFromStorage(key) { @@ -35,7 +36,7 @@ export const create = async (testing=false) => { let day = moment().format("DD") let month = moment().format("MM") let year = moment().format("YYYY") - let zettel = moment().format("YYYYMMDDHHmmss") + let zettel = moment().format(clippingOptions.zettelFormat) let selection = ''; let link = '';