Skip to content

Commit

Permalink
Necessary Final Adjustments and Cleanup
Browse files Browse the repository at this point in the history
Cleanup in /notes/edit/[noteid]/+page.svelte and+page.js, and static folder
  • Loading branch information
Mast3Rei committed Jul 6, 2024
1 parent 9665e4b commit 678a983
Show file tree
Hide file tree
Showing 18 changed files with 3 additions and 10,864 deletions.
4 changes: 1 addition & 3 deletions src/routes/notes/edit/[noteid]/+page.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@ export async function load({ params }) {

const allNotes = await getNotes();
const note = allNotes.find((item) => item.date === date);

console.log('note %o allNotes %o noteid %o date %o' , note, allNotes, noteid, date);

if (!note) {
return {
status: 400,
error: new Error('Note not found'),
};
}

return { note };
}
20 changes: 2 additions & 18 deletions src/routes/notes/edit/[noteid]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import Navbar from '$lib/components/Navbar.svelte';
import { t } from '$lib/data/stores';
import { DeleteIcon, CheckIcon } from '$lib/icons';
import { selectedVerses } from '$lib/data/stores';
import { editNote,addNote,removeNote } from '$lib/data/notes';
import { editNote,removeNote } from '$lib/data/notes';
export let data;
let note = data.note;
Expand All @@ -24,16 +23,6 @@
note: note,
newText:text
});
} else {
await addNote({
docSet: $selectedVerses[0].docSet,
collection: $selectedVerses[0].collection,
book: $selectedVerses[0].book,
chapter: $selectedVerses[0].chapter,
verse: $selectedVerses[0].verse,
text,
reference: $selectedVerses[0].reference
});
}
goBack();
}
Expand All @@ -44,28 +33,23 @@
}
</script>


<!--create a close button for this editor that closes on a button when clicked -->
<div class="fullscreen-editor">
<Navbar on:backNavigation={onBackNavigate}>
<label for="sidebar" slot="center" >
<div class="btn btn-ghost normal-case text-xl" >{$t['Annotation_Note_Edit']}</div>
</label>

<div slot="right-buttons" style="">
<div slot="right-buttons">
<button on:click={deleteNote} class="dy-btn dy-btn-ghost dy-btn-circle"><DeleteIcon color="white" /></button>
<button on:click={modifyNote} class="dy-btn dy-btn-ghost p-1"><CheckIcon color="white" /></button>
</div>

</Navbar>

<div class="flex justify-center mt-7 h-full max-w-screen-md mx-auto">
<textarea bind:value={text} class="dy-textarea dy-textarea-bordered w-full h-5/6 shadow-md" />
</div>

</div>


<style>
.fullscreen-editor{
width: 100%;
Expand Down
1 change: 0 additions & 1 deletion static/book-details/C01/book-details-JHN.xml

This file was deleted.

1 change: 0 additions & 1 deletion static/book-details/C01/book-details-LUK.xml

This file was deleted.

1 change: 0 additions & 1 deletion static/book-details/C01/book-details-MAT.xml

This file was deleted.

1 change: 0 additions & 1 deletion static/book-details/C01/book-details-MRK.xml

This file was deleted.

1 change: 0 additions & 1 deletion static/book-details/C02/book-details-JHN.xml

This file was deleted.

1 change: 0 additions & 1 deletion static/book-details/C02/book-details-LUK.xml

This file was deleted.

1 change: 0 additions & 1 deletion static/book-details/C02/book-details-MAT.xml

This file was deleted.

1 change: 0 additions & 1 deletion static/book-details/C02/book-details-MRK.xml

This file was deleted.

Loading

0 comments on commit 678a983

Please sign in to comment.