Closed
Bug 13261
Opened 26 years ago
Closed 25 years ago
numercial consts in compose window JS
Categories
(SeaMonkey :: MailNews: Message Display, defect, P4)
SeaMonkey
MailNews: Message Display
Tracking
(Not tracked)
VERIFIED
FIXED
M12
People
(Reporter: BenB, Assigned: bugzilla)
Details
enums from C++ and other consts are simply referenced by their numerical values
in JavaScripts.
This will all break, if anyone adds an entry to the enum or similar.
IDL must be changed to include the consts and they should be _excusively_ used
in the scripts.
Atl least that's my opinion. Others?
Comment 1•26 years ago
|
||
Example:
http://lxr.mozilla.org/seamonkey/source/mailnews/base/resources/content/commandglue.js#46
46 function ComposeMessage(type, format)
47 //type: 0=new message, 1=reply, 2=reply all,
48 // 3=forward inline, 4=forward as attachment
[...]
80 for (var i = 0; i < nodeList.length && i < 8; i ++)
Updated•26 years ago
|
Assignee: phil → ducarroz
Severity: normal → minor
Priority: P3 → P4
Summary: numercial consts in *.js → numercial consts in compose window JS
Comment 2•26 years ago
|
||
Yes, that's a fine improvement, but not high priority. Reassigning to ducarroz.
Assignee | ||
Updated•26 years ago
|
Status: NEW → ASSIGNED
Target Milestone: M14
Comment 3•26 years ago
|
||
ok, I've done the first half of this by converting the enums to IDL and fixing
the C++.
You should be able to access the constants from JS with stuff like:
var msgCompFormat = Components.interfaces.nsIMsgCompFormat;
if (format == msgCompFormat.HTML) {
..
}
Assignee | ||
Updated•25 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Target Milestone: M14 → M12
Assignee | ||
Comment 4•25 years ago
|
||
done, checked in.
Checked nsIMsgCompose.idl. It has
[scriptable, uuid(c7035852-7531-11d3-9a73-006008948010)]
38 interface nsIMsgCompType {
39 const long New = 0;
40 const long Reply = 1;
41 const long ReplyAll = 2;
42 const long ForwardAsAttachment = 3;
43 const long ForwardInline = 4;
44 };
45
This interface is used in commandglue.js properly.
VERIFIED
Updated•20 years ago
|
Product: Browser → Seamonkey
You need to log in
before you can comment on or make changes to this bug.
Description
•