Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
3.4k views
in Q2A Core by
edited by
I've searched the net for an autosave, but everything I have found takes more programming skill to understand than I will ever have, or want to have.

Has anyone found a way to add autosave to Question2Answer? If not, does anyone have a step-by-step explanation for getting a CKEditor plugin [Edit: link removed] to work with Question2Answer?

 

[edit note: my link to the plugin is no longer live, but John65 has referred to it below]
by
instead of posting all the data to the server, I guess we could just save the text within a cookie (can store about 5 MB). Should be easy.

4 Answers

+2 votes
by
What this plugin does is posts the post to the forum every x seconds.  How would that be a good thing?  It's supposed to be used for drafts, I guess, probably wordpress or something like that, not where people would be able to see your edits in realtime :)

I got it to work; he was missing a header declaration:

        xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

and of course you'll need to add in q2a parameters - most of the form fields don't have ids, so you have to add them in as well if you want to get their values easily.  But it seems pretty pointless given we don't have a draft posting system.
by
Thank you for that clarification, but you are absolutely correct. Posting a half finished draft is worse than useless.
[edit
Is there anyway you could elaborate on your final sentence?
A draft posting system sounds exactly what I'm looking for. Where can I find one?]
Actually, I think I should post this as a related question, as drafts have never been discussed here before. Thank you again
+1 vote
by

Perhaps you might be interested in Ajax Autosave Plugin for CKEditor - http://cksource.com/forums/viewtopic.php?f=18&t=24128

by
Thank you John.
It seems to fall down, as NoahY has pointed out, on the point that it works by sending data to the server. Yet, Question2Answer cannot handle it without more work. Again, as NoahY has pointed out, handling incomplete data is fraught with dangers.

My conclusion was that it was not a good idea to pursue this. Subsequently, I found a better solution, which I will add as an answer.
0 votes
by
In the few months I have been contemplating this, I came to the conclusion that autosave should never be an website application consideration - it is an operating system or browser issue.

I don't hold much hope on the operating system front, but Firefox has the Lazarus add-in, which is also under development for Chrome and Safari. This auto-saves, with the ability to restore a complete form, or an individual input. It is very good.
0 votes
by
This plugin does the job:

https://ckeditor.com/cke4/addon/autosave

Though it does produce an annoying "Auto Saved" message every time content is saved.
...