Adobe 38040334 - Dreamweaver CS3 User Manual page 394

Api reference
Hide thumbs Also See for 38040334 - Dreamweaver CS3:
Table of Contents

Advertisement

You can also add new Code Hints menus dynamically through JavaScript after Dreamweaver loads the contents of
the CodeHints.xml file. For example, JavaScript code populates the list of session variables in the Bindings panel. You
can use the same code to add a Code Hints menu, so when a user types Session in Code view, Dreamweaver displays
a menu of session variables.
The CodeHints.xml file and the JavaScript API expose a useful subset of the Code Hints engine, but some Dream-
weaver functionality is not accessible. For example, there is no JavaScript hook to open a color picker, so Dream-
weaver cannot express the Attribute Values menu using JavaScript. You can only open a menu of text items from
which you can insert text.
Code Coloring lets you specify code color styles and to modify existing code coloring schemes or create new ones.
You can specify code coloring styles and schemes by modifying the Colors.xml and code coloring scheme files. For
more information on these files, see Extending Dreamweaver.
The JavaScript API for Code Hints and Code Coloring consists of the following functions.
dreamweaver.codeHints.addMenu()
Availability
Dreamweaver MX.
Description
Dynamically defines a new
pattern and document type, this function adds items to the existing menu.
Arguments
menuGroupId, pattern, labelArray, {valueArray}, {iconArray}, {doctypes}, {casesensitive}
• The
argument is the ID attribute for one of the
menuGroupId
• The
argument is the pattern attribute for the new
pattern
• The
argument is an array of strings. Each string is the text for a single menu item in the pop-up menu.
labelArray
• The
argument, which is optional, is an array of strings, which should be the same length as the
valueArray
argument. When a user selects an item from the pop-up menu, the string in this array is inserted in
labelArray
the user's document. If the string to be inserted is always the same as the menu label, this argument might have a
value.
null
• The
argument, which is optional, is either a string or an array of strings. If it is a string, it specifies the
iconArray
URL for a single image file that Dreamweaver uses for all items in the menu. If it is an array of strings, it must be
the same length as the
labelArray
folder, for an image file that Dreamweaver uses as an icon for the corresponding menu item. If this argument is a
value, Dreamweaver displays the menu without icons.
null
• The
argument, which is optional, specifies that this menu is active for only certain document types. You
doctypes
can specify the
doctypes
document types, see the Dreamweaver Configuration/Documenttypes/MMDocumentTypes.xml file.
• The
argument, which is optional, specifies whether the pattern is case-sensitive. The possible
casesensitive
values for the
casesensitive
omit this argument. If the
that the user types exactly matches the pattern that the pattern attribute specifies. If the
is a
value, the menu appears even if the pattern is lowercase and the text is uppercase.
false
tag in the CodeHints.xml file. If there is an existing menu tag that has the same
menu
argument. Each string is a URL, relative to the Dreamweaver Configuration
argument as a comma-separated list of document type IDs. For a list of Dreamweaver
argument are the Boolean values
argument is a
casesensitive
tags.
menugroup
tag.
menu
or
. The value defaults to
true
false
value, the Code Hints menu appears only if the text
true
DREAMWEAVER CS3
API Reference
if you
false
argument
casesensitive
389

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver cs3

Table of Contents