Using the Shared folder
491
Using the Shared folder
Look first in the Dreamweaver Configuration/Shared/Common folder for useful extension
code because this folder contains the most current and commonly used functionality.
Extensions can leverage the resources in the Shared folder for their own functionality. An
object, command, or other extension can specify one of the JavaScript files in the Shared
folder as a source file in a
script
tag, and then use the function in the body of the file or in
another included JavaScript file. Objects and commands can even link several JavaScript files
together, and those JavaScript files can leverage Shared folder resources.
For example, open the Hypertext object file (Hyperlink.htm) in the application folder
Configuration/Objects/Common. Notice that the head tag of the file contains the following
lines:
<script language="javascript" src="../../Shared/Common/Scripts/
ListControlClass.js"></script>
<script language="javascript" src="Hyperlink.js"></script>
And, if you open the related Hyperlink.js file, you can see the following lines:
LIST_LINKS = new ListControl('linkPath');
and
LIST_TARGETS = new ListControl('linkTarget');
With the
new listControl
declarations, Hyperlink.js defines two new ListControl objects.
The code in the Hyperlink.htm file then attaches them to the
SELECT
controls in the form, as
follows:
<td align="left"> <input name="linkText" type="text"
class="basicTextField" value="">
and
<td align="left" nowrap><select name="linkPath" class="basicTextField"
editable="true">
Now, the Hyperlink.js script can call methods or get properties for the
LIST_LINKS
or
LIST_TARGETS
objects to interact with the
SELECT
controls in the form.
Summary of Contents for DREAMWEAVER 8-EXTENDING DREAMWEAVER
Page 1: ...Extending Dreamweaver...
Page 8: ...8 Contents...
Page 14: ...14 Introduction...
Page 16: ......
Page 54: ...54 Customizing Dreamweaver...
Page 96: ...96 Customizing Code View...
Page 98: ......
Page 110: ...110 Extending Dreamweaver...
Page 138: ......
Page 166: ...166 Insert Bar Objects...
Page 180: ...180 Commands...
Page 248: ...248 Toolbars...
Page 260: ...260 Reports...
Page 278: ...278 Tag Libraries and Editors...
Page 288: ...288 Property Inspectors...
Page 378: ...378 Server Behaviors...
Page 398: ...398 Data Sources...
Page 432: ...432 Server Models...
Page 456: ...456 Data Translators...
Page 482: ......
Page 492: ...492 The Shared Folder...