Adding Commands To The Commands Menu; A Simple Command Example - MACROMEDIA DREAMWEAVER 8-EXTENDING DREAMWEAVER Manual

Extending dreamweaver
Table of Contents

Advertisement

4.
Dreamweaver calls the
buttons appear on the right side of the Options dialog box and what code should execute
when the user clicks the buttons.
5.
Dreamweaver scans the command file for a
the
windowDimensions()
elements of the file. If the
BODY
Dreamweaver automatically sizes the dialog box.
6.
If the command file's
(whether or not a dialog box appears). If no dialog box appears, the remaining steps do not
occur.
7.
The user selects options for the command. Dreamweaver executes event handlers that are
associated with the fields as the user encounters them.
8.
The user clicks one of the buttons that is defined by the
9.
Dreamweaver executes the associated code. The dialog box remains visible until one of the
scripts in the command calls the
Adding commands to the Commands
menu
Dreamweaver automatically adds any files that are inside the Configuration/Commands
folder to the bottom of the Commands menu. To prevent a command from appearing in the
Commands menu, insert the following comment on the first line of the file:
<!-- MENU-LOCATION=NONE -->
When this line is present, Dreamweaver does not create a menu item for the file, and you
must call
dw.runCommand()

A simple command example

This simple extension adds an item to the Commands menu and lets you convert selected text
in your document to either uppercase or lowercase. When you click the menu item, it
activates a three-button interface that lets you submit your choice.
You create this extension by performing the following steps:
Creating the UI
Writing the JavaScript code
Testing the extension
168
Commands
commandButtons()
function, which sizes the Options dialog box that contains the
windowDimensions()
tag contains an
BODY
window.close()
to execute the command.
function, if defined, to determine which
tag. If a form exists, Dreamweaver calls
FORM
function is not defined,
handler, Dreamweaver executes it
onLoad
commandButtons()
function.
function.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver 8

Table of Contents