Adobe 38040334 - Dreamweaver CS3 User Manual page 198

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

Advertisement

You create this extension by performing the following steps:
1
"Creating the dialog box UI" on page 192
"Writing the JavaScript code" on page 192
2
This example creates two files in the Configuration/Commands folder: List images.htm which defines the UI of the
dialog box that appears when the user selects the custom command, and Listimages.js, which contains the JavaScript
code specific to this report.
Creating the dialog box UI
The body section of the HTML file specifies the contents of the dialog box that appears when the user selects the
custom command and calls any JavaScript files required.
To create the HTML file:
1
Create the Configuration/Commands/Listimages.htm file.
Enter the following in the Listimages.htm file:
2
<html>
<head>
<title>Standalone report example</title>
<script src="Listimages.js">
</script>
</head>
<body>
<div name="test">
<form name="myForm">
<table>
<tr>
<td>Click OK to display the standalone report.</td>
</tr>
</table>
</form>
</div>
</body>
Save the file as Listimages.htm in the Configuration/Commands folder.
3
Writing the JavaScript code
Next, you create the JavaScript file that contains any functions that are specific to your stand-alone report.
To create the JavaScript file:
Create the Listimages.js file in the Configuration/Commands folder with the following code:
1
function stdaloneresultwin()
{
var curDOM = dw.getDocumentDOM("document");
var tagList = curDOM.getElementsByTagName('img');
var imgfilename;
var iOffset = 0;
var iLineNumber = 0;
var resWin = dw.createResultsWindow("Images in File", ["Line", "Image"]);
for (var i=0; i < tagList.length; i++)
DREAMWEAVER CS3
192
Extending Dreamweaver

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver cs3

Table of Contents