Warn when attempting to close the window and comment field is not empty (like gmail and other web apps)

NEW
Unassigned

Status

()

Bugzilla
User Interface
--
enhancement
11 years ago
a year ago

People

(Reporter: (not reading, please use seth@sspitzer.org instead), Unassigned)

Tracking

Details

Attachments

(1 attachment, 1 obsolete attachment)

[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

11 years ago
How hard is it to catch such actions (closing the window/browser)?
Severity: normal → enhancement
OS: Mac OS X 10.3 → All
Hardware: PC → All
Summary: [rfe] prompt me if I attempt to close and the comment are is non-empty (like gmail and other web apps) → Prompt me if I attempt to close and the comment is non-empty (like gmail and other web apps)

Updated

11 years ago
Summary: Prompt me if I attempt to close and the comment is non-empty (like gmail and other web apps) → Warn when attempting to close the window and comment field is not empty (like gmail and other web apps)
taking. 
Assignee: ui → gandalf
Status: NEW → ASSIGNED
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
Attachment #236863 - Flags: review?(LpSolit)

Comment 4

11 years ago
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).
Attachment #236863 - Flags: review?(LpSolit) → review-

Comment 5

10 years ago
Pretty please, gandalf, wanna revive the patch? :-) I just lost a huge comment by accidently clicking the window. This would be so useful.
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?
Attachment #236863 - Attachment is obsolete: true
Attachment #277295 - Flags: review?(LpSolit)

Comment 7

10 years ago
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.
Attachment #277295 - Flags: review?(LpSolit) → review-

Comment 8

8 years ago
Duplicate of bug 48333 it seems.  
I still find this behavior in FF 3.0.11.

Updated

2 years ago
See Also: → bug 48333
Assignee: gandalf → ui
Status: ASSIGNED → NEW
You need to log in before you can comment on or make changes to this bug.