[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Debconf-team] Penta save button fix

One of the main issues people seem to have been hit by in penta is the
save button not appearing when they edit a text field (and then them
not realising that the contents haven't been saved).

The problem seems to be with the use of this construct from the
prototype.js library in the output page:
new Form.EventObserver('content_form', function(element, value ) {
enable_save_button() } );

This doesn't work ('in all browsers') to detect changes in text
fields.  For that to work, we need to use a timer instead:
new Form.Observer('content_form', 2, function(element, value ) {
enable_save_button() } );

I've tested this using a greasemonkey script, in Iceweasel, and it
made the save button appear after any text editing.  It will waste
some CPU polling for changes, but this seems a price worth paying for
not encouraging people to lose data.

Can someone with access try putting this change into Penta?



P.S. Here's the Greasemonkey script I used for testing:

// ==UserScript==
// @name           Save button fix test
// @namespace      http://www.morayallan.com/temp/blah
// @include        https://penta.debconf.org/penta/submission/dc11/person
// ==/UserScript==

Form = unsafeWindow['Form'];
enable_save_button = unsafeWindow['enable_save_button'];

new Form.Observer('content_form', 1, function(element, value ) {
               enable_save_button() } );

Reply to: