Adobe Extending Dreamweaver CS4 Manuel d'utilisateur Page 248

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 387
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 247
242
EXTENDING DREAMWEAVER CS4
Behaviors
Example
The following instance of the canAcceptBehavior() function returns a list of preferred events for the behavior if the
document has any named images:
function canAcceptBehavior(){
var theDOM = dreamweaver.getDocumentDOM();
// Get an array of all images in the document
var allImages = theDOM.getElementsByTagName('IMG');
if (allImages.length > 0){
return "onMouseOver, onClick, onMouseDown";
}else{
return false;
}
}
displayHelp()
Description
If this function is defined, a Help button appears below the OK and Cancel buttons in the Parameters dialog box. This
function is called when the user clicks the Help button.
Arguments
None.
Returns
Dreamweaver expects nothing.
Example
// the following instance of displayHelp() opens
// in a browser a file that explains how to use
// the extension.
function displayHelp(){
var myHelpFile = dw.getConfigurationPath() +
'/ExtensionsHelp/superDuperHelp.htm';
dw.browseDocument(myHelpFile);
}
deleteBehavior()
Description
This function undoes any edits that the applyBehavior() function performed.
Note: Dreamweaver automatically deletes the function declaration and the event handler that are associated with a
behavior when the user deletes the behavior in the Behaviors panel. It is necessary to define the
deleteBehavior()function only if the applyBehavior() function performs additional edits on the user’s document
(for example, if it inserts a tag).
Arguments
applyBehaviorString
This argument is the string that the applyBehavior() function returns.
Vue de la page 247
1 2 ... 243 244 245 246 247 248 249 250 251 252 253 ... 386 387

Commentaires sur ces manuels

Pas de commentaire