11.4 Changing JavaScript Files Preferences

Designer allows you to change how JavaScript files are displayed and used. ECMAScript is a JavaScript and these preferences affect the ECMAScript editor. To change the preferences:

  1. In the Designer toolbar, select Window > Preferences > Web and XML > JavaScript Files.

  2. Change the desired settings, then click OK.

    See Section 11.4.1, JavaScript Files Preferences for a list of all of the preferences.

11.4.1 JavaScript Files Preferences

Changes how JavaScript files are handled by Designer. There are multiple options to change.

JavaScript Files

Changes how JavaScript files are created.

Figure 11-8 JavaScript Files

Table 11-1 JavaScript Files

Setting

Description

Creating or saving files: Line delimiter

Sets what type of line delimiter is applied to the file. The options are:

  • No translation

  • UNIX

  • Mac

  • Windows

Creating files: Add this suffix (if not specified)

Sets the suffix to file. The default value is js. It can be set to any value.

JavaScript Files > JavaScript Source

Changes the formatting for the JavaScript files.

Figure 11-9 JavaScript Files > JavaScript Source

Table 11-2 JavaScript Files > JavaScript Source

Setting

Description

Formatting

Sets the formatting for the editor. The options are:

  • Indent using tabs

  • Indent using spaces

  • Indention size: Changes the indention size by setting a numeric value.

Content assist

Helps with prompts when creating the files.

Automatically make suggestions: Can be enabled or disabled if the check box is selected.

Prompt when these characters are inserted: Allows you to receive prompts when the specified characters are entered.

JavaScript Files > JavaScript Styles

Customizes the content of the JavaScript files.

Figure 11-10 JavaScript Files > JavaScript Styles

Table 11-3 JavaScript Files > JavaScript Styles

Setting

Description

Content type

Selects the content to be customized. You can change each element independently. The sections that can be changed are:

  • Comments

  • Default Code

  • Keywords

  • Literal Strings

  • Unfinished Strings and Comments

If you select the element in the sample text field, the content type changes to what is selected.

Foreground

Displays the color that is set for the foreground. Double-click the color field to select another color.

Background

Displays the color that is set for the background. Double-click the color field to select another color.

Bold

Allows you to bold an element. Select the element, the click the Bold check box.

Sample text

Displays a sample file to see the changes.

JavaScript Validation

Allows the editor to validate the JavaScript as it is entered. Select Automatically validate scripts to automatically validate the scripts. If it is not select the JavaScript will not be validated.