honestbleeps / Reddit-Enhancement-Suite

Reddit Enhancement Suite
http://redditenhancementsuite.com
GNU General Public License v3.0
4.13k stars 881 forks source link

Cache drafts of comments and posts #320

Open patricksnape opened 11 years ago

patricksnape commented 11 years ago

As requested:

http://www.reddit.com/r/Enhancement/comments/1avpk0/request_prevent_tabs_and_windows_with_comments/

http://www.reddit.com/r/Enhancement/comments/1a8no2/feature_request_confirmation_before_leaving_page/

Suggested Fix

On closing of page, go through every open form and if there is text in it, save it. Then add a new link under the form (where save, source etc is) which says # drafts. Clicking on this opens a list of the drafts which are actually just cloned Reddit forms where you can click edit and then reply to reply to the comment. Same for posts. This will obviously be saved per comment id or filtered by subreddit for submissions.

@honestbleeps I recognise that you talked to someone about this in one those comments and suggested Lazarus - but this shouldn't be TOO difficult a fix. At the very least we just localstorage it and allow them to copy and paste it back in to the form.

jewel-andraia commented 11 years ago

Lazarus (as you may have seen from that conversation), works great for replies to the post, but it doesn't seem to pick up on dynamically-added forms for replying to comments.

I was thinking of an implementation where a draft gets saved to RESStorage, keyed by "reply-to commentID + pageload timestamp" and updating the saved draft at the same time as the Live Comment Preview rendering (i.e. throttle it to debounce every 5 seconds). @honestbleeps, any idea if hitting RESStorage.setItem() every five seconds would be a terrible performance issue?

Dunno about the UI for restoring drafts.. maybe it should be a markdown tool? (I'm also thinking about being able to save multiple drafts for the same comment, hence the timestamp part of the key.. but that might be overambitious at first.)

mirh commented 8 years ago

Duplicate of #1356 And please, for christ's sake.

jewel-andraia commented 8 years ago

Related but not duplicate. The table editor is a separate popup.

jewel-andraia commented 8 years ago

https://www.reddit.com/r/Enhancement/comments/4h01jy/confirm_navigation_settings/

option (disabled?) for onblur from comment area, also move text to placeholder