WikiMatrix

#1 2006-09-12 14:49:53

Furstbariclation
Member
Registered: 2006-09-10
Posts: 4

Wikis with 'save while editing' function

On of the really nice features of the gmail (Google Mail) is that, as you're typing, it automatically saves the page every few minutes. Web-based e-mail without this feature is perfectly usable, but every now and then you lose a good deal of work. For this reason, until gmail came along, I didn't use web-based e-mail for anything important.

The same is true of wikis. I've worked with wikis that lose your changes quite easily.

Are there any that have this save as you type feature as in gmail?

Offline

 

#2 2006-09-12 16:01:30

andi
Administrator
From: Berlin, Germany
Registered: 2005-11-17
Posts: 232
Website

Re: Wikis with 'save while editing' function

DokuWiki has this in the current development release. Just try it at http://wiki.splitbrain.org -  a draft is saved every 30 seconds. If your browser dies (or you close it wink) and you return to the previous edited page you can chose to recover the draft.


Careful: I'm the lead developer of WikiMatrix and DokuWiki so my posts may be biased ;-)

Offline

 

#3 2006-09-13 09:22:14

PeterThoeny
Member
From: San Jose, CA
Registered: 2005-12-14
Posts: 265
Website

Re: Wikis with 'save while editing' function

TWiki does not have an auto-save feature at this time. There is however a "Checkpoint save" feature, simply press Alt-K (or the Checkpoint button) to save and continue edit the content.

-- Peter AT StructuredWikis DOT com - http://www.structuredwikis.com/ - http://twiki.org/

Offline

 

#4 2006-09-13 09:45:37

oyejorge
Member
Registered: 2006-08-20
Posts: 5
Website

Re: Wikis with 'save while editing' function

WikyBlog has taken a slightly different approach, saves aren't made automatically, but clicking 'save' doesn't end the editing session either. Rather, the save is made and the resulting page is loaded in a separate tab. I found this useful when dealing with wiki markup and not knowing exactly what it will look like.

http://www.wikyblog.com

or check it out here

http://www.wikimatrix.org/show/WikyBlog

-- Josh


-  Josh Schmidt
   WikyBlog Developer
   http://www.wikyblog.com - http://www.wikimatrix.org/show/WikyBlog

Offline

 

#5 2006-09-13 13:55:22

kensanata
Member
From: Zürich, Switzerland
Registered: 2005-12-14
Posts: 20
Website

Re: Wikis with 'save while editing' function

I'd be interested in technical details for two of the solutions mentioned:

1. Javascript example code showing how to save every 30 seconds.
2. Where these drafts are stored (every user has one draft? every user has a namespace for drafts?)

For those solutions that just save and let the user keep editing, different questions:

1. Do you collapse all consecutive edits made by one user in such a session, or do you keep all of these revisions in your page database?
2. When reloading the page, are you somehow able to place the curser back into the edit box at the correct location, or is this information lost? If you do it, can I have a code examples?

Trying not to reinvent all of the wheels out there. wink


Right now the Rails folks put everything in a Wiki, which is Hawaiian for "can't find shit." -- Zed

Offline

 

#6 2006-09-14 01:12:38

PeterThoeny
Member
From: San Jose, CA
Registered: 2005-12-14
Posts: 265
Website

Re: Wikis with 'save while editing' function

TWiki with "checkpoint save" feature:

kensanata wrote:

1. Do you collapse all consecutive edits made by one user in such a session, or do you keep all of these revisions in your page database?

Consecutive edit/saves by the same person are collapsed to the same version if within a certain time interval (one our by default). This is with the checkpoint save feature, as well as normal save and re-edit. This is to avoid unnecessary revisions; people frequently edit a topic again to fix a typo or add some more text. Technically speaking, the timestamp and user test is done on save; if "same rev rule" applies, the top rev of rcs is deleted, and a new rev is added with the timestamp of the original rev.

kensanata wrote:

2. When reloading the page, are you somehow able to place the curser back into the edit box at the correct location, or is this information lost? If you do it, can I have a code examples?

TWiki currently just shows the cursor on top after the checkpoint save operation. I think it would be relatively easy to use Javascript to get the current cursor position, send that to the server with the page data, return it back and set the cursor again with Javascript.

An alternative is to use AJAX to store page data in the background.

-- Peter AT StructuredWikis DOT com - http://www.structuredwikis.com/ - http://twiki.org/

Offline

 

#7 2006-09-15 18:22:25

andi
Administrator
From: Berlin, Germany
Registered: 2005-11-17
Posts: 232
Website

Re: Wikis with 'save while editing' function

kensanata wrote:

1. Javascript example code showing how to save every 30 seconds.

http://dev.splitbrain.org/reference/dok … ource.html have a look at the locktimer class. It's just a timer bound to keyup events and some AJAX.

kensanata wrote:

2. Where these drafts are stored (every user has one draft? every user has a namespace for drafts?)

They are stored in a cache directory using an md5 based name using the pageid and the username. So yes, each user has one draft per page. But a draft can only be recovered if it is newer than the current page. If someone else edits and saves the page in between, the draft is lost.

Andi


