updateScript(): write back changes
The
updateScript()
in the
of the
textarea
JavaScript code, and the
To add the updateScript() function:
1.
Open the scriptEditor.htm file that is in the Configuration/Floaters folder.
2.
Enter the following code in the header section of the file.
/* update the document with any changes made by
the user in the textarea */
function updateScript(){
var theDOM = dw.getDocumentDOM();
var theNode = theDOM.getSelectedNode();
theNode.innerHTML = document.layers['scriptlayer'].document.¬
theForm.scriptCode.value;
}
</script>
</head>
3.
Save the file.
Creating a menu item
It is not sufficient to save the Script Editor code in the Configuration/Floaters folder. You
must also call either the
the
dw.toggleFloater('scriptEditor')
visible. The most obvious place from which to invoke the Script Editor is from the Window
menu, which is defined in the menus.xml file. You need to create the
creates an entry for the Script Editor extension on the Window menu, as shown in the
following figure:
296
Floating Panels
function writes back the selected script when an
panel. The
scriptlayer
event occurs when
onBlur
dw.setFloaterVisibility('scriptEditor',true)
form element contains the
textarea
loses input focus.
textarea
function to load the floating panel and make it
event occurs
onBlur
function or
tag that
menuitem
Need help?
Do you have a question about the DREAMWEAVER 8-EXTENDING DREAMWEAVER and is the answer not in the manual?