MACROMEDIA DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER Manual page 229

Extending dreamweaver
Hide thumbs Also See for DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER:
Table of Contents

Advertisement

/* check to see if the node is a script marker */
if (theNode.nodeType == Node.ELEMENT_NODE && ¬
theNode.tagName == "SCRIPT"){
document.layers['blanklayer'].visibility = 'hidden';
document.layers['scriptlayer'].visibility = 'visible';}
else{
document.layers['scriptlayer'].visibility = 'hidden';
document.layers['blanklayer'].visibility = 'visible';
}
}
About performance
Declaring the
selectionChanged()
panels can impact Dreamweaver performance adversely. Consider that the
and
selectionChanged()
Dreamweaver is idle for more than one-tenth of a second. It's important to use different scenarios
to test your floating panel, using large documents (100K or more of HTML) whenever possible,
to test performance impact.
To help avoid performance penalties, the
method in Dreamweaver 3. As in the browsers, the
the JavaScript to be called and the amount of time in milliseconds to wait before calling it.
The
setTimeout()
continue interacting with the application. You must build in these pauses explicitly because the
screen freezes while scripts process, which prevents the user from performing further edits. The
pauses also prevent you from updating the interface or the floating panel.
The following example is from a floating panel that displays information about every layer in the
document. It uses the
each layer.
/* create a flag that specifies whether an edit is being processed, and set it
to false. */
document.running = false;
/* this function called when document is edited */
function documentEdited(){
/* create a list of all the layers to be processed */
var dom = dw.getDocumentDOM();
document.layers = dom.getElementsByTagName("layer");
document.numLayers = document.layers.length;
document.numProcessed = 0;
/* set a timer to call processLayer(); if we didn't get
* to finish processing the previous edit, then the timer
* is already set. */
if (document.running = false){
setTimeout("processLayer()", 500);
}
/* set the processing flag to true */
document.running = true;
}
/* process one layer */
function processLayer(){
or
documentEdited()
functions are called after every keystroke and mouse click when
setTimeout()
method lets you build pauses into your processing. These pauses let the user
method to pause for a half second after processing
setTimeout()
function in your custom floating
function was implemented as a global
function takes two arguments:
setTimeout()
The Floating panel API
documentEdited()
229

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Dreamweaver mx 2004

Table of Contents