Closed Bug 186689 Opened 22 years ago Closed 22 years ago

Should be able to set all/clear all email options in preferences

Categories

(Bugzilla :: User Interface, enhancement)

2.17.1
x86
Linux
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.18

People

(Reporter: mozilla-linux, Assigned: justdave)

References

Details

Attachments

(1 file, 2 obsolete files)

I have two bugzilla accounts:  one for work and one for home.  When I am not
working, I want to completely disable e-mail for my work account.  When I am
working, I want to re-enable it, again.  Currently, I have to click (or unclick)
each option.  

There should be a two extra buttons under "Field/recipient specific options:". 
One should be labeled "Set all" and the other should be labeled "Clear all"
Attached patch patch v1 (obsolete) — Splinter Review
"Enable all mail" and "Disable all mail" javascript buttons which set/clear the
appropriate checkboxes.
Attachment #113358 - Flags: review?(gerv)
-> me
Assignee: myk → justdave
Severity: minor → enhancement
Target Milestone: --- → Bugzilla 2.18
Comment on attachment 113358 [details] [diff] [review]
patch v1

>+<script type="text/javascript">
>+<!--
>+
>+function SetCheckboxes(setting) {
>+  for (var count = 0; count < document.userprefsform.elements.length; count++) {
>+    var theinput = document.userprefsform.elements[count];
>+    if (theinput.type == "checkbox") {
>+      if (theinput.name == "ExcludeSelf") {
>+        theinput.checked = false;

Are you sure you mean "false" rather than "!setting"?

Perhaps the need for this exception tells us that this checkbox should have an
inverted sense...

>@@ -108,7 +127,9 @@
>     </td>
>   </tr>
> </table>
>-
>+<noscript>The following two buttons require Javascript to be active<br></noscript>
>+<input type="button" value="Enable All Mail" onclick="SetCheckboxes(true); return false;">
>+<input type="button" value="Disable All Mail" onclick="SetCheckboxes(false); return false;">

I think it's preferable to document.write() the two buttons, rather than have
the slightly clunky message. This is the usual solution for things that only
work with JS.

Gerv
Attachment #113358 - Flags: review?(gerv) → review-
>>+      if (theinput.name == "ExcludeSelf") {
>>+        theinput.checked = false;
>
>Are you sure you mean "false" rather than "!setting"?

Yep...  if the rest of the mail settings are disabled, that's ignored.  But if
you want "ALL" mail, then that needs to NOT be checked.  But having that checked
when the rest of the settings aren't makes it read like you're still going to
get mail, even though it's really going to be ignored.

We had a huge argument over that last time the prefs got redone, and the
concensus at the time was that we didn't want any of the checkboxes to have a
negative description...

>I think it's preferable to document.write() the two buttons, rather than have
>the slightly clunky message.

I was debating on that. :)  Should we put a <noscript> messasge indicating that
they can check/uncheck all the settings with a single button if they enable
Javascript? :)
Attached patch Patch v2 (obsolete) — Splinter Review
addresses Gerv's nits, with the exception of the "ExcludeSelf" checkbox...
Attachment #113358 - Attachment is obsolete: true
oops, forgot you weren't CC'd, Gerv.  See comment #4
Status: NEW → ASSIGNED
Now you have two scripts, it makes sense to amalgamate them to keep the code
together. I'm not all that keen on the <noscript> (what they don't know won't
hurt 'em) but if you want to keep it, fine.

With the first change, r=gerv.

Gerv
Attached patch Patch v3Splinter Review
This what you had in mind, re: merging the scripts?
Attachment #113365 - Attachment is obsolete: true
Attachment #113380 - Flags: review?(gerv)
Exactly. r=gerv. Although you should probably test on e.g. NS 4.x, if these
buttons are outside the <form>, as I'm not sure it supports form controls
outside one. (I can't see from the context.)

Gerv
I thought of that. :)  They're inside the form.  The form itself is actually
defined in a different template (hence the patch to the second file to name it).
 The email.html.tmpl template is entirely inside the form.
Attachment #113380 - Flags: review?(gerv) → review+
Checking in template/en/default/account/prefs/email.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/account/prefs/email.html.tmpl,v
 <--  email.html.tmpl
new revision: 1.8; previous revision: 1.7
done
Checking in template/en/default/account/prefs/prefs.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/account/prefs/prefs.html.tmpl,v
 <--  prefs.html.tmpl
new revision: 1.9; previous revision: 1.8
done
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Flags: approval+
Resolution: --- → FIXED
*** Bug 201083 has been marked as a duplicate of this bug. ***
*** Bug 150846 has been marked as a duplicate of this bug. ***
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: