New Plugin: Autosave in Browsercache

Creating and modifying plugins.
User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: New Plugin: Autosave in Browsercache

Post by garvinhicking » Wed Jun 04, 2014 2:42 pm

Hi!

IMO the only time clicking "new entry" would present a "backup entry" is, when you forgot to save an entry (by accident clicking on a different link) or when your browser crashed. I think these are important issues, which is why I think that this autosave feature needs to be enabled by default. It has more upsides than downsides, and clearing an entry text is as easy as Ctrl-A+DEL.

Also I believe existing users might not see this cool new feature if they would need to enable it first. We would also get better feedback, when it's used by default...

Other opinions?
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

User avatar
onli
Regular
Posts: 2265
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: New Plugin: Autosave in Browsercache

Post by onli » Wed Jun 04, 2014 2:44 pm

+1

User avatar
yellowled
Regular
Posts: 7084
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: New Plugin: Autosave in Browsercache

Post by yellowled » Wed Jun 04, 2014 2:45 pm

garvinhicking wrote:It has more upsides than downsides, and clearing an entry text is as easy as Ctrl-A+DEL.
This thread is kind of TL;DR for me, but why not just add a button for this? ”Clear entry editor” or whatever form field needs to be cleared. Some people prefer pressing buttons instead of keyboard shortcuts.

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
onli
Regular
Posts: 2265
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: New Plugin: Autosave in Browsercache

Post by onli » Wed Jun 04, 2014 2:50 pm

I thought about it as well, but my perspective was more "can we create a clear flow to really create a new entry?". To add a clear-button has a number of problems:

1. Hard to place it in the editor-form, where should it go to?
2. It would need an undo-functionality, which is not easy at all to get right

I think that Garvins argumentation that you will seldom see that if not in the situatuion where you want to see the cache is actually spot on, so that would not be necessary.

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: New Plugin: Autosave in Browsercache

Post by garvinhicking » Wed Jun 04, 2014 2:51 pm

Just thinking out loud here: What if we add a confirm() JS prompt to the page, that asks the user if he wants to restore the contents of the backup? Then he can either confirm or say "Clear the page".

Ideally I'd like to avoid placing more buttons for very specific scenarios in the editor. At least, the button should only occur if the backup was just restored, and not at all times...?
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

User avatar
yellowled
Regular
Posts: 7084
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: New Plugin: Autosave in Browsercache

Post by yellowled » Wed Jun 04, 2014 2:54 pm

onli wrote:1. Hard to place it in the editor-form, where should it go to?
2. It would need an undo-functionality, which is not easy at all to get right
1. Next to the label of the field to clear (just thinking out loud here, might not work well visually)
2. That's more of a problem, I guess. :)

Also, both is probably not too easy to combine with wysiwyg editors …

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
onli
Regular
Posts: 2265
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: New Plugin: Autosave in Browsercache

Post by onli » Wed Jun 04, 2014 3:05 pm

The only thing that I can imagine is an undo for the restore. I hate confirmation dialogues and would like to avoid that, especially here where it would slow down access to the core functionality of s9y.

But the restore undo could work. We could borrow the interaction mechanism of gmail (there is a js-lib for this) and have a message at the top of the screen, or just use what we use for the time-widget update message. Show a message "Entry restored from cache (undo) x", where (undo) is a normal button to clear the entry editor and x is small button to dismiss the message, all in a message that disappears by itself after x seconds.

That way we wouldn't force the user into an unnecessary interaction as with the confirm dialogue, but still offer a shortcut to clear the editor.

I'm still not convinced we need this.

User avatar
yellowled
Regular
Posts: 7084
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: New Plugin: Autosave in Browsercache

Post by yellowled » Wed Jun 04, 2014 3:24 pm

It does indeed seem like an awful lot of overhead (both in terms of coding and extra JS).

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: New Plugin: Autosave in Browsercache

Post by Timbalu » Wed Jun 04, 2014 3:38 pm

yellowled wrote:
garvinhicking wrote:It has more upsides than downsides, and clearing an entry text is as easy as Ctrl-A+DEL.
why not just add a button for this? ”Clear entry editor” or whatever form field needs to be cleared. Some people prefer pressing buttons instead of keyboard shortcuts.
The command Ctrl-A+DEL on FF only works when already being in focussed textarea. If set to end of text you can flush all by once, if set to start it flushes wordwise. (BTW if done that, the autosave still continues saving. )
A right or up floated button - to flush this fields indexedDB cache in case it isn't empty - next to the textarea label would IMHO help and also a personal preference option to disable autosave at all. This both is better than bringing up a confirm dialogue.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

Post Reply