Adobe 38040334 - Dreamweaver CS3 User Manual page 38

Extending dreamweaver
Hide thumbs Also See for 38040334 - Dreamweaver CS3:
Table of Contents

Advertisement

After Dreamweaver loads the contents of a code hints file, you can also add new Code Hints menus dynamically
through JavaScript. 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
displays a menu of session variables. For information on using JavaScript to add or modify a Code Hints menu, see
"Code Functions" in the Dreamweaver API Reference.
Dreamweaver cannot express some types of Code Hints menus through the XML file or the JavaScript API. The
CodeHints.xml file, the SpryCodeHints.xml file, and the JavaScript API expose a useful subset of the Code Hints
engine, but some Dreamweaver functionality is not accessible. For example, there is no JavaScript hook to open a
color picker, so Dreamweaver cannot express the Attribute Values menu using JavaScript. You can only open a menu
of text items from which you can insert text.
Note: When you insert text, the insertion point is placed after the inserted string.
The CodeHints.xml file
The CodeHints.xml file contains the following entities:
• A list of all the menu groups
Dreamweaver displays the list of menu groups when you select the Code Hints category from the Preferences dialog
box. You can open the Preferences dialog box by selecting Edit > Preferences. Dreamweaver MX provides the
following menu groups or types of Code Hints menus: Tag Names, Attribute Names, Attribute Values, Function
Arguments, Object Methods and Variables, and HTML Entities.
• The description for each menu group
The description appears in the Preferences dialog box for the Code Hints category when you select the menu group
in the list. The description for the selected entry appears below the menu group list.
• Code Hints menus
A menu consists of a pattern that triggers the Code Hints menu and a list of commands. For example, a pattern such
as
could trigger a menu such as
&
The following example shows the format of the CodeHints.xml file (The tags in bold are described in "The
CodeHints.xml file" on page 32):
<codehints>
<menugroup name="HTML Entities" enabled="true" id="CodeHints
<description>
<![CDATA[ When you type a '&', a drop-down menu shows
a list of HTML entities. The list of HTML entities
is stored in Configuration/CodeHints.xml. ]]>
</description>
<menu pattern="&amp;">
<menuitem value="&amp;amp;" texticon="&amp;"/>
<menuitem value="&amp;lt;" icon="lessThan.gif"/>
</menu>
</menugroup>
<menugroup name="Tag Names" enabled="true" id="CodeHints
<description>
<![CDATA[ When you type '<', a drop-down menu shows
all possible tag names.0You can edit the list of tag
names using the
,
,
.
&amp;
&gt;
&lt;
in Code view, Dreamweaver
"Session."
_
_
HTML
Entities">
_
_
Tag
Names">
DREAMWEAVER CS3
32
Extending Dreamweaver

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver cs3

Table of Contents