bugzilla.mozilla.org will be intermittently unavailable on Saturday, March 24th, from 16:00 until 20:00 UTC.

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

RESOLVED FIXED in Bugzilla 2.18



User Interface
16 years ago
5 years ago


(Reporter: Stephen Rasku, Assigned: justdave)


Bugzilla 2.18
Bug Flags:
approval +



(1 attachment, 2 obsolete attachments)



16 years ago
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"
Created attachment 113358 [details] [diff] [review]
patch v1

"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.

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? :)
Created attachment 113365 [details] [diff] [review]
Patch v2

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
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.

Created attachment 113380 [details] [diff] [review]
Patch v3

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.)

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;
 <--  email.html.tmpl
new revision: 1.8; previous revision: 1.7
Checking in template/en/default/account/prefs/prefs.html.tmpl;
 <--  prefs.html.tmpl
new revision: 1.9; previous revision: 1.8
Last Resolved: 15 years ago
Flags: approval+
Resolution: --- → FIXED

Comment 12

15 years ago
*** Bug 201083 has been marked as a duplicate of this bug. ***

Comment 13

13 years ago
*** 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.