(b)log-n

10/01/2021

2021/01/10#p1
# Click to read or leave comments

Since starting the experiment to replace iA Writer on my phone homescreen with a link to the Journal I can honestly say that I haven't used it once. I've put the odd note here and there in Google Keep but, beyond that, everything has been going in the Journal or, if more in depth, in the Garden.

Spending 99% of my time writing in textareas in the browser I wondered about creating some kind of rudimentary autosave feature. I'm not too proud to admit that I have, on occasion, accidentally hit refresh or closed the wrong tab thus losing what I have been writing.

Wondering what would be the simplest way to do this I decided on periodically setting a cookie with the contents of the textarea (as long as it's not empty) and then checking for it when the post form loads. If it exists the form is populated with whatever has been stored. When submitting a post the cookie is then deleted leaving is clear for the next time.

I currently have the cookie expiry set to an hour but may change this if I find it's too long or too short, depending on the circumstances.

Draft:   Publish:
Leave a reply



Cancel comment
2021/01/10#p2
# Click to read or leave comments

I can manually delete the autosave cookie by clearing the textarea and hitting the 'close' link to hide it. Seems to work nicely.

I need to see how this feels in practice to get the optimum autosave duration, I've currently got it set for every 30 seconds.

Draft:   Publish:
Leave a reply



Cancel comment
2021/01/10#p3
# Click to read or leave comments

I've settled on the the name 'blog-In' for want of something better but with an input cursor in place of the capital i. The name also forms the login link which is currently at the top right but I may move it to somewhere less conspicuous.

blog-In

Draft:   Publish:
Leave a reply



Cancel comment
Colin Walker
Colophon. Content: CC BY-NC 2.0 UK
Colin Walker Colin Walker colin@colinwalker.blog

Thinker, blogger.