Another user-unfriendly thing. When you are editing a page and you try to leave without saving, TWiki can pop up with a message box. The first two lines are "You have unsaved changes." and "Are you sure you want to navigate away from this page?". If you click "cancel" it will go ahead an loose those changes. This is the opposite of most (user friendly) software. And cosistency is important to a good UI. If the warning is "Are you sure you want to navigate away from this page?", I want to "Cancel" loosing those changes. I think the last line of the warning box should be something like "Do you want to loose these changes?", in which case, "OK" and "Cancel" do not need to be explained.
--
TWiki:Main/EricWoods
- 30 Jan 2007
Which skin is this?
--
TWiki:Main.ArthurClemens
- 30 Jan 2007
This is the Wysiwyg feature that has this
--
TWiki:Main.KennethLavrsen
- 30 Jan 2007
This has been the subject of much to-ing and fro-ing. I originally coded the behaviour as Eric expects, but was asked to change the sense by the sponsoring client to the current behaviour. I do not intend to do anything on this, but I'm happy for anyone else to try their hand at a fix.
leaving as confirmed, and correcting atrtribution (it's the
KupuContrib that is at fault)
CC
The alert box on twiki's WYSIWYG editor for the abandon changes button is quite peculiar...
"Are you sure you want to navigate away from this page? Cancel will DISCARD your changes (forever!). OK will SAVE your changes. [cancel] [OK]"
1. user is clicking "abandon changes", he presumes that the message will say something like "are you sure?" and that OK will abandon changes, and cancel will stop it and do nothing.
2. the first phrase confirms that fist assumption for the user. (giving the buttons the meanings "OK, i'm sure i want to navigate away from this page" and "cancel my request of navigating away from this page")
3. then, the two instructions contradicts everything. (at least they are very clear)
4. and the OK saving the data makes it worse since it's taking an action that the user didn't even think about. (to confirm leaving the page and to cancel that is one think. now to confirm leaving the page or to saving everything, is very different)
--
TWiki:Main.GabrielB
- 06 Feb 2007
I followed what i believe a click in the "cancel" button should do, and ended up at: cancelEdit() ---> window.document.location = conf.cancel; ---> window.unload ---> navigatingAway() --->
TWikiVetoIfChanged(kupu, true);
what i belive would solve that:
// untested code
var navigatingAway = function () {
var ok = false;
if( kupu.content_changed ) {
var msg = 'You have unsaved changes.\n'+
'Are you sure you want to navigate away from this page?\nOK will DISCARD your changes (forever!).';
ok = confirm(msg);
}
return ok;
// i don't recall if returning true or false on the unload handle allows the page to change or the oposite... just tweak here.
}
--
TWiki:Main.GabrielB
- 06 Feb 2007
the problem i belive, is that the on[Before]Unload event hanlder should return true or false, to allow or cancel the unload. It's a browser feature. But the function the event points to, just call another function, and have no return value. instead, that other function issue a form.submit() to save or not the data.
The Unload event should just receive a true or false to move on (loose changes) or cancel the unload (stay on the page, editing).
--
TWiki:Main.GabrielB
- 06 Feb 2007
Changed to waiting for feedback, because I'm not going to change the behaviour unless someone comes up with a better way to do it.
CC
This is probably never going t get fixed now we have TinyMCE, so discarding.
CC