easy-paste-chrome icon indicating copy to clipboard operation
easy-paste-chrome copied to clipboard

Add Custom Links

Open bohrium272 opened this issue 8 years ago • 13 comments

The user could add their own fields and links.

bohrium272 avatar May 08 '16 13:05 bohrium272

Are you going to work on this? @arpitgogia

sahildua2305 avatar May 08 '16 13:05 sahildua2305

Yes. Trying it out right now.

bohrium272 avatar May 08 '16 13:05 bohrium272

Cool! Let me know if you need any help. I think I have documented/commented the entire code properly. Also, I think you will have to reload the extension using chrome.runtime.reload() if some new link is added. Because you will have to create a new context menu for that link in background.js

sahildua2305 avatar May 08 '16 13:05 sahildua2305

I was able to insert a custom field into the popup. However it disappeared once the popup reloads. I'm guessing I should append the text fields for custom links in updateUI() since that is called each time the popup opens. I'm out of time right now cause I have an exam tomorrow but I'll definitely implement this.

bohrium272 avatar May 08 '16 14:05 bohrium272

@arpitgogia You will have to save the any newly added link in localstorage and then check for localstorage before rendering the UI in the popup. This way, every time all the previously saved fields will be shown and can be removed/edited. When are you exams ending? When will you be able to work on this?

sahildua2305 avatar May 08 '16 14:05 sahildua2305

Practicals begin from tomorrow, and theory from next Monday till 27th. Practicals are on Monday, Wednesday and Thursday. It may get delayed if I can't get it working by tomorrow. So I guess you can go ahead with this.

bohrium272 avatar May 08 '16 14:05 bohrium272

Okay I will see into it, if you are not able to get it working by tomorrow.

sahildua2305 avatar May 08 '16 15:05 sahildua2305

Links can now be added from the form. They are getting stored as well. I'm however not able to add a context menu option. Code is at: https://github.com/arpitgogia/easy-paste-chrome/ I can generate a PR if it looks alright.

bohrium272 avatar May 09 '16 14:05 bohrium272

Just having custom links in popup won't make any sense. Please look into it if you're able to add them to context menus too.

sahildua2305 avatar May 09 '16 18:05 sahildua2305

@arpitgogia Are you still interested in working on this?

sahildua2305 avatar Jul 10 '16 20:07 sahildua2305

Yes. I'll try it out again.

bohrium272 avatar Jul 11 '16 02:07 bohrium272

I am afraid I'm having problems saving the newly added links. Where is the saving mechanism implemented?

bohrium272 avatar Jul 12 '16 19:07 bohrium272

The links are saved in localStorage which is updated whenever a link is saved. So for new links you will need to save them in the same place only.

sahildua2305 avatar Jul 12 '16 19:07 sahildua2305