Extension:LiveSaver

LiveSaver is a save-as-you-write mechanism for your browser written in JavaScript. It saves form input over browser and operating system crashes, power failures, and session timeouts.

Features

 * Saves user-input over browser crashes, accidental reloads and clicks
 * Works in most major and not-so-major browsers
 * Integrates transparently

License
New BSD-Style, see LiveSaver License.

Documentation & Download
For more details, installation instructions and for downloading it, go to the LiveSaver Documentation.

Download the LiveSaver Extension for MediaWiki, unpack it into the extensions/ directory of your MediaWiki installation and add the following line to your LocalSettings.php file:

require ('extensions/LiveSaver/LiveSaver.php');

-- Jan Lehnardt 03 September 2006

User Feedback

 * doesn't work with MW 1.9.3 (I suppose it was tested on 1.6?)
 * MW 1.10.0 OK
 * Fixed (See below) DANGEROUS BUG FOUND! Doesn't work when editing individual sections and using the cancel button. It always remembers the text from the first section. To reproduce: Press the Edit link on a section on a page, press the cancel button, then try to edit the text from another section.JR 10:33, 14 November 2007 (UTC)
 * Be Warned This extention does not validate the page contents online against the saved copy under your edit. That is, if you start making edits, but don't save the changes.  When you return latter your version will display in the edit screen and you will have no indication that other users made changes.  For a wiki with any amount of traffic this can lead to data reverting without anyone knowing and is a big problem.  It is possible to add a clear option to refetch the page but again this makes no guarantees and shows no warnings.

The best solution to this is to have the save state also store the revision number when the edit was started. Then when restoring the save state a warning and reset link can be displayed. In theory the revision number, would have to be rendered from withing the wiki code, or a hash of the page text would be used instead.

Bugfix
The following change will fix the handling of sections. So that editing a section and not saving it, will then cause that data to be loaded into other sections, or the main page. This fix is critical and data can inadvertently be overwritten without it.

Edit File: \LifeSaver\js\lifeSaver.js Line 96

Add the following after the line var wikiPage = window.location.href.match(/title=[^&]+&/);

var wikiSection = window.location.href.match(/section=\d+/); if(wikiSection) { wikiPage += wikiSection; }

New Init Function init: function(id, data) {	if(id) { this.id = id; } else if(this.wikiMedia && (this.wikiMedia == true)) { var wikiPage = window.location.href.match(/title=[^&]+&/); var wikiSection = window.location.href.match(/section=\d+/); if(wikiSection) { wikiPage += wikiSection; }		if(wikiPage) { this.id = window.location.hostname + window.location.pathname + wikiPage; } else { return false; }	} else { this.id = window.location.href; }

--Jeremy Pyne 20:30, 16 January 2008 (UTC)