Changes

Jump to: navigation, search

SeaMonkey:MailNews:CodingStyle

1,276 bytes added, 21:15, 21 August 2009
Use let for sub-scope variables
}
}
 
=== XML/XUL ===
==== Indent is two spaces per nesting level ====
<element>
<element>
<element/>
</element>
</element>
 
==== Sort XUL attributes ====
XUL attributes should come in this rough order:
<element id="menu_showMessagePane"
label="&showMessagePaneCmd.label;"
accesskey="&showMessagePaneCmd.accesskey;"
key="key_toggleMessagePane"
random_other_attributes="put 'em here!"
oncommand="MsgToggleMessagePane(true);"/>
Especially, id should be first, label/accesskey/key should go together and handlers should be last.
 
==== One attribute per line when folding ====
If the XML element definition (vastly) exceeds the 80 columns limit, it should be wrapped. In this case, put each attribute onto its own line and align them vertically:
<!-- Fine! -->
<element id="menu_showMessagePane" type="checkbox"/>
<!-- Bad! Don't do this! -->
<element id="menu_showMessagePane" type="checkbox" random_other_attribute1="1" random_other_attribute2="1" random_other_attribute3="1"/>
<!-- Fine! -->
<element id="menu_showMessagePane"
type="checkbox"
random_other_attribute1="1"
random_other_attribute2="1"
random_other_attribute3="1"/>
 
<div style="text-align: right">''This page is maintained by [mailto:mnyromyr@tprac.de Karsten "Mnyromyr" Düsterloh].''</div>
235
edits

Navigation menu