mraza007 / useful-bookmarks

Basically my firefox bookmarks with better search
https://bookmarks-flask.herokuapp.com/
MIT License
28 stars 16 forks source link

Adding categories #24

Open rani-k opened 5 years ago

rani-k commented 5 years ago

Added categories

Tried to keep it dynamic, so someone can easily add in another category without having to go through lots of code. Can also change category of a link very easily on bookmarks.js.

Here's how it works:

  1. Each link in bookmarks.js has a category key, this can be left blank and it will fall under an 'uncategorized' section which is dynamically created in the end
  2. script.js has two array, categories and categoryHeaders. Categories holds the category keys to be used in the bookmarks.js file, and Headers holds the heading title that will be shown on the web page.
  3. A loop forEach through each of the categories:
    • Clones list node
    • Filters dataSource
    • Populates list on web page
  4. Anything left over and not categorized (category can be "" or undefined) will go into an Uncategorized section

Give it a try and let me know what you think!

Thanks for the list btw, some really awesome resources on it! πŸ˜ƒ

PS: Oh yeah, also added h3 styling and moved main.css lower on the page so it gets priority.

rani-k commented 5 years ago

Oops, just realized there is an issue #7 for this and progress has been made on it πŸ˜…

My take is very different from the tags method mentioned there, if you'd be interested in seeing an alternative.

mraza007 commented 5 years ago

Sure go for it

On Fri, Oct 11, 2019 at 8:49 AM Rani Kheir notifications@github.com wrote:

Oops, just realized there is an issue #7 https://github.com/mraza007/useful-bookmarks/issues/7 for this and progress has been made on it πŸ˜…

My take is very different from the tags method mentioned there, if you'd be interested in seeing an alternative.

β€” You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mraza007/useful-bookmarks/pull/24?email_source=notifications&email_token=AFAYFUNHVGA37WXUXUOVOY3QOBY5TA5CNFSM4I7UU3Y2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEA74O2Q#issuecomment-541050730, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFAYFUMEEPWHPZEMDAVH623QOBY5TANCNFSM4I7UU3YQ .

mraza007 commented 5 years ago

You have few conflicts to resolve

rani-k commented 5 years ago

I'll take a look

rani-k commented 5 years ago

@mraza007 I just realized that the new add bookmark feature clashes with mine.

What happens is I split up the categories into separate listjs objects dynamically, and in the process the main one gets removed. The add bookmark method uses the list.add() method on the main list object which I remove in the process.

So for now I will make a separate page to make use of what I have made so you can take a look. If you like it then perhaps we can try adding the category in the 'add bookmark' modal too, and rather than update the main list (with id bookmarks) it can update the corresponding category or the uncategorized section if category was left blank (id bookmarks-leftover).

mraza007 commented 5 years ago

Interesting points made I am thinking to make this completely dynamic I was thinking to save all th bookmarks in google sheets and then turn that into an api

mraza007 commented 5 years ago

You still have some conflicts