Enable the use of 'optional' on password fields

The logic has been changed, in that 'class="optional"' is applied to both
password and text types if the field begins with the optional market, '&'.
Correct field modifier checking

Existing code checks for the existence of a modifier ('&', '!', '#', '*')
anywhere in the field name, but strips the first character regardless. This
change makes it so that only modifiers at the beginning of the string are
counted.
Enable the use of 'optional' on password fields (JavaScript part)

See ed0c10a10b0b3a9d9d898a64461de707026cd6d3
Insert missing brace
Merge pull request #7842 from Xenopathic/files_external_config_optional

Enable the use of 'optional' on password fields for mount configuration