Last Comment Bug 351432 - Warn when attempting to close the window and comment field is not empty (like gmail and other web apps)
: Warn when attempting to close the window and comment field is not empty (like...
Status: NEW
:
Product: Bugzilla
Classification: Server Software
Component: User Interface (show other bugs)
: unspecified
: All All
: -- enhancement (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
: default-qa
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-09-05 09:57 PDT by (not reading, please use seth@sspitzer.org instead)
Modified: 2016-01-27 15:02 PST (History)
8 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
patch v1 (6.00 KB, patch)
2006-09-05 14:40 PDT, Zibi Braniecki [:gandalf][:zibi]
LpSolit: review-
Details | Diff | Review
patch v2 (5.22 KB, patch)
2007-08-19 09:50 PDT, Zibi Braniecki [:gandalf][:zibi]
LpSolit: review-
Details | Diff | Review

Description (not reading, please use seth@sspitzer.org instead) 2006-09-05 09:57:03 PDT
[rfe] prompt me if I attempt to close and the comment are is non-empty (like gmail and other web apps)

when using gmail, if I go to compose a message, and then I attempt to close the browser window, close the tab, or quit the browser, I get prompted so that I can cancel the close / quit.

do you think it would be useful to add something like this to bugzilla?  (I just lost a big comment, having accidentally hit cmd q)
Comment 1 Frédéric Buclin 2006-09-05 10:00:46 PDT
How hard is it to catch such actions (closing the window/browser)?
Comment 2 Zibi Braniecki [:gandalf][:zibi] 2006-09-05 12:47:47 PDT
taking. 
Comment 3 Zibi Braniecki [:gandalf][:zibi] 2006-09-05 14:40:22 PDT
Created attachment 236863 [details] [diff] [review]
patch v1

This patch works on create field and edit field.

We can raise the number of chars in textarea before we display the message
Comment 4 Frédéric Buclin 2006-09-09 04:10:51 PDT
Comment on attachment 236863 [details] [diff] [review]
patch v1

Please write your JS code in a separate file in the js/ directory, e.g. js/comments.js (or a better file name is fine too).

Also, it would be fine to explain to the user why he gets this message, e.g.:
"You started writing a comment. Do you really want to close this window and loose your changes?", else he will have no clue about what is going on.

And finally, it would be fine to display this msg too when editing an attachment (the comment field on the left).
Comment 5 Håkan Waara 2007-08-18 17:12:03 PDT
Pretty please, gandalf, wanna revive the patch? :-) I just lost a huge comment by accidently clicking the window. This would be so useful.
Comment 6 Zibi Braniecki [:gandalf][:zibi] 2007-08-19 09:50:30 PDT
Created attachment 277295 [details] [diff] [review]
patch v2

ok, patch updated to trunk.

What I need is a way to outsource the message to the template, to make it localizable. LpSolit?
Comment 7 Frédéric Buclin 2007-09-04 08:47:30 PDT
Comment on attachment 277295 [details] [diff] [review]
patch v2

>+++ ./js/comments.js	2007-08-19 18:02:25.000000000 +0200

>+function onPageUnload () {
>+  var msg="You started writing a comment. Do you really want to close this window and loose your changes?";

This string should be passed to the JS script from the template so that you can translate it. For JS code review, ask myk or wicked. They are better reviewers than me in this area.
Comment 8 anonyhole 2009-06-23 15:22:22 PDT
Duplicate of bug 48333 it seems.  
I still find this behavior in FF 3.0.11.

Note You need to log in before you can comment on or make changes to this bug.