borng / wwwsqldesigner

Automatically exported from code.google.com/p/wwwsqldesigner
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Close Window Javascript Confirmation popup #92

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Tables (or unsaved data) or currently on the page
2. The window is (accidentally) closed or refreshed

What is the expected output? What do you see instead?

All the changes are lost (obviously) since there is no live-saving.
I would like to implement a javascript confirm dialogue that detects if the 
window is being closed somehow (like the one used on meebo.com). Perhaps 
also only showing the dialogue if there are tables, or more importantly 
unsaved changes.

What version of the product are you using? On what operating system?

Latest svn checkout (side note: the online package downloads are outdated)

Please provide any additional information below.

Meebo.com and several other web2.0 services (such as popup ads) have a 
simple javascript popup dialogue that appears if the window/tab is being 
closed by the user. It does not use any form of a javascript button, but 
merely detects the normal window event behavior and interrupts

Original issue reported on code.google.com by deansofer on 9 Apr 2010 at 8:11

GoogleCodeExporter commented 9 years ago
window.onbeforeunload = function(){ return 'Have you saved your changes?';}​

should suffice.

Original comment by deansofer on 9 Apr 2010 at 8:30

GoogleCodeExporter commented 9 years ago

Original comment by ondrej.zara on 9 Apr 2010 at 1:22

GoogleCodeExporter commented 9 years ago
Fixed in r106.

Original comment by ondrej.zara on 13 May 2010 at 9:06