Careful: I'm the lead developer of WikiMatrix and DokuWiki so my posts may be biased ;-)

Offline

 

#8 2006-09-26 22:39:15

kensanata
Member
From: Zürich, Switzerland
Registered: 2005-12-14
Posts: 20
Website

Re: Wikis with 'save while editing' function

After meditating upon the answers given, I implemented a prototype for draft support in Oddmuse. I wanted it to be as simple as possible to use, and therefore wanted to introduce as little new user interface as possible. That is why I chose to keep only one draft per user — you can't have drafts of different pages or drafts of different points in time for a single page. This means the user interface is simple: If you have a draft waiting for you, there's a link to it at the bottom of every page you look at.

The drafts currently do not expire, but they will expire after a fortnight, when this does in fact get added to Oddmuse.

I also wanted to avoid Javascript, if it was at all possible. If it worked without Javascript, then adding it later would be a breeze. That's why I added a Draft button to the edit page. It now has four buttons: Save, Draft, Preview, and Cancel. The original Usemod from which Oddmuse derived had only four: Save and Preview. I considered saving a draft whenever you use the Preview button. It might make sense if I called "Save draft and preview" instead of just "Preview".

The Draft button is an ordinary submit button. The script then determines that the Draft button had been used instead of the Save button and replies using a 204 No Content header. Upon receiving this, the browser will not change the view the user is being shown: The focus doesn't jump around (it stays on the Draft button), and the textarea doesn't scroll up to the beginning. It's not as cool as autosaving in the background, but it's pretty cool since there are no surprises.

Once you click on the link to recover your draft, the draft is deleted, and you need to click the Draft button again to save it. One reason for this is that this automatically takes care of spammers trying to put spam on draft pages. Since draft pages are not on RecentChanges, there's no peer review. That's why spammers could potentially hide links on a preview of the draft page. If I delete drafts that have been recovered, this will not work.

I'd be happy to discuss the design with anybody who's interested. I'm not sure whether drafts are important enough to merit being part of the Oddmuse core or whether I should keep it in an extension.

Last edited by kensanata (2006-09-26 22:39:45)


Right now the Rails folks put everything in a Wiki, which is Hawaiian for "can't find shit." -- Zed

Offline

 

#9 2006-09-27 02:14:11

michal_frackowiak
Member
Registered: 2006-08-11
Posts: 11

Re: Wikis with 'save while editing' function

In Wikidot (http://www.wikidot.com) we hava a "simple" AJAX request. "Save and continue" just creates a new page revision without any drafts.
You can experiment in http://sandbox.wikidot.com. If you need any help I can point you to usefull sources. Anyway Wikidot software will be open-sourced so you should see the code behind it soon.

cheers - michal


Wikidot.com - free wiki publishing network
http://www.wikidot.com

Offline

 

#10 2006-09-27 08:49:22

andi
Administrator
From: Berlin, Germany
Registered: 2005-11-17
Posts: 232
Website

Re: Wikis with 'save while editing' function

kensanata wrote:

I considered saving a draft whenever you use the Preview button. It might make sense if I called "Save draft and preview" instead of just "Preview".

That's how it works in DokuWiki. A draft is saved  automatically in the background through ajax, but you can always force the draft to be saved by pressing preview, so this works for non-JavaScript-Users, too.

kensata wrote:

The Draft button is an ordinary submit button. The script then determines that the Draft button had been used instead of the Save button and replies using a 204 No Content header. Upon receiving this, the browser will not change the view the user is being shown: The focus doesn't jump around (it stays on the Draft button), and the textarea doesn't scroll up to the beginning.

That's a pretty cool idea. I never came across a 204 response. Learned another thing today :-)

kensata wrote:

Since draft pages are not on RecentChanges, there's no peer review. That's why spammers could potentially hide links on a preview of the draft page.

Why showing draft pages to anyone but the user who created it?

Andi


Careful: I'm the lead developer of WikiMatrix and DokuWiki so my posts may be biased ;-)

Offline

 

#11 2006-09-27 21:33:13

kensanata
Member
From: Zürich, Switzerland
Registered: 2005-12-14
Posts: 20
Website

Re: Wikis with 'save while editing' function

andi wrote:

you can always force the draft to be saved by pressing preview, so this works for non-JavaScript-Users, too.

Interesting. And there's no usability issue, here? How do users know that the preview button saves a draft?

How do users know they have a draft they can recover? Trying it out on the Wiki Matrix, I was lost. My impression was that no drafts exist.

andi wrote:

Why showing draft pages to anyone but the user who created it?

I don't. But with Oddmuse, you can pass the intended username you want to use as a simple parameter. Thus its possible to publish a link to a draft that you have written. I needed to make sure that the resulting page cannot be used for spam. Deleting it upon draft recovery seems to be an interesting approach. The drawback is that it might not be immediately obvious that the recovered draft is no longer stored on the server. Thus, my solution could use some design improvement...

Alex


Right now the Rails folks put everything in a Wiki, which is Hawaiian for "can't find shit." -- Zed

Offline

 

You are not logged in.


Board footer

Powered by PunBB
© Copyright 2002–2008 PunBB