Closed Bug 1076773 Opened 7 years ago Closed 7 years ago

ReferenceError: EnableDisableAllowedReceipts is not defined in receipts.xul

Categories

(Thunderbird :: Preferences, defect)

defect
Not set
normal

Tracking

(thunderbird36 fixed)

RESOLVED FIXED
Thunderbird 36.0
Tracking Status
thunderbird36 --- fixed

People

(Reporter: aceman, Assigned: aceman)

Details

Attachments

(1 file, 1 obsolete file)

4.82 KB, patch
aceman
: review+
jsbruner
: ui-review+
Details | Diff | Splinter Review
Steps:
1. Tools->Options->Advanced->General->Return receipts
2. Toggle "Never send a return receipt" or "Allow return receipts for some messages"

Results:
Timestamp: 2.10.2014 12:27:26
Error: ReferenceError: EnableDisableAllowedReceipts is not defined
Source File: chrome://messenger/content/preferences/receipts.xul
Line: 1

There is oncommand="EnableDisableAllowedReceipts" on this radiogroup but such a function is defined nowhere.
This may have been caused by copying these elements from /mailnews/extensions/mdn/content/am-mdn.xul which has similar code. The needed function is also there in /mailnews/extensions/mdn/content/am-mdn.js . But I can't trace the history of this file so far to prove that.

So we have 2 options:
1. just remove the oncommand attribute and live with the fact that the suboptions under "Allow return receipts for some messages" are not disabled when this option is not selected. You can see in the account settings (where am-mdn is used) on how this panel should behave.
2. somehow make the function from am-mdn.js accessible here (/mail/components/preferences/receipts.xul). But the code in the function is not usable without changes as it references elements and variables not existent in receipts.xul.
Interestingly, Seamonkey has its own copy of this prefs panel.
3. open-code the function again and make it work on the existing elements and do what is needed. Unfortunately it seems to me the prefs dialog does not have the nice infrastructure to enable/disable/lock dependent options that account manager already has. It is open-coded for each option separately :(
What do you guys think?
Flags: needinfo?(mkmelin+mozilla)
Flags: needinfo?(josiah)
Summary: ReferenceError: EnableDisableAllowedReceipts is not defined → ReferenceError: EnableDisableAllowedReceipts is not defined in receipts.xul
I think options 3 would be best.
Flags: needinfo?(mkmelin+mozilla)
Attached patch patch (obsolete) — Splinter Review
Ok, here you go.
Attachment #8503483 - Flags: review?(mkmelin+mozilla)
Yeah, I agree with Magnus.
Flags: needinfo?(josiah)
Attachment #8503483 - Flags: ui-review?(josiah)
Comment on attachment 8503483 [details] [diff] [review]
patch

Review of attachment 8503483 [details] [diff] [review]:
-----------------------------------------------------------------

::: mail/components/preferences/receipts.js
@@ +6,5 @@
> +/**
> + * Enables/disables the labels and menulists depending whether
> + * sending of return receipts is enabled.
> + */
> +function EnableDisableAllowedReceipts() {

should use lower case (well, camelCase) for function names
Attachment #8503483 - Flags: review?(mkmelin+mozilla) → review+
Attached patch patch v1.1Splinter Review
Thanks, updated.
Attachment #8503483 - Attachment is obsolete: true
Attachment #8503483 - Flags: ui-review?(josiah)
Attachment #8511687 - Flags: ui-review?(josiah)
Attachment #8511687 - Flags: review+
Attachment #8511687 - Flags: ui-review?(josiah) → ui-review+
Thanks.
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 36.0
You need to log in before you can comment on or make changes to this bug.