Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Json mixup fix #3

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Json mixup fix #3

wants to merge 14 commits into from

Conversation

gabbyMill
Copy link
Owner

No description provided.

gabbyMill and others added 14 commits September 22, 2021 15:42
Built html structure with little css.
In this case we only have 3 buttons which is why I preferred this approach then event delegation on the whole section.
Create element helper function is handy here to create a li tag.
Currently this is not storing in local storage correctly.
The only features are adding to the list.
Added a function to load the dom according to local storage.
Each time a new <li> is appended it is updated in the local storage
Made alt function with help of object keeping track of whether a key is pressed or not using keydown and keyup.

All of code uses iteration to set eventListeners instead of delegating
(read that it's lighter, not sure if it's better practice or not..)
Made cards editable with makeeditable attribute.
On double click it sets the attribute and the 'blur' event listener.
Afterwards uses splice to replace edited value with old value in parsed version of local storage.
Made global search function using html classes and css hidden functionality.
Also works retroactively when adding new cards while searching for a specific value.
Added 2 functions to save and load data from the api and update it in local storage.
In load function, it checks if the data is the same as in local storage, if not it updates and refreshes the page.
Drag and drop implemented, saves to local storage
Made more generic function to update local storage which is used throughout all of the code.
Made bonus features including
1.Color palette that you can paint your categories\boxes
2.Bold and underline cards
3.Made enter work as well, like add button.
Changed readme
This event 'e' was in the same function as an existing event 'e'.
It didn't cause any problems though.
To my mistake, I thought the API needed  the value of its tasks property to be stored as a string (like in local storage).
Hence, I sent it over as a string and did some ugly string replacement when loading it back to the browser.
Only later I understood the proper way of doing this, although the former way still worked it was certainly NOT ideal.
Plus, it deleted '\' from card text if there was any.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant