Adobe Extending Dreamweaver CS4 Manual do Utilizador Página 200

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 387
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 199
194
EXTENDING DREAMWEAVER CS4
Reports
At this point, Dreamweaver clears all items from the Site Reports tab of the Results panel. Dreamweaver calls the
beginReporting() function in each report before the reporting process begins. If a report returns a false value
from this function, it is removed from the report run.
5 Each file is passed to each report that was selected in the Reports dialog box using the processFile() function. If
the report needs to include information about this file in the results list, it should call the
dw.resultsPalette.siteReports.addResultItem() function. This process continues until all files that
pertain to the user’s selection are processed or the user clicks the Stop button in the bottom of the window.
Dreamweaver displays the name of each file being processed and the number of files that remain to be processed.
6 Dreamweaver calls the endReporting() function in each report after all the files have been processed and the
reporting process completes.
A simple site report example
The simple extension example lists all the images referenced in a particular file, an entire site, selected files, or a folder
and displays the report in the Results window under the Site Results tab.
To create this extension, you create the report definition and write the JavaScript code.
This example creates two files in the HTML Reports folder: List images.htm, which contains the report definition, and
List Images.js, which contains the JavaScript code specific to this report. In addition, you reference the Reports.js file,
which is included with Dreamweaver.
Create the report definition
The report definition specifies the name of the report as it appears in the Reports dialog box, calls any JavaScript files
required, and defines the user interface of the Settings dialog box, if needed.
1 Create the file Configuration/Reports/HTML Reports/List images.htm.
2 Add the following to specify the name of the report that you want to appear in the Reports dialog box in the title of
the HTML page.
<html>
<head>
<title>List Images</title>
3 At the end of the file, add the script tag and specify the Reports.js file in the src attribute.
<script src="../Reports.js"></script>
4 At the end of the file, add another script tag and specify the List Images.js file, which you will create next, in the
src attribute.
<html>
<head>
<title>List Images</title>
<script src="../Reports.js"></script>
<script src="List Images.js"></script>
5 Close the head tag, include opening and closing body tags, and close the html tag.
</head>
<body>
</body>
</html>
6 Save the file as List Images.js in the Configuration/Reports/HTML Reports folder.
Vista de página 199
1 2 ... 195 196 197 198 199 200 201 202 203 204 205 ... 386 387

Comentários a estes Manuais

Sem comentários