diff --git a/README.md b/README.md index 00740cd..ad0dcce 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,13 @@ # 🚀 Getting started with PomeloNote +### **THIS REPOSITORY HAS DEPENDENCIES WITH SECURITY VULNERABILITIES. YOU MIGHT WANT TO UPDATE PACKAGES BEFORE USE.** +## Setup +- run `npm i` +- get the .env file and save it to the root directory of the project +- set up Strapi + - go to `localhost:1337/admin` + - register an admin user + - go to Settings => Users&Permissions Plugin => Roles => Authenticated => Note => Select all + - Save ### Starting the container with svelte and strapi: ``docker-compose up --build -d`` diff --git a/docs/_config.yml b/docs/_config.yml new file mode 100644 index 0000000..2e92aba --- /dev/null +++ b/docs/_config.yml @@ -0,0 +1,3 @@ +remote_theme: pages-themes/leap-day@v0.2.0 +plugins: +- jekyll-remote-theme diff --git a/docs/_data/devs.csv b/docs/_data/devs.csv new file mode 100644 index 0000000..5c60b6c --- /dev/null +++ b/docs/_data/devs.csv @@ -0,0 +1,4 @@ +name,github,image +Jonas Weissengruber,j-weissen,jowei +Stefan Prechtler,s-prechtl,stef +David Hain,d-hain,dave \ No newline at end of file diff --git a/docs/images/dave.jpg b/docs/images/dave.jpg new file mode 100644 index 0000000..9fe6268 Binary files /dev/null and b/docs/images/dave.jpg differ diff --git a/docs/images/delete.png b/docs/images/delete.png new file mode 100644 index 0000000..39ae1b5 Binary files /dev/null and b/docs/images/delete.png differ diff --git a/docs/images/editor.png b/docs/images/editor.png new file mode 100644 index 0000000..690ef69 Binary files /dev/null and b/docs/images/editor.png differ diff --git a/docs/images/jowei.jpg b/docs/images/jowei.jpg new file mode 100644 index 0000000..6785c8d Binary files /dev/null and b/docs/images/jowei.jpg differ diff --git a/docs/images/listing.png b/docs/images/listing.png new file mode 100644 index 0000000..8b1189b Binary files /dev/null and b/docs/images/listing.png differ diff --git a/docs/images/login.png b/docs/images/login.png new file mode 100644 index 0000000..e9c1cbd Binary files /dev/null and b/docs/images/login.png differ diff --git a/docs/images/register.png b/docs/images/register.png new file mode 100644 index 0000000..68336c8 Binary files /dev/null and b/docs/images/register.png differ diff --git a/docs/images/stef.jpg b/docs/images/stef.jpg new file mode 100644 index 0000000..231d3e3 Binary files /dev/null and b/docs/images/stef.jpg differ diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..7c87e05 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,31 @@ +# Pomelo Note + +This is the best open source note app you will ever find. + +## Login +When first entering the app, you will need to login. If you haven't got an account you may consider [registering](#register), or just not using the app at all. +
+ +## Register +A username, an email and a password that's all you need. If you are missing one of those, just don't use the app at all. +
+ +## Editor +You can edit your notes with our minimalistic editor interface. +
+ +## Listing +Here you can see all your notes. Click on them to open the editor or hover and press the red "X" to delete them. +
+ +## Delete +Confirm the deletion. +
+ +# The Team +{% for dev in site.data.devs %} + {{ dev.name }} + [GitHub](https://github.com/{{ dev.github }}) + ![{{ dev.name }}](images/{{ dev.image }}.jpg) +{% endfor %} + diff --git a/frontend/svelte/src/app.html b/frontend/svelte/src/app.html index fc8346e..9d5ca24 100644 --- a/frontend/svelte/src/app.html +++ b/frontend/svelte/src/app.html @@ -2,12 +2,9 @@ - - - - - + + %sveltekit.head% diff --git a/frontend/svelte/src/models/repos/note/StrapiNoteRepository.ts b/frontend/svelte/src/models/repos/note/StrapiNoteRepository.ts index 47370e9..4043bbf 100644 --- a/frontend/svelte/src/models/repos/note/StrapiNoteRepository.ts +++ b/frontend/svelte/src/models/repos/note/StrapiNoteRepository.ts @@ -79,6 +79,7 @@ export class StrapiNoteRepository implements NoteRepository { } static getAuthorizationHeader() { + // @ts-ignore const jwt = parseCookies('/').jwt; return `bearer ${jwt}` } diff --git a/frontend/svelte/src/routes/editor/+page.svelte b/frontend/svelte/src/routes/editor/+page.svelte index b9a3892..b6d34a3 100644 --- a/frontend/svelte/src/routes/editor/+page.svelte +++ b/frontend/svelte/src/routes/editor/+page.svelte @@ -5,6 +5,7 @@ let noteRepo: StrapiNoteRepository; let currentNote: Note; + onMount(async () => { noteRepo = StrapiNoteRepository.getInstance(); try { @@ -16,19 +17,24 @@ content = (currentNote).content; }) - function save() { + /** + * saves the currently opened Note and returns to listing + */ + function saveAndQuit() { noteRepo.updateNote(currentNote.id, { "title": title, - "content": content + "content": content, }) returnToListing(); } + /** + * redirects to listing + */ function returnToListing() { window.location = "/"; } - export let title: string, content: string; @@ -43,11 +49,11 @@
-

{title}

-
+

{title === "" ? "‎" : title}

+
- +
@@ -55,16 +61,20 @@