/* display information for the next unprocessed layer.
displayLayer() is a function you would write to
perform the "magic".
displayLayer(document.layers[document.numProcessed]);
/* if there's more work to do, set a timeout to process
* the next layer.
* flag to false. */
document.numProcessed = document.numProcessed + 1;
if (document.numProcessed < document.numLayers){
setTimeout("processLayer()", 500);
}else{
document.running = false;
}
}
Script Editor: a floating panel extension
The Script Editor extension creates a floating panel to display the JavaScript code that underlies a
selected Script marker in Design view. The Script Editor displays the JavaScript code in the
element of an HTML form that is defined in a layer called
textarea
changes to the selected code in the floating panel, the extension calls the
function to save your changes. If you have not selected a Script marker when you invoke the
Script Editor, the extension displays
To create the example extension:
Create an HTML layer (
1
marker and a second layer (
has not been selected.
Write the JavaScript code
2
Save the JavaScript and HTML code in the scriptEditor.htm file in the Configuration/
3
Floaters folder.
Create a
4
menuitem
Creating the floating panels
The beginning of the HTML file for this extension contains the standard document header
information and a
panels. The following example shows the code:
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Script Editor</title>
<script language="JavaScript">
The extension defines two floating panels that display either
has not selected a Script marker or the JavaScript code that underlies a selected Script marker. The
following code defines these two floating panels, or layers, called
<body>
<div id="blanklayer" style="position:absolute; width:422px; ¬
height:181px; z-index:1; left: 8px; top: 11px; ¬
visibility: hidden">
<center>
<br>
230
Chapter 13: Floating Panels
*/
If we're finished, set the document.running
(no script selected)
scriptlayer
blanklayer
tag in the menus.xml file to invoke the extension.
tag that puts the words Script Editor in the title bar of the floating
title
in a layer called
) to display the JavaScript code for a selected Script
) to display
(no script selected)
(no script selected)
. If you make
scriptlayer
updateScript()
blanklayer
if a Script marker
if the user
and
blanklayer
scriptlayer
.
:
Need help?
Do you have a question about the DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER and is the answer not in the manual?