The Reports Api Functions - Adobe 38040334 - Dreamweaver CS3 User Manual

Extending dreamweaver
Hide thumbs Also See for 38040334 - Dreamweaver CS3:
Table of Contents

Advertisement

{
// Get the name of the source file.
imgfilename = tagList[i].getAttribute('src');
// Get the character offset from the start of the file
// to the start of the img tag.
iOffset = curDOM.nodeToOffsets(curDOM.images[i]);
// Based on the offset, figure out what line in the file
// the img tag is on.
iLineNumber = curDOM.getLineFromOffset(iOffset[0]);
// As long as the src attribute specifies a file name,
if (imgfilename != null)
{ // display the line number, and image path.
resWin.addItem(resWin, "0", "Images in Current File", null, ¬
null, null, [iLineNumber, imgfilename]);
}
}
return;
}
// add buttons to dialog
function commandButtons()
{
return new Array("OK", "stdaloneresultwin()", "Cancel", "window.close()");
}
Save the file as Listimages.js in the Configuration/Commands folder.
2

The reports API functions

The only required function for the reports API is the
processFile()
Availability
Dreamweaver 4.
Description
This function is called when there is a file to process. The Report command should process the file without
modifying it and use the
dw.ResultsPalette.SiteReports()
function to return information about the file. Dreamweaver automatically releases each file's
resWin.addItem()
DOM when it finishes.
Arguments
strFilePath
The
argument is the full path and filename of the file to process.
strFilePath
Returns
Dreamweaver expects nothing.
function. All other functions are optional.
processFile()
function, the
addResultItem()
DREAMWEAVER CS3
193
Extending Dreamweaver
function, or the

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver cs3

Table of Contents