MACROMEDIA DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER Especificaciones Pagina 177

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 504
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 176
The Commands API 177
Example
The following example of the canAcceptCommand() function makes the command available
only when the selection is a table:
function canAcceptCommand(){
var retval=false;
var selObj=dw.getDocumentDOM.getSelectedNode();
return (selObj.nodeType == Node.ELEMENT_NODE && ¬
selObj.tagName=="TABLE");{
retval=true;
}
return retval;
}
commandButtons()
Description
This function defines the buttons that should appear on the right side of the Options dialog
box and their behaviors when they are clicked. If this function is not defined, no buttons
appear, and the
BODY section of the Commands file expands to fill the entire dialog box.
Arguments
None.
Returns
Dreamweaver expects an array that contains an even number of elements. The first element is
a string that contains the label for the topmost button. The second element is a string of
JavaScript code that defines the behavior of the topmost button when it is clicked. The
remaining elements define additional buttons in the same way.
Example
The following instance of commandButtons() defines three buttons: OK, Cancel, and Help:
function commandButtons(){
return new Array("OK" , "doCommand()" , "Cancel" , ¬
"window.close()" , "Help" , "showHelp()");
}
Vista de pagina 176
1 2 ... 172 173 174 175 176 177 178 179 180 181 182 ... 503 504

Comentarios a estos manuales

Sin comentarios