wiki:DataSaverPlugin

Data Saver Plugin

Description

Prevents unsaved form data loss by providing a restore button to the meta-navigation bar context-navigation [1].

»Restore Form« button of a patched version of DataSaverPlugin in German Trac 0.12 test environment
Screenshot of Restore Form link with German localization provided by DataSaverPlugin within Trac 0.12

[1] moved since changeset [8702] (see ticket #7518 for details)

Bugs/Feature Requests

If you have any issues, check existing bugs and feature requests for DataSaverPlugin here
and take care of closed tickets as well.

In case this is a new issue, you're welcome to create a new ticket.

Patches welcome in favor of complete files, in case you have already developed some better code. Include version, if patch is not against current stable release or trunk development version.

Download

Download the zipped source from here.

Source

You can check out DataSaverPlugin from here using Subversion, or browse the source with Trac.

Installation

Do your normal Trac plugin install. If you are taking the install-into-Python route, add to your trac.ini:

[components]
datasaver.* = enabled

Example

Suppose you write a lengthy wiki page, but accidentally hit refresh or the back button? You'd be out of luck most of the time. I know I was. But with this hack, a link called "Restore Form" will allow you to retrieve your data from your last save. Any time you navigate away from a form page, the contents will be saved in a cookie and when you return you can simply click "Restore Form" to retrieve it.

About i18n/l10n support

The development version of this plugin is prepared for localization.
But English message texts are still the (POSIX) default. If this isn't your preferred language, you can

  1. look, if it's already available from the Trac plugin l10n project at Transifex or
  2. do it yourself (see the l10n cookbook page for Trac plugins for more details).

You've done a new translation? Superb! Contributing your translation is highly appreciated.
You could send it to the plugin's maintainer or contribute to Trac plugin l10n project via Transifex:

Top translations: Trac_Plugin-L10N » datasaver

http://www.transifex.net/projects/p/Trac_Plugin-L10N/resource/datasaver/chart/image_png

Top translations: Trac_Plugin-L10N » datasaver-js

http://www.transifex.net/projects/p/Trac_Plugin-L10N/resource/datasaver-js/chart/image_png

Kindly provided by https://ds0k0en9abmn1.cloudfront.net/static/charts/images/tx-logo-micro.png

Preparing the plugin from source requires the additional step of compiling message catalog files. This will be done automatically by invoking a suitable Babel install. Walk through:

cd datasaver
python ./setup.py compile_catalog -f
python ./setup.py bdist_egg

Step 2 is almost obsolete, and only needed to include translations marked as # fuzzy by the translator, since the compilation before packaging will do message catalog compilation compile only without the extra -f argument. Again, for more details see the l10n cookbook page for Trac plugins.

Recent Changes

[13560] by hasienda on 2014-01-09 00:44:29
DataSaverPlugin: Correct new JavaScript function name, refs #11474.
[13550] by hasienda on 2014-01-07 01:08:52
DataSaverPlugin: Break the 4 kB storage limit for browser cookies, refs #11474.

Thanks to TiagoTT the JavaScript code uses localStorage now, what is great!

[10746] by hasienda on 2011-10-07 23:40:16
DataSaverPlugin: Make sure to always include a 'locale' dir in zipped plugins, refs #9249.

Just some improved i18n code missing for this plugin, done elsewhere before.

Author/Contributors

Author: rharkins
Maintainer: hasienda
Contributors: jun66j5

Last modified 11 days ago Last modified on Nov 15, 2014, 10:57:31 PM