Skip to content

Commit

Permalink
initial note, note collection handler
Browse files Browse the repository at this point in the history
  • Loading branch information
bkeating committed Jul 18, 2023
1 parent 0b627a0 commit 89cee9d
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 94 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.DS_Store
node_modules
dist
68 changes: 0 additions & 68 deletions dist/nvAux.html

This file was deleted.

21 changes: 20 additions & 1 deletion src/lib/OmniBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@
const toggleMenu = () => {
showMenu = !showMenu;
};
const handleDeleteCollection = async () => {
const db$ = await db();
// db$.notes.destroy();
db$.notes.remove();
};
</script>

<svelte:window on:keydown={clearSelection} />
Expand All @@ -70,7 +76,7 @@
<li><div style="width: 10spx;" /> <ImportNotesZip /></li>
<li><div style="width: 10spx;" /> <DownloadNotesZip /></li>
<li class="break" />
<li><div style="width: 10spx;" /> Reset Database</li>
<li><div style="width: 10spx;" /> <button on:click={handleDeleteCollection} class="bg-transparent">Reset Database</button></li>
</ul>
{/if}
</div>
Expand Down Expand Up @@ -131,6 +137,15 @@
color: #3e464d;
}
ul li:first-child {
border-top-left-radius: 6px;
border-top-right-radius: 6px;
}
ul li:last-child {
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
}
li {
height: 30px;
display: flex;
Expand All @@ -140,6 +155,10 @@
box-sizing: border-box;
color: #adadad;
}
li:hover {
background: #602661;
color: white;
}
li.break {
height: 1px; padding: 0; margin: 0; border-bottom: 1px solid rgba(255,255,255,0.05);
}
Expand Down
2 changes: 0 additions & 2 deletions src/lib/ResizeHandle.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
const startResize = () => (dragging = true);
const stopResize = () => (dragging = false);
$:console.log('ddd', $noteListHeight)
const handleResize = () => {
if (!dragging) return;
$noteListHeight = $mousePosition.y >= 42 && $mousePosition.y - 42;
Expand Down
49 changes: 26 additions & 23 deletions src/lib/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,32 @@ const _create = async () => {

await db.addCollections({ notes: { schema } });

// const date = new Date().getTime();
// if (db.notes) {
// await db.notes.insert({
// guid: uuidv4(),
// name: '🚀 Welcome to nvAux!',
// body: `
// Welcome aboard! nvAux is your new personal command center, designed to capture your thoughts and ideas swiftly and securely. Inspired by the principles of OmniFocus and David Allen's 'Getting Things Done', nvAux is more than just a note-taking app—it's a productivity powerhouse.

// Here's a quick rundown of what you can do with nvAux:

// Omni-Modal Input: Type or draw your thoughts into existence.
// Offline-First: Your notes are always available, online or offline.
// Encrypted Data: Your privacy is our priority. All your notes are encrypted.
// Single HTML File: Carry nvAux in your pocket, on any device.
// Dark/Light Theme: Work in the environment you prefer.
// Dive into our User Guide to explore these features in detail, or check out our FAQs if you have any questions. Happy note-taking!

// The nvAux Team
// `,
// createdAt: date,
// updatedAt: date
// });
// };
const notes = await db.notes.find().exec();


if (notes.length === 0) {
const date = new Date().getTime();
await db.notes.insert({
guid: uuidv4(),
name: '🚀 Welcome to nvAux!',
body: `
Welcome aboard! nvAux is your new personal command center, designed to capture your thoughts and ideas swiftly and securely. Inspired by the principles of OmniFocus and David Allen's 'Getting Things Done', nvAux is more than just a note-taking app—it's a productivity powerhouse.
Here's a quick rundown of what you can do with nvAux:
Omni-Modal Input: Type or draw your thoughts into existence.
Offline-First: Your notes are always available, online or offline.
Encrypted Data: Your privacy is our priority. All your notes are encrypted.
Single HTML File: Carry nvAux in your pocket, on any device.
Dark/Light Theme: Work in the environment you prefer.
Dive into our User Guide to explore these features in detail, or check out our FAQs if you have any questions. Happy note-taking!
The nvAux Team
`,
createdAt: date,
updatedAt: date
});
};

dbPromise = db;
return db;
Expand Down

0 comments on commit 89cee9d

Please sign in to comment.