Ask if save changes

MoinMoin modification to confirm saving changes before leaving the editor page.

Features

Please make it so that only "Cancel" does ask, I hate it if the computer constantly questions my mouse clicks -- i.e. if I click the Save bbutton, I mean it. -- JürgenHermann 2005-10-20 18:57:32

Please make it so "Cancel" does NOT ask :) The question should be asked only when there is a high chance that you don't mean to drop your changes. If you try to close the window, you probably don't mean to drop your changes, you simply forgot about them. If you done a preview, and clicked on a link in the preview, you probably don't mean to drop your changes. But if you point your mouse above the "Cancel" button, and click it, you do mean to cancel your changes.

Second, even more important - the editor should NOT ask "Close the editor without saving changes?" and accept "OK" or "Cancel" - this is the wrong way, used by Microsoft everywhere, and confusing even expert users.

Or in other words, not this:

The editor should suggest some actions, and let you choose with one click:

-- NirSoffer 2005-10-20 20:16:28

Internal

Platform Support

Sample

How to apply

Here is another patch added to ask saving changes in the preview mode, and uses i18n warning message. If you preview your changes, the page editor should ask saving changes even if he/she has no change after preview. It's simple:

Discussion

Could you please test if it works on Mozilla (or Firefox) and Opera, too? If yes, I think this would be a nice improvement for moin 1.5. -- ThomasWaldmann 2005-10-20 17:00:52

I've updated the modification and tested it with IE 6, Firefox 1.5b2, Mozilla 1.7a on windows. And I modified the warning message to 'Your changes are not saved'. Because the browsers already inform that you are leaving the page and press OK to continue, CANCEL to stay. Our warning message is just for your information...

-- SeungikLee 2005-10-21 15:46:56

Does not work with Safari.

FYI, while window.onbeforeunload = function used in this wiki works with IE and Firefox, does not with Mozilla. In my experience, only <body onbeforeunload="return function();"> works with all of them.

-- SeungikLee 2005-10-22 04:47:08

Opera supports the "onunload" attribute for body element. As documented here.

MoinMoin: UserInterfaceProposals/AskSaveChanges (last edited 2007-10-29 19:06:13 by localhost)