Adobe Extending Dreamweaver CS4 Manual de usuario Pagina 138

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 387
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 137
132
EXTENDING DREAMWEAVER CS4
Commands
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()
to execute the command.
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.
To create this extension, you create the UI, write the JavaScript code, and test the extension.
This example creates two files in the Commands folder: Change Case.htm, which contains the UI, and Change Case.js,
which contains the JavaScript code. If you prefer, you can create only the Change Case.htm file and put the JavaScript
code in the head section.
Create the user interface
The user interface is a form that contains two options that let the user select uppercase or lowercase.
1 Create a blank file.
2 Add the following code to the file to create the form:
Vista de pagina 137
1 2 ... 133 134 135 136 137 138 139 140 141 142 143 ... 386 387

Comentarios a estos manuales

Sin comentarios