MACROMEDIA DREAMWEAVER 8-EXTENDING DREAMWEAVER Manual page 298

Extending dreamweaver
Table of Contents

Advertisement

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);
}
documentEdited()
Description
This function is called when the floating panel becomes visible and after the current series of
edits is complete; that is, multiple edits might occur before this function is called. This
function should be defined only if the floating panel must track edits to the document.
Define the documentEdited() function only if you require it because its existence
impacts performance.
Arguments
None.
Returns
Dreamweaver expects nothing.
Example
The following example of the
updates a text field that displays the number of layers in the document:
function documentEdited(){
/* create a list of all the layers in the document */
var theDOM = dw.getDocumentDOM();
var layersInDoc = theDOM.getElementsByTagName("layer");
var layerCount = layersInDoc.length;
/* update the numOfLayers field with the new layer count */
document.theForm.numOfLayers.value = layerCount;
}
298
Floating Panels
function scans the document for layers and
documentEdited()

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DREAMWEAVER 8-EXTENDING DREAMWEAVER and is the answer not in the manual?

This manual is also suitable for:

Dreamweaver 8

Table of Contents