Adobe 38040334 - Dreamweaver CS3 User Manual page 234

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

Advertisement

Returns
Dreamweaver expects a Boolean value:
Example
The following example prevents the user from resizing the floating panel:
function isResizable()
{
return false;
}
selectionChanged()
Description
Called when the floating panel becomes visible and when the selection changes (when focus switches to a new
document or when the insertion point moves to a new location in the current document). This function should be
defined only if the floating panel must track the selection.
Note: Define
selectionChanged()
Arguments
None.
Returns
Dreamweaver expects nothing.
Example
The following example of
selectionChanged()
whether the selection is a script marker. If the selection is a script marker, Dreamweaver makes the
AP element visible. Otherwise, Dreamweaver makes the
function selectionChanged(){
/* get the selected node */
var theDOM = dw.getDocumentDOM();
var theNode = theDOM.getSelectedNode();
/* check to see if the node is a script marker */
if (theNode.nodeType == Node.ELEMENT
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()
Dreamweaver performance adversely. Consider that the
are called after every keystroke and mouse click when 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 (100 KB or more of HTML)
whenever possible, to test performance impact.
if the user can resize the floating panel;
true
only if you absolutely require it because its existence impacts performance.
shows a different AP element in the floating panel, depending on
blanklayer
_
NODE && ¬
or
function in your custom floating panels can impact
documentEdited()
documentEdited()
otherwise.
false
AP element visible.
and
selectionChanged()
DREAMWEAVER CS3
228
Extending Dreamweaver
scriptlayer
functions

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver cs3

Table of Contents