Enabling AutoSave as default

I tried to enable the AutoSave feature as default for my wiki by following the description given at https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/FrontendResources/Autosave/

I see the JavaScript extension (JSX code) being executed however the AutoSave still isn’t enabled automatically.

Is there any way to enable this feature from within the wiki by configuration and not changing the source at js/xwiki/editors/autosave.js?

1 Like

Can anybody support for this topic?

I’m interested in autosave by default also.

The autosave feature seems to be working by default but only for the wiki editor, as stated on https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/FrontendResources/Autosave/

However, on https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/PageEditing#HAutosave this restriction is not mentioned. In addition the autosave checkbox is visible for all editors, and not just the wiki one and that’s bad UX; if it’s not enabled for editors other than the wiki editor it should at least be disabled for these other editors.

@mflorea (@mleduc) WDYT?

I think we should also stop saying it’s experimental and instead document the limitations (the one I know is that you’ll get a lot of revisions, maybe there are more?).

1 Like

@vmassol the autosave works fine for the Wiki and WYSIWYG edit modes (both stand-alone and in-place). In these edit modes the autosave widget is loaded (available on the action buttons toolbar) but not enabled: you need to check the autosave checkbox to enable the autosave. It has been like this since a very long time. The state of the autosave checkbox is not preserved between editing sessions and there’s no wiki-level configuration to enable the autosave by default. So ATM you need to remember to check the autosave checkbox each time you enter Wiki or WYSIWYG edit modes, if you want to have automatic saves.

The documentation on https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/FrontendResources/Autosave/ shows how to load and initialize the autosave widget on the In-line Form edit mode which depends very much on the sheet that is rendered. ATM the developer that writes the sheet is responsible for loading the autosave widget, if they think it’s useful. The loading is done in two steps:

  • pull autosave.js from the sheet content
  • instantiate and initialize the autosave widget from a JSX object on the sheet

All this worked fine in my tests, so I don’t see the problem.

I updated a bit https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/FrontendResources/Autosave/ but on the https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/PageEditing#HAutosave it says “not fully mature” which I think it’s true. As for the open issues, we have Loading... .

@shartl there’s no global / wiki level configuration to load the autosave widget in all edit modes, and there’s no global / wiki level configuration to enable the autosave on Wiki and WYSIWYG edit modes either: ATM you need to check the autosave checkbox all the time unfortunately. But for the In-line Form edit mode, i.e. for structured pages that have a sheet, you can have the autosave loaded and enabled by default, and https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/FrontendResources/Autosave/ shows you how.

Hope this helps,
Marius

Thanks Marius for your answer. It seems I didn’t do my tests correctly. I’ve retested and I confirm it works in the wysiwyg inplace editor.

Thanks for improving the doc.